mirror of
https://github.com/preservim/nerdcommenter.git
synced 2024-11-29 04:10:17 +08:00
Simplify and document the config key for toggling language defaults
Closes #33
This commit is contained in:
parent
8291af4c7c
commit
e91be123f0
|
@ -83,6 +83,9 @@ let g:NERDCompactSexyComs = 1
|
||||||
" Align line-wise comment delimiters flush left instead of following code indentation
|
" Align line-wise comment delimiters flush left instead of following code indentation
|
||||||
let g:NERDDefaultAlign = 'left'
|
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
|
" Add your own custom formats or override the defaults
|
||||||
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
|
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
|
||||||
```
|
```
|
||||||
|
|
|
@ -751,11 +751,11 @@ again.
|
||||||
|
|
||||||
If you want the NERD commenter to use the alternative delimiters for a
|
If you want the NERD commenter to use the alternative delimiters for a
|
||||||
specific filetype by default then put a line of this form into your vimrc: >
|
specific filetype by default then put a line of this form into your vimrc: >
|
||||||
let g:NERD_<filetype>_alt_style=1
|
let g:NERDAltDelims_<filetype> = 1
|
||||||
<
|
<
|
||||||
Example: java uses // style comments by default, but you want it to default to
|
Example: java uses // style comments by default, but you want it to default to
|
||||||
/* */ style comments instead. You would put this line in your vimrc: >
|
/* */ style comments instead. You would put this line in your vimrc: >
|
||||||
let g:NERD_java_alt_style=1
|
let g:NERDAltDelims_java = 1
|
||||||
<
|
<
|
||||||
|
|
||||||
See |NERDComAltDelim| for switching commenting styles at runtime.
|
See |NERDComAltDelim| for switching commenting styles at runtime.
|
||||||
|
|
|
@ -516,7 +516,7 @@ function s:SetUpForNewFiletype(filetype, forceReset)
|
||||||
endfor
|
endfor
|
||||||
" if g:NERD_<filetype>_alt_style is defined, use the alternate style
|
" if g:NERD_<filetype>_alt_style is defined, use the alternate style
|
||||||
let b:NERDCommenterFirstInit = getbufvar(1,"NERDCommenterFirstInit",0)
|
let b:NERDCommenterFirstInit = getbufvar(1,"NERDCommenterFirstInit",0)
|
||||||
if exists('g:NERD_'.ft.'_alt_style') && eval('g:NERD_'.ft.'_alt_style') && !b:NERDCommenterFirstInit
|
if exists('g:NERDAltDelims_'.ft) && eval('g:NERDAltDelims_'.ft) && !b:NERDCommenterFirstInit
|
||||||
call s:SwitchToAlternativeDelimiters(0)
|
call s:SwitchToAlternativeDelimiters(0)
|
||||||
let b:NERDCommenterFirstInit = 1
|
let b:NERDCommenterFirstInit = 1
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user