vim-commentary.vim 327 B

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