Commit 6887f35d authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Better support for Python and PEP08

parent ccd17023
...@@ -9,8 +9,6 @@ set shiftwidth=4 ...@@ -9,8 +9,6 @@ set shiftwidth=4
syntax on syntax on
" Filetypes based on extension " Filetypes based on extension
filetype on filetype on
au BufNewFile,BufRead *.md set filetype=markdown
au BufNewFile,BufRead *.html.ep set filetype=php
" Show edit window details in bar at bottom " Show edit window details in bar at bottom
set title set title
...@@ -34,7 +32,6 @@ highlight CursorColumn ctermbg=238 ...@@ -34,7 +32,6 @@ highlight CursorColumn ctermbg=238
" Set color of end of line for programming " Set color of end of line for programming
highlight ColorColumn ctermbg=238 highlight ColorColumn ctermbg=238
set colorcolumn=132
" Highlight line we're on " Highlight line we're on
highlight CursorLine cterm=none ctermbg=235 highlight CursorLine cterm=none ctermbg=235
...@@ -42,10 +39,27 @@ set cursorline ...@@ -42,10 +39,27 @@ set cursorline
" Highlight messed up tab/spaces " Highlight messed up tab/spaces
highlight ExtraWhitespaces ctermbg=202 highlight ExtraWhitespaces ctermbg=202
call matchadd('ExtraWhitespaces',' \t')
call matchadd('ExtraWhitespaces','\t ') " Switch whitespace handling based on file type
call matchadd('ExtraWhitespaces','^ ') function! WhitespaceHighlight()
call matchadd('ExtraWhitespaces','\s\+$') if &filetype == 'python'
call matchadd('ExtraWhitespaces','^\t')
set colorcolumn=79
elseif &filetype != ''
call matchadd('ExtraWhitespaces',' \t')
call matchadd('ExtraWhitespaces','\t ')
call matchadd('ExtraWhitespaces','^ ')
set colorcolumn=132
endif
call matchadd('ExtraWhitespaces','\s\+$')
endfunction
" Autocmd
au BufNewFile,BufRead * call WhitespaceHighlight()
au BufNewFile,BufRead *.md set filetype=markdown | call WhitespaceHighlight()
au BufNewFile,BufRead *.html.ep set filetype=php | call WhitespaceHighlight()
au BufNewFile,BufRead *.py set filetype=python | set expandtab softtabstop=4 | call WhitespaceHighlight()
" Don't use backup files " Don't use backup files
set nobackup set nobackup
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment