浏览代码

add a config file for vim commentary

Gharbi Mohamed 5 年之前
父节点
当前提交
bd30daefea
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      plug-config/vim-commentary.vim

+ 9 - 0
plug-config/vim-commentary.vim

@@ -0,0 +1,9 @@
+function! Comment()
+  if (mode() == "n" )
+    execute "Commentary"
+  else    
+    execute "'<,'>Commentary"
+  endif
+ endfunction
+vnoremap <silent> <space>/ :call Comment()
+autocmd filetype javascript.jsx setlocal commentstring={/*\ %s\ */}