diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim index b0146a36..568b0f3a 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim @@ -204,6 +204,14 @@ let s:hlgrps = { \ } " lname, sname of the basic(non-extension) modes +let s:types = ['fil', 'buf', 'mru'] +if !exists('g:ctrlp_types') + let g:ctrlp_types = s:types +el + call filter(g:ctrlp_types, "index(['fil', 'buf', 'mru'], v:val)!=-1") +en +let g:ctrlp_builtins = len(g:ctrlp_types)-1 + let s:coretypes = filter([ \ ['files', 'fil'], \ ['buffers', 'buf'], @@ -912,10 +920,13 @@ fu! s:PrtDeleteMRU() endf fu! s:PrtExit() + let bw = bufwinnr('%') exe bufwinnr(s:bufnr).'winc w' if bufnr('%') == s:bufnr && bufname('%') == 'ControlP' noa cal s:Close(1) noa winc p + els + exe bw.'winc w' en endf @@ -1962,7 +1973,7 @@ fu! s:isabs(path) endf fu! s:bufnrfilpath(line) - if s:isabs(a:line) || a:line =~ '^\~[/\\]' + if s:isabs(a:line) || a:line =~ '^\~[/\\]' || a:line =~ '^\w\+:\/\/' let filpath = a:line el let filpath = s:dyncwd.s:lash().a:line @@ -2032,7 +2043,7 @@ fu! s:checkbuf() endf fu! s:iscmdwin() - let ermsg = v:errmsg + let [ermsg, v:errmsg] = [v:errmsg, ''] sil! noa winc p sil! noa winc p let [v:errmsg, ermsg] = [ermsg, v:errmsg] diff --git a/sources_non_forked/ctrlp.vim/doc/ctrlp.txt b/sources_non_forked/ctrlp.vim/doc/ctrlp.txt index 4cc6017d..416fd000 100644 --- a/sources_non_forked/ctrlp.vim/doc/ctrlp.txt +++ b/sources_non_forked/ctrlp.vim/doc/ctrlp.txt @@ -255,8 +255,9 @@ plugins look for .git/, .hg/,... some other plugins look for external *.exe tools on Windows). So be a little mindful of what you put in your |wildignore|. *'g:ctrlp_custom_ignore'* -In addition to |'wildignore'|, use this for files and directories you want only -CtrlP to not show. Use regexp to specify the patterns: > +In addition to |'wildignore'| and |g:ctrlp_show_hidden|, use this for files +and directories you want only CtrlP to not show. Use regexp to specify the +patterns: > let g:ctrlp_custom_ignore = '' < Examples: > @@ -860,7 +861,8 @@ COMMANDS *ctrlp-commands* Open CtrlP in find file mode. If no argument is given, the value of |g:ctrlp_working_path_mode| will be - used to determine the starting directory. + used to determine the starting directory. See |:CtrlPCurFile| and + |:CtrlPCurWD| to temporarily override the setting. You can use to auto-complete the [starting-directory] when typing it. @@ -868,6 +870,16 @@ COMMANDS *ctrlp-commands* :CtrlPBuffer Open CtrlP in find buffer mode. + *:CtrlPCurFile* +:CtrlPCurFile + This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores + the variable's current value. + + *:CtrlPCurWD* +:CtrlPCurWD + This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores + the variable's current value. + *:CtrlPMRU* :CtrlPMRU Open CtrlP in find Most-Recently-Used file mode. @@ -1329,7 +1341,8 @@ Available extensions:~ Buffer Tag mode options:~ *'g:ctrlp_buftag_ctags_bin'* -If ctags isn't in your $PATH, use this to set its location: > +If ctags isn't in your $PATH, or a ctags binary exists in either +/opt/local/bin or /usr/local/bin, us this to set its location: > let g:ctrlp_buftag_ctags_bin = '' < diff --git a/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim b/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim index 9f2bb147..5ab368aa 100644 --- a/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim +++ b/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim @@ -10,15 +10,9 @@ if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp en let g:loaded_ctrlp = 1 -let s:types = ['fil', 'buf', 'mru'] -if !exists('g:ctrlp_types') - let g:ctrlp_types = s:types -el - call filter(g:ctrlp_types, "index(['fil', 'buf', 'mru'], v:val)!=-1") -en let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs, \ g:ctrlp_allmixes, g:ctrlp_buftags, g:ctrlp_ext_vars, g:ctrlp_builtins] - \ = [[], [], [], [], {}, {}, [], len(g:ctrlp_types)-1] + \ = [[], [], [], [], {}, {}, [], 2] if !exists('g:ctrlp_map') | let g:ctrlp_map = '' | en if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en diff --git a/sources_non_forked/ctrlp.vim/readme.md b/sources_non_forked/ctrlp.vim/readme.md index 66fc9e8c..5412b6de 100644 --- a/sources_non_forked/ctrlp.vim/readme.md +++ b/sources_non_forked/ctrlp.vim/readme.md @@ -64,6 +64,10 @@ Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 fi If more than one mode is specified, they will be tried in order until a directory is located. +* If a file is already open, open it again in a new pane instead of switching to the existing pane + + `let g:ctrlp_switch_buffer = 'et'` + * Exclude files and directories using Vim's `wildignore` and CtrlP's own `g:ctrlp_custom_ignore`. If a custom listing command is being used, exclusions are ignored: ```vim diff --git a/sources_non_forked/lightline.vim/README.md b/sources_non_forked/lightline.vim/README.md index 03f5da1b..31f79fda 100644 --- a/sources_non_forked/lightline.vim/README.md +++ b/sources_non_forked/lightline.vim/README.md @@ -272,7 +272,7 @@ set noshowmode ``` -Now, let us get back to the tutorial (with the patched font for vim-powerline). +Now, let's get back to the tutorial (with the patched font for vim-powerline). You look into a help file to find the marks annoying. ![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/6.png) @@ -293,8 +293,8 @@ let g:lightline = { ![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/7.png) Huh? Weird! -The components do not collapse even if they have no information! -In order to avoid this situation, you set expressions to `g:lightline.component_visible_condition`, which should become 1 only when the corresponding components have information. +The subseparators are visible even if the components are empty. +In order to hide the subseparators, you can set expressions to `g:lightline.component_visible_condition`, which should be 1 only when the corresponding component is not empty. ```vim let g:lightline = { \ 'colorscheme': 'wombat', @@ -313,8 +313,8 @@ let g:lightline = { ![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/8.png) Okay. It works nice. - - +The configuration `component_visible_condition` is used to control the visibility of the subseparators. +You cannot use this variable to control the visibility of the components themselves. How does lightline decide the components to show in the statusline? It's very simple. @@ -340,16 +340,9 @@ let g:lightline = { \ } ``` If the plugin arranges all the components (in a situation you `set paste` and the file `.vimrc` is read-only, try to modify): + ![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/9.png) -The mode component, the paste component, read-only component, filename component and modified component in a row. -Normally, the paste component does not show up. -![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/10.png) - -If the file is not read-only (more common cases), the read-only component does not show up. -![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/11.png) - - Again look into `g:lightline.active.left`. ```vim let g:lightline = { @@ -357,8 +350,6 @@ let g:lightline = { \ 'left': [ [ 'mode', 'paste' ], \ [ 'readonly', 'filename', 'modified' ] ] ... ``` -And the screen shot of all the components. -![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/9.png) The mode and paste component are displayed in the same group. The read-only, filename and modified component are in the second group. @@ -369,11 +360,11 @@ You can configure the components in the statusline by the following four variabl + `g:lightline.inactive.left` + `g:lightline.inactive.right` -Of course, your settings in `.vimrc` have priority over the default settings in lightline. +Of course, your configurations in `.vimrc` have priority over the default settings in lightline. -GitHub branch is important for us. +Git branch is important for us. And it is a default component in [powerline](https://github.com/Lokaltog/powerline) and [vim-powerline](https://github.com/Lokaltog/vim-powerline). However, lightline does not provide the branch feature by default. @@ -552,7 +543,7 @@ subseparator.left | '\|' | '' (\ue0b1) | '⮁' (\u2b81) subseparator.right | '\|' | '' (\ue0b3) | '⮃' (\u2b83) branch symbol | -- | '' (\ue0a0) | '⭠' (\u2b60) readonly symbol | -- | '' (\ue0a2) | '⭤' (\u2b64) -linecolumn symbol | -- | '' (\ue0a1) | '⭡' (\u2b81) +linecolumn symbol | -- | '' (\ue0a1) | '⭡' (\u2b61) ### My settings I show my settings. I use the patched font for vim-powerline. diff --git a/sources_non_forked/lightline.vim/autoload/lightline.vim b/sources_non_forked/lightline.vim/autoload/lightline.vim index 045e2b85..14d1d2ab 100644 --- a/sources_non_forked/lightline.vim/autoload/lightline.vim +++ b/sources_non_forked/lightline.vim/autoload/lightline.vim @@ -2,7 +2,7 @@ " Filename: autoload/lightline.vim " Author: itchyny " License: MIT License -" Last Change: 2016/06/12 22:40:00. +" Last Change: 2016/09/04 13:01:40. " ============================================================================= let s:save_cpo = &cpo @@ -111,6 +111,7 @@ let s:_lightline = { \ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste', 'spell': '&spell' \ }, \ 'component_function': {}, + \ 'component_function_visible_condition': {}, \ 'component_expand': { \ 'tabs': 'lightline#tabs' \ }, @@ -293,11 +294,11 @@ function! lightline#highlight(...) abort endfunction function! s:subseparator(components, subseparator, expanded) abort - let [a, c, f, v] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition ] + let [a, c, f, v, u ] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition, s:lightline.component_function_visible_condition ] let xs = map(range(len(a:components)), 'a:expanded[v:val] ? "1" : - \ has_key(f, a[v:val]) ? (exists("*".f[a[v:val]]) ? "" : "exists(\"*".f[a[v:val]]."\")&&").f[a[v:val]]."()!=#\"\"" : - \ has_key(v, a[v:val]) ? "(" . v[a[v:val]] . ")" : has_key(c, a[v:val]) ? "1" : "0"') - return '%{' . (xs[0] ==# '1' ? '' : xs[0] . '&&(') . join(xs[1:], '||') . (xs[0] ==# '1' ? '' : ')') . '?"' . a:subseparator . '":""}' + \ has_key(f, a[v:val]) ? (has_key(u, a[v:val]) ? "(".u[a[v:val]].")" : (exists("*".f[a[v:val]]) ? "" : "exists(\"*".f[a[v:val]]."\")&&").f[a[v:val]]."()!=#\"\"") : + \ has_key(v, a[v:val]) ? "(".v[a[v:val]].")" : has_key(c, a[v:val]) ? "1" : "0"') + return '%{' . (xs[0] ==# '1' || xs[0] ==# '(1)' ? '' : xs[0] . '&&(') . join(xs[1:], '||') . (xs[0] ==# '1' || xs[0] ==# '(1)' ? '' : ')') . '?"' . a:subseparator . '":""}' endfunction function! lightline#concatenate(xs, right) abort @@ -324,7 +325,7 @@ endfunction function! s:evaluate_expand(component) abort try - let result = call(a:component, []) + let result = eval(a:component . '()') if type(result) == 1 && result ==# '' return [] endif diff --git a/sources_non_forked/lightline.vim/doc/lightline.txt b/sources_non_forked/lightline.vim/doc/lightline.txt index c151bddb..f4bc29be 100644 --- a/sources_non_forked/lightline.vim/doc/lightline.txt +++ b/sources_non_forked/lightline.vim/doc/lightline.txt @@ -1,10 +1,10 @@ *lightline.txt* A light and configurable statusline/tabline for Vim -Version: 0.0 +Version: 0.1 Author: itchyny (https://github.com/itchyny) License: MIT License Repository: https://github.com/itchyny/lightline.vim -Last Change: 2016/08/09 06:22:39. +Last Change: 2016/09/13 23:56:56. CONTENTS *lightline-contents* @@ -19,7 +19,6 @@ Examples |lightline-examples| Nice Examples |lightline-nice-examples| Powerful Example |lightline-powerful-example| Troubleshooting |lightline-troubleshooting| -Changelog |lightline-changelog| ============================================================================== INTRODUCTION *lightline-introduction* @@ -115,10 +114,13 @@ OPTIONS *lightline-option* \ 'column': '%c' \ 'close': '%999X X ' } < - g:lightline.component_visible_condition *g:lightline.component_visible_condition* - Dictionary of boolean expressions for the components. + g:lightline.component_visible_condition + *g:lightline.component_visible_condition* + Dictionary to store the visible condition of the components. Each expression should correspond to the condition each - component have non-zero length. + component is not empty. This configuration is used to control + the visibility of the subseparators. You cannot use this + configuration to control the visibility of the components. The default value is: > let g:lightline.component_visible_condition = { @@ -135,6 +137,11 @@ OPTIONS *lightline-option* because the user does not have to set both component and component_visible_condition. If a component set to both component and component_function, the setting of component_function has priority. + + The default value is: +> + let g:lightline.component_function = {} +< For example, if you want a component for read-only mark, which disappears in help windows: > @@ -150,6 +157,19 @@ OPTIONS *lightline-option* function! LightLineReadonly() return &ft !~? 'help' && &readonly ? 'RO' : '' endfunction +< + g:lightline.component_function_visible_condition + *g:lightline.component_function_visible_condition* + Dictionary to store the visible conditions of the function + components. Each expression should correspond to the condition + each component is not empty. This configuration is used to + control the visibility of the subseparators. You can use this + configuration to reduce the number of function calls for + function components by setting the value 1 (to tell lightline + that the component is always visible). + The default value is: +> + let g:lightline.component_function_visible_condition = {} < g:lightline.component_expand *g:lightline.component_expand* Another dictionary for components. You can create a component @@ -1126,7 +1146,7 @@ Problem 9: *lightline-problem-9* subseparator.right '|' '' (\ue0b3) '⮃' (\u2b83) branch symbol -- '' (\ue0a0) '⭠' (\u2b60) readonly symbol -- '' (\ue0a2) '⭤' (\u2b64) - linecolumn symbol -- '' (\ue0a1) '⭡' (\u2b81) + linecolumn symbol -- '' (\ue0a1) '⭡' (\u2b61) Problem 10: *lightline-problem-10* Cool statusline disappears on |unite|, |vimfiler| and |vimshell| @@ -1270,11 +1290,5 @@ Problem 17: *lightline-problem-17* Report/Request the issue/feature at https://github.com/itchyny/lightline.vim/issues. -============================================================================== -CHANGELOG *lightline-changelog* - -0.0 2013-08-21, ... - - Initial commit and implementation - ============================================================================== vim:tw=78:sw=4:ts=8:ft=help:norl:noet: diff --git a/sources_non_forked/lightline.vim/test/expand.vim b/sources_non_forked/lightline.vim/test/expand.vim index c2fc0ab9..37804eed 100644 --- a/sources_non_forked/lightline.vim/test/expand.vim +++ b/sources_non_forked/lightline.vim/test/expand.vim @@ -610,3 +610,15 @@ function! s:suite.duplicated_type_both_nil_right_most() \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '1']]) delfunction Custom endfunction + +function! s:suite.dictionary_function() + let g:lightline = { 'component_expand': { 'custom': 'g:lightline.Custom' } } + function! g:lightline.Custom() + return [ ['left'], ['middle'], ['right'] ] + endfunction + call lightline#init() + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), + \ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']]) + call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]), + \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']]) +endfunction diff --git a/sources_non_forked/lightline.vim/test/subseparator.vim b/sources_non_forked/lightline.vim/test/subseparator.vim index 02cac4cc..2393840d 100644 --- a/sources_non_forked/lightline.vim/test/subseparator.vim +++ b/sources_non_forked/lightline.vim/test/subseparator.vim @@ -177,6 +177,111 @@ function! s:suite.subseparator_component_function_7() delfunction Custom3 endfunction +function! s:suite.subseparator_component_function_visible_condition_1() + function! Custom1() + return 'custom1' + endfunction + function! Custom2() + return 'custom2' + endfunction + function! Custom3() + return 'custom3' + endfunction + let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '1', 'custom3': '1' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|') +endfunction + +function! s:suite.subseparator_component_function_visible_condition_2() + function! Custom1() + return 'custom1' + endfunction + function! Custom2() + return 'custom2' + endfunction + function! Custom3() + return 'custom3' + endfunction + let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0', 'custom2': '1', 'custom3': '1' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '') +endfunction + +function! s:suite.subseparator_component_function_visible_condition_3() + function! Custom1() + return 'custom1' + endfunction + function! Custom2() + return 'custom2' + endfunction + function! Custom3() + return 'custom3' + endfunction + let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '1' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|') +endfunction + +function! s:suite.subseparator_component_function_visible_condition_4() + function! Custom1() + return 'custom1' + endfunction + function! Custom2() + return 'custom2' + endfunction + function! Custom3() + return 'custom3' + endfunction + let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '0' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '') +endfunction + +function! s:suite.subseparator_component_function_visible_condition_5() + function! Custom1() + return 'custom1' + endfunction + function! Custom2() + return '' + endfunction + function! Custom3() + return '' + endfunction + let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '') +endfunction + +function! s:suite.subseparator_component_function_visible_condition_6() + function! Custom1() + return '' + endfunction + function! Custom2() + return 'custom2' + endfunction + function! Custom3() + return 'custom3' + endfunction + let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom2': '1', 'custom3': '1' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '') +endfunction + +function! s:suite.subseparator_component_function_visible_condition_7() + function! Custom1() + return 'custom1' + endfunction + function! Custom2() + return '' + endfunction + function! Custom3() + return 'custom3' + endfunction + let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom3': '1' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|') +endfunction + function! s:suite.subseparator_component_expand() function! Custom1() return 'custom1' diff --git a/sources_non_forked/nerdtree/CHANGELOG b/sources_non_forked/nerdtree/CHANGELOG index 2e08dd2a..a06c1669 100644 --- a/sources_non_forked/nerdtree/CHANGELOG +++ b/sources_non_forked/nerdtree/CHANGELOG @@ -1,4 +1,16 @@ Next + - Shorten delete confimration of empty directory to 'y' (mikeperri) #530 + - Fix API call to open directory tree in window (devm33) #533 + - Change default arrows on non-Windows platforms (gwilk) #546 + - Update to README - combine cd and git clone (zwhitchcox) #584 + - Update to README - Tip: start NERDTree when vim starts (therealplato) #593 + - Escape filename when moving an open buffer (zacharyvoase) #595 + - Fixed incorrect :helptags command in README (curran) #619 + - Fixed incomplete escaping of folder arrows (adityanatraj) #548 + - Added NERDTreeCascadeSingleChildDir option (juanibiapina) #558 + - Replace strchars() with backward compatible workaround. + - Add support for copy command in Windows (SkylerLipthay) #231 + - Fixed typo in README.markdown - :Helptags -> :helptags - Rename "primary" and "secondary" trees to "tab" and "window" trees. - Move a bunch of buffer level variables into the NERDTree and UI classes. - Display cascading dirs on one line to save vertical/horizontal space (@matt-gardner: brainstorming/testing) diff --git a/sources_non_forked/nerdtree/README.markdown b/sources_non_forked/nerdtree/README.markdown index 3fb9ee70..b25b97ef 100644 --- a/sources_non_forked/nerdtree/README.markdown +++ b/sources_non_forked/nerdtree/README.markdown @@ -57,10 +57,9 @@ Installation ####[pathogen.vim](https://github.com/tpope/vim-pathogen) - cd ~/.vim/bundle - git clone https://github.com/scrooloose/nerdtree.git + git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree -Then reload vim, run `:Helptags`, and check out `:help NERD_tree.txt`. +Then reload vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:help NERD_tree.txt`. ####[apt-vim](https://github.com/egalpin/apt-vim) @@ -101,6 +100,16 @@ Stick this in your vimrc: Note: Now start vim with plain `vim`, not `vim .` +--- +> How can I open NERDTree on startup, and have my cursor start in the other window? + +Stick this in your vimrc: + + autocmd vimenter * NERDTree + autocmd vimenter * wincmd p + + *via [stackoverflow/Yohann](http://stackoverflow.com/questions/4277808/nerdtree-auto-focus-to-file-when-opened-in-new-tab/19330023#19330023)* + --- > How can I map a specific key or shortcut to open NERDTree? @@ -125,5 +134,5 @@ See here: https://github.com/scrooloose/nerdtree/issues/433#issuecomment-9259069 Use these variables in your vimrc. Note that below are default arrow symbols - let g:NERDTreeDirArrowExpandable = '▸' - let g:NERDTreeDirArrowCollapsible = '▾' + let g:NERDTreeDirArrowExpandable = '►' + let g:NERDTreeDirArrowCollapsible = '▼' diff --git a/sources_non_forked/nerdtree/doc/NERD_tree.txt b/sources_non_forked/nerdtree/doc/NERD_tree.txt index bf1ab5a8..d0af4a82 100644 --- a/sources_non_forked/nerdtree/doc/NERD_tree.txt +++ b/sources_non_forked/nerdtree/doc/NERD_tree.txt @@ -668,14 +668,18 @@ NERD tree. These options should be set in your vimrc. |'NERDTreeWinSize'| Sets the window size when the NERD tree is opened. -|'NERDTreeMinimalUI'| Disables display of the 'Bookmarks' label and +|'NERDTreeMinimalUI'| Disables display of the 'Bookmarks' label and 'Press ? for help' text. +|'NERDTreeCascadeSingleChildDir'| + Collapses on the same line directories that + have only one child directory. + |'NERDTreeCascadeOpenSingleChildDir'| Cascade open while selected directory has only one child that also is a directory. -|'NERDTreeAutoDeleteBuffer'| Tells the NERD tree to automatically remove +|'NERDTreeAutoDeleteBuffer'| Tells the NERD tree to automatically remove a buffer when a file is being deleted or renamed via a context menu command. @@ -987,7 +991,18 @@ of the following lines to set this option: > < ------------------------------------------------------------------------------ - *'NERDTreeCascadeOpenSingleChildDir'* + *'NERDTreeCascadeSingleChildDir'* +Values: 0 or 1 +Default: 1. + +When displaying dir nodes, this option tells NERDTree to collapse dirs that +have only one child. Use one of the follow lines to set this option: > + let NERDTreeCascadeSingleChildDir=0 + let NERDTreeCascadeSingleChildDir=1 +< + +------------------------------------------------------------------------------ + *'NERDTreeCascadeOpenSingleChildDir'* Values: 0 or 1 Default: 1. @@ -1001,7 +1016,7 @@ useful for Java projects. Use one of the follow lines to set this option: > < ------------------------------------------------------------------------------ - *'NERDTreeAutoDeleteBuffer'* + *'NERDTreeAutoDeleteBuffer'* Values: 0 or 1 Default: 0. diff --git a/sources_non_forked/nerdtree/lib/nerdtree/opener.vim b/sources_non_forked/nerdtree/lib/nerdtree/opener.vim index 00947cdb..ac0f92eb 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/opener.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/opener.vim @@ -257,7 +257,7 @@ endfunction function! s:Opener._openDirectory(node) if self._nerdtree.isWinTree() call self._gotoTargetWin() - call g:NERDTreeCreator.CreateWindow(a:node.path.str()) + call g:NERDTreeCreator.CreateWindowTree(a:node.path.str()) else call self._gotoTargetWin() if empty(self._where) diff --git a/sources_non_forked/nerdtree/lib/nerdtree/path.vim b/sources_non_forked/nerdtree/lib/nerdtree/path.vim index 674ca03e..5f3b16ad 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/path.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/path.vim @@ -174,11 +174,15 @@ function! s:Path.copy(dest) call s:Path.createParentDirectories(a:dest) - let dest = s:Path.WinToUnixPath(a:dest) + if exists('g:NERDTreeCopyCmd') + let cmd_prefix = g:NERDTreeCopyCmd + else + let cmd_prefix = (self.isDirectory ? g:NERDTreeCopyDirCmd : g:NERDTreeCopyFileCmd) + endif - let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), self._escChars()) . " " . escape(dest, self._escChars()) + let cmd = cmd_prefix . " " . escape(self.str(), self._escChars()) . " " . escape(a:dest, self._escChars()) let success = system(cmd) - if success != 0 + if v:shell_error != 0 throw "NERDTree.CopyError: Could not copy ''". self.str() ."'' to: '" . a:dest . "'" endif endfunction @@ -187,7 +191,7 @@ endfunction " "returns 1 if copying is supported for this OS function! s:Path.CopyingSupported() - return exists('g:NERDTreeCopyCmd') + return exists('g:NERDTreeCopyCmd') || (exists('g:NERDTreeCopyDirCmd') && exists('g:NERDTreeCopyFileCmd')) endfunction "FUNCTION: Path.copyingWillOverwrite(dest) {{{1 @@ -213,7 +217,7 @@ endfunction "FUNCTION: Path.createParentDirectories(path) {{{1 " "create parent directories for this path if needed -"without throwing any errors is those directories already exist +"without throwing any errors if those directories already exist " "Args: "path: full path of the node whose parent directories may need to be created @@ -226,8 +230,7 @@ endfunction "FUNCTION: Path.delete() {{{1 " -"Deletes the file represented by this path. -"Deletion of directories is not supported +"Deletes the file or directory represented by this path. " "Throws NERDTree.Path.Deletion exceptions function! s:Path.delete() diff --git a/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim b/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim index 48e9bda3..c41077df 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim @@ -117,28 +117,14 @@ endfunction "FUNCTION: TreeDirNode.getCascade() {{{1 "Return an array of dir nodes (starting from self) that can be cascade opened. function! s:TreeDirNode.getCascade() + if !self.isCascadable() + return [self] + endif - let rv = [self] - let node = self + let vc = self.getVisibleChildren() + let visChild = vc[0] - while 1 - let vc = node.getVisibleChildren() - if len(vc) != 1 - break - endif - - let visChild = vc[0] - - "TODO: optimize - if !visChild.path.isDirectory - break - endif - - call add(rv, visChild) - let node = visChild - endwhile - - return rv + return [self] + visChild.getCascade() endfunction "FUNCTION: TreeDirNode.getChildCount() {{{1 @@ -264,6 +250,10 @@ endfunction "FUNCTION: TreeDirNode.isCascadable() {{{1 "true if this dir has only one visible child - which is also a dir function! s:TreeDirNode.isCascadable() + if g:NERDTreeCascadeSingleChildDir == 0 + return 0 + endif + let c = self.getVisibleChildren() return len(c) == 1 && c[0].path.isDirectory endfunction @@ -466,7 +456,7 @@ function! s:TreeDirNode.refresh() " Regular expression is too expensive. Use simply string comparison " instead - if i[len(i)-3:2] != ".." && i[len(i)-2:2] != ".." && + if i[len(i)-3:2] != ".." && i[len(i)-2:2] != ".." && \ i[len(i)-2:1] != "." && i[len(i)-1] != "." try "create a new path and see if it exists in this nodes children diff --git a/sources_non_forked/nerdtree/lib/nerdtree/ui.vim b/sources_non_forked/nerdtree/lib/nerdtree/ui.vim index 094fa0f9..d107814c 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/ui.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/ui.vim @@ -282,7 +282,8 @@ endfunction function! s:UI._indentLevelFor(line) "have to do this work around because match() returns bytes, not chars let numLeadBytes = match(a:line, '\M\[^ '.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.']') - let leadChars = strchars(a:line[0:numLeadBytes-1]) + " The next line is a backward-compatible workaround for strchars(a:line(0:numLeadBytes-1]). strchars() is in 7.3+ + let leadChars = len(split(a:line[0:numLeadBytes-1], '\zs')) return leadChars / s:UI.IndentWid() endfunction diff --git a/sources_non_forked/nerdtree/nerdtree_plugin/fs_menu.vim b/sources_non_forked/nerdtree/nerdtree_plugin/fs_menu.vim index 20a9fcd3..dff4027e 100644 --- a/sources_non_forked/nerdtree/nerdtree_plugin/fs_menu.vim +++ b/sources_non_forked/nerdtree/nerdtree_plugin/fs_menu.vim @@ -74,7 +74,7 @@ endfunction function! s:promptToRenameBuffer(bufnum, msg, newFileName) echo a:msg if g:NERDTreeAutoDeleteBuffer || nr2char(getchar()) ==# 'y' - let quotedFileName = "'" . a:newFileName . "'" + let quotedFileName = fnameescape(a:newFilename) " 1. ensure that a new buffer is loaded exec "badd " . quotedFileName " 2. ensure that all windows which display the just deleted filename @@ -160,10 +160,10 @@ function! NERDTreeDeleteNode() let currentNode = g:NERDTreeFileNode.GetSelected() let confirmed = 0 - if currentNode.path.isDirectory + if currentNode.path.isDirectory && currentNode.getChildCount() > 0 let choice =input("Delete the current node\n" . \ "==========================================================\n" . - \ "STOP! To delete this entire directory, type 'yes'\n" . + \ "STOP! Directory is not empty! To delete, type 'yes'\n" . \ "" . currentNode.path.str() . ": ") let confirmed = choice ==# 'yes' else diff --git a/sources_non_forked/nerdtree/plugin/NERD_tree.vim b/sources_non_forked/nerdtree/plugin/NERD_tree.vim index 0bcfe968..a27714f4 100644 --- a/sources_non_forked/nerdtree/plugin/NERD_tree.vim +++ b/sources_non_forked/nerdtree/plugin/NERD_tree.vim @@ -68,13 +68,14 @@ call s:initVariable("g:NERDTreeShowLineNumbers", 0) call s:initVariable("g:NERDTreeSortDirs", 1) if !nerdtree#runningWindows() - call s:initVariable("g:NERDTreeDirArrowExpandable", "▸") - call s:initVariable("g:NERDTreeDirArrowCollapsible", "▾") + call s:initVariable("g:NERDTreeDirArrowExpandable", "►") + call s:initVariable("g:NERDTreeDirArrowCollapsible", "▼") else call s:initVariable("g:NERDTreeDirArrowExpandable", "+") call s:initVariable("g:NERDTreeDirArrowCollapsible", "~") endif call s:initVariable("g:NERDTreeCascadeOpenSingleChildDir", 1) +call s:initVariable("g:NERDTreeCascadeSingleChildDir", 1) if !exists("g:NERDTreeSortOrder") let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$'] @@ -103,6 +104,8 @@ call s:initVariable("g:NERDTreeWinSize", 31) "Note: the space after the command is important if nerdtree#runningWindows() call s:initVariable("g:NERDTreeRemoveDirCmd", 'rmdir /s /q ') + call s:initVariable("g:NERDTreeCopyDirCmd", 'xcopy /s /e /i /y /q ') + call s:initVariable("g:NERDTreeCopyFileCmd", 'copy /y ') else call s:initVariable("g:NERDTreeRemoveDirCmd", 'rm -rf ') call s:initVariable("g:NERDTreeCopyCmd", 'cp -r ') diff --git a/sources_non_forked/nerdtree/syntax/nerdtree.vim b/sources_non_forked/nerdtree/syntax/nerdtree.vim index d2a94834..efdd9436 100644 --- a/sources_non_forked/nerdtree/syntax/nerdtree.vim +++ b/sources_non_forked/nerdtree/syntax/nerdtree.vim @@ -25,7 +25,7 @@ syn match NERDTreeDirSlash #/# containedin=NERDTreeDir exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile' exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile' -let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~').escape(g:NERDTreeDirArrowExpandable, '~') +let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~]\-').escape(g:NERDTreeDirArrowExpandable, '~]\-') exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#' syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile' diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown index 5523d088..1cf31e6f 100644 --- a/sources_non_forked/syntastic/README.markdown +++ b/sources_non_forked/syntastic/README.markdown @@ -25,22 +25,21 @@ 3. [Recommended settings](#settings) 4. [FAQ](#faq) 4.1. [I installed syntastic but it isn't reporting any errors...](#faqinfo) -4.2. [How can I check scripts written for different versions of Python?](#faqpython) -4.3. [How can I check scripts written for different versions of Ruby?](#faqruby) -4.4. [Are there any local checkers for HTML5 that I can use with syntastic?](#faqhtml5) -4.5. [The `perl` checker has stopped working...](#faqperl) -4.6. [What happened to the `rustc` checker?](#faqrust) -4.7. [What happened to the `tsc` checker?](#faqtsc) -4.8. [What happened to the `xcrun` checker?](#faqxcrun) -4.9. [I run a checker and the location list is not updated...](#faqloclist) -4.9. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) -4.10. [How can I pass additional arguments to a checker?](#faqargs) -4.11. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) -4.12. [What is the difference between syntax checkers and style checkers?](#faqstyle) -4.13. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate) -4.14. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) -4.15. [My favourite checker needs to load a configuration file from the project's root rather than the current directory...](#faqconfig) -4.16. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) +4.2. [Syntastic supports several checkers for my filetype, how do I tell it which one(s) to use?](#faqcheckers) +4.3. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate) +4.4. [How can I pass additional arguments to a checker?](#faqargs) +4.5. [I run a checker and the location list is not updated...](#faqloclist) +4.5. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) +4.6. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) +4.7. [The error window is closed automatically when I `:quit` the current buffer but not when I `:bdelete` it?](#faqbdelete) +4.8. [My favourite checker needs to load a configuration file from the project's root rather than the current directory...](#faqconfig) +4.9. [What is the difference between syntax checkers and style checkers?](#faqstyle) +4.10. [How can I check scripts written for different versions of Python?](#faqpython) +4.11. [How can I check scripts written for different versions of Ruby?](#faqruby) +4.12. [The `perl` checker has stopped working...](#faqperl) +4.13. [What happened to the `rustc` checker?](#faqrust) +4.14. [What happened to the `tsc` checker?](#faqtsc) +4.15. [What happened to the `xcrun` checker?](#faqxcrun) 5. [Resources](#otherresources) - - - @@ -106,9 +105,9 @@ version 7 or later with the "normal", "big", or "huge" feature sets should be fine. Syntastic should work with any modern plugin managers for Vim, such as -[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam], [Vim-Plug][plug], or -[Vundle][vundle]. Instructions for installing syntastic with [Pathogen][pathogen] are -included below for completeness. +[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam], +[Vim-Plug][plug], or [Vundle][vundle]. Instructions for installing syntastic +with [Pathogen][pathogen] are included below for completeness. Starting with Vim version 7.4.1486 you can also load syntastic using the standard mechanism of packages, without the help of third-party plugin managers @@ -230,131 +229,12 @@ or the error output for a syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then post an [issue][bug_tracker] - or better yet, create a pull request. - - -__4.2. Q. How can I check scripts written for different versions of Python?__ - -A. Install a Python version manager such as [virtualenv][virtualenv] -or [pyenv][pyenv], activate the environment for the relevant version -of Python, and install in it the checkers you want to use. Set -`g:syntastic_python_checkers` accordingly in your `vimrc`, and run [Vim][vim] -from the virtual environment. - -If you're starting Vim from a desktop manager rather than from a terminal you -might need to write wrapper scripts around your checkers, to activate the -virtual environment before running the actual checks. Then you'll need to -point the relevant `g:syntastic_python__exec` variables to the wrapper -scripts. - - - -__4.3. Q. How can I check scripts written for different versions of Ruby?__ - -A. Install a Ruby version manager such as [rvm][rvm] or [rbenv][rbenv], -activate the environment for the relevant version of Ruby, and install in it -the checkers you want to use. Set `g:syntastic_ruby_checkers` accordingly in -your `vimrc`, and run [Vim][vim] from the virtual environment. - -If you're starting Vim from a desktop manager rather than from a terminal you -might need to write wrapper scripts around your checkers, to activate the -virtual environment before running the actual checks. Then you'll need to -point the relevant `g:syntastic_ruby__exec` variables to the wrapper -scripts. - - - -__4.4. Q. Are there any local checkers for HTML5 that I can use with syntastic?__ - -[HTML Tidy][tidy_old] has a fork named [HTML Tidy for HTML5][tidy]. It's a drop -in replacement, and syntastic can use it without changes. Just install it -somewhere and point `g:syntastic_html_tidy_exec` to its executable: -```vim -let g:syntastic_html_tidy_exec = 'tidy5' -``` -Alternatively, you can install [vnu.jar][vnu_jar] from the [validator.nu][vnu] -project and run it as a [HTTP server][vnu_server]: -```sh -$ java -Xss512k -cp /path/to/vnu.jar nu.validator.servlet.Main 8888 -``` -Then you can configure syntastic to use it: -```vim -let g:syntastic_html_validator_api = 'http://localhost:8888/' -``` - - - -__4.5. Q. The `perl` checker has stopped working...__ - -A. The `perl` checker runs `perl -c` against your file, which in turn -__executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use` -statements in your file (cf. [perlrun][perlrun]). This is probably fine if you -wrote the file yourself, but it's a security problem if you're checking -third-party files. Since there is currently no way to disable this behaviour -while still producing useful results, the checker is now disabled by default. -To (re-)enable it, make sure the `g:syntastic_perl_checkers` list includes -`perl`, and set `g:syntastic_enable_perl_checker` to 1 in your `vimrc`: -```vim -let g:syntastic_enable_perl_checker = 1 -``` - - - -__4.6. Q. What happened to the `rustc` checker?__ - -A. It is now part of the [rust.vim][rust] plugin. If you install this plugin the -checker should be picked up automatically by syntastic. - - - -__4.7. Q. What happened to the `tsc` checker?__ - -A. It didn't meet people's expectations and it has been removed. Please -consider using the external checker [tsuquyomi][tsuquyomi] instead. If you -install this plugin the checker should be picked up automatically by syntastic. - - - -__4.8. Q. What happened to the `xcrun` checker?__ - -A. The `xcrun` checker used to have a security problem and it has been removed. -A better checker for __Swift__ is part of the [vim-swift][swift] plugin. If you -install this plugin the checker should be picked up automatically by syntastic. - - - -__4.9. Q. I run a checker and the location list is not updated...__ -__4.9. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ - -A. By default the location list is changed only when you run the `:Errors` -command, in order to minimise conflicts with other plugins. If you want the -location list to always be updated when you run the checkers, add this line to -your `vimrc`: -```vim -let g:syntastic_always_populate_loc_list = 1 -``` - - - -__4.10. Q. How can I pass additional arguments to a checker?__ - -A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers -that do can be configured using global variables. The general form of the -global `args` variables is `syntastic___args`. - -So, If you wanted to pass `--my --args --here` to the ruby mri checker you -would add this line to your `vimrc`: -```vim -let g:syntastic_ruby_mri_args = "--my --args --here" -``` - -See `:help syntastic-checker-options` for more information. - -__4.11. Q. Syntastic supports several checkers for my filetype - how do I tell it +__4.2. Q. Syntastic supports several checkers for my filetype, how do I tell it which one(s) to use?__ -A. Stick a line like this in your `vimrc`: +A. Add a line like this to your `vimrc`: ```vim let g:syntastic__checkers = [''] ``` @@ -362,10 +242,9 @@ let g:syntastic__checkers = [''] To see the list of supported checkers for your filetype read the [manual][checkers] (`:help syntastic-checkers` in Vim). -e.g. Python has the following checkers, among others: `flake8`, `pyflakes`, -`pylint` and a native `python` checker. - -To tell syntastic to use `pylint`, you would use this setting: +For example, Python has the following checkers, among others: `flake8`, +`pyflakes`, `pylint` and a native `python` checker. To tell syntastic to use +`pylint`, you would use this setting: ```vim let g:syntastic_python_checkers = ['pylint'] ``` @@ -379,8 +258,7 @@ This is telling syntastic to run the `php` checker first, and if no errors are found, run `phpcs`, and then `phpmd`. You can also run checkers explicitly by calling `:SyntasticCheck `. - -e.g. to run `phpcs` and `phpmd`: +For example to run `phpcs` and `phpmd`: ```vim :SyntasticCheck phpcs phpmd ``` @@ -390,39 +268,9 @@ aren't listed in `g:syntastic__checkers`. You can't run checkers for "foreign" filetypes though (e.g. you can't run, say, a Python checker if the filetype of the current file is `php`). - - -__4.12. Q. What is the difference between syntax checkers and style checkers?__ - -A. The errors and warnings they produce are highlighted differently and can -be filtered by different rules, but otherwise the distinction is pretty much -arbitrary. There is an ongoing effort to keep things consistent, so you can -_generally_ expect messages produced by syntax checkers to be _mostly_ related -to syntax, and messages produced by style checkers to be _mostly_ about style. -But there can be no formal guarantee that, say, a style checker that runs into -a syntax error wouldn't die with a fatal message, nor that a syntax checker -wouldn't give you warnings against using some constructs as being bad practice. -There is also no guarantee that messages marked as "style" are less severe than -the ones marked as "syntax" (whatever that might mean). And there are even a -few Frankenstein checkers (for example `flake8` and `pylama`) that, by their -nature, produce both kinds of messages. Syntastic is not smart enough to be -able to sort out these things by itself. - -In fact it's more useful to look at this from the perspective of filtering -unwanted messages, rather than as an indicator of severity levels. The -distinction between syntax and style is orthogonal to the distinction between -errors and warnings, and thus you can turn off messages based on level, on -type, or both. - -e.g. To disable all style messages: -```vim -let g:syntastic_quiet_messages = { "type": "style" } -``` -See `:help syntastic_quiet_messages` for details. - -__4.13. Q. I have enabled multiple checkers for the current filetype. How can I +__4.3. Q. I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?__ A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`: @@ -432,9 +280,46 @@ let g:syntastic_aggregate_errors = 1 See `:help syntastic-aggregating-errors` for more details. + + +__4.4. Q. How can I pass additional arguments to a checker?__ + +A. In most cases a command line is constructed using an internal function +named `makeprgBuild()`, which provides a number of options that allow you to +customise every part of the command that gets run. You can set these options +using global variables. + +The general form of the global `args` variable is +`syntastic___args`. Thus if you wanted to pass +`--my --args --here` to the Ruby `mri` checker you would add this line to your +`vimrc`: +```vim +let g:syntastic_ruby_mri_args = "--my --args --here" +``` + +See `:help syntastic-checker-options` for more information. + +A number of checkers don't use the `makeprgBuild()` function mentioned above, +or have additional options that can be configured. For these checkers the exact +list of options should be included in the [manual][checkers] +(`:help syntastic-checkers` in Vim). + + + +__4.5. Q. I run a checker and the location list is not updated...__ +__4.5. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ + +A. By default the location list is changed only when you run the `:Errors` +command, in order to minimise conflicts with other plugins. If you want the +location list to always be updated when you run the checkers, add this line to +your `vimrc`: +```vim +let g:syntastic_always_populate_loc_list = 1 +``` + -__4.14. Q. How can I jump between the different errors without using the location +__4.6. Q. How can I jump between the different errors without using the location list at the bottom of the window?__ A. Vim provides several built-in commands for this. See `:help :lnext` and @@ -444,9 +329,21 @@ If you use these commands a lot then you may want to add shortcut mappings to your `vimrc`, or install something like [unimpaired][unimpaired], which provides such mappings (among other things). + + +__4.7. Q. The error window is closed automatically when I `:quit` the current buffer +but not when I `:bdelete` it?__ + +A. There is no safe way to handle that situation automatically, but you can +work around it: +```vim +nnoremap :lclose:bdelete +cabbrev bd =(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdelete' : 'bd') +``` + -__4.15. My favourite checker needs to load a configuration file from the +__4.8. My favourite checker needs to load a configuration file from the project's root rather than the current directory...__ A. You can set up an `autocmd` to search for the configuration file in the @@ -463,18 +360,106 @@ autocmd FileType javascript let b:syntastic_javascript_jscs_args = \ get(g:, 'syntastic_javascript_jscs_args', '') . \ FindConfig('-c', '.jscsrc', expand(':p:h', 1)) ``` - -__4.16. Q. The error window is closed automatically when I :quit the current buffer -but not when I :bdelete it?__ + -A. There is no safe way to handle that situation automatically, but you can -work around it: +__4.9. Q. What is the difference between syntax checkers and style checkers?__ +A. The errors and warnings they produce are highlighted differently and can +be filtered by different rules, but otherwise the distinction is pretty much +arbitrary. There is an ongoing effort to keep things consistent, so you can +_generally_ expect messages produced by syntax checkers to be _mostly_ related +to syntax, and messages produced by style checkers to be _mostly_ about style. +But there can be no formal guarantee that, say, a style checker that runs into +a syntax error wouldn't die with a fatal message, nor that a syntax checker +wouldn't give you warnings against using some constructs as being bad practice. +There is also no guarantee that messages marked as `style` are less severe than +the ones marked as `syntax` (whatever that might mean). And there are even a +few Frankenstein checkers (for example `flake8` and `pylama`) that, by their +nature, produce both kinds of messages. Syntastic is not smart enough to be +able to sort out these things by itself. + +Generally it's more useful to look at this from the perspective of filtering +unwanted messages, rather than as an indicator of severity levels. The +distinction between syntax and style is orthogonal to the distinction between +errors and warnings, and thus you can turn off messages based on level, on +type, or both. + +e.g. To disable all style messages: ```vim -nnoremap :lclose:bdelete -cabbrev bd =(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdelete' : 'bd') +let g:syntastic_quiet_messages = { "type": "style" } ``` +See `:help syntastic_quiet_messages` for more information. + + + +__4.10. Q. How can I check scripts written for different versions of Python?__ + +A. Install a Python version manager such as [virtualenv][virtualenv] +or [pyenv][pyenv], activate the environment for the relevant version +of Python, and install in it the checkers you want to use. Set +`g:syntastic_python_checkers` accordingly in your `vimrc`, and run [Vim][vim] +from the virtual environment. + +If you're starting Vim from a desktop manager rather than from a terminal you +might need to write wrapper scripts around your checkers, to activate the +virtual environment before running the actual checks. Then you'll need to +point the relevant `g:syntastic_python__exec` variables to the wrapper +scripts. + + + +__4.11. Q. How can I check scripts written for different versions of Ruby?__ + +A. Install a Ruby version manager such as [rvm][rvm] or [rbenv][rbenv], +activate the environment for the relevant version of Ruby, and install in it +the checkers you want to use. Set `g:syntastic_ruby_checkers` accordingly in +your `vimrc`, and run [Vim][vim] from the virtual environment. + +If you're starting Vim from a desktop manager rather than from a terminal you +might need to write wrapper scripts around your checkers, to activate the +virtual environment before running the actual checks. Then you'll need to +point the relevant `g:syntastic_ruby__exec` variables to the wrapper +scripts. + + + +__4.12. Q. The `perl` checker has stopped working...__ + +A. The `perl` checker runs `perl -c` against your file, which in turn +__executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use` +statements in your file (cf. [perlrun][perlrun]). This is probably fine if you +wrote the file yourself, but it's a security problem if you're checking +third-party files. Since there is currently no way to disable this behaviour +while still producing useful results, the checker is now disabled by default. +To (re-)enable it, make sure the `g:syntastic_perl_checkers` list includes +`perl`, and set `g:syntastic_enable_perl_checker` to 1 in your `vimrc`: +```vim +let g:syntastic_enable_perl_checker = 1 +``` + + + +__4.13. Q. What happened to the `rustc` checker?__ + +A. It is now part of the [rust.vim][rust] plugin. If you install this plugin the +checker should be picked up automatically by syntastic. + + + +__4.14. Q. What happened to the `tsc` checker?__ + +A. It didn't meet people's expectations and it has been removed. The plugin +[tsuquyomi][tsuquyomi] comes packaged with a checker for TypeScript. If you +install this plugin the checker should be picked up automatically by syntastic. + + + +__4.15. Q. What happened to the `xcrun` checker?__ + +A. The `xcrun` checker used to have a security problem and it has been removed. +A better checker for __Swift__ is part of the [vim-swift][swift] plugin. If you +install this plugin the checker should be picked up automatically by syntastic. @@ -517,8 +502,6 @@ a look at [ghcmod-vim][ghcmod], [jedi-vim][jedi], [python-mode][python_mode], [v [rvm]: https://rvm.io/ [stack_overflow]: http://stackoverflow.com/questions/tagged/syntastic [swift]: https://github.com/kballard/vim-swift -[tidy]: http://www.htacg.org/tidy-html5/ -[tidy_old]: http://tidy.sourceforge.net/ [tsuquyomi]: https://github.com/Quramy/tsuquyomi/ [unimpaired]: https://github.com/tpope/vim-unimpaired [vam]: https://github.com/MarcWeber/vim-addon-manager diff --git a/sources_non_forked/syntastic/autoload/syntastic/util.vim b/sources_non_forked/syntastic/autoload/syntastic/util.vim index 68eb06ea..535d2671 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/util.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/util.vim @@ -271,6 +271,36 @@ function! syntastic#util#findGlobInParent(what, where) abort " {{{2 return '' endfunction " }}}2 +" Returns the buffer number of a filename +" @vimlint(EVL104, 1, l:old_shellslash) +function! syntastic#util#fname2buf(fname) abort " {{{2 + if exists('+shellslash') + " bufnr() can't cope with backslashes + let old_shellslash = &shellslash + let &shellslash = 1 + endif + + " this is a best-effort attempt to escape file patterns (cf. :h file-pattern) + " XXX it fails for filenames containing something like \{2,3} + for md in [':~:.', ':~', ':p'] + let buf = bufnr('^' . escape(fnamemodify(a:fname, md), '\*?,{}[') . '$') + if buf != -1 + break + endif + endfor + if buf == -1 + " XXX definitely wrong, but hope is the last thing to die :) + let buf = bufnr(fnamemodify(a:fname, ':p')) + endif + + if exists('+shellslash') + let &shellslash = old_shellslash + endif + + return buf +endfunction " }}}2 +" @vimlint(EVL104, 0, l:old_shellslash) + " Returns unique elements in a list function! syntastic#util#unique(list) abort " {{{2 let seen = {} @@ -342,10 +372,8 @@ function! syntastic#util#stamp() abort " {{{2 return split( split(reltimestr(reltime(g:_SYNTASTIC_START)))[0], '\.' ) endfunction " }}}2 -function! syntastic#util#setChangedtick() abort " {{{2 - unlockvar! b:syntastic_changedtick - let b:syntastic_changedtick = b:changedtick - lockvar! b:syntastic_changedtick +function! syntastic#util#setLastTick(buf) abort " {{{2 + call setbufvar(a:buf, 'syntastic_lasttick', getbufvar(a:buf, 'changedtick')) endfunction " }}}2 let s:_wid_base = 'syntastic_' . getpid() . '_' . reltimestr(g:_SYNTASTIC_START) . '_' diff --git a/sources_non_forked/syntastic/doc/syntastic-checkers.txt b/sources_non_forked/syntastic/doc/syntastic-checkers.txt index dbb6d7ab..4541ddf2 100644 --- a/sources_non_forked/syntastic/doc/syntastic-checkers.txt +++ b/sources_non_forked/syntastic/doc/syntastic-checkers.txt @@ -3147,13 +3147,13 @@ accepts the standard options described at |syntastic-config-makeprg|. Notes~ -Syntastic requires "Flow" version 0.6 or later. +Syntastic requires "Flow" version 0.18.1 or later. To use "Flow" with your projects, you must: a. Install it: - https://github.com/sindresorhus/flow-bin + https://github.com/flowtype/flow-bin b. Configure your project: > @@ -6183,7 +6183,7 @@ Maintainer: LCD 47 "ESLint" is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. With the "babel-eslint" plugin -(https://github.com/babel/babel-eslint) "ESLint" can also can also be +(https://github.com/babel/babel-eslint) "ESLint" can also be used to check TypeScript files. See the project's page for details: https://github.com/nzakas/eslint diff --git a/sources_non_forked/syntastic/doc/syntastic.txt b/sources_non_forked/syntastic/doc/syntastic.txt index 431638bb..8f3473bc 100644 --- a/sources_non_forked/syntastic/doc/syntastic.txt +++ b/sources_non_forked/syntastic/doc/syntastic.txt @@ -46,19 +46,21 @@ CONTENTS *syntastic-contents* 6.4.Saving Vim sessions....................|syntastic-sessions| 6.5.The location list callback.............|syntastic-loclist-callback| 7.Compatibility with other software............|syntastic-compatibility| - 7.1.The csh and tcsh shells................|syntastic-csh| - 7.2.Eclim..................................|syntastic-eclim| - 7.3.The fish shell.........................|syntastic-fish| - 7.4.The fizsh shell........................|syntastic-fizsh| - 7.5.flagship...............................|syntastic-flagship| - 7.6.powerline..............................|syntastic-powerline| - 7.7.The PowerShell shell...................|syntastic-powershell| - 7.8.python-mode............................|syntastic-pymode| - 7.9.vim-auto-save..........................|syntastic-vim-auto-save| - 7.10.vim-go................................|syntastic-vim-go| - 7.11.vim-virtualenv........................|syntastic-vim-virtualenv| - 7.12.YouCompleteMe.........................|syntastic-ycm| - 7.13.The zsh shell and MacVim..............|syntastic-zsh| + 7.1.airline................................|syntastic-airline| + 7.2.The csh and tcsh shells................|syntastic-csh| + 7.3.Eclim..................................|syntastic-eclim| + 7.4.ferret.................................|syntastic-ferret| + 7.5.The fish shell.........................|syntastic-fish| + 7.6.The fizsh shell........................|syntastic-fizsh| + 7.7.flagship...............................|syntastic-flagship| + 7.8.powerline..............................|syntastic-powerline| + 7.9.The PowerShell shell...................|syntastic-powershell| + 7.10.python-mode...........................|syntastic-pymode| + 7.11.vim-auto-save.........................|syntastic-vim-auto-save| + 7.12.vim-go................................|syntastic-vim-go| + 7.13.vim-virtualenv........................|syntastic-vim-virtualenv| + 7.14.YouCompleteMe.........................|syntastic-ycm| + 7.15.The zsh shell and MacVim..............|syntastic-zsh| 8.About........................................|syntastic-about| 9.License......................................|syntastic-license| @@ -158,12 +160,17 @@ Something like this could be more useful: > set statusline+=%* < When syntax errors are detected a flag will be shown. The content of the flag -is derived from the |syntastic_stl_format| option. +is derived from the |'syntastic_stl_format'| option. Please note that these settings might conflict with other Vim plugins that -change the way statusline works. Refer to these plugins' documentation for -possible solutions. See also |syntastic-powerline| below if you're using the -"powerline" Vim plugin (https://github.com/powerline/powerline). +change the way statusline works. Refer to the |syntastic-compatibility| notes +below and to the respective plugins' documentation for possible solutions. + +In particular see |syntastic-airline| below if you're using the "airline" Vim +plugin (https://github.com/vim-airline/vim-airline). See |syntastic-flagship| +if you're using "flagship" (https://github.com/tpope/vim-flagship). See also +|syntastic-powerline| if you're using the "powerline" Vim plugin +(https://github.com/powerline/powerline). ------------------------------------------------------------------------------ 2.2. Error signs *syntastic-error-signs* @@ -195,6 +202,10 @@ following highlight groups: Example: > highlight SyntasticErrorLine guibg=#2f0000 < +With Vim 8.0 or later you can ask Vim not to turn off the sign column when no +errors are found, by setting 'signcolumn' to "yes": > + set signcolumn=yes +< ------------------------------------------------------------------------------ 2.3. The error window *syntastic-error-window* @@ -248,7 +259,7 @@ grouped together, and sorting within each group is decided by the variables |'syntastic___sort'|. ------------------------------------------------------------------------------ -2.6 Filtering errors *syntastic-filtering-errors* +2.6. Filtering errors *syntastic-filtering-errors* You can selectively disable some of the errors found by checkers either using |'syntastic_quiet_messages'|, or by specifying a list of patterns in @@ -732,7 +743,7 @@ filetypes. 5. Checker Options *syntastic-checker-options* ------------------------------------------------------------------------------ -5.1 Choosing which checkers to use *syntastic-filetype-checkers* +5.1. Choosing which checkers to use *syntastic-filetype-checkers* *'g:syntastic__checkers'* You can tell syntastic which checkers to run for a given filetype by setting a @@ -756,7 +767,7 @@ are supported by syntastic: |syntastic-checkers|. Use `:SyntasticInfo` to see which checkers are available for a given filetype. ------------------------------------------------------------------------------ -5.2 Choosing the executable *syntastic-config-exec* +5.2. Choosing the executable *syntastic-config-exec* *'syntastic___exec'* The executable run by a checker is normally defined automatically, when the @@ -773,7 +784,7 @@ takes precedence over both 'b:syntastic___exec' and 'g:syntastic___exec' in the buffers where it is defined. ------------------------------------------------------------------------------ -5.3 Configuring specific checkers *syntastic-config-makeprg* +5.3. Configuring specific checkers *syntastic-config-makeprg* Checkers are run by constructing a command line and by passing it to a shell (see |'shell'| and |'syntastic_shell'|). In most cases this command line is @@ -797,7 +808,7 @@ The result is a command line of the form: > All fields above are optional, and can be overridden by setting global variables 'g:syntastic___' - even parameters not specified in the call to "makeprgBuild()". For example to -override the argguments and the tail: > +override the arguments and the tail: > let g:syntastic_c_pc_lint_args = "-w5 -Iz:/usr/include/linux" let g:syntastic_c_pc_lint_tail = "2>/dev/null" < @@ -849,7 +860,7 @@ options that can be set they are normally documented in this manual (see |syntastic-checkers|). ------------------------------------------------------------------------------ -5.4 Sorting errors *syntastic-config-sort* +5.4. Sorting errors *syntastic-config-sort* *'syntastic___sort'* Syntastic may decide to group the errors produced by some checkers by file, @@ -868,7 +879,7 @@ For aggregated lists (see |syntastic-aggregating-errors|) these variables are ignored if |'syntastic_sort_aggregated_errors'| is set (which is the default). ------------------------------------------------------------------------------ -5.5 Filtering errors *syntastic-config-filtering* +5.5. Filtering errors *syntastic-config-filtering* *'syntastic___quiet_messages'* Finally, variables 'g:syntastic___quiet_messages' can @@ -882,7 +893,7 @@ from the corresponding checkers are filtered. Example: > The syntax is of course identical to that of |syntastic_quiet_messages|. ------------------------------------------------------------------------------ -5.6 Debugging *syntastic-config-debug* +5.6. Debugging *syntastic-config-debug* *syntastic-debug* Syntastic can log a trace of its working to Vim's |message-history|. To verify @@ -902,7 +913,7 @@ Debug logs can be saved to a file; see |'syntastic_debug_file'| for details. Setting |'syntastic_debug'| to 0 turns off logging. ------------------------------------------------------------------------------ -5.7 Profiling *syntastic-profiling* +5.7. Profiling *syntastic-profiling* A very useful tool for debugging performance problems is Vim's built-in |profiler|. In order to enable profiling for syntastic you need to add two lines @@ -932,7 +943,7 @@ composite filetypes to simple ones using |'syntastic_filetype_map'|, e.g.: > let g:syntastic_filetype_map = { "handlebars.html": "handlebars" } < ------------------------------------------------------------------------------ -6.2 Editing files over network *syntastic-netrw* +6.2. Editing files over network *syntastic-netrw* The standard plugin |netrw| allows Vim to transparently edit files over network and inside archives. Currently syntastic doesn't support this mode @@ -940,7 +951,7 @@ of operation. It can only check files that can be accessed directly by local checkers, without any translation or conversion. ------------------------------------------------------------------------------ -6.3 The 'shellslash' option *syntastic-shellslash* +6.3. The 'shellslash' option *syntastic-shellslash* The 'shellslash' option is relevant only on Windows systems. This option determines (among other things) the rules for quoting command lines, and there @@ -951,7 +962,7 @@ shell. It should be turned off if your 'shell' (or |'syntastic_shell'|) is value. ------------------------------------------------------------------------------ -6.4 Saving Vim sessions *syntastic-sessions* +6.4. Saving Vim sessions *syntastic-sessions* If you use `:mksession` to save Vim sessions you should probably make sure to remove option "blank" from 'sessionoptions': > @@ -961,7 +972,7 @@ This will prevent `:mksession` from saving |syntastic-error-window| as empty quickfix windows. ------------------------------------------------------------------------------ -6.5 The location list callback *syntastic-loclist-callback* +6.5. The location list callback *syntastic-loclist-callback* *SyntasticCheckHook()* Syntastic also gives you direct access to the list of errors. A function @@ -987,7 +998,17 @@ also affect window sizes.) 7. Compatibility with other software *syntastic-compatibility* ------------------------------------------------------------------------------ -7.1 The csh and tcsh shells *syntastic-csh* +7.1. airline *syntastic-airline* + +The "airline" Vim plugin (https://github.com/vim-airline/vim-airline) comes +packaged with a mechanism of showing flags on the |'statusline'| according +to your |'syntastic_stl_format'|. When using this plugin you do NOT need to +follow the recommendation outlined in the |syntastic-statusline-flag| section +above to modify your |'statusline'|; "airline" will make all necessary changes +automatically. + +------------------------------------------------------------------------------ +7.2. The csh and tcsh shells *syntastic-csh* The "csh" and "tcsh" shells are mostly compatible with syntastic. However, some checkers assume Bourne shell syntax for redirecting "stderr". For this @@ -996,7 +1017,7 @@ such as "zsh", "bash", "ksh", or even the original Bourne "sh": > let g:syntastic_shell = "/bin/sh" < ------------------------------------------------------------------------------ -7.2. Eclim *syntastic-eclim* +7.3. Eclim *syntastic-eclim* Syntastic can be used together with "Eclim" (see http://eclim.org/). However, by default Eclim disables syntastic's checks for the filetypes it supports, in @@ -1009,7 +1030,15 @@ run Eclim's validation for others. Please consult Eclim's documentation for details. ------------------------------------------------------------------------------ -7.3 The fish shell *syntastic-fish* +7.4. ferret *syntastic-ferret* + +At the time of this writing syntastic conflicts with the "ferret" Vim plugin +(https://github.com/wincent/ferret). The "ferret" plugin assumes control over +loclist windows even when configured to use |quickfix| lists. This interferes +with syntastic's functioning. + +------------------------------------------------------------------------------ +7.5. The fish shell *syntastic-fish* At the time of this writing the "fish" shell (see http://fishshell.com/) doesn't support the standard UNIX syntax for file redirections, and thus it @@ -1019,7 +1048,7 @@ original Bourne "sh": > let g:syntastic_shell = "/bin/sh" < ------------------------------------------------------------------------------ -7.4. The fizsh shell *syntastic-fizsh* +7.6. The fizsh shell *syntastic-fizsh* Using syntastic with the "fizsh" shell (see https://github.com/zsh-users/fizsh) is possible, but potentially problematic. In order to do it you'll need to set @@ -1032,7 +1061,7 @@ interactive features of "fizsh". Using a more traditional shell such as "zsh", let g:syntastic_shell = "/bin/sh" < ------------------------------------------------------------------------------ -7.5 flagship *syntastic-flagship* +7.7. flagship *syntastic-flagship* The "flagship" Vim plugin (https://github.com/tpope/vim-flagship) has its own mechanism of showing flags on the |'statusline'|. To allow "flagship" @@ -1042,7 +1071,7 @@ described in the |syntastic-statusline-flag| section above: > autocmd User Flags call Hoist("window", "SyntasticStatuslineFlag") < ------------------------------------------------------------------------------ -7.6. powerline *syntastic-powerline* +7.8. powerline *syntastic-powerline* The "powerline" Vim plugin (https://github.com/powerline/powerline) comes packaged with a syntastic segment. To customize this segment create a file @@ -1059,16 +1088,18 @@ packaged with a syntastic segment. To customize this segment create a file } < ------------------------------------------------------------------------------ -7.7. The PowerShell shell *syntastic-powershell* +7.9. The PowerShell shell *syntastic-powershell* -At the time of this writing, syntastic is not compatible with using "Windows -PowerShell" (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's -'shell'. You may still run Vim from 'PowerShell', but you do have to point -Vim's 'shell' to a more traditional program, such as "cmd.exe": > - set shell=cmd.exe +At the time of this writing syntastic is not compatible with using +"PowerShell" (https://msdn.microsoft.com/en-us/powershell) as Vim's 'shell'. +You may still run Vim from "PowerShell", but you do have to point Vim's +'shell' to a more traditional program, such as "cmd.exe" on Windows, or +"/bin/sh" on UNIX: > + set shell=c:\Windows\system32\cmd.exe + set shell=/bin/sh < ------------------------------------------------------------------------------ -7.8 python-mode *syntastic-pymode* +7.10. python-mode *syntastic-pymode* Syntastic can be used along with the "python-mode" Vim plugin (see https://github.com/klen/python-mode). However, they both run syntax checks by @@ -1079,14 +1110,14 @@ for python in syntastic (see |'syntastic_mode_map'|), or disable lint checks in let g:pymode_lint_on_write = 0 < ------------------------------------------------------------------------------ -7.9. vim-auto-save *syntastic-vim-auto-save* +7.11. vim-auto-save *syntastic-vim-auto-save* Syntastic can be used together with the "vim-auto-save" Vim plugin (see https://github.com/907th/vim-auto-save). However, syntastic checks in active mode only work with "vim-auto-save" version 0.1.7 or later. ------------------------------------------------------------------------------ -7.10. vim-go *syntastic-vim-go* +7.12. vim-go *syntastic-vim-go* Syntastic can be used along with the "vim-go" Vim plugin (see https://github.com/fatih/vim-go). However, both "vim-go" and syntastic run @@ -1103,7 +1134,7 @@ stick with |quickfix| lists: > let g:go_list_type = "quickfix" < ------------------------------------------------------------------------------ -7.11. vim-virtualenv *syntastic-vim-virtualenv* +7.13. vim-virtualenv *syntastic-vim-virtualenv* At the time of this writing, syntastic can't run checkers installed in Python virtual environments activated by "vim-virtualenv" (see @@ -1111,7 +1142,7 @@ https://github.com/jmcantrell/vim-virtualenv). This is a limitation of "vim-virtualenv". ------------------------------------------------------------------------------ -7.12 YouCompleteMe *syntastic-ycm* +7.14. YouCompleteMe *syntastic-ycm* Syntastic can be used together with the "YouCompleteMe" Vim plugin (see http://valloric.github.io/YouCompleteMe/). However, by default "YouCompleteMe" @@ -1122,7 +1153,7 @@ have to set |g:ycm_show_diagnostics_ui| to 0. E.g.: > let g:ycm_show_diagnostics_ui = 0 < ------------------------------------------------------------------------------ -7.13 The zsh shell and MacVim *syntastic-zsh* +7.15. The zsh shell and MacVim *syntastic-zsh* If you're running MacVim together with the "zsh" shell (http://www.zsh.org/) you need to be aware that MacVim does not source your .zshrc file, but will diff --git a/sources_non_forked/syntastic/plugin/syntastic.vim b/sources_non_forked/syntastic/plugin/syntastic.vim index 3678990c..94b141ac 100644 --- a/sources_non_forked/syntastic/plugin/syntastic.vim +++ b/sources_non_forked/syntastic/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.7.0-193' +let g:_SYNTASTIC_VERSION = '3.7.0-226' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 @@ -132,13 +132,19 @@ let s:_DEBUG_DUMP_OPTIONS = [ \ 'shellpipe', \ 'shellquote', \ 'shellredir', - \ 'shellslash', \ 'shelltemp', \ 'shellxquote' \ ] -if exists('+shellxescape') - call add(s:_DEBUG_DUMP_OPTIONS, 'shellxescape') -endif +for s:feature in [ + \ 'shellxescape', + \ 'shellslash', + \ 'autochdir', + \ ] + + if exists('+' . s:feature) + call add(s:_DEBUG_DUMP_OPTIONS, s:feature) + endif +endfor lockvar! s:_DEBUG_DUMP_OPTIONS " debug constants @@ -163,6 +169,7 @@ let s:registry = g:SyntasticRegistry.Instance() let s:notifiers = g:SyntasticNotifiers.Instance() let s:modemap = g:SyntasticModeMap.Instance() +let s:_check_stack = [] let s:_quit_pre = [] " Commands {{{1 @@ -207,7 +214,7 @@ command! SyntasticJavacEditConfig runtime! syntax_checkers/java/*.vim | Synta " Public API {{{1 function! SyntasticCheck(...) abort " {{{2 - call s:UpdateErrors(0, a:000) + call s:UpdateErrors(bufnr(''), 0, a:000) call syntastic#util#redraw(g:syntastic_full_redraws) endfunction " }}}2 @@ -215,6 +222,8 @@ function! SyntasticInfo(...) abort " {{{2 call s:modemap.modeInfo(a:000) call s:registry.echoInfoFor(s:_resolve_filetypes(a:000)) call s:_explain_skip(a:000) + call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, s:_DEBUG_DUMP_OPTIONS) + call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES) endfunction " }}}2 function! SyntasticErrors() abort " {{{2 @@ -222,19 +231,19 @@ function! SyntasticErrors() abort " {{{2 endfunction " }}}2 function! SyntasticReset() abort " {{{2 - call s:ClearCache() + call s:ClearCache(bufnr('')) call s:notifiers.refresh(g:SyntasticLoclist.New([])) endfunction " }}}2 function! SyntasticToggleMode() abort " {{{2 call s:modemap.toggleMode() - call s:ClearCache() + call s:ClearCache(bufnr('')) call s:notifiers.refresh(g:SyntasticLoclist.New([])) call s:modemap.echoMode() endfunction " }}}2 function! SyntasticSetLoclist() abort " {{{2 - call g:SyntasticLoclist.current().setloclist() + call g:SyntasticLoclist.current().setloclist(0) endfunction " }}}2 " }}}1 @@ -243,54 +252,68 @@ endfunction " }}}2 augroup syntastic autocmd! - autocmd BufEnter * call s:BufEnterHook() + autocmd VimEnter * call s:VimEnterHook() + autocmd BufEnter * call s:BufEnterHook(expand('', 1)) + autocmd BufWinEnter * call s:BufWinEnterHook(expand('', 1)) augroup END if g:syntastic_nested_autocommands augroup syntastic - autocmd BufReadPost * nested call s:BufReadPostHook() - autocmd BufWritePost * nested call s:BufWritePostHook() + autocmd BufReadPost * nested call s:BufReadPostHook(expand('', 1)) + autocmd BufWritePost * nested call s:BufWritePostHook(expand('', 1)) augroup END else augroup syntastic - autocmd BufReadPost * call s:BufReadPostHook() - autocmd BufWritePost * call s:BufWritePostHook() + autocmd BufReadPost * call s:BufReadPostHook(expand('', 1)) + autocmd BufWritePost * call s:BufWritePostHook(expand('', 1)) augroup END endif if exists('##QuitPre') " QuitPre was added in Vim 7.3.544 augroup syntastic - autocmd QuitPre * call s:QuitPreHook(expand('', 1)) + autocmd QuitPre * call s:QuitPreHook(expand('', 1)) augroup END endif -function! s:BufReadPostHook() abort " {{{2 - if g:syntastic_check_on_open +function! s:BufReadPostHook(fname) abort " {{{2 + let buf = syntastic#util#fname2buf(a:fname) + if g:syntastic_check_on_open && buf > 0 call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, - \ 'autocmd: BufReadPost, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr(''))))) - call s:UpdateErrors(1, []) + \ 'autocmd: BufReadPost, buffer ' . buf . ' = ' . string(a:fname)) + if index(s:_check_stack, buf) == -1 + call add(s:_check_stack, buf) + endif endif endfunction " }}}2 -function! s:BufWritePostHook() abort " {{{2 +function! s:BufWritePostHook(fname) abort " {{{2 + let buf = syntastic#util#fname2buf(a:fname) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, - \ 'autocmd: BufWritePost, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr(''))))) - call s:UpdateErrors(1, []) + \ 'autocmd: BufWritePost, buffer ' . buf . ' = ' . string(a:fname)) + call s:UpdateErrors(buf, 1, []) endfunction " }}}2 -function! s:BufEnterHook() abort " {{{2 +function! s:BufEnterHook(fname) abort " {{{2 + let buf = syntastic#util#fname2buf(a:fname) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, - \ 'autocmd: BufEnter, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr('')))) . - \ ', &buftype = ' . string(&buftype)) - if &buftype ==# '' - call s:notifiers.refresh(g:SyntasticLoclist.current()) + \ 'autocmd: BufEnter, buffer ' . buf . ' = ' . string(a:fname) . ', &buftype = ' . string(&buftype)) + if buf > 0 && getbufvar(buf, '&buftype') ==# '' + let idx = index(reverse(copy(s:_check_stack)), buf) + if idx >= 0 + if !has('vim_starting') + call remove(s:_check_stack, -idx - 1) + call s:UpdateErrors(buf, 1, []) + endif + elseif &buftype ==# '' + call s:notifiers.refresh(g:SyntasticLoclist.current()) + endif elseif &buftype ==# 'quickfix' " TODO: this is needed because in recent versions of Vim lclose " can no longer be called from BufWinLeave " TODO: at this point there is no b:syntastic_loclist let loclist = filter(copy(getloclist(0)), 'v:val["valid"] == 1') - let owner = str2nr(getbufvar(bufnr(''), 'syntastic_owner_buffer')) + let owner = str2nr(getbufvar(buf, 'syntastic_owner_buffer')) let buffers = syntastic#util#unique(map(loclist, 'v:val["bufnr"]') + (owner ? [owner] : [])) if !empty(get(w:, 'syntastic_loclist_set', [])) && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' )) call SyntasticLoclistHide() @@ -298,8 +321,39 @@ function! s:BufEnterHook() abort " {{{2 endif endfunction " }}}2 +function! s:BufWinEnterHook(fname) abort " {{{2 + let buf = syntastic#util#fname2buf(a:fname) + call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, + \ 'autocmd: BufWinEnter, buffer ' . buf . ' = ' . string(a:fname) . ', &buftype = ' . string(&buftype)) + if buf > 0 && getbufvar(buf, '&buftype') ==# '' + let idx = index(reverse(copy(s:_check_stack)), buf) + if idx >= 0 && !has('vim_starting') + call remove(s:_check_stack, -idx - 1) + call s:UpdateErrors(buf, 1, []) + endif + endif +endfunction " }}}2 + +function! s:VimEnterHook() abort " {{{2 + let g:syntastic_version = + \ g:_SYNTASTIC_VERSION . + \ ' (Vim ' . v:version . (has('nvim') ? ', Neovim' : '') . ', ' . + \ g:_SYNTASTIC_UNAME . + \ (has('gui') ? ', GUI' : '') . ')' + lockvar g:syntastic_version + + let buf = bufnr('') + call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, + \ 'autocmd: VimEnter, buffer ' . buf . ' = ' . string(bufname(buf)) . ', &buftype = ' . string(&buftype)) + let idx = index(reverse(copy(s:_check_stack)), buf) + if idx >= 0 && getbufvar(buf, '&buftype') ==# '' + call remove(s:_check_stack, -idx - 1) + call s:UpdateErrors(buf, 1, []) + endif +endfunction " }}}2 + function! s:QuitPreHook(fname) abort " {{{2 - let buf = bufnr(fnameescape(a:fname)) + let buf = syntastic#util#fname2buf(a:fname) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, 'autocmd: QuitPre, buffer ' . buf . ' = ' . string(a:fname)) if !syntastic#util#var('check_on_wq') @@ -317,7 +371,7 @@ endfunction " }}}2 " Main {{{1 "refresh and redraw all the error info for this buf when saving or reading -function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2 +function! s:UpdateErrors(buf, auto_invoked, checker_names) abort " {{{2 call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'version') call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, s:_DEBUG_DUMP_OPTIONS) call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES) @@ -326,21 +380,21 @@ function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2 call s:modemap.synch() - if s:_skip_file() + if s:_skip_file(a:buf) return endif let run_checks = !a:auto_invoked || s:modemap.doAutoChecking() if run_checks - call s:CacheErrors(a:checker_names) - call syntastic#util#setChangedtick() + call s:CacheErrors(a:buf, a:checker_names) + call syntastic#util#setLastTick(a:buf) else if a:auto_invoked return endif endif - let loclist = g:SyntasticLoclist.current() + let loclist = g:SyntasticLoclist.current(a:buf) if exists('*SyntasticCheckHook') call SyntasticCheckHook(loclist.getRaw()) @@ -356,14 +410,8 @@ function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2 let do_jump = 0 endif - let w:syntastic_loclist_set = [] if syntastic#util#var('always_populate_loc_list') || do_jump - call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist (new)') - call setloclist(0, loclist.getRaw()) - if !exists('b:syntastic_changedtick') - call syntastic#util#setChangedtick() - endif - let w:syntastic_loclist_set = [bufnr(''), b:syntastic_changedtick] + call loclist.setloclist(1) if run_checks && do_jump && !loclist.isEmpty() call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: jump') execute 'silent! lrewind ' . do_jump @@ -383,21 +431,24 @@ function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2 endfunction " }}}2 "clear the loc list for the buffer -function! s:ClearCache() abort " {{{2 - call s:notifiers.reset(g:SyntasticLoclist.current()) - call b:syntastic_loclist.destroy() +function! s:ClearCache(buf) abort " {{{2 + let loclist = g:SyntasticLoclist.current(a:buf) + call s:notifiers.reset(loclist) + call loclist.destroy() endfunction " }}}2 "detect and cache all syntax errors in this buffer -function! s:CacheErrors(checker_names) abort " {{{2 +function! s:CacheErrors(buf, checker_names) abort " {{{2 call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: ' . \ (len(a:checker_names) ? join(a:checker_names) : 'default checkers')) - call s:ClearCache() + call s:ClearCache(a:buf) let newLoclist = g:SyntasticLoclist.New([]) + call newLoclist.setOwner(a:buf) - if !s:_skip_file() + if !s:_skip_file(a:buf) " debug logging {{{3 call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'aggregate_errors') + call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$TERM = ' . string($TERM)) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$PATH = ' . string($PATH)) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getcwd() = ' . string(getcwd())) " }}}3 @@ -436,7 +487,7 @@ function! s:CacheErrors(checker_names) abort " {{{2 call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'sorted:', loclist) endif - let newLoclist = newLoclist.extend(loclist) + call newLoclist.extend(loclist) if !aggregate_errors break @@ -556,7 +607,7 @@ function! SyntasticMake(options) abort " {{{2 let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines]) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'preprocess:', err_lines) endif - lgetexpr err_lines + noautocmd lgetexpr err_lines let errors = deepcopy(getloclist(0)) @@ -569,6 +620,12 @@ function! SyntasticMake(options) abort " {{{2 catch /\m^Vim\%((\a\+)\)\=:E380/ " E380: At bottom of quickfix stack call setloclist(0, [], 'r') + try + " Vim 7.4.2200 or later + call setloclist(0, [], 'r', { 'title': '' }) + catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/ + " do nothing + endtry catch /\m^Vim\%((\a\+)\)\=:E776/ " E776: No location list " do nothing @@ -660,10 +717,10 @@ function! s:_is_quitting(buf) abort " {{{2 endfunction " }}}2 " Skip running in special buffers -function! s:_skip_file() abort " {{{2 - let fname = expand('%', 1) - let skip = s:_is_quitting(bufnr('%')) || get(b:, 'syntastic_skip_checks', 0) || - \ (&buftype !=# '') || !filereadable(fname) || getwinvar(0, '&diff') || +function! s:_skip_file(buf) abort " {{{2 + let fname = bufname(a:buf) + let skip = s:_is_quitting(a:buf) || getbufvar(a:buf, 'syntastic_skip_checks') || + \ (getbufvar(a:buf, '&buftype') !=# '') || !filereadable(fname) || getwinvar(0, '&diff') || \ getwinvar(0, '&previewwindow') || s:_ignore_file(fname) || \ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions if skip @@ -674,17 +731,19 @@ endfunction " }}}2 " Explain why checks will be skipped for the current file function! s:_explain_skip(filetypes) abort " {{{2 - if empty(a:filetypes) && s:_skip_file() + let buf = bufnr('') + if empty(a:filetypes) && s:_skip_file(buf) let why = [] - let fname = expand('%', 1) + let fname = bufname(buf) + let bt = getbufvar(buf, '&buftype') - if s:_is_quitting(bufnr('%')) + if s:_is_quitting(buf) call add(why, 'quitting buffer') endif - if get(b:, 'syntastic_skip_checks', 0) + if getbufvar(buf, 'syntastic_skip_checks') call add(why, 'b:syntastic_skip_checks set') endif - if &buftype !=# '' + if bt !=# '' call add(why, 'buftype = ' . string(&buftype)) endif if !filereadable(fname) diff --git a/sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim b/sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim index 153b0bc9..415d5ab9 100644 --- a/sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim +++ b/sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim @@ -25,10 +25,27 @@ function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) abort " {{{2 call a:loclist.show() endif else - if auto_loc_list == 1 || auto_loc_list == 2 - "TODO: this will close the loc list window if one was opened by - "something other than syntastic - lclose + if (auto_loc_list == 1 || auto_loc_list == 2) && !empty(get(w:, 'syntastic_loclist_set', [])) + try + " Vim 7.4.2200 or later + let title = get(getloclist(0, { 'title': 1 }), 'title', ':SyntasticCheck ') + catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/ + let title = ':SyntasticCheck ' + endtry + + if strpart(title, 0, 16) ==# ':SyntasticCheck ' + " TODO: this will close the loc list window if one was opened + " by something other than syntastic + call SyntasticLoclistHide() + + try + " Vim 7.4.2200 or later + call setloclist(0, [], 'r', { 'title': '' }) + catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/ + " do nothing + endtry + let w:syntastic_loclist_set = [] + endif endif endif endfunction " }}}2 diff --git a/sources_non_forked/syntastic/plugin/syntastic/loclist.vim b/sources_non_forked/syntastic/plugin/syntastic/loclist.vim index 3e9528b5..d4a20b98 100644 --- a/sources_non_forked/syntastic/plugin/syntastic/loclist.vim +++ b/sources_non_forked/syntastic/plugin/syntastic/loclist.vim @@ -27,17 +27,18 @@ function! g:SyntasticLoclist.New(rawLoclist) abort " {{{2 return newObj endfunction " }}}2 -function! g:SyntasticLoclist.current() abort " {{{2 - if !exists('b:syntastic_loclist') || empty(b:syntastic_loclist) - let b:syntastic_loclist = g:SyntasticLoclist.New([]) +function! g:SyntasticLoclist.current(...) abort " {{{2 + let buf = a:0 > 1 ? a:1 : bufnr('') + let loclist = getbufvar(buf, 'syntastic_loclist') + if type(loclist) != type({}) || empty(loclist) + unlet! loclist + let loclist = g:SyntasticLoclist.New([]) endif - return b:syntastic_loclist + return loclist endfunction " }}}2 function! g:SyntasticLoclist.extend(other) abort " {{{2 - let list = self.copyRaw() - call extend(list, a:other.copyRaw()) - return g:SyntasticLoclist.New(list) + call extend(self._rawLoclist, a:other.copyRaw()) endfunction " }}}2 function! g:SyntasticLoclist.sort() abort " {{{2 @@ -167,7 +168,6 @@ function! g:SyntasticLoclist.setOwner(buffer) abort " {{{2 endfunction " }}}2 function! g:SyntasticLoclist.deploy() abort " {{{2 - call self.setOwner(bufnr('')) let self._stamp = syntastic#util#stamp() for buf in self.getBuffers() call setbufvar(buf, 'syntastic_loclist', self) @@ -289,23 +289,29 @@ function! g:SyntasticLoclist.filter(filters) abort " {{{2 return filter(copy(self._rawLoclist), filter) endfunction " }}}2 -function! g:SyntasticLoclist.setloclist() abort " {{{2 +function! g:SyntasticLoclist.setloclist(new) abort " {{{2 if !exists('w:syntastic_loclist_set') let w:syntastic_loclist_set = [] endif - if empty(w:syntastic_loclist_set) || w:syntastic_loclist_set != [bufnr(''), b:changedtick] - let replace = g:syntastic_reuse_loc_lists && !empty(w:syntastic_loclist_set) + if a:new || empty(w:syntastic_loclist_set) || w:syntastic_loclist_set != [self._owner, getbufvar(self._owner, 'changedtick')] + let replace = !a:new && g:syntastic_reuse_loc_lists && !empty(w:syntastic_loclist_set) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)')) call setloclist(0, self.getRaw(), replace ? 'r' : ' ') - call syntastic#util#setChangedtick() - let w:syntastic_loclist_set = [bufnr(''), b:syntastic_changedtick] + try + " Vim 7.4.2200 or later + call setloclist(0, [], 'r', { 'title': ':SyntasticCheck ' . self._name }) + catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/ + " do nothing + endtry + call syntastic#util#setLastTick(self._owner) + let w:syntastic_loclist_set = [self._owner, getbufvar(self._owner, 'syntastic_lasttick')] endif endfunction " }}}2 "display the cached errors for this buf in the location list function! g:SyntasticLoclist.show() abort " {{{2 call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: show') - call self.setloclist() + call self.setloclist(0) if !self.isEmpty() let num = winnr() diff --git a/sources_non_forked/syntastic/plugin/syntastic/modemap.vim b/sources_non_forked/syntastic/plugin/syntastic/modemap.vim index 501c82b7..40445b6e 100644 --- a/sources_non_forked/syntastic/plugin/syntastic/modemap.vim +++ b/sources_non_forked/syntastic/plugin/syntastic/modemap.vim @@ -72,7 +72,7 @@ function! g:SyntasticModeMap.echoMode() abort " {{{2 endfunction " }}}2 function! g:SyntasticModeMap.modeInfo(filetypes) abort " {{{2 - echomsg 'Syntastic version: ' . g:_SYNTASTIC_VERSION . ' (Vim ' . v:version . ', ' . g:_SYNTASTIC_UNAME . ')' + echomsg 'Syntastic version: ' . g:syntastic_version let type = len(a:filetypes) ? a:filetypes[0] : &filetype echomsg 'Info for filetype: ' . type diff --git a/sources_non_forked/syntastic/plugin/syntastic/notifiers.vim b/sources_non_forked/syntastic/plugin/syntastic/notifiers.vim index fe158ca1..6a3b8239 100644 --- a/sources_non_forked/syntastic/plugin/syntastic/notifiers.vim +++ b/sources_non_forked/syntastic/plugin/syntastic/notifiers.vim @@ -23,7 +23,7 @@ function! g:SyntasticNotifiers.Instance() abort " {{{2 endfunction " }}}2 function! g:SyntasticNotifiers.refresh(loclist) abort " {{{2 - if !a:loclist.isEmpty() && !a:loclist.isNewerThan([]) + if !syntastic#util#bufIsActive(bufnr('')) || (!a:loclist.isEmpty() && !a:loclist.isNewerThan([])) " loclist not fully constructed yet return endif diff --git a/sources_non_forked/syntastic/plugin/syntastic/registry.vim b/sources_non_forked/syntastic/plugin/syntastic/registry.vim index bcfd5c63..a24e283a 100644 --- a/sources_non_forked/syntastic/plugin/syntastic/registry.vim +++ b/sources_non_forked/syntastic/plugin/syntastic/registry.vim @@ -339,7 +339,10 @@ endfunction " }}}2 " Check for obsolete variable g:syntastic__checker function! g:SyntasticRegistry._checkDeprecation(filetype) abort " {{{2 - if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers') + if exists('g:syntastic_' . a:filetype . '_checker') && + \ !exists('g:syntastic_' . a:filetype . '_checkers') && + \ type(g:syntastic_{a:filetype}_checker) == type('') + let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker] call syntastic#log#oneTimeWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated') endif diff --git a/sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim b/sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim index 4b0a80fb..f2313b3f 100644 --- a/sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim +++ b/sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim @@ -31,12 +31,12 @@ function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict let errorformat = \ '%-Z %#,'. - \ '%W%f:%l:%v: Warning: %m,'. - \ '%W%f:%l:%v: Warning:,'. - \ '%E%f:%l:%v: %m,'. - \ '%E%>%f:%l:%v:,'. + \ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning: %m,'. + \ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning:,'. + \ '%E%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: %m,'. + \ '%E%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'. \ '%+C %#%m,'. - \ '%W%>%f:%l:%v:,'. + \ '%W%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'. \ '%+C %#%tarning: %m,' return SyntasticMake({ diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim index 13ee47a3..02826548 100644 --- a/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim @@ -25,7 +25,7 @@ function! SyntaxCheckers_javascript_flow_IsAvailable() dict if !executable(self.getExec()) return 0 endif - return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 6]) + return syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [0, 18, 1]) endfunction function! SyntaxCheckers_javascript_flow_GetLocList() dict diff --git a/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim b/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim index 178f76a5..f37e923e 100644 --- a/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim +++ b/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim @@ -47,7 +47,7 @@ endfunction function! SyntaxCheckers_lua_luac_GetLocList() dict let makeprg = self.makeprgBuild({ 'args_after': '-p' }) - let errorformat = 'luac: %#%f:%l: %m' + let errorformat = '%*\f: %#%f:%l: %m' return SyntasticMake({ \ 'makeprg': makeprg, diff --git a/sources_non_forked/vim-coffee-script/syntax/coffee.vim b/sources_non_forked/vim-coffee-script/syntax/coffee.vim index 662ab756..973bb547 100644 --- a/sources_non_forked/vim-coffee-script/syntax/coffee.vim +++ b/sources_non_forked/vim-coffee-script/syntax/coffee.vim @@ -32,7 +32,7 @@ hi def link coffeeConditional Conditional syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display hi def link coffeeException Exception -syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\)\>/ +syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\)\>/ \ display " The `own` keyword is only a keyword after `for`. syn match coffeeKeyword /\/ contained containedin=coffeeRepeat @@ -107,7 +107,7 @@ hi def link coffeeFloat Float " An error for reserved keywords, taken from the RESERVED array: " http://coffeescript.org/documentation/docs/lexer.html#section-67 -syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\)\>/ +syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|native\|implements\|interface\|package\|private\|protected\|public\|static\)\>/ \ display hi def link coffeeReservedError Error diff --git a/sources_non_forked/vim-go/.gitignore b/sources_non_forked/vim-go/.gitignore index 926ccaaf..bdeb2b82 100644 --- a/sources_non_forked/vim-go/.gitignore +++ b/sources_non_forked/vim-go/.gitignore @@ -1 +1,2 @@ doc/tags +.DS_Store diff --git a/sources_non_forked/vim-go/CHANGELOG.md b/sources_non_forked/vim-go/CHANGELOG.md index 02d0e4d2..a6923af6 100644 --- a/sources_non_forked/vim-go/CHANGELOG.md +++ b/sources_non_forked/vim-go/CHANGELOG.md @@ -1,13 +1,26 @@ ## Unplanned +* We have now a [logo for vim-go](https://github.com/fatih/vim-go/blob/master/assets/vim-go.png)! Thanks to @egonelbre for his work on this. + +BUG FIXES: + +* Change back nil and iota highlighting color to the old type [gh-1049] +* Fix passing arguments to `:GoBuild` while using NeoVim [gh-1062] + +## 1.9 (September 13, 2016) + IMPROVEMENTS: * **guru** uses now the `-modified` flag, which allows us use guru on modified buffers as well. This affects all commands where `guru` is used. Such as `:GoDef`, `:GoReferrers`, etc.. [gh-944] +* **:GoDoc** uses now the `-modified` flag under the hood (for `gogetdoc), which allows us to get documentation for the identifier under the cursor ina modified buffer. [gh-1014] * Cleanup and improve documentation [gh-987] * Add new `g:go_gocode_socket_type` setting to change the underlying socket type passed to `gocode`. Usefull to fallback to `tcp` on cases such as Bash on Windows [gh-1000] * `:GoSameIds` is now automatically re-evaluated in cases of buffer reloads (such as `:GoRename`) [gh-998] +* Improve docs about `go_auto_sameids` [gh-1017] +* Improve error message by printing the full path if an incompatible `goimports` is being used [gh-1006] +* `iota` and `nil` are now highlighted correctly and are not treated as booleans [gh-1030] BUG FIXES: @@ -15,7 +28,15 @@ BUG FIXES: * Fix :GoSameIds and :GoCoverage for light background and after changing color schemes [gh-983] * Fix TagBar and `GoCallers` for Windows user [gh-999] * Set updatetime for for `auto_sameids` feature as well [gh-1016] +* Update docs about missing `go_highlight_generate_tags` setting [gh-1023] +* Fix updating the jumplist if `:GoDef` is used [gh-1029] +* Fix highlighting literal percent sign (`%%`) in strings [gh-1011] +* Fix highlighting of nested fields [gh-1007] +* Fix checking for `exepath` feature for the upcoming vim 8.0 release [gh-1046] +BACKWARDS INCOMPATIBILITIES: + +* Rename `GoMetalinterAutoSaveToggle` to `GoMetaLinterAutoSaveToggle` to make it compatible with the existing `:GoMetaLinter` command [gh-1020] ## 1.8 (July 31, 2016) diff --git a/sources_non_forked/vim-go/README.md b/sources_non_forked/vim-go/README.md index 47d8c416..1d886e90 100644 --- a/sources_non_forked/vim-go/README.md +++ b/sources_non_forked/vim-go/README.md @@ -1,5 +1,9 @@ # vim-go +

+ Vim-go logo +

+ Go (golang) support for Vim, which comes with pre-defined sensible settings (like auto gofmt on save), with autocomplete, snippet support, improved syntax highlighting, go toolchain commands, and more. If needed vim-go installs all @@ -7,8 +11,6 @@ necessary binaries for providing seamless Vim integration with current commands. It's highly customizable and each individual feature can be disabled/enabled easily. -![vim-go](https://dl.dropboxusercontent.com/u/174404/vim-go-2.png) - ## Features * Improved Syntax highlighting with items such as Functions, Operators, Methods. @@ -50,9 +52,9 @@ disabled/enabled easily. in their own new terminal. (beta) * Alternate between implementation and test code with `:GoAlternate` -Checkout the official [tutorial](https://github.com/fatih/vim-go-tutorial) -that goes literally over all features and shows many tips and tricks. It shows -how to install vim-go and explains many unknown use cases. Recommended for +Checkout the official [tutorial](https://github.com/fatih/vim-go-tutorial) +that goes literally over all features and shows many tips and tricks. It shows +how to install vim-go and explains many unknown use cases. Recommended for beginners as well as advanced users: https://github.com/fatih/vim-go-tutorial ## Install @@ -290,7 +292,7 @@ other [various pieces](https://github.com/fatih/vim-go/wiki) of information. ## Donation People have asked for this for a long time, now you can be a fully supporter by -[being a patron](https://www.patreon.com/fatih)! +[being a patron](https://www.patreon.com/fatih)! By being a patron, you are enabling vim-go to grow and mature, helping me to invest in bug fixes, new documentation, and improving both current and future diff --git a/sources_non_forked/vim-go/assets/screenshot.png b/sources_non_forked/vim-go/assets/screenshot.png new file mode 100644 index 00000000..8b2923d7 Binary files /dev/null and b/sources_non_forked/vim-go/assets/screenshot.png differ diff --git a/sources_non_forked/vim-go/assets/vim-go.png b/sources_non_forked/vim-go/assets/vim-go.png new file mode 100644 index 00000000..cb26e2c0 Binary files /dev/null and b/sources_non_forked/vim-go/assets/vim-go.png differ diff --git a/sources_non_forked/vim-go/assets/vim-go.svg b/sources_non_forked/vim-go/assets/vim-go.svg new file mode 100644 index 00000000..8471db59 --- /dev/null +++ b/sources_non_forked/vim-go/assets/vim-go.svg @@ -0,0 +1,821 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources_non_forked/vim-go/autoload/go/cmd.vim b/sources_non_forked/vim-go/autoload/go/cmd.vim index 33fccd3a..126ac807 100644 --- a/sources_non_forked/vim-go/autoload/go/cmd.vim +++ b/sources_non_forked/vim-go/autoload/go/cmd.vim @@ -18,8 +18,9 @@ function! go#cmd#Build(bang, ...) let goargs = map(copy(a:000), "expand(v:val)") " escape all shell arguments before we pass it to make - let goargs = go#util#Shelllist(goargs, 1) - + if !has('nvim') + let goargs = go#util#Shelllist(goargs, 1) + endif " create our command arguments. go build discards any results when it " compiles multiple packages. So we pass the `errors` package just as an " placeholder with the current folder (indicated with '.') diff --git a/sources_non_forked/vim-go/autoload/go/complete.vim b/sources_non_forked/vim-go/autoload/go/complete.vim index 5ebad4da..17834536 100644 --- a/sources_non_forked/vim-go/autoload/go/complete.vim +++ b/sources_non_forked/vim-go/autoload/go/complete.vim @@ -1,3 +1,5 @@ +let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix' + function! s:gocodeCurrentBuffer() let buf = getline(1, '$') if &encoding != 'utf-8' @@ -32,7 +34,7 @@ function! s:gocodeCommand(cmd, preargs, args) let old_gopath = $GOPATH let $GOPATH = go#path#Detect() - let socket_type = get(g:, 'go_gocode_socket_type', 'unix') + let socket_type = get(g:, 'go_gocode_socket_type', s:sock_type) let cmd = printf('%s -sock %s %s %s %s', \ go#util#Shellescape(bin_path), \ socket_type, diff --git a/sources_non_forked/vim-go/autoload/go/def.vim b/sources_non_forked/vim-go/autoload/go/def.vim index 2c783939..b7e22a1c 100644 --- a/sources_non_forked/vim-go/autoload/go/def.vim +++ b/sources_non_forked/vim-go/autoload/go/def.vim @@ -113,8 +113,8 @@ function! s:jump_to_declaration(out, mode) " modes of switchbuf which we need based on the split mode let old_switchbuf = &switchbuf - let l:fname = fnamemodify(expand("%"), ':p:gs?\\?/?') - if filename != l:fname + normal! m' + if filename != fnamemodify(expand("%"), ':p:gs?\\?/?') " jump to existing buffer if, 1. we have enabled it, 2. the buffer is loaded " and 3. there is buffer window number we switch to if get(g:, 'go_def_reuse_buffer', 0) && bufloaded(filename) != 0 && bufwinnr(filename) != -1 @@ -134,7 +134,7 @@ function! s:jump_to_declaration(out, mode) endif " open the file and jump to line and column - exec 'edit '.filename + exec 'edit' filename endif call cursor(line, col) @@ -248,7 +248,7 @@ function! go#def#Stack(...) let target = s:go_stack[s:go_stack_level] " jump - exec 'edit '.target["file"] + exec 'edit' target["file"] call cursor(target["line"], target["col"]) normal! zz else diff --git a/sources_non_forked/vim-go/autoload/go/doc.vim b/sources_non_forked/vim-go/autoload/go/doc.vim index 70250109..a65351f3 100644 --- a/sources_non_forked/vim-go/autoload/go/doc.vim +++ b/sources_non_forked/vim-go/autoload/go/doc.vim @@ -85,6 +85,7 @@ function! go#doc#Open(newmode, mode, ...) endif let command = printf("%s %s", bin_path, join(a:000, ' ')) + let out = go#util#System(command) else " check if we have 'gogetdoc' and use it automatically let bin_path = go#path#CheckBinPath('gogetdoc') @@ -95,11 +96,27 @@ function! go#doc#Open(newmode, mode, ...) let offset = go#util#OffsetCursor() let fname = expand("%:p:gs!\\!/!") let pos = shellescape(fname.':#'.offset) - let command = printf("%s -pos %s", bin_path, pos) + + if &modified + " gogetdoc supports the same archive format as guru for dealing with + " modified buffers. + " use the -modified flag + " write each archive entry on stdin as: + " filename followed by newline + " file size followed by newline + " file contents + let in = "" + let sep = go#util#LineEnding() + let content = join(getline(1, '$'), sep) + let in = fname . "\n" . strlen(content) . "\n" . content + let command .= " -modified" + let out = go#util#System(command, in) + else + let out = go#util#System(command) + endif endif - let out = go#util#System(command) if go#util#ShellError() != 0 call go#util#EchoError(out) return diff --git a/sources_non_forked/vim-go/autoload/go/fmt.vim b/sources_non_forked/vim-go/autoload/go/fmt.vim index e47b52d2..b55ba83d 100644 --- a/sources_non_forked/vim-go/autoload/go/fmt.vim +++ b/sources_non_forked/vim-go/autoload/go/fmt.vim @@ -115,7 +115,7 @@ function! go#fmt#Format(withGoimport) if !exists('b:goimports_vendor_compatible') let out = go#util#System(bin_path . " --help") if out !~ "-srcdir" - call go#util#EchoWarning("vim-go: goimports does not support srcdir. update with: :GoUpdateBinaries") + call go#util#EchoWarning(printf("vim-go: goimports (%s) does not support srcdir. Update with: :GoUpdateBinaries", bin_path)) else let b:goimports_vendor_compatible = 1 endif diff --git a/sources_non_forked/vim-go/autoload/go/path.vim b/sources_non_forked/vim-go/autoload/go/path.vim index 16c4d926..75c46616 100644 --- a/sources_non_forked/vim-go/autoload/go/path.vim +++ b/sources_non_forked/vim-go/autoload/go/path.vim @@ -151,7 +151,7 @@ function! go#path#CheckBinPath(binpath) " if it's in PATH just return it if executable(binpath) - if v:version == 704 && has('patch235') + if exists('*exepath') let binpath = exepath(binpath) endif let $PATH = old_path diff --git a/sources_non_forked/vim-go/doc/vim-go.txt b/sources_non_forked/vim-go/doc/vim-go.txt index 39d0b670..19682c42 100644 --- a/sources_non_forked/vim-go/doc/vim-go.txt +++ b/sources_non_forked/vim-go/doc/vim-go.txt @@ -582,8 +582,9 @@ CTRL-t Enables or disables automatic highlighting of |:GoSameIds| while moving the cursor. This basically toggles the option |'g:go_auto_sameids'| on/off. - If enabled it starts highlighting whenever your cursor is. If disabled it - clears and stops automatic highlighting. + If enabled it starts highlighting whenever your cursor is staying at the + same position for a configurable period of time (see 'updatetime'). If + disabled it clears and stops automatic highlighting. *:GoMetaLinter* :GoMetaLinter [path] @@ -695,8 +696,8 @@ CTRL-t Toggles |'g:go_asmfmt_autosave'|. - *:GoMetalinterAutoSaveToggle* -:GoMetalinterAutoSaveToggle + *:GoMetaLinterAutoSaveToggle* +:GoMetaLinterAutoSaveToggle Toggles |'g:go_metalinter_autosave'|. @@ -995,7 +996,8 @@ updated. By default it's disabled. *'g:go_auto_sameids'* Use this option to highlight all uses of the identifier under the cursor -(:GoSameIds) automatically. By default it's disabled. +(:GoSameIds) automatically. By default it's disabled. The delay can be +configured with the 'updatetime' setting. > let g:go_auto_sameids = 0 < @@ -1230,6 +1232,12 @@ Highlights field names. By default it's disabled. > Highlights build constraints. By default it's disabled. > let g:go_highlight_build_constraints = 0 +< + *'g:go_highlight_generate_tags'* + +Highlights go:generate directives. By default it's disabled. > + + let g:go_highlight_generate_tags = 0 < *'g:go_highlight_string_spellcheck'* @@ -1456,8 +1464,7 @@ Vim becomes slow while editing Go files~ Don't enable these options: > - let g:go_highlight_structs = 0 - let g:go_highlight_interfaces = 0 + let g:go_highlight_types = 0 let g:go_highlight_operators = 0 < diff --git a/sources_non_forked/vim-go/ftplugin/go/commands.vim b/sources_non_forked/vim-go/ftplugin/go/commands.vim index 89c1a984..c54de24c 100644 --- a/sources_non_forked/vim-go/ftplugin/go/commands.vim +++ b/sources_non_forked/vim-go/ftplugin/go/commands.vim @@ -71,7 +71,7 @@ command! -nargs=* -bang -complete=customlist,go#package#Complete GoImportAs call " -- linters command! -nargs=* GoMetaLinter call go#lint#Gometa(0, ) -command! -nargs=0 GoMetalinterAutoSaveToggle call go#lint#ToggleMetaLinterAutoSave() +command! -nargs=0 GoMetaLinterAutoSaveToggle call go#lint#ToggleMetaLinterAutoSave() command! -nargs=* GoLint call go#lint#Golint() command! -nargs=* -bang GoVet call go#lint#Vet(0, ) command! -nargs=* -complete=customlist,go#package#Complete GoErrCheck call go#lint#Errcheck() diff --git a/sources_non_forked/vim-go/syntax/go.vim b/sources_non_forked/vim-go/syntax/go.vim index 987485a0..e7e61ff3 100644 --- a/sources_non_forked/vim-go/syntax/go.vim +++ b/sources_non_forked/vim-go/syntax/go.vim @@ -125,12 +125,14 @@ hi def link goComplexes Type " Predefined functions and values -syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/ -syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/ -syn keyword goBoolean iota true false nil +syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/ +syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/ +syn keyword goBoolean true false +syn keyword goPredefinedIdentifiers nil iota -hi def link goBuiltins Keyword -hi def link goBoolean Boolean +hi def link goBuiltins Keyword +hi def link goBoolean Boolean +hi def link goPredefinedIdentifiers goBoolean " Comments; their contents syn keyword goTodo contained TODO FIXME XXX BUG @@ -175,7 +177,7 @@ else endif if g:go_highlight_format_strings != 0 - syn match goFormatSpecifier /%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString + syn match goFormatSpecifier /\([^%]\(%%\)*\)\@<=%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString hi def link goFormatSpecifier goSpecialString endif @@ -313,7 +315,7 @@ hi def link goMethod Type " Fields; if g:go_highlight_fields != 0 - syn match goField /\.\w\+\([\ \n\r\:\)\[,]\)\@=/hs=s+1 + syn match goField /\.\w\+\([.\ \n\r\:\)\[,]\)\@=/hs=s+1 endif hi def link goField Identifier diff --git a/sources_non_forked/vim-snipmate/autoload/snipMate.vim b/sources_non_forked/vim-snipmate/autoload/snipMate.vim index 74366fa8..76cc6481 100644 --- a/sources_non_forked/vim-snipmate/autoload/snipMate.vim +++ b/sources_non_forked/vim-snipmate/autoload/snipMate.vim @@ -488,8 +488,18 @@ fun! snipMate#WordBelowCursor() abort endf fun! snipMate#GetSnippetsForWordBelowCursorForComplete(word) abort - let snippets = map(snipMate#GetSnippetsForWordBelowCursor(a:word, 0), 'v:val[0]') - return filter(snippets, 'v:val =~# "\\V\\^' . escape(a:word, '"\') . '"') + let matches = snipMate#GetSnippetsForWordBelowCursor(a:word, 0) + let snippets = [] + for [trigger, dict] in matches + if get(g:snipMate, 'description_in_completion', 0) + call extend(snippets, map(keys(dict), + \ '{ "word" : trigger, "menu" : v:val, "dup" : 1 }')) + else + call add(snippets, { "word" : trigger }) + endif + endfor + return filter(snippets, + \ 'v:val.word =~# "\\V\\^' . escape(a:word, '"\') . '"') endf fun! snipMate#CanBeTriggered() abort diff --git a/sources_non_forked/vim-snipmate/doc/snipMate.txt b/sources_non_forked/vim-snipmate/doc/snipMate.txt index 230fe686..c97205a6 100644 --- a/sources_non_forked/vim-snipmate/doc/snipMate.txt +++ b/sources_non_forked/vim-snipmate/doc/snipMate.txt @@ -160,6 +160,12 @@ g:snipMate.override maps and other settings work. Note: Load order is determined by 'runtimepath'. +g:snipMate.description_in_completion + If set to 1 (default is 0), snippet + descriptions will be included in the popup + menu used for snippet completion, like with + snipMateShow. + g:snipMate['no_match_completion_feedkeys_chars'] A string inserted when no match for a trigger is found. By default a tab is inserted diff --git a/sources_non_forked/vim-snippets/UltiSnips/all.snippets b/sources_non_forked/vim-snippets/UltiSnips/all.snippets index 0e286e5a..8b7079e2 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/all.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/all.snippets @@ -73,4 +73,27 @@ snippet modeline "Vim modeline" vim`!v ':set '. (&expandtab ? printf('et sw=%i ts=%i', &sw, &ts) : printf('noet sts=%i sw=%i ts=%i', &sts, &sw, &ts)) . (&tw ? ' tw='. &tw : '') . ':'` endsnippet +######### +# DATES # +######### +snippet date "YYYY-MM-DD" w +`date +%Y-%m-%d` +endsnippet + +snippet ddate "Month DD, YYYY" w +`date +%B\ %d,\ %Y` +endsnippet + +snippet diso "ISO format datetime" w +`date +%Y-%m-%dT%H:%M:%S%:z` +endsnippet + +snippet time "hh:mm" w +`date +%H:%M` +endsnippet + +snippet datetime "YYYY-MM-DD hh:mm" w +`date +%Y-%m-%d\ %H:%M` +endsnippet + # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/html.snippets b/sources_non_forked/vim-snippets/UltiSnips/html.snippets index 4e92a960..084d9f78 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/html.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/html.snippets @@ -239,6 +239,18 @@ snippet script "XHTML endsnippet +snippet span "" w + ${0:${VISUAL}} +endsnippet + +snippet span. " with class" w + ${0:${VISUAL}} +endsnippet + +snippet span# " with ID & class" w + ${0:${VISUAL}} +endsnippet + snippet style "XHTML