1
0
mirror of https://github.com/amix/vimrc synced 2025-07-09 10:45:00 +08:00

updated plugins and added eslint goodies

This commit is contained in:
Max Alcala
2016-02-19 10:35:36 -06:00
parent a1deb28314
commit f3143286d3
402 changed files with 14389 additions and 4024 deletions

View File

@ -34,7 +34,7 @@ Once help tags have been generated, you can view the manual with
Relax! You just have to adjust `'commentstring'`:
autocmd FileType apache set commentstring=#\ %s
autocmd FileType apache setlocal commentstring=#\ %s
## Self-Promotion

View File

@ -6,9 +6,6 @@ License: Same terms as Vim itself (see |license|)
Comment stuff out. Then uncomment it later. Relies on 'commentstring' to be
correctly set, or uses b:commentary_format if it is set.
The gc mappings are preferred, while the \\ mappings are provided for
backwards compatibility.
*gc*
gc{motion} Comment or uncomment lines that {motion} moves over.

View File

@ -1,6 +1,6 @@
" commentary.vim - Comment stuff out
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 1.2
" Version: 1.3
" GetLatestVimScripts: 3695 1 :AutoInstall: commentary.vim
if exists("g:loaded_commentary") || &cp || v:version < 700
@ -13,6 +13,14 @@ function! s:surroundings() abort
\ &commentstring, '\S\zs%s',' %s','') ,'%s\ze\S', '%s ', '')), '%s', 1)
endfunction
function! s:strip_white_space(l,r,line) abort
let [l, r] = [a:l, a:r]
if stridx(a:line,l) == -1 && stridx(a:line,l[0:-2]) == 0 && a:line[strlen(a:line)-strlen(r[1:]):-1] == r[1:]
return [l[0:-2], r[1:]]
endif
return [l, r]
endfunction
function! s:go(type,...) abort
if a:0
let [lnum1, lnum2] = [a:type, a:1]
@ -24,6 +32,7 @@ function! s:go(type,...) abort
let uncomment = 2
for lnum in range(lnum1,lnum2)
let line = matchstr(getline(lnum),'\S.*\s\@<!')
let [l, r] = s:strip_white_space(l,r,line)
if line != '' && (stridx(line,l) || line[strlen(line)-strlen(r) : -1] != r)
let uncomment = 0
endif
@ -53,12 +62,14 @@ function! s:go(type,...) abort
endfunction
function! s:textobject(inner) abort
let [l, r] = s:surroundings()
let [l_, r_] = s:surroundings()
let [l, r] = [l_, r_]
let lnums = [line('.')+1, line('.')-2]
for [index, dir, bound, line] in [[0, -1, 1, ''], [1, 1, line('$'), '']]
while lnums[index] != bound && line ==# '' || !(stridx(line,l) || line[strlen(line)-strlen(r) : -1] != r)
let lnums[index] += dir
let line = matchstr(getline(lnums[index]+dir),'\S.*\s\@<!')
let [l, r] = s:strip_white_space(l_,r_,line)
endwhile
endfor
while (a:inner || lnums[1] != line('$')) && empty(getline(lnums[0]))
@ -89,11 +100,4 @@ if !hasmapto('<Plug>Commentary') || maparg('gc','n') ==# ''
nmap gcu <Plug>Commentary<Plug>Commentary
endif
if maparg('\\','n') ==# '' && maparg('\','n') ==# '' && get(g:, 'commentary_map_backslash', 1)
xmap \\ <Plug>Commentary:echomsg '\\ is deprecated. Use gc'<CR>
nmap \\ :echomsg '\\ is deprecated. Use gc'<CR><Plug>Commentary
nmap \\\ <Plug>CommentaryLine:echomsg '\\ is deprecated. Use gc'<CR>
nmap \\u <Plug>CommentaryUndo:echomsg '\\ is deprecated. Use gc'<CR>
endif
" vim:set et sw=2: