summaryrefslogtreecommitdiff
path: root/plug-config/vim-commentary.vim
blob: f672715d484a9bdc2d90086edb762f578ef20d7e (plain)
1
2
3
4
5
6
7
8
9
10
" this function check whether vim is in normal mode or not and comment appropriately
function! Comment()
  if (mode() == "n" )
    execute "Commentary"
  else    
    execute "'<,'>Commentary"
  endif
 endfunction
vnoremap <silent> <space>/ :call Comment()  
autocmd filetype javascript.jsx setlocal commentstring={/*\ %s\ */}