Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " To define toggle switch <C-G> to color the comments grey/darkblue
- " Author: Anjishnu Sarkar
- " Version: 1.0
- " Date: 21/04/07
- " Vim Version: 6.0
- " Acknowledgement: www.vim.org -> Vim_Tip #1072
- " ****************************************************************
- " Exit quickly when:
- " - this plugin was already loaded (or disabled)
- " - when 'compatible' is set
- if exists ("g:loaded_color_comment") || &cp
- finish
- endif
- let g:loaded_color_comment = 1
- " To autoload grayed out comments
- if !exists("s:c_color")
- let s:c_color = 1
- highlight Comment ctermfg=darkblue guifg=gray
- endif
- " To toggle between darkblue and gray colors for comments
- function Color_comment()
- if s:c_color == 1
- highlight Comment ctermfg=gray guifg=blue
- let s:c_color = 0
- else
- highlight Comment ctermfg=darkblue guifg=gray
- let s:c_color = 1
- endif
- endfunction
- " To map the function to keyboard <C-G>
- nmap <C-G> :call Color_comment()<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement