Courser highlighting and code formating in Vim
Posted #CaffeeLog#Vim

Every Programmer knows some of these very annoying situations:
- you have to edit someones code and he likes it to use really long lines
- you write in a language, which is sensitive to Indenting (e.g. Phyton, YAML)
- you have to read/edit someones code and he doesn’t now what
Code Style
means…
So, to boils it down to one Point: You have trouble to because of bad code formating…
Today, I’ve found a solution, with unburden you from this problem a little bit: Vim helps you!
"Courser Highlighting
hi CursorLine term=bold cterm=bold guibg=Grey40 ctermbg=darkgrey
hi CursorColumn cterm=none guibg=Grey40 ctermbg=darkgrey
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
Adding these to your .vimrc you can toggle with \c (when ** is your Leader-Key (by default)) a line and column highlighting. In these case in darkgrey.
So you can very easy see wrong indenting or can read long lines a little bit comfortably.
And, you can persuade vim to format the code for you:
= n
" where n is the number of following lines, which should be formatted
" (e.g =7, for the next 7 lines)
" or
=i{
"to format the next code block
Try it and make your life easier!