50 Commits

Author SHA1 Message Date
Andy Wokula
f0d58015ca restored scrooloose's original readme 2019-05-01 14:41:38 +02:00
Andy Wokula
c888c82828 fix startup init omitted for empty filetype (my bad) 2019-05-01 11:30:13 +02:00
Andy Wokula
20f9e88395 Merge remote-tracking branch 'upstream/master'
Ignored changes in other README!
2019-04-30 19:55:23 +02:00
Jingchang Shi
17b68e47d7 Add an option: NERDDisableTabsInBlockComm (#374)
* Add an option: NERDDisableTabsInBlockComm. 1 disables adding tabs before the comment symbols in the block style.
* Add doc for the new option.
2019-04-17 12:11:07 +03:00
Lane
67950d4b5d Make g:NERDToggleCheckAllLines not check blank/whitespace-only lines (#355) 2019-04-17 09:49:38 +03:00
Caleb Maclennan
f46226bcd6 Remove apparently bogus filetype
I can't find any record of this being a legitimate filetype. It isn't in
vim or nvim's filetype detection system and nothing comes up in search.
If it's legit somebody can complain and we'll add it back, but it seems
likely this was left over from a fat-fingered mistake during the initial
development of the plugin.

Fixes #363
2019-03-07 12:00:42 +03:00
Caleb Maclennan
5100f47542 Add kivy file format, fixes #361 2019-02-14 09:50:24 +03:00
Caleb Maclennan
5ac43900e9 Strip trailing whitespace 2019-02-14 09:48:49 +03:00
MeNsaaH
3427b2f4ef updated Django comments (#359)
* updated Django comments
* Adding alternate comments for django
2019-02-04 12:13:20 +03:00
glegodais
371e4d0e09 Add support for Faust (#354) 2018-12-26 14:11:50 +03:00
Maarten van der Hoef
d24868bc85 Terraform replacing Transcript File (#350) 2018-12-03 16:22:57 +03:00
keysen
fdf950f20b Fix ruby comments, totally broken with =begin and =end (#340) 2018-07-31 20:29:13 +03:00
Zachary Churchill
f9dd87271a Swap default comment style to be more idiomatic of haskell (#343)
See discussion at https://github.com/scrooloose/nerdcommenter/pull/343
2018-07-28 06:52:07 +03:00
fcying
9a32fd2534 Add NERDToggleCheckAllLines option to NERDCommenterToggle (#334) 2018-06-21 11:06:22 +03:00
Jiaobuzuji
e679d8a341 Add support for 'sdc' filetype (#327) 2018-03-03 15:16:47 +03:00
Andy Wokula
8718240a51 merge remote-tracking branch 'upstream/master' 2018-02-18 21:50:16 +01:00
dandersson
670dba1bb5 Add support for Robot Framework files (#323) 2018-02-07 12:19:12 +03:00
Sean
2f973bd4fa Fix Markdown formatting 2018-02-02 12:56:54 +03:00
tlsvc
ff3d8d7d7c Add support for ANSYS Parametric Design Language (apdl) (#317) 2018-01-13 11:47:04 +03:00
Alec Shaw
af8bb4258d Add support for Praat scripting language (#316)
[Praat][1] is a program for phonetics research which has a scripting interface.

[1]: http://www.fon.hum.uva.nl/praat/
2017-12-26 11:02:19 +03:00
Andy Wokula
f18bb5b223 Merge remote-tracking branch 'upstream/master' 2017-11-10 21:03:42 +01:00
Caleb Maclennan
fd61bc71f6 Udate version and date strings 2017-11-07 10:46:22 +03:00
Caleb Maclennan
3e99b39f4f Add sshconfig filetype to complement sshdconfig
Mentioned in #313
2017-11-07 10:38:04 +03:00
Caleb Maclennan
09b07d50ba Merge branch 'pr/266'
Closes #266
2017-11-07 10:17:06 +03:00
Caleb Maclennan
013cfec44d Merge branch 'pr/279'
Closes #279

Since original author of this PR has deleted their Github account
I squashed their two commits and added one to fix the issue with the
implementation as noted in the PR.
2017-11-07 10:12:51 +03:00
Caleb Maclennan
d4548ebb0c Fix implementation of renpy to not include python hack 2017-11-07 10:12:00 +03:00
Komeji Koishi
c321b3460b Added filetype 'renpy' support.
Renpy is an extension of python syntax and it uses '#' comments.
2017-11-07 10:11:59 +03:00
Andy Wokula
9d1b1d5827 one more menu mode 2017-11-01 20:51:50 +01:00
Andy Wokula
14004e00e0 more cautious init check 2017-11-01 20:50:25 +01:00
Andy Wokula
c5bf6053f3 use string() 2017-11-01 20:45:36 +01:00
Andy Wokula
5fce03e259 Merge remote-tracking branch 'upstream/master' 2017-11-01 20:33:56 +01:00
Carlos Eduardo de Andrade
63ba1a1123 Adding support to MiniZinc constraint modeling language. (#311) 2017-10-31 18:53:26 +02:00
Ratan
376838672d Add julia multiline comment chars (#312) 2017-10-31 18:52:28 +02:00
Andy Wokula
e935614365 Merge remote-tracking branch 'upstream/master' 2017-04-08 19:25:33 +02:00
Caleb Maclennan
285902752f Cleanup code formatting in file support matrix 2017-04-07 11:53:35 +03:00
m-pilia
d1ac2382b2 add gl shaders language (#293) 2017-04-06 13:59:25 +03:00
Andy Wokula
9b5b930b72 Merge remote-tracking branch 'upstream/master' 2017-03-31 21:13:38 +02:00
Lyude
a6b3cc6842 Add support for piglit's shader_test files (#292)
This adds support for shader_test files in piglit, the open source
test suite for OpenGL implementations such as mesa. More information on
piglit can be found at:

https://piglit.freedesktop.org/
2017-03-25 13:19:06 +02:00
Caleb Maclennan
d05cfd190b Revert "add support for react/jsx comments (Closes #280) (#290)"
This reverts commit 0e1f6f6866.

Given the unexpected behaviour of this and disruption to people's
established work flows, I'm reverting this until a better solution can
be found that only handles the special comment format inside React code
blocks.
2017-03-15 13:18:09 +03:00
Lucas Charles
0e1f6f6866 add support for react/jsx comments (Closes #280) (#290) 2017-03-12 09:08:58 +02:00
Dylan Baker
41e686824a Add support for the meson build system. (#289) 2017-02-28 08:04:50 +02:00
Andy Wokula
398a3e22a4 indent 2016-12-18 17:57:29 +01:00
Andy Wokula
b4827d552e readme 2016-12-18 17:54:51 +01:00
Andy Wokula
0b2a2b0641 style: changed case in keycodes 2016-12-18 17:39:03 +01:00
Andy Wokula
cb8527ed3f fix comments 2016-12-18 17:37:07 +01:00
Andy Wokula
032143ad23 no default mappings at all 2016-12-18 17:34:36 +01:00
Andy Wokula
f5571fd82f autoload scripts don't need loading guards, and Vim7 is implied 2016-12-18 17:32:45 +01:00
Andy Wokula
3ebd9b56ff essential changes ... renamed functions, added plug function; per default no mappings creation 2016-12-18 17:31:06 +01:00
Andy Wokula
80eb7ff3fd moved plugin file to autoload 2016-12-18 17:22:11 +01:00
Aluriak
c51f5992b2 add support for turtle (.ttl) files 2016-09-10 01:20:29 +02:00
3 changed files with 133 additions and 59 deletions

View File

@@ -22,7 +22,7 @@ Comment functions so powerful—no comment necessary.
1. Add `NeoBundle 'scrooloose/nerdcommenter'` to your vimrc file. 1. Add `NeoBundle 'scrooloose/nerdcommenter'` to your vimrc file.
2. Reload your vimrc or restart 2. Reload your vimrc or restart
3. Run `:NeoUpdate`` 3. Run `:NeoUpdate`
#### [Pathogen](https://github.com/tpope/vim-pathogen) #### [Pathogen](https://github.com/tpope/vim-pathogen)
@@ -94,6 +94,9 @@ let g:NERDCommentEmptyLines = 1
" Enable trimming of trailing whitespace when uncommenting " Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1 let g:NERDTrimTrailingWhitespace = 1
" Enable NERDCommenterToggle to check all selected lines is commented or not
let g:NERDToggleCheckAllLines = 1
``` ```
### Default mappings ### Default mappings

View File

@@ -1,10 +1,10 @@
" ============================================================================ " ============================================================================
" File: NERD_commenter.vim " File: nerdcommenter.vim
" Description: vim global plugin that provides easy code commenting " Description: vim global plugin that provides easy code commenting
" Author: Martin Grenfell <martin.grenfell at gmail dot com> " Author: Martin Grenfell <martin.grenfell at gmail dot com>
" Maintainer: Caleb Maclennan <caleb@alerque.com> " Maintainer: Caleb Maclennan <caleb@alerque.com>
" Version: 2.4.0 " Version: 2.5.1
" Last Change: Tue May 24 14:03:29 EEST 2016 " Last Change: Tue Nov 7 10:45:53 +03 2017
" License: This program is free software. It comes without any warranty, " License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You " it and/or modify it under the terms of the Do What The Fuck You
@@ -14,14 +14,7 @@
" ============================================================================ " ============================================================================
" Section: script init stuff {{{1 " Section: script init stuff {{{1
if exists("loaded_nerd_comments") let nerdcommenter#loaded = 1
finish
endif
if v:version < 700
echoerr "NERDCommenter: this plugin requires vim >= 7. DOWNLOAD IT! You'll thank me later!"
finish
endif
let loaded_nerd_comments = 1
" Function: s:InitVariable() function {{{2 " Function: s:InitVariable() function {{{2
" This function is used to initialise a given variable to a given value. The " This function is used to initialise a given variable to a given value. The
@@ -35,7 +28,7 @@ let loaded_nerd_comments = 1
" 1 if the var is set, 0 otherwise " 1 if the var is set, 0 otherwise
function s:InitVariable(var, value) function s:InitVariable(var, value)
if !exists(a:var) if !exists(a:var)
execute 'let ' . a:var . ' = ' . "'" . a:value . "'" execute 'let ' . a:var . ' = ' . string(a:value)
return 1 return 1
endif endif
return 0 return 0
@@ -54,7 +47,6 @@ call s:InitVariable("g:NERDBlockComIgnoreEmpty", 0)
call s:InitVariable("g:NERDCommentWholeLinesInVMode", 0) call s:InitVariable("g:NERDCommentWholeLinesInVMode", 0)
call s:InitVariable("g:NERDCommentEmptyLines", 0) call s:InitVariable("g:NERDCommentEmptyLines", 0)
call s:InitVariable("g:NERDCompactSexyComs", 0) call s:InitVariable("g:NERDCompactSexyComs", 0)
call s:InitVariable("g:NERDCreateDefaultMappings", 1)
call s:InitVariable("g:NERDDefaultNesting", 1) call s:InitVariable("g:NERDDefaultNesting", 1)
call s:InitVariable("g:NERDMenuMode", 3) call s:InitVariable("g:NERDMenuMode", 3)
call s:InitVariable("g:NERDLPlace", "[>") call s:InitVariable("g:NERDLPlace", "[>")
@@ -65,6 +57,8 @@ call s:InitVariable("g:NERDRPlace", "<]")
call s:InitVariable("g:NERDSpaceDelims", 0) call s:InitVariable("g:NERDSpaceDelims", 0)
call s:InitVariable("g:NERDDefaultAlign", "none") call s:InitVariable("g:NERDDefaultAlign", "none")
call s:InitVariable("g:NERDTrimTrailingWhitespace", 0) call s:InitVariable("g:NERDTrimTrailingWhitespace", 0)
call s:InitVariable("g:NERDToggleCheckAllLines", 0)
call s:InitVariable("g:NERDDisableTabsInBlockComm", 0)
let s:NERDFileNameEscape="[]#*$%'\" ?`!&();<>\\" let s:NERDFileNameEscape="[]#*$%'\" ?`!&();<>\\"
@@ -82,13 +76,14 @@ let s:delimiterMap = {
\ 'ansible': { 'left': '#' }, \ 'ansible': { 'left': '#' },
\ 'apache': { 'left': '#' }, \ 'apache': { 'left': '#' },
\ 'apachestyle': { 'left': '#' }, \ 'apachestyle': { 'left': '#' },
\ 'apdl': { 'left': '!' },
\ 'applescript': { 'left': '--', 'leftAlt': '(*', 'rightAlt': '*)' }, \ 'applescript': { 'left': '--', 'leftAlt': '(*', 'rightAlt': '*)' },
\ 'armasm': { 'left': ';' }, \ 'armasm': { 'left': ';' },
\ 'asciidoc': { 'left': '//' }, \ 'asciidoc': { 'left': '//' },
\ 'asm': { 'left': ';', 'leftAlt': '#' }, \ 'asm': { 'left': ';', 'leftAlt': '#' },
\ 'asm68k': { 'left': ';' }, \ 'asm68k': { 'left': ';' },
\ 'asn': { 'left': '--' }, \ 'asn': { 'left': '--' },
\ 'asp': { 'left': '%', 'leftAlt': '%*','rightAlt': '*%' }, \ 'asp': { 'left': '%', 'leftAlt': '%*', 'rightAlt': '*%' },
\ 'aspvbs': { 'left': '''', 'leftAlt': '<!--', 'rightAlt': '-->' }, \ 'aspvbs': { 'left': '''', 'leftAlt': '<!--', 'rightAlt': '-->' },
\ 'asterisk': { 'left': ';' }, \ 'asterisk': { 'left': ';' },
\ 'asy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'asy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
@@ -106,7 +101,7 @@ let s:delimiterMap = {
\ 'blade': { 'left': '{{--', 'right': '--}}' }, \ 'blade': { 'left': '{{--', 'right': '--}}' },
\ 'bst': { 'left': '%' }, \ 'bst': { 'left': '%' },
\ 'btm': { 'left': '::' }, \ 'btm': { 'left': '::' },
\ 'c': { 'left': '/*','right': '*/', 'leftAlt': '//' }, \ 'c': { 'left': '/*', 'right': '*/', 'leftAlt': '//' },
\ 'cabal': { 'left': '--' }, \ 'cabal': { 'left': '--' },
\ 'calibre': { 'left': '//' }, \ 'calibre': { 'left': '//' },
\ 'caos': { 'left': '*' }, \ 'caos': { 'left': '*' },
@@ -130,7 +125,7 @@ let s:delimiterMap = {
\ 'csp': { 'left': '--' }, \ 'csp': { 'left': '--' },
\ 'cterm': { 'left': '*' }, \ 'cterm': { 'left': '*' },
\ 'cucumber': { 'left': '#' }, \ 'cucumber': { 'left': '#' },
\ 'cuda': { 'left': '/*','right': '*/', 'leftAlt': '//' }, \ 'cuda': { 'left': '/*', 'right': '*/', 'leftAlt': '//' },
\ 'cvs': { 'left': 'CVS:' }, \ 'cvs': { 'left': 'CVS:' },
\ 'cython': { 'left': '# ', 'leftAlt': '#' }, \ 'cython': { 'left': '# ', 'leftAlt': '#' },
\ 'd': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'd': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
@@ -142,7 +137,7 @@ let s:delimiterMap = {
\ 'desktop': { 'left': '#' }, \ 'desktop': { 'left': '#' },
\ 'dhcpd': { 'left': '#' }, \ 'dhcpd': { 'left': '#' },
\ 'diff': { 'left': '#' }, \ 'diff': { 'left': '#' },
\ 'django': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' }, \ 'django': { 'left': '{% comment %}', 'right': '{% endcomment %}', 'leftAlt': '{#', 'rightAlt': '#}' },
\ 'dns': { 'left': ';' }, \ 'dns': { 'left': ';' },
\ 'docbk': { 'left': '<!--', 'right': '-->' }, \ 'docbk': { 'left': '<!--', 'right': '-->' },
\ 'dockerfile': { 'left': '#' }, \ 'dockerfile': { 'left': '#' },
@@ -170,6 +165,7 @@ let s:delimiterMap = {
\ 'exports': { 'left': '#' }, \ 'exports': { 'left': '#' },
\ 'factor': { 'left': '! ', 'leftAlt': '!# ' }, \ 'factor': { 'left': '! ', 'leftAlt': '!# ' },
\ 'fancy': { 'left': '#' }, \ 'fancy': { 'left': '#' },
\ 'faust': { 'left': '//' },
\ 'fgl': { 'left': '#' }, \ 'fgl': { 'left': '#' },
\ 'focexec': { 'left': '-*' }, \ 'focexec': { 'left': '-*' },
\ 'form': { 'left': '*' }, \ 'form': { 'left': '*' },
@@ -183,7 +179,7 @@ let s:delimiterMap = {
\ 'gdb': { 'left': '#' }, \ 'gdb': { 'left': '#' },
\ 'gdmo': { 'left': '--' }, \ 'gdmo': { 'left': '--' },
\ 'geek': { 'left': 'GEEK_COMMENT:' }, \ 'geek': { 'left': 'GEEK_COMMENT:' },
\ 'genshi': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' }, \ 'genshi': { 'left': '<!--', 'right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' },
\ 'gentoo-conf-d': { 'left': '#' }, \ 'gentoo-conf-d': { 'left': '#' },
\ 'gentoo-env-d': { 'left': '#' }, \ 'gentoo-env-d': { 'left': '#' },
\ 'gentoo-init-d': { 'left': '#' }, \ 'gentoo-init-d': { 'left': '#' },
@@ -195,15 +191,16 @@ let s:delimiterMap = {
\ 'gitconfig': { 'left': ';' }, \ 'gitconfig': { 'left': ';' },
\ 'gitignore': { 'left': '#' }, \ 'gitignore': { 'left': '#' },
\ 'gitrebase': { 'left': '#' }, \ 'gitrebase': { 'left': '#' },
\ 'glsl': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'gnuplot': { 'left': '#' }, \ 'gnuplot': { 'left': '#' },
\ 'go': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'go': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'groovy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'groovy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'gsp': { 'left': '<%--', 'right': '--%>', 'leftAlt': '<!--','rightAlt': '-->'}, \ 'gsp': { 'left': '<%--', 'right': '--%>', 'leftAlt': '<!--', 'rightAlt': '-->' },
\ 'gtkrc': { 'left': '#' }, \ 'gtkrc': { 'left': '#' },
\ 'h': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'h': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'haml': { 'left': '-#', 'leftAlt': '/' }, \ 'haml': { 'left': '-#', 'leftAlt': '/' },
\ 'handlebars': { 'left': '{{!-- ', 'right': ' --}}' }, \ 'handlebars': { 'left': '{{!-- ', 'right': ' --}}' },
\ 'haskell': { 'left': '{-','right': '-}', 'nested': 1, 'leftAlt': '--', 'nestedAlt': 1 }, \ 'haskell': { 'left': '--', 'nested': 0, 'leftAlt': '{-', 'rightAlt': '-}', 'nestedAlt': 1 },
\ 'haxe': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'haxe': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'hb': { 'left': '#' }, \ 'hb': { 'left': '#' },
\ 'hbs': { 'left': '{{!-- ', 'right': ' --}}' }, \ 'hbs': { 'left': '{{!-- ', 'right': ' --}}' },
@@ -212,7 +209,7 @@ let s:delimiterMap = {
\ 'hog': { 'left': '#' }, \ 'hog': { 'left': '#' },
\ 'hostsaccess': { 'left': '#' }, \ 'hostsaccess': { 'left': '#' },
\ 'htmlcheetah': { 'left': '##' }, \ 'htmlcheetah': { 'left': '##' },
\ 'htmldjango': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' }, \ 'htmldjango': { 'left': '{% comment %}', 'right': '{% endcomment %}', 'leftAlt': '{#', 'rightAlt': '#}' },
\ 'htmlos': { 'left': '#', 'right': '/#' }, \ 'htmlos': { 'left': '#', 'right': '/#' },
\ 'hxml': { 'left': '#' }, \ 'hxml': { 'left': '#' },
\ 'hyphy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'hyphy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
@@ -234,17 +231,18 @@ let s:delimiterMap = {
\ 'javascript.jquery': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'javascript.jquery': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'jess': { 'left': ';' }, \ 'jess': { 'left': ';' },
\ 'jgraph': { 'left': '(*', 'right': '*)' }, \ 'jgraph': { 'left': '(*', 'right': '*)' },
\ 'jinja': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' }, \ 'jinja': { 'left': '<!--', 'right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' },
\ 'jproperties': { 'left': '#' }, \ 'jproperties': { 'left': '#' },
\ 'jsp': { 'left': '<%--', 'right': '--%>' }, \ 'jsp': { 'left': '<%--', 'right': '--%>' },
\ 'julia': { 'left': '#' }, \ 'julia': { 'left': '# ', 'leftAlt': '#=', 'rightAlt': '=#' },
\ 'kivy': { 'left': '#' },
\ 'kix': { 'left': ';' }, \ 'kix': { 'left': ';' },
\ 'kscript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'kscript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'lace': { 'left': '--' }, \ 'lace': { 'left': '--' },
\ 'laravel': { 'left': '{{--', 'right': '--}}' }, \ 'laravel': { 'left': '{{--', 'right': '--}}' },
\ 'ldif': { 'left': '#' }, \ 'ldif': { 'left': '#' },
\ 'less': { 'left': '/*','right': '*/' }, \ 'less': { 'left': '/*', 'right': '*/' },
\ 'lhaskell': { 'left': '>{-','right': '-}', 'leftAlt': '>-- ' }, \ 'lhaskell': { 'left': '>{-', 'right': '-}', 'leftAlt': '>-- ' },
\ 'lilo': { 'left': '#' }, \ 'lilo': { 'left': '#' },
\ 'lilypond': { 'left': '%' }, \ 'lilypond': { 'left': '%' },
\ 'liquid': { 'left': '{% comment %}', 'right': '{% endcomment %}' }, \ 'liquid': { 'left': '{% comment %}', 'right': '{% endcomment %}' },
@@ -271,13 +269,14 @@ let s:delimiterMap = {
\ 'master': { 'left': '$' }, \ 'master': { 'left': '$' },
\ 'matlab': { 'left': '%', 'leftAlt': '%{', 'rightAlt': '%}' }, \ 'matlab': { 'left': '%', 'leftAlt': '%{', 'rightAlt': '%}' },
\ 'mel': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'mel': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'meson': { 'left': '#' },
\ 'mib': { 'left': '--' }, \ 'mib': { 'left': '--' },
\ 'mips': { 'left': '#'}, \ 'minizinc': { 'left': '% ', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'mirah': {'left': '#'}, \ 'mips': { 'left': '#' },
\ 'mirah': {'left': '#' },
\ 'mkd': { 'left': '<!---', 'right': '-->' }, \ 'mkd': { 'left': '<!---', 'right': '-->' },
\ 'mma': { 'left': '(*', 'right': '*)' }, \ 'mma': { 'left': '(*', 'right': '*)' },
\ 'model': { 'left': '$', 'right': '$' }, \ 'model': { 'left': '$', 'right': '$' },
\ 'moduala.': { 'left': '(*', 'right': '*)' },
\ 'modula2': { 'left': '(*', 'right': '*)' }, \ 'modula2': { 'left': '(*', 'right': '*)' },
\ 'modula3': { 'left': '(*', 'right': '*)' }, \ 'modula3': { 'left': '(*', 'right': '*)' },
\ 'molpro': { 'left': '!' }, \ 'molpro': { 'left': '!' },
@@ -311,7 +310,7 @@ let s:delimiterMap = {
\ 'ox': { 'left': '//' }, \ 'ox': { 'left': '//' },
\ 'paludis-use-conf': { 'left': '#' }, \ 'paludis-use-conf': { 'left': '#' },
\ 'pandoc': { 'left': '<!--', 'right': '-->' }, \ 'pandoc': { 'left': '<!--', 'right': '-->' },
\ 'pascal': { 'left': '{','right': '}', 'leftAlt': '(*', 'rightAlt': '*)' }, \ 'pascal': { 'left': '{', 'right': '}', 'leftAlt': '(*', 'rightAlt': '*)' },
\ 'patran': { 'left': '$', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'patran': { 'left': '$', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'pcap': { 'left': '#' }, \ 'pcap': { 'left': '#' },
\ 'pccts': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'pccts': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
@@ -332,6 +331,7 @@ let s:delimiterMap = {
\ 'povini': { 'left': ';' }, \ 'povini': { 'left': ';' },
\ 'ppd': { 'left': '%' }, \ 'ppd': { 'left': '%' },
\ 'ppwiz': { 'left': ';;' }, \ 'ppwiz': { 'left': ';;' },
\ 'praat': { 'left': '#' },
\ 'privoxy': { 'left': '#' }, \ 'privoxy': { 'left': '#' },
\ 'processing': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'processing': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'prolog': { 'left': '%', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'prolog': { 'left': '%', 'leftAlt': '/*', 'rightAlt': '*/' },
@@ -350,13 +350,15 @@ let s:delimiterMap = {
\ 'rebol': { 'left': ';' }, \ 'rebol': { 'left': ';' },
\ 'registry': { 'left': ';' }, \ 'registry': { 'left': ';' },
\ 'remind': { 'left': '#' }, \ 'remind': { 'left': '#' },
\ 'renpy': { 'left': '# ' },
\ 'resolv': { 'left': '#' }, \ 'resolv': { 'left': '#' },
\ 'rgb': { 'left': '!' }, \ 'rgb': { 'left': '!' },
\ 'rib': { 'left': '#' }, \ 'rib': { 'left': '#' },
\ 'rmd': { 'left': '#' }, \ 'rmd': { 'left': '#' },
\ 'robot': { 'left': '#' },
\ 'robots': { 'left': '#' }, \ 'robots': { 'left': '#' },
\ 'rspec': { 'left': '#' }, \ 'rspec': { 'left': '#' },
\ 'ruby': { 'left': '#', 'leftAlt': '=begin', 'rightAlt': '=end' }, \ 'ruby': { 'left': '#' },
\ 'rust': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'rust': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'sa': { 'left': '--' }, \ 'sa': { 'left': '--' },
\ 'samba': { 'left': ';', 'leftAlt': '#' }, \ 'samba': { 'left': ';', 'leftAlt': '#' },
@@ -367,11 +369,13 @@ let s:delimiterMap = {
\ 'scilab': { 'left': '//' }, \ 'scilab': { 'left': '//' },
\ 'scons': { 'left': '#' }, \ 'scons': { 'left': '#' },
\ 'scsh': { 'left': ';' }, \ 'scsh': { 'left': ';' },
\ 'scss': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/'}, \ 'scss': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'sdc': { 'left': '#' },
\ 'sed': { 'left': '#' }, \ 'sed': { 'left': '#' },
\ 'sgmldecl': { 'left': '--', 'right': '--' }, \ 'sgmldecl': { 'left': '--', 'right': '--' },
\ 'sgmllnx': { 'left': '<!--', 'right': '-->' }, \ 'sgmllnx': { 'left': '<!--', 'right': '-->' },
\ 'sh': { 'left': '#' }, \ 'sh': { 'left': '#' },
\ 'shader_test': { 'left': '#' },
\ 'sicad': { 'left': '*' }, \ 'sicad': { 'left': '*' },
\ 'sile': { 'left': '%' }, \ 'sile': { 'left': '%' },
\ 'simula': { 'left': '%', 'leftAlt': '--' }, \ 'simula': { 'left': '%', 'leftAlt': '--' },
@@ -403,12 +407,13 @@ let s:delimiterMap = {
\ 'sqr': { 'left': '!' }, \ 'sqr': { 'left': '!' },
\ 'squid': { 'left': '#' }, \ 'squid': { 'left': '#' },
\ 'ss': { 'left': ';', 'leftAlt': '#|', 'rightAlt': '|#' }, \ 'ss': { 'left': ';', 'leftAlt': '#|', 'rightAlt': '|#' },
\ 'sshconfig': { 'left': '#' },
\ 'sshdconfig': { 'left': '#' }, \ 'sshdconfig': { 'left': '#' },
\ 'st': { 'left': '"' }, \ 'st': { 'left': '"' },
\ 'stan': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'stan': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'stp': { 'left': '/*','right': '*/', 'leftAlt': '//' }, \ 'stp': { 'left': '/*', 'right': '*/', 'leftAlt': '//' },
\ 'supercollider': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'supercollider': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'swift': { 'left': '/*','right': '*/', 'leftAlt': '//' }, \ 'swift': { 'left': '/*', 'right': '*/', 'leftAlt': '//' },
\ 'systemverilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'systemverilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'tads': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'tads': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'tags': { 'left': ';' }, \ 'tags': { 'left': ';' },
@@ -420,7 +425,7 @@ let s:delimiterMap = {
\ 'tex': { 'left': '%' }, \ 'tex': { 'left': '%' },
\ 'texinfo': { 'left': "@c " }, \ 'texinfo': { 'left': "@c " },
\ 'texmf': { 'left': '%' }, \ 'texmf': { 'left': '%' },
\ 'tf': { 'left': ';' }, \ 'tf': { 'left': '#' },
\ 'tidy': { 'left': '#' }, \ 'tidy': { 'left': '#' },
\ 'tli': { 'left': '#' }, \ 'tli': { 'left': '#' },
\ 'tmux': { 'left': '#' }, \ 'tmux': { 'left': '#' },
@@ -429,6 +434,7 @@ let s:delimiterMap = {
\ 'tsalt': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'tsalt': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'tsscl': { 'left': '#' }, \ 'tsscl': { 'left': '#' },
\ 'tssgm': { 'left': "comment = '", 'right': "'" }, \ 'tssgm': { 'left': "comment = '", 'right': "'" },
\ 'ttl': { 'left': '#' },
\ 'tup': { 'left': '#' }, \ 'tup': { 'left': '#' },
\ 'twig': { 'left': '{#', 'right': '#}' }, \ 'twig': { 'left': '{#', 'right': '#}' },
\ 'txt2tags': { 'left': '%' }, \ 'txt2tags': { 'left': '%' },
@@ -440,7 +446,7 @@ let s:delimiterMap = {
\ 'vasp': { 'left': '!' }, \ 'vasp': { 'left': '!' },
\ 'vb': { 'left': "'" }, \ 'vb': { 'left': "'" },
\ 'velocity': { 'left': "##", 'right': "", 'leftAlt': '#*', 'rightAlt': '*#' }, \ 'velocity': { 'left': "##", 'right': "", 'leftAlt': '#*', 'rightAlt': '*#' },
\ 'vera': { 'left': '/*','right': '*/', 'leftAlt': '//' }, \ 'vera': { 'left': '/*', 'right': '*/', 'leftAlt': '//' },
\ 'verilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'verilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'verilog_systemverilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'verilog_systemverilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'vgrindefs': { 'left': '#' }, \ 'vgrindefs': { 'left': '#' },
@@ -984,7 +990,11 @@ function s:CommentLinesSexy(topline, bottomline)
" the lines down when we added the left delimiter " the lines down when we added the left delimiter
call cursor(a:bottomline+1, 1) call cursor(a:bottomline+1, 1)
execute 'normal! o' execute 'normal! o'
if g:NERDDisableTabsInBlockComm
let theLine = repeat(' ', leftAlignIndx) . right
else
let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . right let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . right
endif
" Make sure tabs are respected " Make sure tabs are respected
if !&expandtab if !&expandtab
@@ -1010,7 +1020,11 @@ function s:CommentLinesSexy(topline, bottomline)
endif endif
" add the sexyComMarker " add the sexyComMarker
if g:NERDDisableTabsInBlockComm
let theLine = repeat(' ', leftAlignIndx) . sexyComMarkerSpaced . strpart(theLine, leftAlignIndx)
else
let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . sexyComMarkerSpaced . strpart(theLine, leftAlignIndx) let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . sexyComMarkerSpaced . strpart(theLine, leftAlignIndx)
endif
if lineHasTabs if lineHasTabs
let theLine = s:ConvertLeadingSpacesToTabs(theLine) let theLine = s:ConvertLeadingSpacesToTabs(theLine)
@@ -1174,12 +1188,12 @@ function s:InvertComment(firstLine, lastLine)
endwhile endwhile
endfunction endfunction
function! NERDCommentIsLineCommented(lineNo) function! nerdcommenter#IsLineCommented(lineNo)
let theLine = getline(a:lineNo) let theLine = getline(a:lineNo)
return s:IsInSexyComment(a:lineNo) || s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine) return s:IsInSexyComment(a:lineNo) || s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
endfunction endfunction
" Function: NERDComment(mode, type) function {{{2 " Function: nerdcommenter#Comment(mode, type) function {{{2
" This function is a Wrapper for the main commenting functions " This function is a Wrapper for the main commenting functions
" "
" Args: " Args:
@@ -1188,7 +1202,7 @@ endfunction
" -type: the type of commenting requested. Can be 'Sexy', 'Invert', " -type: the type of commenting requested. Can be 'Sexy', 'Invert',
" 'Minimal', 'Toggle', 'AlignLeft', 'AlignBoth', 'Comment', " 'Minimal', 'Toggle', 'AlignLeft', 'AlignBoth', 'Comment',
" 'Nested', 'ToEOL', 'Append', 'Insert', 'Uncomment', 'Yank' " 'Nested', 'ToEOL', 'Append', 'Insert', 'Uncomment', 'Yank'
function! NERDComment(mode, type) range function! nerdcommenter#Comment(mode, type) range
if exists('*NERDCommenter_before') if exists('*NERDCommenter_before')
exe "call NERDCommenter_before()" exe "call NERDCommenter_before()"
endif endif
@@ -1247,13 +1261,30 @@ function! NERDComment(mode, type) range
endtry endtry
elseif a:type ==? 'Toggle' elseif a:type ==? 'Toggle'
if g:NERDToggleCheckAllLines ==# 0
let theLine = getline(firstLine) let theLine = getline(firstLine)
if s:IsInSexyComment(firstLine) || s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine) if s:IsInSexyComment(firstLine) || s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
call s:UncommentLines(firstLine, lastLine) call s:UncommentLines(firstLine, lastLine)
else else
call s:CommentLinesToggle(forceNested, firstLine, lastLine) call s:CommentLinesToggle(forceNested, firstLine, lastLine)
endif endif
else
let l:commentAllLines = 0
for i in range(firstLine, lastLine)
let theLine = getline(i)
" if have one line no comment(not include blank/whitespace-only lines), then comment all lines
if theLine =~ '[^ \t]\+' && !s:IsInSexyComment(firstLine) && !s:IsCommentedFromStartOfLine(s:Left(), theLine) && !s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
let l:commentAllLines = 1
break
else
endif
endfor
if l:commentAllLines ==# 1
call s:CommentLinesToggle(forceNested, firstLine, lastLine)
else
call s:UncommentLines(firstLine, lastLine)
endif
endif
elseif a:type ==? 'Minimal' elseif a:type ==? 'Minimal'
try try
@@ -1286,7 +1317,7 @@ function! NERDComment(mode, type) range
else else
normal! yy normal! yy
endif endif
execute firstLine .','. lastLine .'call NERDComment("'. a:mode .'", "Comment")' execute firstLine .','. lastLine .'call nerdcommenter#Comment("'. a:mode .'", "Comment")'
endif endif
call s:RecoverStateAfterLineComment(state) call s:RecoverStateAfterLineComment(state)
@@ -2981,17 +3012,21 @@ endfunction
" Section: Comment mapping and menu item setup {{{1 " Section: Comment mapping and menu item setup {{{1
" =========================================================================== " ===========================================================================
function! nerdcommenter#Plug(target)
return "\<Plug>NERDCommenter". a:target
endfunction
" Create menu items for the specified modes. If a:combo is not empty, then " Create menu items for the specified modes. If a:combo is not empty, then
" also define mappings and show a:combo in the menu items. " also define mappings and show a:combo in the menu items.
function! s:CreateMaps(modes, target, desc, combo) function! s:CreateMaps(modes, target, desc, combo)
" Build up a map command like " Build up a map command like
" 'noremap <silent> <plug>NERDCommenterComment :call NERDComment("n", "Comment")' " 'noremap <silent> <Plug>NERDCommenterComment :call nerdcommenter#Comment("n", "Comment")'
let plug = '<plug>NERDCommenter' . a:target let plug = '<Plug>NERDCommenter' . a:target
let plug_start = 'noremap <silent> ' . plug . ' :call NERDComment("' let plug_start = 'noremap <silent> ' . plug . ' :call nerdcommenter#Comment("'
let plug_end = '", "' . a:target . '")<cr>' let plug_end = '", "' . a:target . '")<CR>'
" Build up a menu command like " Build up a menu command like
" 'menu <silent> comment.Comment<Tab>\\cc <plug>NERDCommenterComment' " 'menu <silent> comment.Comment<Tab>\\cc <Plug>NERDCommenterComment'
let menuRoot = get(['', 'comment', '&comment', '&Plugin.&comment'], let menuRoot = get(['', 'comment', '&comment', '&Plugin.&comment', '&Plugin.Nerd\ &Commenter'],
\ g:NERDMenuMode, '') \ g:NERDMenuMode, '')
let menu_command = 'menu <silent> ' . menuRoot . '.' . escape(a:desc, ' ') let menu_command = 'menu <silent> ' . menuRoot . '.' . escape(a:desc, ' ')
if strlen(a:combo) if strlen(a:combo)
@@ -3003,9 +3038,6 @@ function! s:CreateMaps(modes, target, desc, combo)
for mode in (a:modes == '') ? [''] : split(a:modes, '\zs') for mode in (a:modes == '') ? [''] : split(a:modes, '\zs')
if strlen(a:combo) if strlen(a:combo)
execute mode . plug_start . mode . plug_end execute mode . plug_start . mode . plug_end
if g:NERDCreateDefaultMappings && !hasmapto(plug, mode)
execute mode . 'map <leader>' . a:combo . ' ' . plug
endif
endif endif
" Check if the user wants the menu to be displayed. " Check if the user wants the menu to be displayed.
if g:NERDMenuMode != 0 if g:NERDMenuMode != 0
@@ -3014,7 +3046,7 @@ function! s:CreateMaps(modes, target, desc, combo)
endfor endfor
endfunction endfunction
call s:CreateMaps('nx', 'Comment', 'Comment', 'cc') call s:CreateMaps('nx', 'Comment', 'Comment', 'cc')
call s:CreateMaps('nx', 'Toggle', 'Toggle', 'c<space>') call s:CreateMaps('nx', 'Toggle', 'Toggle', 'c<Space>')
call s:CreateMaps('nx', 'Minimal', 'Minimal', 'cm') call s:CreateMaps('nx', 'Minimal', 'Minimal', 'cm')
call s:CreateMaps('nx', 'Nested', 'Nested', 'cn') call s:CreateMaps('nx', 'Nested', 'Nested', 'cn')
call s:CreateMaps('n', 'ToEOL', 'To EOL', 'c$') call s:CreateMaps('n', 'ToEOL', 'To EOL', 'c$')
@@ -3032,13 +3064,15 @@ call s:CreateMaps('i', 'Insert', 'Insert Comment Here', '')
call s:CreateMaps('', ':', '-Sep3-', '') call s:CreateMaps('', ':', '-Sep3-', '')
call s:CreateMaps('', ':help NERDCommenterContents<CR>', 'Help', '') call s:CreateMaps('', ':help NERDCommenterContents<CR>', 'Help', '')
inoremap <silent> <plug>NERDCommenterInsert <SPACE><BS><ESC>:call NERDComment('i', "insert")<CR> inoremap <silent> <Plug>NERDCommenterInsert <Space><BS><Esc>:call nerdcommenter#Comment('i', "insert")<CR>
" switch to/from alternative delimiters (does not use wrapper function) " switch to/from alternative delimiters (does not use wrapper function)
nnoremap <plug>NERDCommenterAltDelims :call <SID>SwitchToAlternativeDelimiters(1)<cr> nnoremap <Plug>NERDCommenterAltDelims :call <SID>SwitchToAlternativeDelimiters(1)<CR>
" This is a workaround to enable lazy-loading from supported plugin managers: " This is a workaround to enable lazy-loading from supported plugin managers:
" See https://github.com/scrooloose/nerdcommenter/issues/176 " See https://github.com/scrooloose/nerdcommenter/issues/176
call s:SetUpForNewFiletype(&filetype, 1) if !has('vim_starting')
call s:SetUpForNewFiletype(&filetype, 1)
endif
" vim: set foldmethod=marker : " vim: set foldmethod=marker :

View File

@@ -488,6 +488,9 @@ change the filetype back: >
one of 'none', 'left', 'start', or one of 'none', 'left', 'start', or
'both'. 'both'.
|'NERDToggleCheckAllLines'| Enable NERDCommenterToggle to check
all selected lines is commented or not.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
4.3 Options details *NERDComOptionsDetails* 4.3 Options details *NERDComOptionsDetails*
@@ -800,6 +803,39 @@ When this option is set to 1, comments are nested automatically. That is, if
you hit |<Leader>|cc on a line that is already commented it will be commented you hit |<Leader>|cc on a line that is already commented it will be commented
again. again.
------------------------------------------------------------------------------
*'NERDToggleCheckAllLines'*
Values: 0 or 1.
Default 0.
When this option is set to 1, NERDCommenterToggle will check all selected line,
if there have oneline not be commented, then comment all lines.
------------------------------------------------------------------------------
*'NERDDisableTabsInBlockComm'*
Values: 0 or 1.
Default 0.
When this option is set to 1, NERDDisableTabsInBlockComm will not add
whitespaces align the start location of the ending comment symbol with the
end location of the starting comment symbol. For example, in Fortran, the new
style will be as the following: >
close (inpt,iostat=ierr,iomsg=error_message)
call io_error(pname,input_fname,2,__LINE__,__FILE__,ierr,error_message)
<
to >
!===BEGIN===!
! close (inpt,iostat=ierr,iomsg=error_message)
! call io_error(pname,input_fname,2,__LINE__,__FILE__,ierr,error_message)
!===END===!
<
for the block comment style if customized comment symbols are set up in vimrc
file by the following line >
let g:NERDCustomDelimiters = {
\ 'fortran':{'left':'!','leftAlt':'!===BEGIN===!','rightAlt':'!===END===!'}
\ }
<
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
3.3 Default delimiter customisation *NERDComDefaultDelims* 3.3 Default delimiter customisation *NERDComDefaultDelims*
@@ -1093,6 +1129,7 @@ Simon Hengel htmlcheetah
Matt Tolton javacc Matt Tolton javacc
Ivan Devat javascript.jquery Ivan Devat javascript.jquery
tpope cucumber,pdf tpope cucumber,pdf
Lyude Paul piglit shader_test
============================================================================== ==============================================================================
10. License *NERDComLicense* 10. License *NERDComLicense*