diff --git a/doc/NERD_commenter.txt b/doc/NERD_commenter.txt index 9852a31..dd099ea 100644 --- a/doc/NERD_commenter.txt +++ b/doc/NERD_commenter.txt @@ -23,11 +23,10 @@ CONTENTS *NERDCommenterContents* 2.2.7 Yank comment map............|NERDComYankComment| 2.2.8 Comment to EOL map..........|NERDComEOLComment| 2.2.9 Append com to line map......|NERDComAppendComment| - 2.2.10 Prepend com to line map....|NERDComPrependComment| - 2.2.11 Insert comment map.........|NERDComInsertComment| - 2.2.12 Use alternate delims map...|NERDComAltDelim| - 2.2.13 Comment aligned maps.......|NERDComAlignedComment| - 2.2.14 Uncomment line map.........|NERDComUncommentLine| + 2.2.10 Insert comment map.........|NERDComInsertComment| + 2.2.11 Use alternate delims map...|NERDComAltDelim| + 2.2.12 Comment aligned maps.......|NERDComAlignedComment| + 2.2.13 Uncomment line map.........|NERDComUncommentLine| 2.3 Supported filetypes...............|NERDComFiletypes| 2.4 Sexy Comments.....................|NERDComSexyComments| 2.5 The NERDComment function..........|NERDComNERDComment| @@ -101,11 +100,6 @@ Adds comment delimiters to the end of line and goes into insert mode between them. -cI |NERDComPrependComment| -Adds comment delimiters to the start of line and goes into insert mode between -them. - - |NERDComInsertComment| Adds comment delimiters at the current cursor position and inserts between. Disabled by default. @@ -270,17 +264,7 @@ Appends comment delimiters to the end of the current line and goes to insert mode between the new delimiters. ------------------------------------------------------------------------------ -2.2.10 Prepend com to line map *NERDComPrependComment* - -Default mapping: cI -Mapped to: NERDCommenterPrepend -Applicable modes: normal. - -Prepends comment delimiters to the start of the current line and goes to -insert mode between the new delimiters. - ------------------------------------------------------------------------------- -2.2.11 Insert comment map *NERDComInsertComment* +2.2.10 Insert comment map *NERDComInsertComment* Default mapping: disabled by default. Map it to: NERDCommenterInInsert @@ -296,7 +280,7 @@ mapping add > to your vimrc. ------------------------------------------------------------------------------ -2.2.12 Use alternate delims map *NERDComAltDelim* +2.2.11 Use alternate delims map *NERDComAltDelim* Default mapping: ca Mapped to: NERDCommenterAltDelims @@ -309,7 +293,7 @@ then they will be switched over to /**/ comments. See also |NERDComDefaultDelims| ------------------------------------------------------------------------------ -2.2.13 Comment aligned maps *NERDComAlignedComment* +2.2.12 Comment aligned maps *NERDComAlignedComment* Default mappings: [count]cl [count]cb Mapped to: NERDCommenterAlignLeft @@ -324,7 +308,7 @@ If a [count] is given in normal mode, the mapping works as though that many lines were selected in visual-line mode. ------------------------------------------------------------------------------ -2.2.14 Uncomment line map *NERDComUncommentLine* +2.2.13 Uncomment line map *NERDComUncommentLine* Default mapping: [count]cu Mapped to: NERDCommenterUncomment @@ -410,8 +394,8 @@ The arguments to this function are simple: line. - type: is used to specify what type of commenting operation is to be performed, and it can be one of the following: "sexy", "invert", - "minimal", "toggle", "alignLeft", "alignBoth", "norm", - "nested", "toEOL", "prepend", "append", "insert", "uncomment", "yank" + "minimal", "toggle", "alignLeft", "alignBoth", "norm", "nested", + "toEOL", "append", "insert", "uncomment", "yank" For example, if you typed > :call NERDComment(1, 'sexy') diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 710cece..a3474a0 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -1501,7 +1501,7 @@ endfunction " mode or not " -type: the type of commenting requested. Can be 'sexy', 'invert', " 'minimal', 'toggle', 'alignLeft', 'alignBoth', 'norm', -" 'nested', 'toEOL', 'prepend', 'append', 'insert', 'uncomment', 'yank' +" 'nested', 'toEOL', 'append', 'insert', 'uncomment', 'yank' function! NERDComment(isVisual, type) range " we want case sensitivity when commenting let oldIgnoreCase = &ignorecase @@ -1574,9 +1574,6 @@ function! NERDComment(isVisual, type) range call s:CommentBlock(firstLine, firstLine, col("."), col("$")-1, 1) call s:RestoreScreenState() - elseif a:type == 'prepend' - call s:PrependCommentToLine() - elseif a:type == 'append' call s:AppendCommentToLine() @@ -1654,46 +1651,6 @@ function s:PlaceDelimitersAndInsBetween() startinsert endfunction -" Function: s:PrependCommentToLine(){{{2 -" This function prepends comment delimiters to the start of line and places -" the cursor in position to start typing the comment -function s:PrependCommentToLine() - " get the left and right delimiters without any escape chars in them - let left = s:GetLeft(0, 1, 0) - let right = s:GetRight(0, 1, 0) - - " get the len of the right delim - let lenRight = strlen(right) - - - "if the line is empty then we need to know about this later on - let isLineEmpty = strlen(getline(".")) == 0 - - "stick the delimiters down at the start of the line. We have to format the - "comment with spaces as appropriate - if lenRight > 0 - execute ":normal I" . left . right - else - execute ":normal I" . left - endif - - " if there is a right delimiter then we gotta move the cursor left - " by the len of the right delimiter so we insert between the delimiters - if lenRight > 0 - let leftMoveAmount = lenRight - execute ":normal " . leftMoveAmount . "h" - endif - normal l - - "if the line was empty then we gotta add an extra space on the end because - "the cursor will move back one more at the end of the last "execute" - "command - if isLineEmpty && lenRight == 0 - execute ":normal a " - endif - - startinsert -endfunction " Function: s:RemoveDelimiters(left, right, line) {{{2 " this function is called to remove the first left comment delimiter and the " last right delimiter of the given line. @@ -3281,9 +3238,6 @@ nnoremap NERDCommenterToEOL :call NERDComment(0, "toEOL") " append comments nmap NERDCommenterAppend :call NERDComment(0, "append") -" prepend comments -nmap NERDCommenterPrepend :call NERDComment(0, "prepend") - " insert comments inoremap NERDCommenterInInsert :call NERDComment(0, "insert") @@ -3311,7 +3265,6 @@ if g:NERDCreateDefaultMappings call s:CreateMaps('NERDCommenterUncomment', 'cu') call s:CreateMaps('NERDCommenterToEOL', 'c$') call s:CreateMaps('NERDCommenterAppend', 'cA') - call s:CreateMaps('NERDCommenterPrepend', 'cI') if !hasmapto('NERDCommenterAltDelims', 'n') nmap ca NERDCommenterAltDelims @@ -3347,7 +3300,6 @@ if g:NERDMenuMode != 0 call s:CreateMenuItems('NERDCommenterSexy', 'Sexy', menuRoot) call s:CreateMenuItems('NERDCommenterYank', 'Yank\ then\ comment', menuRoot) exec 'nmenu '. menuRoot .'.Append NERDCommenterAppend' - exec 'nmenu '. menuRoot .'.Prepend NERDCommenterPrepend' exec 'menu '. menuRoot .'.-Sep- :' call s:CreateMenuItems('NERDCommenterAlignLeft', 'Left\ aligned', menuRoot) call s:CreateMenuItems('NERDCommenterAlignBoth', 'Left\ and\ right\ aligned', menuRoot)