Kaydet (Commit) 07eca3a9 authored tarafından Brett Cannon's avatar Brett Cannon

Add a highlight group for denoting bad whitespace. Also added a match rule for

leading tabs in a line when in Python mode.

Also fixed some grammatical errors in the comments.
üst 1bfd85b6
...@@ -9,12 +9,11 @@ ...@@ -9,12 +9,11 @@
" "
" All setting are protected by 'au' ('autocmd') statements. Only files ending " All setting are protected by 'au' ('autocmd') statements. Only files ending
" in .py or .pyw will trigger the Python settings while files ending in *.c or " in .py or .pyw will trigger the Python settings while files ending in *.c or
" *.h will trigger the C settings. This make the file "safe" in terms of only " *.h will trigger the C settings. This makes the file "safe" in terms of only
" adjusting settings for Python and C files. " adjusting settings for Python and C files.
" "
" Only basic settings needed to enforce the style guidelines are set. " Only basic settings needed to enforce the style guidelines are set.
" Some suggested options are listed but commented out at the end of this file. " Some suggested options are listed but commented out at the end of this file.
"
" Number of spaces to use for an indent. " Number of spaces to use for an indent.
...@@ -39,6 +38,12 @@ au BufRead,BufNewFile *.py,*.pyw set expandtab ...@@ -39,6 +38,12 @@ au BufRead,BufNewFile *.py,*.pyw set expandtab
au BufRead,BufNewFile *.c,*.h set noexpandtab au BufRead,BufNewFile *.c,*.h set noexpandtab
au BufRead,BufNewFile Makefile* set noexpandtab au BufRead,BufNewFile Makefile* set noexpandtab
" Use the below highlight group when displaying bad whitespace is desired
highlight BadWhitespace ctermbg=red guibg=red
" Display tabs at the beginning of a line in Python mode as bad
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
" Wrap text after a certain number of characters " Wrap text after a certain number of characters
" Python: 79 " Python: 79
" C: 79 " C: 79
...@@ -67,7 +72,7 @@ au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix ...@@ -67,7 +72,7 @@ au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
" Set the default file encoding to UTF-8: ``set encoding=utf-8`` " Set the default file encoding to UTF-8: ``set encoding=utf-8``
" Put a marker at the beginning of the file to differentiate between UTF and " Puts a marker at the beginning of the file to differentiate between UTF and
" UCS encoding (WARNING: can trick shells into thinking a text file is actually " UCS encoding (WARNING: can trick shells into thinking a text file is actually
" a binary file when executing the text file): ``set bomb`` " a binary file when executing the text file): ``set bomb``
...@@ -79,9 +84,11 @@ au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix ...@@ -79,9 +84,11 @@ au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
" Folding based on indentation: ``set foldmethod=indent`` " Folding based on indentation: ``set foldmethod=indent``
" Make trailing whitespace explicit: " Make trailing whitespace explicit (left off since this will automatically
"highlight WhitespaceEOL ctermbg=red guibg=red " insert the highlight or characters *as you type*, which can get annoying):
"match WhitespaceEOL /\s\+$/ "``match BadWhitespace /\s\+$/``
" or "
"set list listchars=trail:- " or, for a non-colored, character-based solution:
"
"``set list listchars=trail:-``
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