
NERD Commenter 的具体配置如下
" NERD Commenter config " Add spaces after comment delimiters by default let g:NERDSpaceDelims = 1 " Use compact syntax for prettified multi-line comments let g:NERDCompactSexyComs = 1 " Align line-wise comment delimiters flush left instead of following code indentation let g:NERDDefaultAlign = 'left' " Set a language to use its alternate delimiters by default let g:NERDAltDelims_java = 1 " Add your own custom formats or override the defaults let g:NERDCustomDelimiters = { 'c': { 'left': '/*','right': '*/' } } " Allow commenting and inverting empty lines (useful when commenting a region) let g:NERDCommentEmptyLines = 1 " Enable trimming of trailing whitespace when uncommenting let g:NERDTrimTrailingWhitespace = 1 其他的配置都是默认的,但是在注释 python 的时候,会在注释符后加两个空格,别的文件的注释目前没有发现问题,这是怎么回事呢?
1 xucuncicero Aug 9, 2016 let g:NERDSpaceDelims = 1 这个设置为 0 ; 或者编辑 python 时,按一下<leader>ca ,注意看看变化。 |
2 xinali OP @xucuncicero 这个能不能配置默认的注释符呢? |
3 xucuncicero Aug 21, 2016 @xinali :h 'NERDCustomDelimiters' :h NERDComDefaultDelims 设置不能满足要求的话,自己修改 plugin/NERD_commenter.vim 里面的 ``` \ 'python': { 'left': '# ', 'leftAlt': '#' }, ``` |