I have these lines in my .vimrc :
autocmd FileType vim map <leader>ccb I"<Del> <Esc>A "<Del><Esc>yyp0lv$hhr"yykPjj autocmd FileType javascript,php,c map <leader>ccb I// <Esc>A //<Esc>yyp0llv$hhhr-yykPjj autocmd FileType python,ruby,sh,zsh map <leader>ccb I# <Esc>A #<Esc>yyp0lv$hhr-yykPjj autocmd FileType css map <leader>ccb I/* <Esc>A */<Esc>yyp0llv$r-$hc$*/<Esc>yykPjj
In .vimrc he turns this:
vimrc banner
in it:
"""""""""""""""""" " vimrc banner " """"""""""""""""""
In the JS file, it looks like this:
javascript banner
in it:
//---------------------// // javascript banner // //---------------------//
Etc.
" Creating underline/overline headings for markup languages " Inspired by http://sphinx.pocoo.org/rest.html#sections nnoremap <leader>== yyP^v$r=jyyp^v$r= nnoremap <leader>** yyP^v$r*jyyp^v$r* nnoremap <leader>= yyp^v$r= nnoremap <leader>- yyp^v$r- nnoremap <leader>^ yyp^v$r^ nnoremap <leader>" yyp^v$r"
I would like for me to keep a link to where I found it.
source share