Updated plugins
This commit is contained in:
parent
3be3af28e5
commit
7fc202ec88
64 changed files with 1659 additions and 525 deletions
|
@ -1006,7 +1006,9 @@ fu! s:KeyLoop()
|
||||||
wh exists('s:init') && s:keyloop
|
wh exists('s:init') && s:keyloop
|
||||||
try
|
try
|
||||||
set t_ve=
|
set t_ve=
|
||||||
|
if guicursor != ''
|
||||||
set guicursor=a:NONE
|
set guicursor=a:NONE
|
||||||
|
en
|
||||||
let nr = getchar()
|
let nr = getchar()
|
||||||
fina
|
fina
|
||||||
let &t_ve = t_ve
|
let &t_ve = t_ve
|
||||||
|
@ -2009,7 +2011,7 @@ fu! s:bufnrfilpath(line)
|
||||||
if (a:line =~ '[\/]\?\[\d\+\*No Name\]$')
|
if (a:line =~ '[\/]\?\[\d\+\*No Name\]$')
|
||||||
let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$'))
|
let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$'))
|
||||||
let filpath = bufnr
|
let filpath = bufnr
|
||||||
else
|
els
|
||||||
let bufnr = bufnr(a:line)
|
let bufnr = bufnr(a:line)
|
||||||
retu [bufnr, a:line]
|
retu [bufnr, a:line]
|
||||||
en
|
en
|
||||||
|
@ -2414,7 +2416,7 @@ fu! s:buildpat(lst)
|
||||||
let c = a:lst[item - 1]
|
let c = a:lst[item - 1]
|
||||||
let pat .= (c == '/' ? '[^/]\{-}' : '[^'.c.'/]\{-}').a:lst[item]
|
let pat .= (c == '/' ? '[^/]\{-}' : '[^'.c.'/]\{-}').a:lst[item]
|
||||||
endfo
|
endfo
|
||||||
else
|
els
|
||||||
for item in range(1, len(a:lst) - 1)
|
for item in range(1, len(a:lst) - 1)
|
||||||
let pat .= '[^'.a:lst[item - 1].']\{-}'.a:lst[item]
|
let pat .= '[^'.a:lst[item - 1].']\{-}'.a:lst[item]
|
||||||
endfo
|
endfo
|
||||||
|
|
|
@ -638,7 +638,6 @@ Set this to 1 to save every MRU file path $HOME/$filepath in the $HOME dir
|
||||||
let g:ctrlp_tilde_homedir = 0
|
let g:ctrlp_tilde_homedir = 0
|
||||||
<
|
<
|
||||||
Note: This applies also to all dir paths stored by :CtrlPBookmarkDirAdd!
|
Note: This applies also to all dir paths stored by :CtrlPBookmarkDirAdd!
|
||||||
<
|
|
||||||
|
|
||||||
*'g:ctrlp_mruf_relative'*
|
*'g:ctrlp_mruf_relative'*
|
||||||
Set this to 1 to show only MRU files in the current working directory: >
|
Set this to 1 to show only MRU files in the current working directory: >
|
||||||
|
@ -873,12 +872,12 @@ COMMANDS *ctrlp-commands*
|
||||||
|
|
||||||
*:CtrlPCurFile*
|
*:CtrlPCurFile*
|
||||||
:CtrlPCurFile
|
:CtrlPCurFile
|
||||||
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores
|
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = 'c' and ignores
|
||||||
the variable's current value.
|
the variable's current value.
|
||||||
|
|
||||||
*:CtrlPCurWD*
|
*:CtrlPCurWD*
|
||||||
:CtrlPCurWD
|
:CtrlPCurWD
|
||||||
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores
|
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = 'd' and ignores
|
||||||
the variable's current value.
|
the variable's current value.
|
||||||
|
|
||||||
*:CtrlPMRU*
|
*:CtrlPMRU*
|
||||||
|
|
|
@ -65,8 +65,8 @@ Features
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Lots of style-customization options (contrast, color invertion, italics usage etc.)
|
* Lots of style-customization options (contrast, color invertion, italics usage etc.)
|
||||||
* Extended filetype highlighting: Html, Xml, Vim (and ES6 with [yajs.vim](https://github.com/othree/yajs.vim)), Clojure, C, Python, JavaScript, CoffeeScript, Ruby, Objective-C, Go, Lua, MoonScript, Java, Markdown, Haskell
|
* Extended filetype highlighting: Html, Xml, Vim, Clojure, C, Python, JavaScript, TypeScript, PureScript, CoffeeScript, Ruby, Objective-C, Go, Lua, MoonScript, Java, Markdown, Haskell, Elixir
|
||||||
* Supported plugins: [EasyMotion][], [vim-sneak][], [Indent Guides][], [indentLine][], [Rainbow Parentheses][], [Airline][], [Lightline][], [GitGutter][], [Signify][], [ShowMarks][], [Signature][], [Syntastic][], [CtrlP][], [Startify][]
|
* Supported plugins: [EasyMotion][], [vim-sneak][], [Indent Guides][], [indentLine][], [Rainbow Parentheses][], [Airline][], [Lightline][], [GitGutter][], [Signify][], [ShowMarks][], [Signature][], [Syntastic][], [Ale][], [CtrlP][], [Startify][], [NERDTree][], [Dirvish][]
|
||||||
|
|
||||||
[EasyMotion]: https://github.com/Lokaltog/vim-easymotion
|
[EasyMotion]: https://github.com/Lokaltog/vim-easymotion
|
||||||
[vim-sneak]: https://github.com/justinmk/vim-sneak
|
[vim-sneak]: https://github.com/justinmk/vim-sneak
|
||||||
|
@ -80,8 +80,11 @@ Features
|
||||||
[ShowMarks]: http://www.vim.org/scripts/script.php?script_id=152
|
[ShowMarks]: http://www.vim.org/scripts/script.php?script_id=152
|
||||||
[Signature]: https://github.com/kshenoy/vim-signature
|
[Signature]: https://github.com/kshenoy/vim-signature
|
||||||
[Syntastic]: https://github.com/scrooloose/syntastic
|
[Syntastic]: https://github.com/scrooloose/syntastic
|
||||||
|
[Ale]: https://github.com/w0rp/ale
|
||||||
[CtrlP]: https://github.com/kien/ctrlp.vim
|
[CtrlP]: https://github.com/kien/ctrlp.vim
|
||||||
[Startify]: https://github.com/mhinz/vim-startify
|
[Startify]: https://github.com/mhinz/vim-startify
|
||||||
|
[NERDTree]: https://github.com/scrooloose/nerdtree
|
||||||
|
[Dirvish]: https://github.com/justinmk/vim-dirvish
|
||||||
|
|
||||||
Contributions
|
Contributions
|
||||||
-------------
|
-------------
|
||||||
|
@ -93,8 +96,8 @@ See [gruvbox-contrib][] repo for contributions, ports and extras.
|
||||||
ToDo
|
ToDo
|
||||||
----
|
----
|
||||||
|
|
||||||
* Filetype syntax highlighting (R, TeX, Swift, Erlang, Purescript and I'm still dissatisfied with CSS)
|
* Filetype syntax highlighting (R, TeX, Swift, Erlang)
|
||||||
* Plugin support (MiniBufExplorer, Tagbar, Netrw, VimPLug)
|
* Plugin support (Tagbar, VimPlug)
|
||||||
|
|
||||||
Self-Promotion
|
Self-Promotion
|
||||||
--------------
|
--------------
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
" Description: Retro groove color scheme for Airline
|
" Description: Retro groove color scheme for Airline
|
||||||
" Author: morhetz <morhetz@gmail.com>
|
" Author: morhetz <morhetz@gmail.com>
|
||||||
" Source: https://github.com/morhetz/gruvbox
|
" Source: https://github.com/morhetz/gruvbox
|
||||||
" Last Modified: 22 Aug 2014
|
" Last Modified: 12 Aug 2017
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
|
|
||||||
let g:airline#themes#gruvbox#palette = {}
|
let g:airline#themes#gruvbox#palette = {}
|
||||||
|
@ -17,7 +17,7 @@ function! airline#themes#gruvbox#refresh()
|
||||||
let error_group = airline#themes#get_highlight2(['Normal', 'bg'], ['WarningMsg', 'fg'])
|
let error_group = airline#themes#get_highlight2(['Normal', 'bg'], ['WarningMsg', 'fg'])
|
||||||
|
|
||||||
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLineNC', 'bg'])
|
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLineNC', 'bg'])
|
||||||
let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['StatusLineNC', 'fg'])
|
let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['Pmenu', 'bg'])
|
||||||
let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg'])
|
let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg'])
|
||||||
let g:airline#themes#gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
let g:airline#themes#gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||||
let g:airline#themes#gruvbox#palette.normal_modified = { 'airline_c': modified_group }
|
let g:airline#themes#gruvbox#palette.normal_modified = { 'airline_c': modified_group }
|
||||||
|
@ -28,7 +28,7 @@ function! airline#themes#gruvbox#refresh()
|
||||||
|
|
||||||
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Identifier', 'fg'])
|
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Identifier', 'fg'])
|
||||||
let s:I2 = s:N2
|
let s:I2 = s:N2
|
||||||
let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['StatusLineNC', 'fg'])
|
let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['Pmenu', 'bg'])
|
||||||
let g:airline#themes#gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
let g:airline#themes#gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||||
let g:airline#themes#gruvbox#palette.insert_modified = g:airline#themes#gruvbox#palette.normal_modified
|
let g:airline#themes#gruvbox#palette.insert_modified = g:airline#themes#gruvbox#palette.normal_modified
|
||||||
let g:airline#themes#gruvbox#palette.insert.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
|
let g:airline#themes#gruvbox#palette.insert.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
|
||||||
|
@ -46,7 +46,7 @@ function! airline#themes#gruvbox#refresh()
|
||||||
let g:airline#themes#gruvbox#palette.replace.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error
|
let g:airline#themes#gruvbox#palette.replace.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error
|
||||||
let g:airline#themes#gruvbox#palette.replace_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error
|
let g:airline#themes#gruvbox#palette.replace_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error
|
||||||
|
|
||||||
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['ModeMsg', 'fg'])
|
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg'])
|
||||||
let s:V2 = s:N2
|
let s:V2 = s:N2
|
||||||
let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg'])
|
let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg'])
|
||||||
let g:airline#themes#gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
let g:airline#themes#gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||||
|
|
|
@ -25,8 +25,9 @@ if exists('g:lightline')
|
||||||
let s:blue = s:getGruvColor('GruvboxBlue')
|
let s:blue = s:getGruvColor('GruvboxBlue')
|
||||||
let s:aqua = s:getGruvColor('GruvboxAqua')
|
let s:aqua = s:getGruvColor('GruvboxAqua')
|
||||||
let s:orange = s:getGruvColor('GruvboxOrange')
|
let s:orange = s:getGruvColor('GruvboxOrange')
|
||||||
|
let s:green = s:getGruvColor('GruvboxGreen')
|
||||||
|
|
||||||
let s:p = {'normal':{}, 'inactive':{}, 'insert':{}, 'replace':{}, 'visual':{}, 'tabline':{}}
|
let s:p = {'normal':{}, 'inactive':{}, 'insert':{}, 'replace':{}, 'visual':{}, 'tabline':{}, 'terminal':{}}
|
||||||
let s:p.normal.left = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ]
|
let s:p.normal.left = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ]
|
||||||
let s:p.normal.right = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ]
|
let s:p.normal.right = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ]
|
||||||
let s:p.normal.middle = [ [ s:fg4, s:bg1 ] ]
|
let s:p.normal.middle = [ [ s:fg4, s:bg1 ] ]
|
||||||
|
@ -36,6 +37,9 @@ if exists('g:lightline')
|
||||||
let s:p.insert.left = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ]
|
let s:p.insert.left = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ]
|
||||||
let s:p.insert.right = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ]
|
let s:p.insert.right = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ]
|
||||||
let s:p.insert.middle = [ [ s:fg4, s:bg2 ] ]
|
let s:p.insert.middle = [ [ s:fg4, s:bg2 ] ]
|
||||||
|
let s:p.terminal.left = [ [ s:bg0, s:green ], [ s:fg1, s:bg2 ] ]
|
||||||
|
let s:p.terminal.right = [ [ s:bg0, s:green ], [ s:fg1, s:bg2 ] ]
|
||||||
|
let s:p.terminal.middle = [ [ s:fg4, s:bg2 ] ]
|
||||||
let s:p.replace.left = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ]
|
let s:p.replace.left = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ]
|
||||||
let s:p.replace.right = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ]
|
let s:p.replace.right = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ]
|
||||||
let s:p.replace.middle = [ [ s:fg4, s:bg2 ] ]
|
let s:p.replace.middle = [ [ s:fg4, s:bg2 ] ]
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
" Description: Retro groove color scheme for Vim
|
" Description: Retro groove color scheme for Vim
|
||||||
" Author: morhetz <morhetz@gmail.com>
|
" Author: morhetz <morhetz@gmail.com>
|
||||||
" Source: https://github.com/morhetz/gruvbox
|
" Source: https://github.com/morhetz/gruvbox
|
||||||
" Last Modified: 04 Sep 2015
|
" Last Modified: 12 Aug 2017
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
|
|
||||||
" Supporting code -------------------------------------------------------------
|
" Supporting code -------------------------------------------------------------
|
||||||
|
@ -18,7 +18,7 @@ endif
|
||||||
|
|
||||||
let g:colors_name='gruvbox'
|
let g:colors_name='gruvbox'
|
||||||
|
|
||||||
if !has('gui_running') && &t_Co != 256
|
if !(has('termguicolors') && &termguicolors) && !has('gui_running') && &t_Co != 256
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -269,7 +269,35 @@ let s:gb.aqua = s:aqua
|
||||||
let s:gb.orange = s:orange
|
let s:gb.orange = s:orange
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
" Setup Terminal Colors For Neovim: {{{
|
||||||
|
|
||||||
|
if has('nvim')
|
||||||
|
let g:terminal_color_0 = s:bg0[0]
|
||||||
|
let g:terminal_color_8 = s:gray[0]
|
||||||
|
|
||||||
|
let g:terminal_color_1 = s:gb.neutral_red[0]
|
||||||
|
let g:terminal_color_9 = s:red[0]
|
||||||
|
|
||||||
|
let g:terminal_color_2 = s:gb.neutral_green[0]
|
||||||
|
let g:terminal_color_10 = s:green[0]
|
||||||
|
|
||||||
|
let g:terminal_color_3 = s:gb.neutral_yellow[0]
|
||||||
|
let g:terminal_color_11 = s:yellow[0]
|
||||||
|
|
||||||
|
let g:terminal_color_4 = s:gb.neutral_blue[0]
|
||||||
|
let g:terminal_color_12 = s:blue[0]
|
||||||
|
|
||||||
|
let g:terminal_color_5 = s:gb.neutral_purple[0]
|
||||||
|
let g:terminal_color_13 = s:purple[0]
|
||||||
|
|
||||||
|
let g:terminal_color_6 = s:gb.neutral_aqua[0]
|
||||||
|
let g:terminal_color_14 = s:aqua[0]
|
||||||
|
|
||||||
|
let g:terminal_color_7 = s:fg4[0]
|
||||||
|
let g:terminal_color_15 = s:fg1[0]
|
||||||
|
endif
|
||||||
|
|
||||||
|
" }}}
|
||||||
" Overload Setting: {{{
|
" Overload Setting: {{{
|
||||||
|
|
||||||
let s:hls_cursor = s:orange
|
let s:hls_cursor = s:orange
|
||||||
|
@ -300,7 +328,7 @@ if exists('g:gruvbox_color_column')
|
||||||
let s:color_column = get(s:gb, g:gruvbox_color_column)
|
let s:color_column = get(s:gb, g:gruvbox_color_column)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:vert_split = s:bg2
|
let s:vert_split = s:bg0
|
||||||
if exists('g:gruvbox_vert_split')
|
if exists('g:gruvbox_vert_split')
|
||||||
let s:vert_split = get(s:gb, g:gruvbox_vert_split)
|
let s:vert_split = get(s:gb, g:gruvbox_vert_split)
|
||||||
endif
|
endif
|
||||||
|
@ -451,9 +479,9 @@ if version >= 700
|
||||||
hi! link CursorColumn CursorLine
|
hi! link CursorColumn CursorLine
|
||||||
|
|
||||||
" Tab pages line filler
|
" Tab pages line filler
|
||||||
call s:HL('TabLineFill', s:bg4, s:vim_bg, s:invert_tabline)
|
call s:HL('TabLineFill', s:bg4, s:bg1, s:invert_tabline)
|
||||||
" Active tab page label
|
" Active tab page label
|
||||||
call s:HL('TabLineSel', s:vim_bg, s:bg4, s:bold . s:invert_tabline)
|
call s:HL('TabLineSel', s:green, s:bg1, s:invert_tabline)
|
||||||
" Not active tab page label
|
" Not active tab page label
|
||||||
hi! link TabLine TabLineFill
|
hi! link TabLine TabLineFill
|
||||||
|
|
||||||
|
@ -483,11 +511,11 @@ call s:HL('IncSearch', s:hls_cursor, s:bg0, s:inverse)
|
||||||
|
|
||||||
call s:HL('Underlined', s:blue, s:none, s:underline)
|
call s:HL('Underlined', s:blue, s:none, s:underline)
|
||||||
|
|
||||||
call s:HL('StatusLine', s:bg4, s:bg0, s:bold . s:inverse)
|
call s:HL('StatusLine', s:bg2, s:fg1, s:inverse)
|
||||||
call s:HL('StatusLineNC', s:bg2, s:fg4, s:bold . s:inverse)
|
call s:HL('StatusLineNC', s:bg1, s:fg4, s:inverse)
|
||||||
|
|
||||||
" The column separating vertically split windows
|
" The column separating vertically split windows
|
||||||
call s:HL('VertSplit', s:fg4, s:vert_split)
|
call s:HL('VertSplit', s:bg3, s:vert_split)
|
||||||
|
|
||||||
" Current match in wildmenu completion
|
" Current match in wildmenu completion
|
||||||
call s:HL('WildMenu', s:blue, s:bg2, s:bold)
|
call s:HL('WildMenu', s:blue, s:bg2, s:bold)
|
||||||
|
@ -541,7 +569,7 @@ hi! link lCursor Cursor
|
||||||
if g:gruvbox_improved_strings == 0
|
if g:gruvbox_improved_strings == 0
|
||||||
hi! link Special GruvboxOrange
|
hi! link Special GruvboxOrange
|
||||||
else
|
else
|
||||||
call s:HL('Special', s:bg1, s:orange, s:italic)
|
call s:HL('Special', s:orange, s:bg1, s:italicize_strings)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call s:HL('Comment', s:gray, s:none, s:italicize_comments)
|
call s:HL('Comment', s:gray, s:none, s:italicize_comments)
|
||||||
|
@ -587,7 +615,7 @@ hi! link Character GruvboxPurple
|
||||||
if g:gruvbox_improved_strings == 0
|
if g:gruvbox_improved_strings == 0
|
||||||
call s:HL('String', s:green, s:none, s:italicize_strings)
|
call s:HL('String', s:green, s:none, s:italicize_strings)
|
||||||
else
|
else
|
||||||
call s:HL('String', s:bg1, s:fg1, s:italicize_strings)
|
call s:HL('String', s:fg1, s:bg1, s:italicize_strings)
|
||||||
endif
|
endif
|
||||||
" Boolean constant: TRUE, false
|
" Boolean constant: TRUE, false
|
||||||
hi! link Boolean GruvboxPurple
|
hi! link Boolean GruvboxPurple
|
||||||
|
@ -660,10 +688,8 @@ hi! link EasyMotionShade Comment
|
||||||
" }}}
|
" }}}
|
||||||
" Sneak: {{{
|
" Sneak: {{{
|
||||||
|
|
||||||
hi! link SneakPluginTarget Search
|
autocmd ColorScheme gruvbox hi! link Sneak Search
|
||||||
hi! link SneakStreakTarget Search
|
autocmd ColorScheme gruvbox hi! link SneakLabel Search
|
||||||
call s:HL('SneakStreakMask', s:yellow, s:yellow)
|
|
||||||
hi! link SneakStreakStatusLine Search
|
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
" Indent Guides: {{{
|
" Indent Guides: {{{
|
||||||
|
@ -779,7 +805,7 @@ call s:HL('CtrlPStats', s:fg4, s:bg2, s:bold)
|
||||||
" Startify: {{{
|
" Startify: {{{
|
||||||
|
|
||||||
hi! link StartifyBracket GruvboxFg3
|
hi! link StartifyBracket GruvboxFg3
|
||||||
hi! link StartifyFile GruvboxFg0
|
hi! link StartifyFile GruvboxFg1
|
||||||
hi! link StartifyNumber GruvboxBlue
|
hi! link StartifyNumber GruvboxBlue
|
||||||
hi! link StartifyPath GruvboxGray
|
hi! link StartifyPath GruvboxGray
|
||||||
hi! link StartifySlash GruvboxGray
|
hi! link StartifySlash GruvboxGray
|
||||||
|
@ -806,6 +832,62 @@ call s:HL('BufTabLineActive', s:fg4, s:bg2)
|
||||||
call s:HL('BufTabLineHidden', s:bg4, s:bg1)
|
call s:HL('BufTabLineHidden', s:bg4, s:bg1)
|
||||||
call s:HL('BufTabLineFill', s:bg0, s:bg0)
|
call s:HL('BufTabLineFill', s:bg0, s:bg0)
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" Asynchronous Lint Engine: {{{
|
||||||
|
|
||||||
|
call s:HL('ALEError', s:none, s:none, s:undercurl, s:red)
|
||||||
|
call s:HL('ALEWarning', s:none, s:none, s:undercurl, s:yellow)
|
||||||
|
call s:HL('ALEInfo', s:none, s:none, s:undercurl, s:blue)
|
||||||
|
|
||||||
|
hi! link ALEErrorSign GruvboxRedSign
|
||||||
|
hi! link ALEWarningSign GruvboxYellowSign
|
||||||
|
hi! link ALEInfoSign GruvboxBlueSign
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" Dirvish: {{{
|
||||||
|
|
||||||
|
hi! link DirvishPathTail GruvboxAqua
|
||||||
|
hi! link DirvishArg GruvboxYellow
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" Netrw: {{{
|
||||||
|
|
||||||
|
hi! link netrwDir GruvboxAqua
|
||||||
|
hi! link netrwClassify GruvboxAqua
|
||||||
|
hi! link netrwLink GruvboxGray
|
||||||
|
hi! link netrwSymLink GruvboxFg1
|
||||||
|
hi! link netrwExe GruvboxYellow
|
||||||
|
hi! link netrwComment GruvboxGray
|
||||||
|
hi! link netrwList GruvboxBlue
|
||||||
|
hi! link netrwHelpCmd GruvboxAqua
|
||||||
|
hi! link netrwCmdSep GruvboxFg3
|
||||||
|
hi! link netrwVersion GruvboxGreen
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" NERDTree: {{{
|
||||||
|
|
||||||
|
hi! link NERDTreeDir GruvboxAqua
|
||||||
|
hi! link NERDTreeDirSlash GruvboxAqua
|
||||||
|
|
||||||
|
hi! link NERDTreeOpenable GruvboxOrange
|
||||||
|
hi! link NERDTreeClosable GruvboxOrange
|
||||||
|
|
||||||
|
hi! link NERDTreeFile GruvboxFg1
|
||||||
|
hi! link NERDTreeExecFile GruvboxYellow
|
||||||
|
|
||||||
|
hi! link NERDTreeUp GruvboxGray
|
||||||
|
hi! link NERDTreeCWD GruvboxGreen
|
||||||
|
hi! link NERDTreeHelp GruvboxFg1
|
||||||
|
|
||||||
|
hi! link NERDTreeToggleOn GruvboxGreen
|
||||||
|
hi! link NERDTreeToggleOff GruvboxRed
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" Vim Multiple Cursors: {{{
|
||||||
|
|
||||||
|
call s:HL('multiple_cursors_cursor', s:none, s:none, s:inverse)
|
||||||
|
call s:HL('multiple_cursors_visual', s:none, s:bg2)
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Filetype specific -----------------------------------------------------------
|
" Filetype specific -----------------------------------------------------------
|
||||||
|
@ -932,9 +1014,13 @@ hi! link pythonImport GruvboxBlue
|
||||||
hi! link pythonRun GruvboxBlue
|
hi! link pythonRun GruvboxBlue
|
||||||
hi! link pythonCoding GruvboxBlue
|
hi! link pythonCoding GruvboxBlue
|
||||||
hi! link pythonOperator GruvboxRed
|
hi! link pythonOperator GruvboxRed
|
||||||
|
hi! link pythonException GruvboxRed
|
||||||
hi! link pythonExceptions GruvboxPurple
|
hi! link pythonExceptions GruvboxPurple
|
||||||
hi! link pythonBoolean GruvboxPurple
|
hi! link pythonBoolean GruvboxPurple
|
||||||
hi! link pythonDot GruvboxFg3
|
hi! link pythonDot GruvboxFg3
|
||||||
|
hi! link pythonConditional GruvboxRed
|
||||||
|
hi! link pythonRepeat GruvboxRed
|
||||||
|
hi! link pythonDottedName GruvboxGreenBold
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
" CSS: {{{
|
" CSS: {{{
|
||||||
|
@ -999,9 +1085,24 @@ hi! link javascriptEndColons GruvboxFg1
|
||||||
hi! link javascriptFuncArg GruvboxFg1
|
hi! link javascriptFuncArg GruvboxFg1
|
||||||
hi! link javascriptGlobalMethod GruvboxFg1
|
hi! link javascriptGlobalMethod GruvboxFg1
|
||||||
hi! link javascriptNodeGlobal GruvboxFg1
|
hi! link javascriptNodeGlobal GruvboxFg1
|
||||||
|
hi! link javascriptBOMWindowProp GruvboxFg1
|
||||||
|
hi! link javascriptArrayMethod GruvboxFg1
|
||||||
|
hi! link javascriptArrayStaticMethod GruvboxFg1
|
||||||
|
hi! link javascriptCacheMethod GruvboxFg1
|
||||||
|
hi! link javascriptDateMethod GruvboxFg1
|
||||||
|
hi! link javascriptMathStaticMethod GruvboxFg1
|
||||||
|
|
||||||
" hi! link javascriptVariable GruvboxOrange
|
" hi! link javascriptProp GruvboxFg1
|
||||||
hi! link javascriptVariable GruvboxRed
|
hi! link javascriptURLUtilsProp GruvboxFg1
|
||||||
|
hi! link javascriptBOMNavigatorProp GruvboxFg1
|
||||||
|
hi! link javascriptDOMDocMethod GruvboxFg1
|
||||||
|
hi! link javascriptDOMDocProp GruvboxFg1
|
||||||
|
hi! link javascriptBOMLocationMethod GruvboxFg1
|
||||||
|
hi! link javascriptBOMWindowMethod GruvboxFg1
|
||||||
|
hi! link javascriptStringMethod GruvboxFg1
|
||||||
|
|
||||||
|
hi! link javascriptVariable GruvboxOrange
|
||||||
|
" hi! link javascriptVariable GruvboxRed
|
||||||
" hi! link javascriptIdentifier GruvboxOrange
|
" hi! link javascriptIdentifier GruvboxOrange
|
||||||
" hi! link javascriptClassSuper GruvboxOrange
|
" hi! link javascriptClassSuper GruvboxOrange
|
||||||
hi! link javascriptIdentifier GruvboxOrange
|
hi! link javascriptIdentifier GruvboxOrange
|
||||||
|
@ -1030,7 +1131,7 @@ hi! link javascriptObjectLabel GruvboxFg1
|
||||||
hi! link javascriptPropertyName GruvboxFg1
|
hi! link javascriptPropertyName GruvboxFg1
|
||||||
|
|
||||||
hi! link javascriptLogicSymbols GruvboxFg1
|
hi! link javascriptLogicSymbols GruvboxFg1
|
||||||
hi! link javascriptArrowFunc GruvboxFg1
|
hi! link javascriptArrowFunc GruvboxYellow
|
||||||
|
|
||||||
hi! link javascriptDocParamName GruvboxFg4
|
hi! link javascriptDocParamName GruvboxFg4
|
||||||
hi! link javascriptDocTags GruvboxFg4
|
hi! link javascriptDocTags GruvboxFg4
|
||||||
|
@ -1038,11 +1139,38 @@ hi! link javascriptDocNotation GruvboxFg4
|
||||||
hi! link javascriptDocParamType GruvboxFg4
|
hi! link javascriptDocParamType GruvboxFg4
|
||||||
hi! link javascriptDocNamedParamType GruvboxFg4
|
hi! link javascriptDocNamedParamType GruvboxFg4
|
||||||
|
|
||||||
|
hi! link javascriptBrackets GruvboxFg1
|
||||||
|
hi! link javascriptDOMElemAttrs GruvboxFg1
|
||||||
|
hi! link javascriptDOMEventMethod GruvboxFg1
|
||||||
|
hi! link javascriptDOMNodeMethod GruvboxFg1
|
||||||
|
hi! link javascriptDOMStorageMethod GruvboxFg1
|
||||||
|
hi! link javascriptHeadersMethod GruvboxFg1
|
||||||
|
|
||||||
|
hi! link javascriptAsyncFuncKeyword GruvboxRed
|
||||||
|
hi! link javascriptAwaitFuncKeyword GruvboxRed
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" PanglossJS: {{{
|
||||||
|
|
||||||
|
hi! link jsClassKeyword GruvboxAqua
|
||||||
|
hi! link jsExtendsKeyword GruvboxAqua
|
||||||
|
hi! link jsExportDefault GruvboxAqua
|
||||||
|
hi! link jsTemplateBraces GruvboxAqua
|
||||||
|
hi! link jsGlobalNodeObjects GruvboxFg1
|
||||||
|
hi! link jsGlobalObjects GruvboxFg1
|
||||||
|
hi! link jsFunction GruvboxAqua
|
||||||
|
hi! link jsFuncParens GruvboxFg3
|
||||||
|
hi! link jsParens GruvboxFg3
|
||||||
|
hi! link jsNull GruvboxPurple
|
||||||
|
hi! link jsUndefined GruvboxPurple
|
||||||
|
hi! link jsClassDefinition GruvboxYellow
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
" TypeScript: {{{
|
" TypeScript: {{{
|
||||||
|
|
||||||
hi! link typeScriptReserved GruvboxAqua
|
hi! link typeScriptReserved GruvboxAqua
|
||||||
hi! link typeScriptLabel GruvboxAqua
|
hi! link typeScriptLabel GruvboxAqua
|
||||||
|
hi! link typeScriptFuncKeyword GruvboxAqua
|
||||||
hi! link typeScriptIdentifier GruvboxOrange
|
hi! link typeScriptIdentifier GruvboxOrange
|
||||||
hi! link typeScriptBraces GruvboxFg1
|
hi! link typeScriptBraces GruvboxFg1
|
||||||
hi! link typeScriptEndColons GruvboxFg1
|
hi! link typeScriptEndColons GruvboxFg1
|
||||||
|
@ -1052,6 +1180,32 @@ hi! link typeScriptLogicSymbols GruvboxFg1
|
||||||
hi! link typeScriptDocSeeTag Comment
|
hi! link typeScriptDocSeeTag Comment
|
||||||
hi! link typeScriptDocParam Comment
|
hi! link typeScriptDocParam Comment
|
||||||
hi! link typeScriptDocTags vimCommentTitle
|
hi! link typeScriptDocTags vimCommentTitle
|
||||||
|
hi! link typeScriptGlobalObjects GruvboxFg1
|
||||||
|
hi! link typeScriptParens GruvboxFg3
|
||||||
|
hi! link typeScriptOpSymbols GruvboxFg3
|
||||||
|
hi! link typeScriptHtmlElemProperties GruvboxFg1
|
||||||
|
hi! link typeScriptNull GruvboxPurple
|
||||||
|
hi! link typeScriptInterpolationDelimiter GruvboxAqua
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" PureScript: {{{
|
||||||
|
|
||||||
|
hi! link purescriptModuleKeyword GruvboxAqua
|
||||||
|
hi! link purescriptModuleName GruvboxFg1
|
||||||
|
hi! link purescriptWhere GruvboxAqua
|
||||||
|
hi! link purescriptDelimiter GruvboxFg4
|
||||||
|
hi! link purescriptType GruvboxFg1
|
||||||
|
hi! link purescriptImportKeyword GruvboxAqua
|
||||||
|
hi! link purescriptHidingKeyword GruvboxAqua
|
||||||
|
hi! link purescriptAsKeyword GruvboxAqua
|
||||||
|
hi! link purescriptStructure GruvboxAqua
|
||||||
|
hi! link purescriptOperator GruvboxBlue
|
||||||
|
|
||||||
|
hi! link purescriptTypeVar GruvboxFg1
|
||||||
|
hi! link purescriptConstructor GruvboxFg1
|
||||||
|
hi! link purescriptFunction GruvboxFg1
|
||||||
|
hi! link purescriptConditional GruvboxOrange
|
||||||
|
hi! link purescriptBacktick GruvboxOrange
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
" CoffeeScript: {{{
|
" CoffeeScript: {{{
|
||||||
|
|
10
sources_non_forked/gruvbox/package.json
Normal file
10
sources_non_forked/gruvbox/package.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"name": "gruvbox",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"repository": "git@github.com:morhetz/gruvbox.git",
|
||||||
|
"author": "Pavel Pertsev <morhetz@gmail.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"vim": {
|
||||||
|
"opt": true
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
" Filename: autoload/lightline.vim
|
" Filename: autoload/lightline.vim
|
||||||
" Author: itchyny
|
" Author: itchyny
|
||||||
" License: MIT License
|
" License: MIT License
|
||||||
" Last Change: 2016/12/03 12:08:08.
|
" Last Change: 2017/08/21 08:19:52.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
|
@ -118,6 +118,7 @@ let s:_lightline = {
|
||||||
\ 'component_type': {
|
\ 'component_type': {
|
||||||
\ 'tabs': 'tabsel', 'close': 'raw'
|
\ 'tabs': 'tabsel', 'close': 'raw'
|
||||||
\ },
|
\ },
|
||||||
|
\ 'component_raw': {},
|
||||||
\ 'tab_component': {},
|
\ 'tab_component': {},
|
||||||
\ 'tab_component_function': {
|
\ 'tab_component_function': {
|
||||||
\ 'filename': 'lightline#tab#filename', 'modified': 'lightline#tab#modified',
|
\ 'filename': 'lightline#tab#filename', 'modified': 'lightline#tab#modified',
|
||||||
|
@ -338,7 +339,9 @@ endfunction
|
||||||
function! s:convert(name, index) abort
|
function! s:convert(name, index) abort
|
||||||
if has_key(s:lightline.component_expand, a:name)
|
if has_key(s:lightline.component_expand, a:name)
|
||||||
let type = get(s:lightline.component_type, a:name, a:index)
|
let type = get(s:lightline.component_type, a:name, a:index)
|
||||||
return filter(s:map(s:evaluate_expand(s:lightline.component_expand[a:name]), '[v:val, 1, v:key == 1 ? "' . type . '" : "' . a:index . '"]'), 'v:val[0] != []')
|
let is_raw = get(s:lightline.component_raw, a:name) || type ==# 'raw'
|
||||||
|
return filter(s:map(s:evaluate_expand(s:lightline.component_expand[a:name]),
|
||||||
|
\ '[v:val, 1 + ' . is_raw . ', v:key == 1 && ' . (type !=# 'raw') . ' ? "' . type . '" : "' . a:index . '"]'), 'v:val[0] != []')
|
||||||
else
|
else
|
||||||
return [[[a:name], 0, a:index]]
|
return [[[a:name], 0, a:index]]
|
||||||
endif
|
endif
|
||||||
|
@ -393,7 +396,7 @@ function! s:line(tabline, inactive) abort
|
||||||
endif
|
endif
|
||||||
let [l, r] = a:tabline ? [s:lightline.tab_llen, s:lightline.tab_rlen] : [s:lightline.llen, s:lightline.rlen]
|
let [l, r] = a:tabline ? [s:lightline.tab_llen, s:lightline.tab_rlen] : [s:lightline.llen, s:lightline.rlen]
|
||||||
let [p, s] = a:tabline ? [s:lightline.tabline_separator, s:lightline.tabline_subseparator] : [s:lightline.separator, s:lightline.subseparator]
|
let [p, s] = a:tabline ? [s:lightline.tabline_separator, s:lightline.tabline_subseparator] : [s:lightline.separator, s:lightline.subseparator]
|
||||||
let [c, f, t] = [s:lightline.component, s:lightline.component_function, s:lightline.component_type]
|
let [c, f, t, w] = [s:lightline.component, s:lightline.component_function, s:lightline.component_type, s:lightline.component_raw]
|
||||||
let mode = a:tabline ? 'tabline' : a:inactive ? 'inactive' : 'active'
|
let mode = a:tabline ? 'tabline' : a:inactive ? 'inactive' : 'active'
|
||||||
let l_ = has_key(s:lightline, mode) ? s:lightline[mode].left : s:lightline.active.left
|
let l_ = has_key(s:lightline, mode) ? s:lightline[mode].left : s:lightline.active.left
|
||||||
let [lt, lc, ll] = s:expand(copy(l_))
|
let [lt, lc, ll] = s:expand(copy(l_))
|
||||||
|
@ -403,7 +406,7 @@ function! s:line(tabline, inactive) abort
|
||||||
let _ .= '%#LightlineLeft_' . mode . '_' . ll[i] . '#'
|
let _ .= '%#LightlineLeft_' . mode . '_' . ll[i] . '#'
|
||||||
for j in range(len(lt[i]))
|
for j in range(len(lt[i]))
|
||||||
let x = lc[i][j] ? lt[i][j] : has_key(f, lt[i][j]) ? (exists('*' . f[lt[i][j]]) ? '%{' . f[lt[i][j]] . '()}' : '%{exists("*' . f[lt[i][j]] . '")?' . f[lt[i][j]] . '():""}') : get(c, lt[i][j], '')
|
let x = lc[i][j] ? lt[i][j] : has_key(f, lt[i][j]) ? (exists('*' . f[lt[i][j]]) ? '%{' . f[lt[i][j]] . '()}' : '%{exists("*' . f[lt[i][j]] . '")?' . f[lt[i][j]] . '():""}') : get(c, lt[i][j], '')
|
||||||
let _ .= has_key(t, lt[i][j]) && t[lt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
|
let _ .= has_key(t, lt[i][j]) && t[lt[i][j]] ==# 'raw' || get(w, lt[i][j]) || lc[i][j] ==# 2 || x ==# '' ? x : '%( ' . x . ' %)'
|
||||||
if j < len(lt[i]) - 1 && s.left !=# ''
|
if j < len(lt[i]) - 1 && s.left !=# ''
|
||||||
let _ .= s:subseparator(lt[i][(j):], s.left, lc[i][(j):])
|
let _ .= s:subseparator(lt[i][(j):], s.left, lc[i][(j):])
|
||||||
endif
|
endif
|
||||||
|
@ -418,7 +421,7 @@ function! s:line(tabline, inactive) abort
|
||||||
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '#'
|
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '#'
|
||||||
for j in range(len(rt[i]))
|
for j in range(len(rt[i]))
|
||||||
let x = rc[i][j] ? rt[i][j] : has_key(f, rt[i][j]) ? (exists('*' . f[rt[i][j]]) ? '%{' . f[rt[i][j]] . '()}' : '%{exists("*' . f[rt[i][j]] . '")?' . f[rt[i][j]] . '():""}') : get(c, rt[i][j], '')
|
let x = rc[i][j] ? rt[i][j] : has_key(f, rt[i][j]) ? (exists('*' . f[rt[i][j]]) ? '%{' . f[rt[i][j]] . '()}' : '%{exists("*' . f[rt[i][j]] . '")?' . f[rt[i][j]] . '():""}') : get(c, rt[i][j], '')
|
||||||
let _ .= has_key(t, rt[i][j]) && t[rt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
|
let _ .= has_key(t, rt[i][j]) && t[rt[i][j]] ==# 'raw' || get(w, rt[i][j]) || rc[i][j] ==# 2 || x ==# '' ? x : '%( ' . x . ' %)'
|
||||||
if j < len(rt[i]) - 1 && s.right !=# ''
|
if j < len(rt[i]) - 1 && s.right !=# ''
|
||||||
let _ .= s:subseparator(rt[i][(j):], s.right, rc[i][(j):])
|
let _ .= s:subseparator(rt[i][(j):], s.right, rc[i][(j):])
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -4,7 +4,7 @@ Version: 0.1
|
||||||
Author: itchyny (https://github.com/itchyny)
|
Author: itchyny (https://github.com/itchyny)
|
||||||
License: MIT License
|
License: MIT License
|
||||||
Repository: https://github.com/itchyny/lightline.vim
|
Repository: https://github.com/itchyny/lightline.vim
|
||||||
Last Change: 2017/05/28 01:07:02.
|
Last Change: 2017/08/21 08:33:12.
|
||||||
|
|
||||||
CONTENTS *lightline-contents*
|
CONTENTS *lightline-contents*
|
||||||
|
|
||||||
|
@ -188,11 +188,22 @@ OPTIONS *lightline-option*
|
||||||
|g:lightline.component_expand|. The types are used to specify
|
|g:lightline.component_expand|. The types are used to specify
|
||||||
the color. Specifically, the type raw is used to specify a
|
the color. Specifically, the type raw is used to specify a
|
||||||
component which should not be wrapped by item group: %(...%).
|
component which should not be wrapped by item group: %(...%).
|
||||||
|
If you want to specify the type of a raw component, please use
|
||||||
|
|g:lightline.component_raw|.
|
||||||
The default value is: >
|
The default value is: >
|
||||||
|
|
||||||
let g:lightline.component_type = {
|
let g:lightline.component_type = {
|
||||||
\ 'tabs': 'tabsel',
|
\ 'tabs': 'tabsel',
|
||||||
\ 'close': 'raw' }
|
\ 'close': 'raw' }
|
||||||
|
<
|
||||||
|
g:lightline.component_raw *g:lightline.component_raw*
|
||||||
|
A dictionary to specify the raw type components. When you
|
||||||
|
register a component to this dictionary (like >
|
||||||
|
let g:lightline.component_raw = { 'example': 1 }
|
||||||
|
< ), the example component is not wrapped by item group: %(...%).
|
||||||
|
The default value is: >
|
||||||
|
|
||||||
|
let g:lightline.component_raw = {}
|
||||||
<
|
<
|
||||||
g:lightline.tab_component *g:lightline.tab_component*
|
g:lightline.tab_component *g:lightline.tab_component*
|
||||||
A dictionary for components in one tab.
|
A dictionary for components in one tab.
|
||||||
|
|
|
@ -45,6 +45,32 @@ function! s:suite.custom_type()
|
||||||
delfunction Custom
|
delfunction Custom
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:suite.raw_type()
|
||||||
|
function! Custom()
|
||||||
|
return [ ['left'], ['middle'], ['right'] ]
|
||||||
|
endfunction
|
||||||
|
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'raw' } }
|
||||||
|
call lightline#init()
|
||||||
|
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
||||||
|
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [2, 2, 2], [0]], ['0', '1', '2', '3']])
|
||||||
|
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||||
|
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 2, 2, 2, 0]], ['0', '1']])
|
||||||
|
delfunction Custom
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:suite.component_raw()
|
||||||
|
function! Custom()
|
||||||
|
return [ ['left'], ['middle'], ['right'] ]
|
||||||
|
endfunction
|
||||||
|
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' }, 'component_raw': { 'custom': 1 } }
|
||||||
|
call lightline#init()
|
||||||
|
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
||||||
|
\ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [2], [2], [2], [0]], ['0', '1', 'custom', '1', '2', '3']])
|
||||||
|
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||||
|
\ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 2], [2], [2, 0]], ['0', 'custom', '0', '1']])
|
||||||
|
delfunction Custom
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:suite.multiple()
|
function! s:suite.multiple()
|
||||||
function! Custom()
|
function! Custom()
|
||||||
return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
|
return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
|
||||||
|
|
|
@ -1,56 +1,18 @@
|
||||||
The NERDTree
|
The NERDTree
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Intro
|
Introduction
|
||||||
-----
|
------------
|
||||||
|
|
||||||
The NERD tree allows you to explore your filesystem and to open files and
|
The NERDTree is a file system explorer for the Vim editor. Using this plugin,
|
||||||
directories. It presents the filesystem to you in the form of a tree which you
|
users can visually browse complex directory hierarchies, quickly open files for
|
||||||
manipulate with the keyboard and/or mouse. It also allows you to perform
|
reading or editing, and perform basic file system operations.
|
||||||
simple filesystem operations.
|
|
||||||
|
|
||||||
The following features and functionality are provided by the NERD tree:
|
This plugin can also be extended with custom mappings using a special API. The
|
||||||
|
details of this API and of other NERDTree features are described in the
|
||||||
|
included documentation.
|
||||||
|
|
||||||
* Files and directories are displayed in a hierarchical tree structure
|
![NERDTree Screenshot](https://github.com/scrooloose/nerdtree/raw/master/screenshot.png)
|
||||||
* Different highlighting is provided for the following types of nodes:
|
|
||||||
* files
|
|
||||||
* directories
|
|
||||||
* sym-links
|
|
||||||
* windows .lnk files
|
|
||||||
* read-only files
|
|
||||||
* executable files
|
|
||||||
* Many (customisable) mappings are provided to manipulate the tree:
|
|
||||||
* Mappings to open/close/explore directory nodes
|
|
||||||
* Mappings to open files in new/existing windows/tabs
|
|
||||||
* Mappings to change the current root of the tree
|
|
||||||
* Mappings to navigate around the tree
|
|
||||||
* ...
|
|
||||||
* Directories and files can be bookmarked.
|
|
||||||
* Most NERD tree navigation can also be done with the mouse
|
|
||||||
* Filtering of tree content (can be toggled at runtime)
|
|
||||||
* custom file filters to prevent e.g. vim backup files being displayed
|
|
||||||
* optional displaying of hidden files (. files)
|
|
||||||
* files can be "turned off" so that only directories are displayed
|
|
||||||
* The position and size of the NERD tree window can be customised
|
|
||||||
* The order in which the nodes in the tree are listed can be customised.
|
|
||||||
* A model of your filesystem is created/maintained as you explore it. This
|
|
||||||
has several advantages:
|
|
||||||
* All filesystem information is cached and is only re-read on demand
|
|
||||||
* If you revisit a part of the tree that you left earlier in your
|
|
||||||
session, the directory nodes will be opened/closed as you left them
|
|
||||||
* The script remembers the cursor position and window position in the NERD
|
|
||||||
tree so you can toggle it off (or just close the tree window) and then
|
|
||||||
reopen it (with NERDTreeToggle) the NERD tree window will appear exactly
|
|
||||||
as you left it
|
|
||||||
* You can have a separate NERD tree for each tab, share trees across tabs,
|
|
||||||
or a mix of both.
|
|
||||||
* By default the script overrides the default file browser (netrw), so if
|
|
||||||
you :edit a directory a (slightly modified) NERD tree will appear in the
|
|
||||||
current window
|
|
||||||
* A programmable menu system is provided (simulates right clicking on a node)
|
|
||||||
* one default menu plugin is provided to perform basic filesystem
|
|
||||||
operations (create/delete/move/copy files/directories)
|
|
||||||
* There's an API for adding your own keymappings
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
@ -66,10 +28,8 @@ Then reload Vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:he
|
||||||
|
|
||||||
apt-vim install -y https://github.com/scrooloose/nerdtree.git
|
apt-vim install -y https://github.com/scrooloose/nerdtree.git
|
||||||
|
|
||||||
|
F.A.Q.
|
||||||
|
------
|
||||||
Faq
|
|
||||||
---
|
|
||||||
|
|
||||||
> Is there any support for `git` flags?
|
> Is there any support for `git` flags?
|
||||||
|
|
||||||
|
|
|
@ -293,23 +293,26 @@ function! s:Bookmark.str()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Bookmark.toRoot(nerdtree) {{{1
|
" FUNCTION: Bookmark.toRoot(nerdtree) {{{1
|
||||||
" Make the node for this bookmark the new tree root
|
" Set the root of the given NERDTree to the node for this Bookmark. If a node
|
||||||
|
" for this Bookmark does not exist, a new one is initialized.
|
||||||
function! s:Bookmark.toRoot(nerdtree)
|
function! s:Bookmark.toRoot(nerdtree)
|
||||||
if self.validate()
|
if self.validate()
|
||||||
try
|
try
|
||||||
let targetNode = self.getNode(a:nerdtree, 1)
|
let l:targetNode = self.getNode(a:nerdtree, 1)
|
||||||
|
call l:targetNode.closeChildren()
|
||||||
catch /^NERDTree.BookmarkedNodeNotFoundError/
|
catch /^NERDTree.BookmarkedNodeNotFoundError/
|
||||||
let targetNode = g:NERDTreeFileNode.New(s:Bookmark.BookmarkFor(self.name).path, a:nerdtree)
|
let l:targetNode = g:NERDTreeFileNode.New(s:Bookmark.BookmarkFor(self.name).path, a:nerdtree)
|
||||||
endtry
|
endtry
|
||||||
call a:nerdtree.changeRoot(targetNode)
|
call a:nerdtree.changeRoot(l:targetNode)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Bookmark.ToRoot(name, nerdtree) {{{1
|
" FUNCTION: Bookmark.ToRoot(name, nerdtree) {{{1
|
||||||
" Make the node for this bookmark the new tree root
|
" Class method that makes the Bookmark with the given name the root of
|
||||||
|
" specified NERDTree.
|
||||||
function! s:Bookmark.ToRoot(name, nerdtree)
|
function! s:Bookmark.ToRoot(name, nerdtree)
|
||||||
let bookmark = s:Bookmark.BookmarkFor(a:name)
|
let l:bookmark = s:Bookmark.BookmarkFor(a:name)
|
||||||
call bookmark.toRoot(a:nerdtree)
|
call l:bookmark.toRoot(a:nerdtree)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Bookmark.validate() {{{1
|
" FUNCTION: Bookmark.validate() {{{1
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
|
" ============================================================================
|
||||||
" CLASS: Opener
|
" CLASS: Opener
|
||||||
"============================================================
|
"
|
||||||
|
" The Opener class defines an API for "opening" operations.
|
||||||
|
" ============================================================================
|
||||||
|
|
||||||
|
|
||||||
let s:Opener = {}
|
let s:Opener = {}
|
||||||
let g:NERDTreeOpener = s:Opener
|
let g:NERDTreeOpener = s:Opener
|
||||||
|
|
||||||
|
@ -26,6 +31,7 @@ function! s:Opener._bufInWindows(bnum)
|
||||||
|
|
||||||
return cnt
|
return cnt
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Opener._checkToCloseTree(newtab) {{{1
|
" FUNCTION: Opener._checkToCloseTree(newtab) {{{1
|
||||||
" Check the class options and global options (i.e. NERDTreeQuitOnOpen) to see
|
" Check the class options and global options (i.e. NERDTreeQuitOnOpen) to see
|
||||||
" if the tree should be closed now.
|
" if the tree should be closed now.
|
||||||
|
@ -44,7 +50,6 @@ function! s:Opener._checkToCloseTree(newtab)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
" FUNCTION: s:Opener._firstUsableWindow() {{{1
|
" FUNCTION: s:Opener._firstUsableWindow() {{{1
|
||||||
" find the window number of the first normal window
|
" find the window number of the first normal window
|
||||||
function! s:Opener._firstUsableWindow()
|
function! s:Opener._firstUsableWindow()
|
||||||
|
@ -217,18 +222,22 @@ endfunction
|
||||||
|
|
||||||
" FUNCTION: Opener._newVSplit() {{{1
|
" FUNCTION: Opener._newVSplit() {{{1
|
||||||
function! s:Opener._newVSplit()
|
function! s:Opener._newVSplit()
|
||||||
let winwidth = winwidth(".")
|
let l:winwidth = winwidth('.')
|
||||||
if winnr("$")==#1
|
|
||||||
let winwidth = g:NERDTreeWinSize
|
if winnr('$') == 1
|
||||||
|
let l:winwidth = g:NERDTreeWinSize
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call nerdtree#exec("wincmd p")
|
call nerdtree#exec('wincmd p')
|
||||||
vnew
|
vnew
|
||||||
|
|
||||||
"resize the nerd tree back to the original size
|
let l:currentWindowNumber = winnr()
|
||||||
|
|
||||||
|
" Restore the NERDTree to its original width.
|
||||||
call g:NERDTree.CursorToTreeWin()
|
call g:NERDTree.CursorToTreeWin()
|
||||||
exec("silent vertical resize ". winwidth)
|
execute 'silent vertical resize ' . l:winwidth
|
||||||
call nerdtree#exec('wincmd p')
|
|
||||||
|
call nerdtree#exec(l:currentWindowNumber . 'wincmd w')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Opener.open(target) {{{1
|
" FUNCTION: Opener.open(target) {{{1
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
"we need to use this number many times for sorting... so we calculate it only
|
" ============================================================================
|
||||||
"once here
|
|
||||||
let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
|
|
||||||
|
|
||||||
" CLASS: Path
|
" CLASS: Path
|
||||||
"============================================================
|
"
|
||||||
|
" The Path class provides an abstracted representation of a file system
|
||||||
|
" pathname. Various operations on pathnames are provided and a number of
|
||||||
|
" representations of a given path name can be accessed here.
|
||||||
|
" ============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
" This constant is used throughout this script for sorting purposes.
|
||||||
|
let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
|
||||||
|
lockvar s:NERDTreeSortStarIndex
|
||||||
|
|
||||||
let s:Path = {}
|
let s:Path = {}
|
||||||
let g:NERDTreePath = s:Path
|
let g:NERDTreePath = s:Path
|
||||||
|
|
||||||
|
@ -529,9 +536,20 @@ function! s:Path.New(path)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path.Slash() {{{1
|
" FUNCTION: Path.Slash() {{{1
|
||||||
"return the slash to use for the current OS
|
" Return the path separator used by the underlying file system. Special
|
||||||
|
" consideration is taken for the use of the 'shellslash' option on Windows
|
||||||
|
" systems.
|
||||||
function! s:Path.Slash()
|
function! s:Path.Slash()
|
||||||
return nerdtree#runningWindows() ? '\' : '/'
|
|
||||||
|
if nerdtree#runningWindows()
|
||||||
|
if exists('+shellslash') && &shellslash
|
||||||
|
return '/'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return '\'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return '/'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path.Resolve() {{{1
|
" FUNCTION: Path.Resolve() {{{1
|
||||||
|
@ -633,27 +651,27 @@ function! s:Path.rename(newPath)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path.str() {{{1
|
" FUNCTION: Path.str() {{{1
|
||||||
|
" Return a string representation of this Path object.
|
||||||
"
|
"
|
||||||
"Returns a string representation of this Path
|
" Args:
|
||||||
|
" This function takes a single dictionary (optional) with keys and values that
|
||||||
|
" specify how the returned pathname should be formatted.
|
||||||
"
|
"
|
||||||
"Takes an optional dictionary param to specify how the output should be
|
" The dictionary may have the following keys:
|
||||||
"formatted.
|
|
||||||
"
|
|
||||||
"The dict may have the following keys:
|
|
||||||
" 'format'
|
" 'format'
|
||||||
" 'escape'
|
" 'escape'
|
||||||
" 'truncateTo'
|
" 'truncateTo'
|
||||||
"
|
"
|
||||||
" The 'format' key may have a value of:
|
" The 'format' key may have a value of:
|
||||||
" 'Cd' - a string to be used with the :cd command
|
" 'Cd' - a string to be used with ":cd" and similar commands
|
||||||
" 'Edit' - a string to be used with :e :sp :new :tabedit etc
|
" 'Edit' - a string to be used with ":edit" and similar commands
|
||||||
" 'UI' - a string used in the NERD tree UI
|
" 'UI' - a string to be displayed in the NERDTree user interface
|
||||||
"
|
"
|
||||||
"The 'escape' key, if specified will cause the output to be escaped with
|
" The 'escape' key, if specified, will cause the output to be escaped with
|
||||||
"shellescape()
|
" Vim's internal "shellescape()" function.
|
||||||
"
|
"
|
||||||
"The 'truncateTo' key causes the resulting string to be truncated to the value
|
" The 'truncateTo' key shortens the length of the path to that given by the
|
||||||
"'truncateTo' maps to. A '<' char will be prepended.
|
" value associated with 'truncateTo'. A '<' is prepended.
|
||||||
function! s:Path.str(...)
|
function! s:Path.str(...)
|
||||||
let options = a:0 ? a:1 : {}
|
let options = a:0 ? a:1 : {}
|
||||||
let toReturn = ""
|
let toReturn = ""
|
||||||
|
@ -698,33 +716,33 @@ function! s:Path._strForUI()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path._strForCd() {{{1
|
" FUNCTION: Path._strForCd() {{{1
|
||||||
"
|
" Return a string representation of this Path that is suitable for use as an
|
||||||
" returns a string that can be used with :cd
|
" argument to Vim's internal ":cd" command.
|
||||||
function! s:Path._strForCd()
|
function! s:Path._strForCd()
|
||||||
return escape(self.str(), self._escChars())
|
return fnameescape(self.str())
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path._strForEdit() {{{1
|
" FUNCTION: Path._strForEdit() {{{1
|
||||||
"
|
" Return a string representation of this Path that is suitable for use as an
|
||||||
"Return: the string for this path that is suitable to be used with the :edit
|
" argument to Vim's internal ":edit" command.
|
||||||
"command
|
|
||||||
function! s:Path._strForEdit()
|
function! s:Path._strForEdit()
|
||||||
let p = escape(self.str(), self._escChars())
|
|
||||||
|
|
||||||
"make it relative
|
" Make the path relative to the current working directory, if possible.
|
||||||
let p = fnamemodify(p, ':.')
|
let l:result = fnamemodify(self.str(), ':.')
|
||||||
|
|
||||||
"handle the edge case where the file begins with a + (vim interprets
|
" On Windows, the drive letter may be removed by "fnamemodify()". Add it
|
||||||
"the +foo in `:e +foo` as an option to :edit)
|
" back, if necessary.
|
||||||
if p[0] == "+"
|
if nerdtree#runningWindows() && l:result[0] == s:Path.Slash()
|
||||||
let p = '\' . p
|
let l:result = self.drive . l:result
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if p ==# ''
|
let l:result = fnameescape(l:result)
|
||||||
let p = '.'
|
|
||||||
|
if empty(l:result)
|
||||||
|
let l:result = '.'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return p
|
return l:result
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path._strForGlob() {{{1
|
" FUNCTION: Path._strForGlob() {{{1
|
||||||
|
@ -745,19 +763,17 @@ function! s:Path._strForGlob()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path._str() {{{1
|
" FUNCTION: Path._str() {{{1
|
||||||
"
|
" Return the absolute pathname associated with this Path object. The pathname
|
||||||
"Gets the string path for this path object that is appropriate for the OS.
|
" returned is appropriate for the underlying file system.
|
||||||
"EG, in windows c:\foo\bar
|
|
||||||
" in *nix /foo/bar
|
|
||||||
function! s:Path._str()
|
function! s:Path._str()
|
||||||
let lead = s:Path.Slash()
|
let l:separator = s:Path.Slash()
|
||||||
|
let l:leader = l:separator
|
||||||
|
|
||||||
"if we are running windows then slap a drive letter on the front
|
|
||||||
if nerdtree#runningWindows()
|
if nerdtree#runningWindows()
|
||||||
let lead = self.drive . '\'
|
let l:leader = self.drive . l:separator
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return lead . join(self.pathSegments, s:Path.Slash())
|
return l:leader . join(self.pathSegments, l:separator)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Path.strTrunk() {{{1
|
" FUNCTION: Path.strTrunk() {{{1
|
||||||
|
|
|
@ -56,12 +56,12 @@ function! s:TreeDirNode.close()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: TreeDirNode.closeChildren() {{{1
|
" FUNCTION: TreeDirNode.closeChildren() {{{1
|
||||||
" Closes all the child dir nodes of this node
|
" Recursively close any directory nodes that are descendants of this node.
|
||||||
function! s:TreeDirNode.closeChildren()
|
function! s:TreeDirNode.closeChildren()
|
||||||
for i in self.children
|
for l:child in self.children
|
||||||
if i.path.isDirectory
|
if l:child.path.isDirectory
|
||||||
call i.close()
|
call l:child.close()
|
||||||
call i.closeChildren()
|
call l:child.closeChildren()
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -220,13 +220,6 @@ function! s:TreeDirNode.getChildIndex(path)
|
||||||
return -1
|
return -1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: TreeDirNode.getDirChildren() {{{1
|
|
||||||
" Return a list of all child nodes from "self.children" that are of type
|
|
||||||
" TreeDirNode.
|
|
||||||
function! s:TreeDirNode.getDirChildren()
|
|
||||||
return filter(self.children, 'v:val.path.isDirectory == 1')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" FUNCTION: TreeDirNode._glob(pattern, all) {{{1
|
" FUNCTION: TreeDirNode._glob(pattern, all) {{{1
|
||||||
" Return a list of strings naming the descendants of the directory in this
|
" Return a list of strings naming the descendants of the directory in this
|
||||||
" TreeDirNode object that match the specified glob pattern.
|
" TreeDirNode object that match the specified glob pattern.
|
||||||
|
@ -250,7 +243,7 @@ function! s:TreeDirNode._glob(pattern, all)
|
||||||
let l:pathSpec = fnamemodify(self.path.str({'format': 'Glob'}), ':.')
|
let l:pathSpec = fnamemodify(self.path.str({'format': 'Glob'}), ':.')
|
||||||
|
|
||||||
" On Windows, the drive letter may be removed by "fnamemodify()".
|
" On Windows, the drive letter may be removed by "fnamemodify()".
|
||||||
if nerdtree#runningWindows() && l:pathSpec[0] == '\'
|
if nerdtree#runningWindows() && l:pathSpec[0] == g:NERDTreePath.Slash()
|
||||||
let l:pathSpec = self.path.drive . l:pathSpec
|
let l:pathSpec = self.path.drive . l:pathSpec
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -21,7 +21,7 @@ endfunction
|
||||||
"prints out the quick help
|
"prints out the quick help
|
||||||
function! s:UI._dumpHelp()
|
function! s:UI._dumpHelp()
|
||||||
if self.getShowHelp()
|
if self.getShowHelp()
|
||||||
let help = "\" NERD tree (" . nerdtree#version() . ") quickhelp~\n"
|
let help = "\" NERDTree (" . nerdtree#version() . ") quickhelp~\n"
|
||||||
let help .= "\" ============================\n"
|
let help .= "\" ============================\n"
|
||||||
let help .= "\" File node mappings~\n"
|
let help .= "\" File node mappings~\n"
|
||||||
let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
||||||
|
|
|
@ -212,14 +212,40 @@ endfunction
|
||||||
|
|
||||||
" FUNCTION: NERDTreeListNodeWin32() {{{1
|
" FUNCTION: NERDTreeListNodeWin32() {{{1
|
||||||
function! NERDTreeListNodeWin32()
|
function! NERDTreeListNodeWin32()
|
||||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
if treenode != {}
|
|
||||||
let metadata = split(system('DIR /Q ' . shellescape(treenode.path.str()) . ' | FINDSTR "^[012][0-9]/[0-3][0-9]/[12][0-9][0-9][0-9]"'), '\n')
|
if !empty(l:node)
|
||||||
call nerdtree#echo(metadata[0])
|
|
||||||
else
|
let l:save_shell = &shell
|
||||||
call nerdtree#echo("No information avaialable")
|
set shell&
|
||||||
|
|
||||||
|
if exists('+shellslash')
|
||||||
|
let l:save_shellslash = &shellslash
|
||||||
|
set noshellslash
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let l:command = 'DIR /Q '
|
||||||
|
\ . shellescape(l:node.path.str())
|
||||||
|
\ . ' | FINDSTR "^[012][0-9]/[0-3][0-9]/[12][0-9][0-9][0-9]"'
|
||||||
|
|
||||||
|
let l:metadata = split(system(l:command), "\n")
|
||||||
|
|
||||||
|
if v:shell_error == 0
|
||||||
|
call nerdtree#echo(l:metadata[0])
|
||||||
|
else
|
||||||
|
call nerdtree#echoError('shell command failed')
|
||||||
|
endif
|
||||||
|
|
||||||
|
let &shell = l:save_shell
|
||||||
|
|
||||||
|
if exists('l:save_shellslash')
|
||||||
|
let &shellslash = l:save_shellslash
|
||||||
|
endif
|
||||||
|
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
call nerdtree#echo('node not recognized')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: NERDTreeCopyNode() {{{1
|
" FUNCTION: NERDTreeCopyNode() {{{1
|
||||||
|
|
BIN
sources_non_forked/nerdtree/screenshot.png
Normal file
BIN
sources_non_forked/nerdtree/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
|
@ -8,7 +8,7 @@ execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
|
||||||
"quickhelp syntax elements
|
"quickhelp syntax elements
|
||||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#ms=s+2,me=e-1
|
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#ms=s+2,me=e-1
|
||||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#ms=s+2,me=e-1
|
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#ms=s+2,me=e-1
|
||||||
syn match NERDTreeHelpTitle #" .*\~#ms=s+2,me=e-1
|
syn match NERDTreeHelpTitle #" .*\~$#ms=s+2,me=e-1
|
||||||
syn match NERDTreeToggleOn #(on)#ms=s+1,he=e-1
|
syn match NERDTreeToggleOn #(on)#ms=s+1,he=e-1
|
||||||
syn match NERDTreeToggleOff #(off)#ms=e-3,me=e-1
|
syn match NERDTreeToggleOff #(off)#ms=e-3,me=e-1
|
||||||
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
|
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
|
||||||
|
@ -22,8 +22,8 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
|
||||||
"highlighing for directory nodes and file nodes
|
"highlighing for directory nodes and file nodes
|
||||||
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
||||||
|
|
||||||
exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
exec 'syn match NERDTreeClosable #' . escape(g:NERDTreeDirArrowCollapsible, '~') . '\ze .*/# containedin=NERDTreeDir,NERDTreeFile'
|
||||||
exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
exec 'syn match NERDTreeOpenable #' . escape(g:NERDTreeDirArrowExpandable, '~') . '\ze .*/# 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.' ].*/#'
|
exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#'
|
||||||
|
|
|
@ -68,9 +68,9 @@ Perl POD, PHP, gettext Portable Object, OS X and iOS property lists, Pug
|
||||||
(formerly Jade), Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax
|
(formerly Jade), Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax
|
||||||
NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Solidity,
|
NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Solidity,
|
||||||
Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL,
|
Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL,
|
||||||
Vim help, VimL, xHtml, XML, XSLT, XQuery, YACC, YAML, YANG data models, z80,
|
Vim help, VimL, Vue.js, xHtml, XML, XSLT, XQuery, YACC, YAML, YANG data models,
|
||||||
Zope page templates, and Zsh. See the [manual][checkers] for details about the
|
z80, Zope page templates, and Zsh. See the [manual][checkers] for details about
|
||||||
corresponding supported checkers (`:help syntastic-checkers` in Vim).
|
the corresponding supported checkers (`:help syntastic-checkers` in Vim).
|
||||||
|
|
||||||
A number of third-party Vim plugins also provide checkers for syntastic, for
|
A number of third-party Vim plugins also provide checkers for syntastic, for
|
||||||
example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],
|
example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],
|
||||||
|
@ -437,15 +437,15 @@ scripts.
|
||||||
__4.12. Q. How can I check scripts written for different versions of Ruby?__
|
__4.12. 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],
|
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
|
activate the relevant version of Ruby, and install in it the checkers you want
|
||||||
the checkers you want to use. Set `g:syntastic_ruby_checkers` accordingly in
|
to use. Set `g:syntastic_ruby_checkers` accordingly in your `vimrc`, and run
|
||||||
your `vimrc`, and run [Vim][vim] from the virtual environment.
|
[Vim][vim] under the relevant Ruby version.
|
||||||
|
|
||||||
If you're starting Vim from a desktop manager rather than from a terminal you
|
If you're starting Vim from a desktop manager rather than from a terminal
|
||||||
might need to write wrapper scripts around your checkers, to activate the
|
and depending on the version manager you use you might need to write wrapper
|
||||||
virtual environment before running the actual checks. Then you'll need to
|
scripts around your checkers, to activate the relevant version of Ruby
|
||||||
point the relevant `g:syntastic_ruby_<checker>_exec` variables to the wrapper
|
before running the actual checks. Then you'll need to point the relevant
|
||||||
scripts.
|
`g:syntastic_ruby_<checker>_exec` variables to the wrapper scripts.
|
||||||
|
|
||||||
<a name="faqperl"></a>
|
<a name="faqperl"></a>
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang*
|
||||||
VHDL.....................................|syntastic-checkers-vhdl|
|
VHDL.....................................|syntastic-checkers-vhdl|
|
||||||
Vim help.................................|syntastic-checkers-help|
|
Vim help.................................|syntastic-checkers-help|
|
||||||
VimL.....................................|syntastic-checkers-vim|
|
VimL.....................................|syntastic-checkers-vim|
|
||||||
|
Vue.js...................................|syntastic-checkers-vue|
|
||||||
|
|
||||||
xHTML....................................|syntastic-checkers-xhtml|
|
xHTML....................................|syntastic-checkers-xhtml|
|
||||||
XML......................................|syntastic-checkers-xml|
|
XML......................................|syntastic-checkers-xml|
|
||||||
|
@ -2867,7 +2868,8 @@ to it:
|
||||||
|
|
||||||
https://github.com/mantoni/eslint_d.js#editor-integration
|
https://github.com/mantoni/eslint_d.js#editor-integration
|
||||||
|
|
||||||
See also: |syntastic-javascript-eslint|, |syntastic-typescript-eslint|.
|
See also: |syntastic-javascript-eslint|, |syntastic-typescript-eslint|,
|
||||||
|
|syntastic-vue-eslint|.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2. gjslint *syntastic-html-gjslint*
|
2. gjslint *syntastic-html-gjslint*
|
||||||
|
@ -2935,7 +2937,7 @@ See also: |syntastic-xhtml-tidy|.
|
||||||
Name: HTMLHint
|
Name: HTMLHint
|
||||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||||
|
|
||||||
"JSHint" is a static code analysis tool for HTML. See the project's page for
|
"HTMLHint" is a static code analysis tool for HTML. See the project's page for
|
||||||
details:
|
details:
|
||||||
|
|
||||||
http://htmlhint.com/
|
http://htmlhint.com/
|
||||||
|
@ -3425,7 +3427,8 @@ version 2.1.0 or later, instead of "ESLint". Just point
|
||||||
|
|
||||||
https://github.com/mantoni/eslint_d.js#editor-integration
|
https://github.com/mantoni/eslint_d.js#editor-integration
|
||||||
|
|
||||||
See also: |syntastic-html-eslint|, |syntastic-typescript-eslint|.
|
See also: |syntastic-html-eslint|, |syntastic-typescript-eslint|,
|
||||||
|
|syntastic-vue-eslint|.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
3. Flow *syntastic-javascript-flow*
|
3. Flow *syntastic-javascript-flow*
|
||||||
|
@ -5720,11 +5723,12 @@ running "rubocop --version" from the shell. If it complains about "Parser"
|
||||||
"Ruby" than you are running, your configuration is not directly supported by
|
"Ruby" than you are running, your configuration is not directly supported by
|
||||||
syntastic.
|
syntastic.
|
||||||
|
|
||||||
While passing around the blame for this does have a certain entertaining value
|
While passing around the blame for this does have a certain entertaining
|
||||||
(cf. https://github.com/bbatsov/rubocop/issues/1819), the problem is real,
|
value (cf. https://github.com/bbatsov/rubocop/issues/1819), the problem
|
||||||
since "Ruby" syntax did change between versions. The solution is to run a
|
is real, since "Ruby" syntax did change between versions. The solution
|
||||||
system such as "rbenv" (http://rbenv.org/) or "rvm" (https://rvm.io/), that
|
is to run a version manager such as "rbenv" (http://rbenv.org/) or "rvm"
|
||||||
allows you to run multiple versions of "Ruby" without conflicts: >
|
(https://rvm.io/), that allows you to run multiple versions of "Ruby" without
|
||||||
|
conflicts: >
|
||||||
$ rbenv version
|
$ rbenv version
|
||||||
2.1.3 (set by /usr/local/var/rbenv/version)
|
2.1.3 (set by /usr/local/var/rbenv/version)
|
||||||
|
|
||||||
|
@ -5768,11 +5772,12 @@ running "ruby-lint --version" from the shell. If it complains about "Parser"
|
||||||
"Ruby" than you are running, your configuration is not directly supported by
|
"Ruby" than you are running, your configuration is not directly supported by
|
||||||
syntastic.
|
syntastic.
|
||||||
|
|
||||||
While passing around the blame for this does have a certain entertaining value
|
While passing around the blame for this does have a certain entertaining
|
||||||
(cf. https://github.com/bbatsov/rubocop/issues/1819), the problem is real,
|
value (cf. https://github.com/bbatsov/rubocop/issues/1819), the problem
|
||||||
since "Ruby" syntax did change between versions. The solution is to run a
|
is real, since "Ruby" syntax did change between versions. The solution
|
||||||
system such as "rbenv" (http://rbenv.org/) or "rvm" (https://rvm.io/), that
|
is to run a version manager such as "rbenv" (http://rbenv.org/) or "rvm"
|
||||||
allows you to run multiple versions of "Ruby" without conflicts: >
|
(https://rvm.io/), that allows you to run multiple versions of "Ruby" without
|
||||||
|
conflicts: >
|
||||||
$ rbenv version
|
$ rbenv version
|
||||||
2.1.3 (set by /usr/local/var/rbenv/version)
|
2.1.3 (set by /usr/local/var/rbenv/version)
|
||||||
|
|
||||||
|
@ -6377,6 +6382,14 @@ Default: 1
|
||||||
Whether to show informational messages ("chktex" option "-m"). By default
|
Whether to show informational messages ("chktex" option "-m"). By default
|
||||||
informational messages are shown as warnings.
|
informational messages are shown as warnings.
|
||||||
|
|
||||||
|
Note~
|
||||||
|
|
||||||
|
If you're checking files containing tab characters, then Vim's 'tabstop'
|
||||||
|
must match "ChkTeX"'s idea of tabstop, otherwise column numbers will be
|
||||||
|
shifted. At the time of this writing, "ChkTeX"'s tabstop is hardcoded to 8,
|
||||||
|
so you should probably add something like this to your vimrc: >
|
||||||
|
set tabstop=8
|
||||||
|
<
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2. lacheck *syntastic-tex-lacheck*
|
2. lacheck *syntastic-tex-lacheck*
|
||||||
|
|
||||||
|
@ -6726,7 +6739,8 @@ as "typescript-vim":
|
||||||
|
|
||||||
https://github.com/leafgarland/typescript-vim
|
https://github.com/leafgarland/typescript-vim
|
||||||
|
|
||||||
See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|.
|
See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|,
|
||||||
|
|syntastic-vue-eslint|.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2. TSLint *syntastic-typescript-tslint*
|
2. TSLint *syntastic-typescript-tslint*
|
||||||
|
@ -7026,6 +7040,72 @@ Checker options~
|
||||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||||
accepts the standard options described at |syntastic-config-makeprg|.
|
accepts the standard options described at |syntastic-config-makeprg|.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
SYNTAX CHECKERS FOR VUE.JS *syntastic-checkers-vue*
|
||||||
|
|
||||||
|
The following checkers are available for Vue.js (filetype "vue"):
|
||||||
|
|
||||||
|
1. ESLint...................|syntastic-vue-eslint|
|
||||||
|
2. pug_lint_vue.............|syntastic-vue-pug_lint_vue|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
1. ESLint *syntastic-vue-eslint*
|
||||||
|
|
||||||
|
Name: eslint
|
||||||
|
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||||
|
|
||||||
|
"ESLint" is a tool for identifying and reporting on patterns found in
|
||||||
|
ECMAScript/JavaScript code. It can also detect problems in JavaScript
|
||||||
|
components of Vue.js files. See the project's page for details:
|
||||||
|
|
||||||
|
https://github.com/nzakas/eslint
|
||||||
|
|
||||||
|
Checker options~
|
||||||
|
|
||||||
|
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||||
|
accepts the standard options described at |syntastic-config-makeprg|.
|
||||||
|
|
||||||
|
Notes~
|
||||||
|
|
||||||
|
Automatically fixing errors (option "--fix") is not supported.
|
||||||
|
|
||||||
|
You can also use "eslint_d" (https://github.com/mantoni/eslint_d.js), version
|
||||||
|
2.1.0 or later, instead of "ESLint". Just point 'g:syntastic_vue_eslint_exec'
|
||||||
|
to it:
|
||||||
|
|
||||||
|
https://github.com/mantoni/eslint_d.js#editor-integration
|
||||||
|
|
||||||
|
See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|,
|
||||||
|
|syntastic-typescript-eslint|.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
2. pug_lint_vue *syntastic-vue-pug_lint_vue*
|
||||||
|
|
||||||
|
Name: pug_lint_vue
|
||||||
|
Maintainer: Tim Carry <tim@pixelastic.com>
|
||||||
|
|
||||||
|
"pug-lint-vue" is a linter for Pug templates inside of Vue.js components. See
|
||||||
|
the project's page at GitHub for details:
|
||||||
|
|
||||||
|
https://github.com/sourceboat/pug-lint-vue
|
||||||
|
|
||||||
|
Installation~
|
||||||
|
|
||||||
|
Install it with: >
|
||||||
|
npm install -g pug-lint-vue
|
||||||
|
<
|
||||||
|
Checker options~
|
||||||
|
|
||||||
|
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||||
|
accepts the standard options described at |syntastic-config-makeprg|.
|
||||||
|
|
||||||
|
Note~
|
||||||
|
|
||||||
|
You probably also need a plugin to set |filetype| for Vue.js files, such as
|
||||||
|
"vim-vue":
|
||||||
|
|
||||||
|
https://github.com/posva/vim-vue
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
SYNTAX CHECKERS FOR XHTML *syntastic-checkers-xhtml*
|
SYNTAX CHECKERS FOR XHTML *syntastic-checkers-xhtml*
|
||||||
|
|
||||||
|
|
|
@ -1015,11 +1015,18 @@ also affect window sizes.)
|
||||||
7.1. airline *syntastic-airline*
|
7.1. airline *syntastic-airline*
|
||||||
|
|
||||||
The "airline" Vim plugin (https://github.com/vim-airline/vim-airline) comes
|
The "airline" Vim plugin (https://github.com/vim-airline/vim-airline) comes
|
||||||
packaged with a mechanism of showing flags on the |'statusline'| according
|
with an extension for showing syntastic-related flags on the |'statusline'|.
|
||||||
to your |'syntastic_stl_format'|. When using this plugin you do NOT need to
|
|
||||||
follow the recommendation outlined in the |syntastic-statusline-flag| section
|
"airline" versions v0.8 and earlier use |'syntastic_stl_format'| to format the
|
||||||
above to modify your |'statusline'|; "airline" will make all necessary changes
|
|'statusline'| flags. Newer versions ignore |'syntastic_stl_format'|, and require
|
||||||
automatically.
|
you to set variables 'airline#extensions#syntastic#stl_format_err' and
|
||||||
|
'airline#extensions#syntastic#stl_format_warn' separately for errors and
|
||||||
|
warnings (with the same syntax as |'syntastic_stl_format'|) if you want to
|
||||||
|
change the flags from the defaults.
|
||||||
|
|
||||||
|
When using "airline" you should NOT follow the recommendation outlined in
|
||||||
|
the |syntastic-statusline-flag| section above to modify your |'statusline'|.
|
||||||
|
"airline" shall make all necessary changes automatically.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
7.2. The csh and tcsh shells *syntastic-csh*
|
7.2. The csh and tcsh shells *syntastic-csh*
|
||||||
|
|
|
@ -19,7 +19,7 @@ if has('reltime')
|
||||||
lockvar! g:_SYNTASTIC_START
|
lockvar! g:_SYNTASTIC_START
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:_SYNTASTIC_VERSION = '3.8.0-63'
|
let g:_SYNTASTIC_VERSION = '3.8.0-73'
|
||||||
lockvar g:_SYNTASTIC_VERSION
|
lockvar g:_SYNTASTIC_VERSION
|
||||||
|
|
||||||
" Sanity checks {{{1
|
" Sanity checks {{{1
|
||||||
|
|
|
@ -103,6 +103,7 @@ let s:_DEFAULT_CHECKERS = {
|
||||||
\ 'verilog': ['verilator'],
|
\ 'verilog': ['verilator'],
|
||||||
\ 'vhdl': ['ghdl'],
|
\ 'vhdl': ['ghdl'],
|
||||||
\ 'vim': ['vimlint'],
|
\ 'vim': ['vimlint'],
|
||||||
|
\ 'vue': ['pug_lint_vue', 'eslint'],
|
||||||
\ 'xhtml': ['tidy'],
|
\ 'xhtml': ['tidy'],
|
||||||
\ 'xml': ['xmllint'],
|
\ 'xml': ['xmllint'],
|
||||||
\ 'xslt': ['xmllint'],
|
\ 'xslt': ['xmllint'],
|
||||||
|
|
|
@ -23,7 +23,9 @@ function! SyntaxCheckers_python_flake8_GetLocList() dict
|
||||||
|
|
||||||
let errorformat =
|
let errorformat =
|
||||||
\ '%E%f:%l: could not compile,%-Z%p^,' .
|
\ '%E%f:%l: could not compile,%-Z%p^,' .
|
||||||
|
\ '%A%f:%l:%c: %t%n: %m,' .
|
||||||
\ '%A%f:%l:%c: %t%n %m,' .
|
\ '%A%f:%l:%c: %t%n %m,' .
|
||||||
|
\ '%A%f:%l: %t%n: %m,' .
|
||||||
\ '%A%f:%l: %t%n %m,' .
|
\ '%A%f:%l: %t%n %m,' .
|
||||||
\ '%-G%.%#'
|
\ '%-G%.%#'
|
||||||
|
|
||||||
|
@ -39,6 +41,7 @@ function! SyntaxCheckers_python_flake8_GetLocList() dict
|
||||||
" F*** are PyFlakes codes
|
" F*** are PyFlakes codes
|
||||||
" C*** are McCabe complexity messages
|
" C*** are McCabe complexity messages
|
||||||
" N*** are naming conventions from pep8-naming
|
" N*** are naming conventions from pep8-naming
|
||||||
|
" H*** are OpenStack messages
|
||||||
|
|
||||||
if has_key(e, 'nr')
|
if has_key(e, 'nr')
|
||||||
let e['text'] .= printf(' [%s%03d]', e['type'], e['nr'])
|
let e['text'] .= printf(' [%s%03d]', e['type'], e['nr'])
|
||||||
|
@ -50,11 +53,11 @@ function! SyntaxCheckers_python_flake8_GetLocList() dict
|
||||||
call remove(e, 'nr')
|
call remove(e, 'nr')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if e['type'] =~? '\m^[CNW]'
|
if e['type'] =~? '\m^[CHNW]'
|
||||||
let e['subtype'] = 'Style'
|
let e['subtype'] = 'Style'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let e['type'] = e['type'] =~? '\m^[EFC]' ? 'E' : 'W'
|
let e['type'] = e['type'] =~? '\m^[EFHC]' ? 'E' : 'W'
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return loclist
|
return loclist
|
||||||
|
|
|
@ -27,12 +27,12 @@ let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
function! SyntaxCheckers_tex_chktex_GetLocList() dict
|
function! SyntaxCheckers_tex_chktex_GetLocList() dict
|
||||||
let makeprg = self.makeprgBuild({ 'args_after': '-q -v1' })
|
let makeprg = self.makeprgBuild({ 'args_after': ['-q', '-f', "%k:%n:%f:%l:%c:%m\n"] })
|
||||||
|
|
||||||
let errorformat =
|
let errorformat =
|
||||||
\ '%EError %n in %f line %l: %m,' .
|
\ '%EError:%n:%f:%l:%v:%m,' .
|
||||||
\ '%WWarning %n in %f line %l: %m,' .
|
\ '%WWarning:%n:%f:%l:%v:%m,' .
|
||||||
\ (g:syntastic_tex_chktex_showmsgs ? '%WMessage %n in %f line %l: %m,' : '') .
|
\ (g:syntastic_tex_chktex_showmsgs ? '%WMessage:%n:%f:%l:%v:%m,' : '') .
|
||||||
\ '%Z%p^,' .
|
\ '%Z%p^,' .
|
||||||
\ '%-G%.%#'
|
\ '%-G%.%#'
|
||||||
|
|
||||||
|
|
23
sources_non_forked/syntastic/syntax_checkers/vue/eslint.vim
Normal file
23
sources_non_forked/syntastic/syntax_checkers/vue/eslint.vim
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
"============================================================================
|
||||||
|
"File: eslint.vim
|
||||||
|
"Description: Syntax checking plugin for syntastic
|
||||||
|
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||||
|
"License: This program is free software. It comes without any warranty,
|
||||||
|
" to the extent permitted by applicable law. You can redistribute
|
||||||
|
" it and/or modify it under the terms of the Do What The Fuck You
|
||||||
|
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||||
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||||
|
"
|
||||||
|
"============================================================================
|
||||||
|
|
||||||
|
if exists('g:loaded_syntastic_vue_eslint_checker')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_syntastic_vue_eslint_checker = 1
|
||||||
|
|
||||||
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
|
\ 'filetype': 'vue',
|
||||||
|
\ 'name': 'eslint',
|
||||||
|
\ 'redirect': 'javascript/eslint'})
|
||||||
|
|
||||||
|
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -0,0 +1,42 @@
|
||||||
|
"============================================================================
|
||||||
|
"File: pug_lint_vue.vim
|
||||||
|
"Description: Syntax checking plugin for syntastic using pug-lint-vue
|
||||||
|
" (https://github.com/sourceboat/pug-lint-vue)
|
||||||
|
"Maintainer: Tim Carry <tim at pixelastic dot com>
|
||||||
|
"License: This program is free software. It comes without any warranty,
|
||||||
|
" to the extent permitted by applicable law. You can redistribute
|
||||||
|
" it and/or modify it under the terms of the Do What The Fuck You
|
||||||
|
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||||
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||||
|
"
|
||||||
|
"============================================================================
|
||||||
|
|
||||||
|
if exists('g:loaded_syntastic_vue_pug_lint_vue_checker')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_syntastic_vue_pug_lint_vue_checker = 1
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
function! SyntaxCheckers_vue_pug_lint_vue_GetLocList() dict
|
||||||
|
let buf = bufnr('')
|
||||||
|
let makeprg = self.makeprgBuild({ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) })
|
||||||
|
|
||||||
|
let errorformat = '%\s%#%l:%c %m'
|
||||||
|
|
||||||
|
return SyntasticMake({
|
||||||
|
\ 'makeprg': makeprg,
|
||||||
|
\ 'errorformat': errorformat,
|
||||||
|
\ 'defaults': { 'bufnr': buf, 'type': 'E' } })
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
|
\ 'filetype': 'vue',
|
||||||
|
\ 'name': 'pug_lint_vue',
|
||||||
|
\ 'exec': 'pug-lint-vue' })
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -1,19 +0,0 @@
|
||||||
This project is a colleciton of vim scripts that relate to the Mako templating
|
|
||||||
engine for python. Most of thse are not at all written by me, just packaged
|
|
||||||
here from the vim-script site. The purpose is to make them easy to use with
|
|
||||||
pathogen.vim.
|
|
||||||
|
|
||||||
About mako: http://www.makotemplates.org/
|
|
||||||
|
|
||||||
Original scripts:
|
|
||||||
|
|
||||||
Externally sourced scripts:
|
|
||||||
|
|
||||||
* indent/mako.vim (vim script 2663) by Scott Torborg
|
|
||||||
http://www.vim.org/scripts/script.php?script_id=2663
|
|
||||||
version used here: 0.4
|
|
||||||
|
|
||||||
* syntax/mako.vim (vim script 1858) by Armin Ronacher
|
|
||||||
http://www.vim.org/scripts/script.php?script_id=1858
|
|
||||||
version used here: 0.6.1
|
|
||||||
|
|
22
sources_non_forked/vim-bundle-mako/README.md
Normal file
22
sources_non_forked/vim-bundle-mako/README.md
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
This project is a colleciton of vim scripts that relate to the Mako templating
|
||||||
|
engine for python. Most of thse are not at all written by me, just packaged
|
||||||
|
here from the vim-script site. The purpose is to make them easy to use with
|
||||||
|
pathogen.vim.
|
||||||
|
|
||||||
|
Useful configuration variables:
|
||||||
|
|
||||||
|
* `g:mako_detect_lang_from_ext`: when set to 1 (the default), the ftdetect
|
||||||
|
script will attempt to figure out the "outer" filetype of the file by
|
||||||
|
stripping the ".mako" extension (eg: index.html.mako will be treated as HTML,
|
||||||
|
while script.cpp.mako will be treated as C++). Set to 0 to prevent this
|
||||||
|
detection.
|
||||||
|
* `g:mako_default_outer_lang`: if ftdetect cannot detect the "outer" filetype of
|
||||||
|
the file, this sets the default filetype used. If not set, defaults to "html".
|
||||||
|
|
||||||
|
About mako: http://www.makotemplates.org/
|
||||||
|
|
||||||
|
Externally sourced scripts:
|
||||||
|
|
||||||
|
* [indent/mako.vim](http://www.vim.org/scripts/script.php?script_id=2663) 0.4 by Scott Torborg
|
||||||
|
* [syntax/mako.vim](http://www.vim.org/scripts/script.php?script_id=1858) 0.6.1 by Armin Ronacher
|
||||||
|
|
|
@ -1 +1,11 @@
|
||||||
|
if !exists("g:mako_detect_lang_from_ext")
|
||||||
|
let g:mako_detect_lang_from_ext = 1
|
||||||
|
endif
|
||||||
|
if g:mako_detect_lang_from_ext
|
||||||
|
au BufNewFile *.*.mako execute "do BufNewFile filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype
|
||||||
|
" it's important to get this before any of the normal BufRead autocmds execute
|
||||||
|
" for this file, otherwise a mako tag at the start of the file can cause the
|
||||||
|
" filetype to be set to mason
|
||||||
|
au BufReadPre *.*.mako execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype
|
||||||
|
endif
|
||||||
au BufRead,BufNewFile *.mako set filetype=mako
|
au BufRead,BufNewFile *.mako set filetype=mako
|
||||||
|
|
|
@ -19,16 +19,27 @@ elseif exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists("b:mako_outer_lang")
|
||||||
|
if exists("g:mako_default_outer_lang")
|
||||||
|
let b:mako_outer_lang = g:mako_default_outer_lang
|
||||||
|
else
|
||||||
|
let b:mako_outer_lang = "html"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
if !exists("main_syntax")
|
if !exists("main_syntax")
|
||||||
let main_syntax = "html"
|
let main_syntax = b:mako_outer_lang
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"Source the html syntax file
|
"Source the outer syntax file
|
||||||
ru! syntax/html.vim
|
execute "ru! syntax/" . b:mako_outer_lang . ".vim"
|
||||||
|
if exists("b:current_syntax")
|
||||||
unlet b:current_syntax
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
if b:mako_outer_lang == "html"
|
||||||
" tell html.vim what syntax groups should take precedence (see :help html.vim)
|
" tell html.vim what syntax groups should take precedence (see :help html.vim)
|
||||||
syn cluster htmlPreproc add=makoLine,makoVariable,makoTag,makoDocComment,makoDefEnd,makoText,makoDelim,makoEnd,makoComment,makoEscape
|
syn cluster htmlPreproc add=makoLine,makoVariable,makoTag,makoDocComment,makoDefEnd,makoText,makoDelim,makoEnd,makoComment,makoEscape
|
||||||
|
endif
|
||||||
|
|
||||||
"Put the python syntax file in @pythonTop
|
"Put the python syntax file in @pythonTop
|
||||||
syn include @pythonTop syntax/python.vim
|
syn include @pythonTop syntax/python.vim
|
||||||
|
@ -89,4 +100,4 @@ if version >= 508 || !exists("did_mako_syn_inits")
|
||||||
delc HiLink
|
delc HiLink
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "html"
|
let b:current_syntax = b:mako_outer_lang
|
||||||
|
|
|
@ -66,7 +66,7 @@ If you don't have a preferred installation method, one option is to install
|
||||||
and paste:
|
and paste:
|
||||||
|
|
||||||
cd ~/.vim/bundle
|
cd ~/.vim/bundle
|
||||||
git clone git://github.com/tpope/vim-fugitive.git
|
git clone https://github.com/tpope/vim-fugitive.git
|
||||||
vim -u NONE -c "helptags vim-fugitive/doc" -c q
|
vim -u NONE -c "helptags vim-fugitive/doc" -c q
|
||||||
|
|
||||||
If your Vim version is below 7.2, I recommend also installing
|
If your Vim version is below 7.2, I recommend also installing
|
||||||
|
|
|
@ -134,7 +134,7 @@ And you can turn line highlighting on and off (defaults to off):
|
||||||
|
|
||||||
Note that if you have line highlighting on and signs off, you will have an empty sign column – more accurately, a sign column with invisible signs. This is because line highlighting requires signs and Vim always shows the sign column even if the signs are invisible.
|
Note that if you have line highlighting on and signs off, you will have an empty sign column – more accurately, a sign column with invisible signs. This is because line highlighting requires signs and Vim always shows the sign column even if the signs are invisible.
|
||||||
|
|
||||||
If you switch off both line highlighting and signs, you won't see the sign column. That is unless you have set `let g:gitgutter_sign_column_always = 1` so it's always there.
|
If you switch off both line highlighting and signs, you won't see the sign column. That is unless you configure the sign column always to be there (see Sign Column section).
|
||||||
|
|
||||||
To keep your Vim snappy, vim-gitgutter will suppress itself when a file has more than 500 changes. As soon as the number of changes falls below the limit vim-gitgutter will show the signs again. You can configure the threshold with:
|
To keep your Vim snappy, vim-gitgutter will suppress itself when a file has more than 500 changes. As soon as the number of changes falls below the limit vim-gitgutter will show the signs again. You can configure the threshold with:
|
||||||
|
|
||||||
|
@ -270,7 +270,15 @@ highlight SignColumn ctermbg=whatever " terminal Vim
|
||||||
highlight SignColumn guibg=whatever " gVim/MacVim
|
highlight SignColumn guibg=whatever " gVim/MacVim
|
||||||
```
|
```
|
||||||
|
|
||||||
By default the sign column will appear when there are signs to show and disappear when there aren't. If you would always like the sign column to be there, add `let g:gitgutter_sign_column_always = 1` to your `~/.vimrc`.
|
By default the sign column will appear when there are signs to show and disappear when there aren't. To always have the sign column, add to your vimrc:
|
||||||
|
|
||||||
|
```viml
|
||||||
|
if exists('&signcolumn') " Vim 7.4.2201
|
||||||
|
set signcolumn=yes
|
||||||
|
else
|
||||||
|
let g:gitgutter_sign_column_always = 1
|
||||||
|
endif
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Signs' colours and symbols
|
#### Signs' colours and symbols
|
||||||
|
|
|
@ -32,6 +32,11 @@ call s:set('g:gitgutter_max_signs', 500)
|
||||||
call s:set('g:gitgutter_signs', 1)
|
call s:set('g:gitgutter_signs', 1)
|
||||||
call s:set('g:gitgutter_highlight_lines', 0)
|
call s:set('g:gitgutter_highlight_lines', 0)
|
||||||
call s:set('g:gitgutter_sign_column_always', 0)
|
call s:set('g:gitgutter_sign_column_always', 0)
|
||||||
|
if g:gitgutter_sign_column_always && exists('&signcolumn')
|
||||||
|
set signcolumn=yes
|
||||||
|
let g:gitgutter_sign_column_always = 0
|
||||||
|
call gitgutter#utility#warn('please replace "let g:gitgutter_sign_column_always=1" with "set signcolumn=yes"')
|
||||||
|
endif
|
||||||
call s:set('g:gitgutter_override_sign_column_highlight', 1)
|
call s:set('g:gitgutter_override_sign_column_highlight', 1)
|
||||||
call s:set('g:gitgutter_realtime', 1)
|
call s:set('g:gitgutter_realtime', 1)
|
||||||
call s:set('g:gitgutter_eager', 1)
|
call s:set('g:gitgutter_eager', 1)
|
||||||
|
@ -208,6 +213,11 @@ augroup gitgutter
|
||||||
|
|
||||||
autocmd TabEnter * call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
|
autocmd TabEnter * call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
|
||||||
|
|
||||||
|
" Ensure that all buffers are processed when opening vim with multiple files, e.g.:
|
||||||
|
"
|
||||||
|
" vim -o file1 file2
|
||||||
|
autocmd VimEnter * if winnr() != winnr('$') | :GitGutterAll | endif
|
||||||
|
|
||||||
if !has('gui_win32')
|
if !has('gui_win32')
|
||||||
autocmd FocusGained * call gitgutter#all()
|
autocmd FocusGained * call gitgutter#all()
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -4,6 +4,6 @@ Thanks for improving vim-go! Before you dive in please read the following:
|
||||||
[Documentation](https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt), it might
|
[Documentation](https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt), it might
|
||||||
have answers for your problem
|
have answers for your problem
|
||||||
2. If you add a new feature please don't forget to update the documentation:
|
2. If you add a new feature please don't forget to update the documentation:
|
||||||
[doc/vim-go.txt](https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt.
|
[doc/vim-go.txt](https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt).
|
||||||
3. If it's a breaking change or exceed +100 lines please open an issue first
|
3. If it's a breaking change or exceed +100 lines please open an issue first
|
||||||
and describe the changes you want to make.
|
and describe the changes you want to make.
|
||||||
|
|
|
@ -1,8 +1,44 @@
|
||||||
## unplanned
|
## unplanned
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* `:GoAddTags` and `:GoRemoveTags` now continue to process if there are malformed individual struct tags [gh-1401]
|
||||||
|
* `:GoAddTags` and `:GoRemoveTags` now shows a quickfix window if there are malformed struct tags [gh-1401]
|
||||||
|
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
* Include comments in import block when folding is enabled [gh-1387]
|
||||||
|
* Fix opening definitions in tabs [gh-1400]
|
||||||
|
* Fix accidently closing quickfix window from other commands if :GoFmt or autosave format was called [gh-1407]
|
||||||
|
|
||||||
|
## 1.14 - (August 6, 2017)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
|
||||||
|
* We now have folding support based on Go syntax. Check out the
|
||||||
|
[demo](https://twitter.com/fatih/status/893843722093330433) to see it in
|
||||||
|
action. To enable it you have to set the following vim setting: `set
|
||||||
|
foldmethod=syntax`. Currently it folds at block (`{ }`), var and const level.
|
||||||
|
These can be individually disabled/enabled if wished. For more info please
|
||||||
|
read the documentation for the `g:go_fold_enable` setting. [gh-1339]
|
||||||
|
* `:GoFiles` accepts now an argument to change the type of files it can show.
|
||||||
|
By default it shows`.go source files` but now it can be changed to show
|
||||||
|
various kind of files. The full list can be seen via `go list --help` under
|
||||||
|
the `// Source Files` section [gh-1372] i.e:
|
||||||
|
|
||||||
|
```
|
||||||
|
:GoFiles CgoFiles // shows .go sources files that import "C"
|
||||||
|
:GoFiles TestGoFiles // shows _test.go files in package
|
||||||
|
:GoFiles IgnoredGoFiles // shows .go sources ignored due to build constraints
|
||||||
|
etc..
|
||||||
|
```
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
|
|
||||||
* Files created with `_test.go` extension have a new template with a ready to go test function. The template can be changed with the `g:go_template_test_file` setting. [gh-1318]
|
* Files created with `_test.go` extension have a new template with a ready to
|
||||||
|
go test function. The template can be changed with the
|
||||||
|
`g:go_template_test_file` setting. [gh-1318]
|
||||||
* Improve performance for highly used operations by caching `go env` calls [gh-1320]
|
* Improve performance for highly used operations by caching `go env` calls [gh-1320]
|
||||||
* `:GoCoverage` can accept arguments now. i.e: `:GoCoverage -run TestFoo` [gh-1326]
|
* `:GoCoverage` can accept arguments now. i.e: `:GoCoverage -run TestFoo` [gh-1326]
|
||||||
* `:GoDecls` and `:GoDeclsDir` shows a warning if [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) is not installed
|
* `:GoDecls` and `:GoDeclsDir` shows a warning if [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) is not installed
|
||||||
|
@ -10,6 +46,11 @@ IMPROVEMENTS
|
||||||
* `:GoCoverage` echos now the progress if `g:go_echo_command_info` is enabled [gh-1333]
|
* `:GoCoverage` echos now the progress if `g:go_echo_command_info` is enabled [gh-1333]
|
||||||
* Add `g:go_doc_max_height` setting to control the maximum height of the window created by `:GoDoc` and `K` mapping [gh-1335]
|
* Add `g:go_doc_max_height` setting to control the maximum height of the window created by `:GoDoc` and `K` mapping [gh-1335]
|
||||||
* The `af` text object is able to include the assignment variable for anonymous functions. Can be disabled with `g:go_textobj_include_variable = 0` [gh-1345]
|
* The `af` text object is able to include the assignment variable for anonymous functions. Can be disabled with `g:go_textobj_include_variable = 0` [gh-1345]
|
||||||
|
* Add `g:go_list_autoclose` setting to prevent closting the quickfix/location list after zero items [gh-1361]
|
||||||
|
* Cursor is now adjusted and locked to the correct line when `goimports` is used for autosave [gh-1367]
|
||||||
|
* Complement the path of command for different situations of Cygwin environment [gh-1394]
|
||||||
|
* Show message when using :GoDef and opening a new buffer [gh-1385]
|
||||||
|
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
|
@ -17,7 +58,29 @@ BUG FIXES:
|
||||||
* Fix documentation for vim-go & syntastic integration for errcheck using [gh-1323]
|
* Fix documentation for vim-go & syntastic integration for errcheck using [gh-1323]
|
||||||
* Fix showing an output if a test has finished when `:GoTest` is called [gh-1327]
|
* Fix showing an output if a test has finished when `:GoTest` is called [gh-1327]
|
||||||
* Fix warning when goimports doesn't support srcdir [gh-1344]
|
* Fix warning when goimports doesn't support srcdir [gh-1344]
|
||||||
* Fix brokwn code folding with go_highlight_types [gh-1338]
|
* Fix broken code folding with go_highlight_types [gh-1338]
|
||||||
|
* Fix blocking the ui when swapfile is enabled and `:GoFmt` is called (either manually or via autosave) [gh-1362]
|
||||||
|
* Fix getting bin paths for binaries if GOPATH was not set and Go version =>1.7 was used [gh-1363]
|
||||||
|
* Fix picking up the correct list type for showing `:GoFmt` errors [gh-1365]
|
||||||
|
* Fix auto detecting of GOPATH for import paths with string 'src' (i.e: `GOPATH/src/github.com/foo/src/bar`) [gh-1366]
|
||||||
|
* Fix showing an empty window if `gogetdoc` was not found [gh-1379]
|
||||||
|
* Fix commands not being executed if paths would include spaces (binary name, GOPATH, file itself, etc..) [gh-1374]
|
||||||
|
* Fix showing correct message when editing a new file [gh-1371]
|
||||||
|
* Fix filepaths in the quickfix list for :GoVet [gh-1381]
|
||||||
|
* Run :GoLint against the package of the open file [gh-1382]
|
||||||
|
|
||||||
|
BACKWARDS INCOMPATIBILITIES:
|
||||||
|
|
||||||
|
* `:GoFmt` now uses `quickfix` to show formatting errors instead of
|
||||||
|
`locationlist`. To change back to `locationlist` you can change it with the
|
||||||
|
setting `let g:go_list_type = "locationlist"` [gh-1365]
|
||||||
|
* `:GoLint` now runs against the package of the open file instead of the
|
||||||
|
current working directory. This is so all commands behave the same relative
|
||||||
|
to the current open buffer. For more info check the [comment
|
||||||
|
here](https://github.com/fatih/vim-go/issues/1375#issuecomment-317535953)
|
||||||
|
[gh-1382]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 1.13 - (June 6, 2017)
|
## 1.13 - (June 6, 2017)
|
||||||
|
|
||||||
|
@ -150,7 +213,11 @@ BACKWARDS INCOMPATIBILITIES:
|
||||||
|
|
||||||
FEATURES:
|
FEATURES:
|
||||||
|
|
||||||
* Travis test integration has been added. Now any file that is added as `<name>_test.vim` will be automatically tested in for every Pull Request (just like how we add tests to Go with `_test.go`). Going forward this will tremendously increase the stability and decrease the maintenance burden of vim-go. [gh-1157]
|
* Travis test integration has been added. Now any file that is added as
|
||||||
|
`<name>_test.vim` will be automatically tested in for every Pull Request
|
||||||
|
(just like how we add tests to Go with `_test.go`). Going forward this will
|
||||||
|
tremendously increase the stability and decrease the maintenance burden of
|
||||||
|
vim-go. [gh-1157]
|
||||||
* Add new `g:go_updatetime` setting to change the default updatetime (which was hardcoded previously) [gh-1055]
|
* Add new `g:go_updatetime` setting to change the default updatetime (which was hardcoded previously) [gh-1055]
|
||||||
* Add new `g:go_template_use_pkg` setting to enable to use cwd as package name instead of basic template file [gh-1124]
|
* Add new `g:go_template_use_pkg` setting to enable to use cwd as package name instead of basic template file [gh-1124]
|
||||||
|
|
||||||
|
@ -491,6 +558,376 @@ BACKWARDS INCOMPATIBILITIES:
|
||||||
i.g: `let g:go_guru_scope = ["github.com/fatih/structs", "golang.org/x/tools/..."]`
|
i.g: `let g:go_guru_scope = ["github.com/fatih/structs", "golang.org/x/tools/..."]`
|
||||||
|
|
||||||
|
|
||||||
## Previous releases
|
## 1.5 (Mar 16, 2016)
|
||||||
|
|
||||||
Previous changelogs can be found here: https://github.com/fatih/vim-go/releases
|
FEATURES:
|
||||||
|
* Introducing code name "motion". A new whole way of moving
|
||||||
|
around and navigating (gh-765). Checkout the following new changes:
|
||||||
|
* A vim-go specific tool, called [motion](https://github.com/fatih/motion) is being developed which
|
||||||
|
provides us the underlying foundation for the following and upcoming
|
||||||
|
new features.
|
||||||
|
* `]]` and `[[` motions can be used to jump between functions
|
||||||
|
* `if` and `af` are improved and implement from scratch. It has now
|
||||||
|
support for literal functions, comments of functions, better cursor
|
||||||
|
position support and more stable.
|
||||||
|
* New `:GoDecls` and `:GoDeclsDir` commands that are available if
|
||||||
|
`ctrlp.vim` is installed. Once called one can easily jump to any generic declaration available.
|
||||||
|
* I wrote two blog posts about these new features in more detail. I recommend you to read it: [Treating Go types as objects in Vim](https://medium.com/@farslan/treating-go-types-as-objects-in-vim-ed6b3fad9287#.mbwaisevp) and [Navigation between functions and types in vim-go](https://medium.com/@farslan/navigation-between-functions-and-types-in-vim-go-f9dd7de8ca37#.2sdf8tbbe)
|
||||||
|
* A new `:GoAlternate` command that toggles to the test
|
||||||
|
file of the current file. It also has new appropriate mappings to open the
|
||||||
|
alternate file in split or tabs. (gh-704)
|
||||||
|
* Now commands can choose whether they want to open a
|
||||||
|
`quickfix` or a `location list` via the setting `g:go_list_type`. Also all
|
||||||
|
the commands have now some sensible settings, some will open a qf window,
|
||||||
|
some will open a location list (gh-700)
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* Add support for goimport's new `-srcdir`. Goimports now succesfully suports `vendor/` folders with this release. (gh-735)
|
||||||
|
* Add `g:go_gorename_prefill` setting which disabled pre filling the argument for `:GoRename` (gh-711)
|
||||||
|
* Improve `:GoRun` to complete to filenames (gh-742)
|
||||||
|
* Highlight `//go:generate` comment directives (gh-757)
|
||||||
|
* Indent code in Go HTML templates (gh-709)
|
||||||
|
* Improve negative numbers of all types, octals, imaginary numbers with exponents (gh-752)
|
||||||
|
* Improved internal usage of retrieving offsets (gh-762)
|
||||||
|
* Improve by substitute all backslashes to slashes for filename (gh-703)
|
||||||
|
* Improve internal Go package path function (gh-702)
|
||||||
|
* Improved typo and grammar errors in docs (gh-714)
|
||||||
|
* Improved internal `:GoInfo` automatic call (gh-759)
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
* Fix oracle scope not working if trailing slash exists in scope (gh-751)
|
||||||
|
* Fix `:GoErrCheck` checking abspath (gh-671)
|
||||||
|
* Fix `:GoInstall` correctly parsing errors (gh-692)
|
||||||
|
* Fix `:GoInstall` correctly parsing errors (gh-692)
|
||||||
|
* Fix `:GoTestFunc` for neovim (gh-695)
|
||||||
|
* Fix `:GoRun` accepting arguments for neovim (gh-730)
|
||||||
|
* Fix `go run` mappings not working (gh-542)
|
||||||
|
* Fix autodetect gopath picking up non existing GB vendor folder
|
||||||
|
* Fix gofmt errors showing per buffer instead of per script (gh-721)
|
||||||
|
* Fix some of the neosnippet snippets
|
||||||
|
|
||||||
|
## 1.4 (Jan 18, 2016)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
|
||||||
|
* You waited for it for a long time. And here you have it: **Neovim support!**
|
||||||
|
This is a huge feature. It's fully compatible with Vim and kicks only in if
|
||||||
|
vim-go is being used within Neovim. Checkout the full list of changes
|
||||||
|
(gh-607):
|
||||||
|
* An async launcher and base foundation was implemented for the `go` command.
|
||||||
|
This will be used in the future for all upcoming subcommands of the `go`
|
||||||
|
tool.
|
||||||
|
* `:GoBuild` is now called asynchronously (it doesn't block the UI anymore).
|
||||||
|
* A new `go#jobcontrol#Statusline()` can be used to plug into the statusline.
|
||||||
|
This will show the status of the job running asynchronously. The statusline
|
||||||
|
is improved to show the status per package instead of file. Assume you have
|
||||||
|
three files open, all belonging to the same package, if the package build
|
||||||
|
(`:GoBuild`) is successful, all statusline's will be empty (means SUCCESS),
|
||||||
|
if it fails all files statusline's will show `FAILED`.
|
||||||
|
* `:GoRun` opens a new vertical terminal emulator inside Neovim and runs the
|
||||||
|
command there. The terminal mode can be changed with `g:go_term_mode`,
|
||||||
|
which is by default `vsplit`. Current options are `vsplit, split or tab`.
|
||||||
|
We also have three new mappings to open `:GoRun` command in different
|
||||||
|
terminal split modes: `<Plug>(go-run-vertical)`, `<Plug>(go-run-split)`
|
||||||
|
and `<Plug>(go-run-tab)`
|
||||||
|
* `:GoTest`, `:GoTestFunc` and `:GoTestCompile` opens and runs in a new
|
||||||
|
terminal. The view mode (split,vertical, tab) is defined with
|
||||||
|
`g:go_term_mode`. The `g:go_term_enabled` setting can be use to change the
|
||||||
|
behavior of `:GoTestXXX` commands .If set to `1`, it opens the test
|
||||||
|
commands inside a terminal, if not it runs them in background just like
|
||||||
|
`:GoBuild` and displays the result in the statusline.
|
||||||
|
* We have two settings for terminal sizes: `g:go_term_height` and
|
||||||
|
`g:go_term_width`. By default a vertical or horizontal view is equally
|
||||||
|
splitted by vim automatically. However with these settings we can for
|
||||||
|
example have a terminal with a smaller height when we split it
|
||||||
|
horizontally.
|
||||||
|
* If a command inside the term fails (such as `go run`, `go test` ...) we
|
||||||
|
parse now the errors and list them inside a location list.
|
||||||
|
* Instead of quickfix window, vim-go now uses the `location list` feature of
|
||||||
|
Vim. These are associated with each window independently of each other. This
|
||||||
|
enables us to have multiple, independent location lists per window (example
|
||||||
|
usages: `:GoBuild` with errors that needs to be fixed, `:GoLint` with
|
||||||
|
warnings that we want to check, `:GoReferrers` with a list of referred
|
||||||
|
identifiers) (gh-626)
|
||||||
|
* a new **`:AsmFmt`** command which is integrated to work with [asmfmt](https://github.com/klauspost/asmfmt) (gh-673)
|
||||||
|
* the full identifier information of a completed identifier is echoed in
|
||||||
|
statusline. This is very useful to see a function signatures arguments.
|
||||||
|
(gh-685)
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* Improve `:GoFmt` by checking if the binary is indeed installed on the system (gh-617)
|
||||||
|
* Improve `:GoMetaLinter` by adding the option to run the metalinter on save
|
||||||
|
and adding the option to limit the output to the currently active buffer. Set
|
||||||
|
`let g:go_metalinter_autosave = 1` to enable autosave and use `let
|
||||||
|
g:go_metalinter_autosave_enabled = ['vet', 'golint']` to change your options.
|
||||||
|
(gh-631)
|
||||||
|
* Improved `:GoDef`. If `vimproc` is installed `godef` will make use of it (gh-670)
|
||||||
|
* Improve completion of godoce when vimproc is used (gh-620)
|
||||||
|
* Improve internal error matching prodecure to not match false positives (gh-618)
|
||||||
|
* A new option to highlight interface variables with `go_highlight_interfaces` (gh-681)
|
||||||
|
|
||||||
|
BUG FIXES
|
||||||
|
|
||||||
|
* Fix `:GoFmt` changing the fileformat of the current buffer (gh-615)
|
||||||
|
* Fix `:GoRename` to output the original error if parsing fails (gh-675)
|
||||||
|
* Fix `:GoTest` to output the original error if parsing fails (gh-676)
|
||||||
|
* Fixed `fmt.Fprintln` not to highlight as builtin (gh-628)
|
||||||
|
* Fixed wrong highlighting of channels of channels (gh-678)
|
||||||
|
|
||||||
|
## 1.3 (Nov 22, 2015)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
|
||||||
|
* A new `:GoOracleTags` command was added to pass build tags to Oracle's `-tags` flag. (gh-573)
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* Change `:GoTest` command to timeout after 10 seconds. Vim UI is blocking and
|
||||||
|
tests with large running times makes Vim blocking for a long time. This is
|
||||||
|
also customizable with the new option `g:go_test_timeout`. (gh-578)
|
||||||
|
* Improve `:GoRename` to collect and populate quickfix window with errors.
|
||||||
|
(gh-577)
|
||||||
|
* Improve `:GoRun` by dropping bad filenames from quickfix window. This allows
|
||||||
|
us to have only valid entries which can be jumped to (gh-547)
|
||||||
|
* Improve `:GoMetaLinter` quickfix output by using absolute paths. This enables
|
||||||
|
us to jump to errors for all cases. (gh-565)
|
||||||
|
* Improve `:GoMetaLinter` command by adding a new option
|
||||||
|
`g:go_metalinter_deadline` which cancels the linters after 5 seconds
|
||||||
|
(previous default). (gh-576)
|
||||||
|
* Improve `:GoMetaLinter` by jumping to the first encountered error from the quickfix window.
|
||||||
|
* Automatically resize quickfix window based on the number of errors (gh-602)
|
||||||
|
* Improve build constraints to show invalid cases (such as `// +buildfoo`, not
|
||||||
|
having an empty line between the package statement, etc..). Also add missing
|
||||||
|
`GOARCH` values sucha s `arm64`. There are many other useful improvements,
|
||||||
|
for more detail please have a look at
|
||||||
|
([gh-589](https://github.com/fatih/vim-go/pull/589))
|
||||||
|
* Add support for all values of `GOARCH` (gh-601)
|
||||||
|
* Add note about Syntastic usage as this problem comes up a lot (gh-580)
|
||||||
|
* Add note about `:GoUpdateBinaries` (gh-606)
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
* Fixed `:GoErrCheck` showing the correct output when executed inside the source folder (gh-564)
|
||||||
|
* Fixed `:GoBuild` by not using `/dev/null` anymore for build output (not
|
||||||
|
supported by `go`). We pass a temporary file now. (gh-567)
|
||||||
|
* Fixed `:GoFmt` passing `g:go_fmt_options` options to `goimports`. This option
|
||||||
|
is only valid with `gofmt`. (gh-590)
|
||||||
|
* Fix vim-go for `cygwin` users. (gh-575)
|
||||||
|
* Fixed identifier in template files to be highlighted correctly (gh-559)
|
||||||
|
* Fixed character region in template files to be highlighted correctly (gh-603)
|
||||||
|
* Fixed variables in template files to be highlighted correctly (gh-611)
|
||||||
|
* Do not treat builtins as keywords. Now `make` will not highlighted but
|
||||||
|
`make()` will be highlighted (gh-605)
|
||||||
|
|
||||||
|
## 1.2 (Oct 2, 2015)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
|
||||||
|
* A new `:GoMetaLinter` command which invokes [gometalinter](https://github.com/alecthomas/gometalinter). Please check the PR [#553](https://github.com/fatih/vim-go/pull/553) for more detail on customizing and usage of `:GoMetaLinter`.
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* Improve `:GoImport` to trim spaces when including import paths of form `"fmt "`
|
||||||
|
* Avoid setting `filetype` twice. Previously it was doing it twice, which was expensive
|
||||||
|
* Improve handling of GOPATH's with trailing `/` characters, such as `/home/user/go/`
|
||||||
|
* Add a new `g:go_highlight_string_spellcheck` feature, which is enabled by feature. Now if spell is enabled, go strings are also checked.
|
||||||
|
* Specify our limited but functional [gb](http://getgb.io/) support
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
* Fixed `:GoRun` to display errors when `g:go_dispatch_enabled` was enabled
|
||||||
|
* Fixed `:GoDrop` displaying "Not enough arguments" (regression)
|
||||||
|
* Fixed `:GoErrCheck` not showing `PASS` message if the command was successful
|
||||||
|
* Fixed `:GoErrCheck` not executing in the directory of the currently edited file
|
||||||
|
* Close quickfix window after a successful second round of `:GoInstall`
|
||||||
|
* Fix passing files rather than packages to certain oracle commands.
|
||||||
|
* Escape files passed to oracle command. This could lead to some serious things.
|
||||||
|
* Clear `g:go_oracle_scope` when the scope was reseted. Previously it was set to empty string, which was causing false positives.
|
||||||
|
* Correct various misspellings.
|
||||||
|
|
||||||
|
## 1.1 (Jul 25, 2015)
|
||||||
|
|
||||||
|
With this release the version will now increase in `minor` levels. So the next
|
||||||
|
release will be `1.2`, the other one `1.3`, etc.. This provides us more
|
||||||
|
flexibility (like releasing patch versions if needed).
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
* A new `:GoGenerate` command is now available which can be used to invoke `go generate` within vim
|
||||||
|
* Vim-go didn't had any license, now we use BSD 3-Clause License (the same as Go). This is needed for Linux distributions to package vim-go and is also something that people asked for.
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
* Improve commands `GoRun, GoTest{,Func,Compile}, GoCoverage,
|
||||||
|
GoGenerate, GoErrcheck, GoLint, and GoVet` to handle multiple arguments.
|
||||||
|
Previously this feature was limited to only certain commands. What this means
|
||||||
|
is, for example `:GoVet . -all` will invoke `go tool vet . -all`
|
||||||
|
automatically instead of plan `go vet`. This is one of the big changes in
|
||||||
|
this release, so give it a try :)
|
||||||
|
* Improved `:GoFmt` command, which now uses the `-w` flag to
|
||||||
|
write to the source code directly, instead of outputting it to stdout. This
|
||||||
|
makes `:GoFmt` much more faster than the current implementation. This is one
|
||||||
|
of the big changes in this release, so feedback is welcome!
|
||||||
|
* Improve `:GoImport` to have a `!` feature. Now when when called
|
||||||
|
with a `!` appended it will go get it. i.e: `:GoImport!
|
||||||
|
github.com/fatih/color`. Useful if `:GoImport` fails and you want to download
|
||||||
|
it.
|
||||||
|
* Automatic GOPATH detections can now detect `gb` vendored folders. Some commands should now work without any problem when invoked on a `gb` project.
|
||||||
|
* All command arguments are now properly escaped for shell invocation.
|
||||||
|
* Added the `-f` flag to :GoInstallBinaries command to support `git url.<base>.insteadOf` configuration
|
||||||
|
* Improve width and precision highlighting, such as `%s %5s %-5s %5.5f %.5f`
|
||||||
|
* Show an error if a region is not selected when `:GoFreeVars` is called
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
* Fix`:GoDef` for files containing spaces. We know escape the files before passing to `:GoDef`
|
||||||
|
* Fix `:GoFmt` not picking up the correct GOPATH when the fmt command was set to `goimports`
|
||||||
|
* Fix and simplify README.md, add Wiki reference
|
||||||
|
* Fixed tagbar integration to show correct imports.
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0.5 (May 26, 2015)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
* A new `:GoOracleScope` is added to change the oracle scope on-the-fly. It
|
||||||
|
accepts import paths as arguments. If no arguments are passed it prints the
|
||||||
|
current custom oracle scope. `:GoOracleScope` also supports completion of
|
||||||
|
import paths, so it's very fast and handy to use. `:GoOracleScope ""` clears
|
||||||
|
the current custom scope.
|
||||||
|
* A new `:GoPath` command that displays the current `GOPATH`. A path can be
|
||||||
|
passed to change the `GOPATH` (i.e `:GoPath ~/foo/src`). `:GoPath ""` clears
|
||||||
|
and resets the `GOPATH` to the initial value.
|
||||||
|
* A new "autodetect GOPATH" feature is added. This automatically detects if the
|
||||||
|
project is using `godep` or is under a `src` root directory which is not in
|
||||||
|
`GOPATH` and changes/modifies the `GOPATH` so all commands work based on this
|
||||||
|
GOPATH. What this means is, commands such as `:GoDef`, `:GoBuild`, etc.. will
|
||||||
|
include the Godeps folder. For example any go-to-definition via `:GoDef` will
|
||||||
|
jump to the source code inside Godeps. This is enabled by default, but can
|
||||||
|
disabled with `let g:go_autodetect_gopath = 0`. This new feature is also the
|
||||||
|
foundation for other tools such as `gb` or `wgo`.
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
* Improve `:GoFmt` (gofmt and goimports) speed. Now it's 2x faster than the previous implementation.
|
||||||
|
* Add Dispatch support for `:GoBuild` and `:GoRun`. For more info about
|
||||||
|
dispatch see https://github.com/tpope/vim-dispatch . By default it's
|
||||||
|
disabled, to enable it add `let g:go_dispatch_enabled = 1` to your vimrc.
|
||||||
|
* Add support for the bang `!` attribute for all `go` tool commands. What this
|
||||||
|
does it, if `:GoBuild` is called it will jump to the error. But `:GoBuild!`
|
||||||
|
will not jump to any error. This has the same behavior as the internal
|
||||||
|
`:make` command in vim. We had this feature already for `:GoBuild` and
|
||||||
|
`:GoRun`. But not for `:GoInstall`, `:GoTest`, etc.. Now all commands are
|
||||||
|
unified.
|
||||||
|
* Add autojump to error for `:GoInstall`.
|
||||||
|
* Add autowrite feature for `:GoInstall`, `:GoTestXXX` functions and `:GoVet`
|
||||||
|
* Support `git url.<base>.insteadOf` and custom import paths of binaries. This
|
||||||
|
improves the commands `:GoInstallBinaries` and `:GoUpdateBinaries`.
|
||||||
|
* Add support for highlighting go templates with `*.tmpl` extensions. Based on
|
||||||
|
the work from @cespare from https://github.com/cespare/vim-go-templates
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
* Fix clearing the status bar when `:GoErrCheck` is called
|
||||||
|
* Fix godocNotFound to not match 'os' pkg contents. This improves the command
|
||||||
|
`:GoDoc`
|
||||||
|
* Fix parsing and jumping to error locations when used Vim from a different
|
||||||
|
directory than the current buffer's directory
|
||||||
|
* Fix completion showing duplicates paths for completion results, such as
|
||||||
|
github.com/fatih/color and github.com/fatih/color/.
|
||||||
|
|
||||||
|
## 1.0.4 (Apr 28, 2015)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
|
||||||
|
* A new `:GoTestFunc` command (with appropriate
|
||||||
|
mappings) is added. Run tests function which surrounds the current cursor
|
||||||
|
location. Useful to test single tests.
|
||||||
|
* Highlight all Go operators. Previously not all
|
||||||
|
operators were highlighted. As previously, to highlight options, enable it
|
||||||
|
with by setting `g:go_highlight_operators` to 1 in your vimrc.
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* Improved certain `:GoDoc` usages to show a better error message
|
||||||
|
* Improved `:GoRename` to have a default value for rename input. Avoids retyping similar words.
|
||||||
|
* Synced with latest Oracle version. `callgraph` is removed.
|
||||||
|
* Removed our custom referrers mode. New version of oracle now displays the matching lines.
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
* Fixed the internal `executeInDir` function which was failing when ignorelist was not set properly.
|
||||||
|
* Fixed trailing slash for package completion with `:GoImport`
|
||||||
|
* Fixed paths in error list for Windows users.
|
||||||
|
* Fixed not showing "import cycle not allowed" error message when called `:GoBuild` or `:GoRun`
|
||||||
|
* Fixed users using vimproc requiring arguments to functions to be escaped.
|
||||||
|
* Fixed depth for test snippets
|
||||||
|
* Fixed neosnippet support loading snippet files the second time if necessary.
|
||||||
|
|
||||||
|
## 1.0.3 (Mar 7, 2015)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
* A new `:GoTestCompile` command (with appropriate mappings) is added. Useful to compile a test binary or show/fix compile errors in quickfix window
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
* `referrer` mode is improved to show referring lines in the quickfix window
|
||||||
|
* A new `errt` snippet is added, which expands to `if err != nil { t.Fatal(err) }`
|
||||||
|
* A new `errh` snippet is added, useful to be used in a `http.Handler`
|
||||||
|
* UltiSnips snippets are improved to take advance of Vim's `Visual` mode. For example selecting a block and typing `if` will create an if scope around the block.
|
||||||
|
* Cleanup README.md
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
* Fix trimming brackets if completion was invoked on a previous completion
|
||||||
|
* Fix Oracle scope settings. Added docs about usage.
|
||||||
|
* Fixed previously broken `var` and `vars` snippets
|
||||||
|
* Fix duplicate docs
|
||||||
|
* Fix fallback binary path for Windows users. The fallback mechanism is used to discover the necessary Go tools, such as `godef`, `gocode`, etc...
|
||||||
|
|
||||||
|
## 1.0.2 (Feb 17, 2015)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
|
||||||
|
* New snippets are added, mostly for testing ( [changes](https://github.com/fatih/vim-go/pull/321/files))
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* Enable all Oracle commands. Docs, mappings and commands are also added. It uses Quickfix list instead of a custom UI.
|
||||||
|
* Clarify installation process in Readme, add instructions for vim-plug, NeoBundle and manual.
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
* Fix shiftwidth parsing, it was broken in the previous release for old Vim versions
|
||||||
|
* Fix experimantal mode
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0.1 (Feb 9, 2015)
|
||||||
|
|
||||||
|
FEATURES:
|
||||||
|
|
||||||
|
* New feature to highlight build constraints (disabled by default)
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
* Updated godef import path
|
||||||
|
* Updated Readme for possible problems with `csh`
|
||||||
|
* Documentation for text objects are updated, typo fixes are merged
|
||||||
|
* If vimproc is installed, Windows users will use it for autocompletion
|
||||||
|
* Improve UltiSnips snippets to pick Visual selection (demo: http://quick.as/0dvigz5)
|
||||||
|
* Packages with extensions, like "gopkg.in/yaml.v2" can be now displayed
|
||||||
|
* Packages with different import paths, like "github.com/bitly/go-simplejson" can be now displayed
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
* Fatal errors are now parsed successfully and populated to quickfix list
|
||||||
|
* Shiftwidth is changed to use shiftwidth() function. Fixes usage with plugins like vim-sleuth and possible mis usage (like setting shiftwidth to zero)
|
||||||
|
* Added a new [Donation](https://github.com/fatih/vim-go#donations) section to Readme, for those who ask for it.
|
||||||
|
* Fix parsing of errcheck error syntax
|
||||||
|
* Fix consistency between Neosnippet and UltiSnips snippets
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0 (Dec 24, 2014)
|
||||||
|
|
||||||
|
We don't tag any changes or releases, so let's start with `1.0`. Our Windows
|
||||||
|
support is now in a good shape, tons of bugs are fixed, many new features and
|
||||||
|
improvements is being added and it's getting better with each day (thanks to
|
||||||
|
the community contributions).
|
||||||
|
|
||||||
|
## 0.0 (Mar 24, 2014)
|
||||||
|
|
||||||
|
Initial commit: https://github.com/fatih/vim-go/commit/78c5caa82c111c50e9c219f222d65b07694f8f5a
|
||||||
|
|
|
@ -59,6 +59,11 @@ Official documentation can be found under [doc/vim-go.txt](doc/vim-go.txt). You
|
||||||
```
|
```
|
||||||
:help vim-go
|
:help vim-go
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Depending on your installation, you may have to generate the plugin's [help
|
||||||
|
tags](https://github.com/vim/vim/blob/v8.0.0711/runtime/doc/helphelp.txt#L206-L227)
|
||||||
|
manually (eg. `:helptags ALL`).
|
||||||
|
|
||||||
We also have an [official vim-go
|
We also have an [official vim-go
|
||||||
tutorial](https://github.com/fatih/vim-go-tutorial).
|
tutorial](https://github.com/fatih/vim-go-tutorial).
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ function! go#def#Jump(mode) abort
|
||||||
let $GOPATH = old_gopath
|
let $GOPATH = old_gopath
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let command = printf("%s -f=%s -o=%s -t", bin_path, fname, go#util#OffsetCursor())
|
let command = printf("%s -f=%s -o=%s -t", go#util#Shellescape(bin_path),
|
||||||
|
\ go#util#Shellescape(fname), go#util#OffsetCursor())
|
||||||
let out = go#util#System(command)
|
let out = go#util#System(command)
|
||||||
if exists("l:tmpname")
|
if exists("l:tmpname")
|
||||||
call delete(l:tmpname)
|
call delete(l:tmpname)
|
||||||
|
@ -96,6 +97,7 @@ function! s:jump_to_declaration_cb(mode, bin_name, job, exit_status, data) abort
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call go#def#jump_to_declaration(a:data[0], a:mode, a:bin_name)
|
call go#def#jump_to_declaration(a:data[0], a:mode, a:bin_name)
|
||||||
|
call go#util#EchoSuccess(fnamemodify(a:data[0], ":t"))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#def#jump_to_declaration(out, mode, bin_name) abort
|
function! go#def#jump_to_declaration(out, mode, bin_name) abort
|
||||||
|
@ -153,9 +155,11 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if a:mode == "tab"
|
if a:mode == "tab"
|
||||||
let &switchbuf = "usetab"
|
let &switchbuf = "useopen,usetab,newtab"
|
||||||
if bufloaded(filename) == 0
|
if bufloaded(filename) == 0
|
||||||
tab split
|
tab split
|
||||||
|
else
|
||||||
|
let cmd = 'sbuf'
|
||||||
endif
|
endif
|
||||||
elseif a:mode == "split"
|
elseif a:mode == "split"
|
||||||
split
|
split
|
||||||
|
@ -164,7 +168,7 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" open the file and jump to line and column
|
" open the file and jump to line and column
|
||||||
exec cmd filename
|
exec cmd fnameescape(filename)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
call cursor(line, col)
|
call cursor(line, col)
|
||||||
|
|
|
@ -58,17 +58,21 @@ function! go#doc#OpenBrowser(...) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#doc#Open(newmode, mode, ...) abort
|
function! go#doc#Open(newmode, mode, ...) abort
|
||||||
|
" With argument: run "godoc [arg]".
|
||||||
if len(a:000)
|
if len(a:000)
|
||||||
" check if we have 'godoc' and use it automatically
|
|
||||||
let bin_path = go#path#CheckBinPath('godoc')
|
let bin_path = go#path#CheckBinPath('godoc')
|
||||||
if empty(bin_path)
|
if empty(bin_path)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let command = printf("%s %s", bin_path, join(a:000, ' '))
|
let command = printf("%s %s", go#util#Shellescape(bin_path), join(a:000, ' '))
|
||||||
let out = go#util#System(command)
|
let out = go#util#System(command)
|
||||||
|
" Without argument: run gogetdoc on cursor position.
|
||||||
else
|
else
|
||||||
let out = s:gogetdoc(0)
|
let out = s:gogetdoc(0)
|
||||||
|
if out == -1
|
||||||
|
return
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if go#util#ShellError() != 0
|
if go#util#ShellError() != 0
|
||||||
|
@ -137,7 +141,7 @@ function! s:gogetdoc(json) abort
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cmd = [bin_path]
|
let cmd = [go#util#Shellescape(bin_path)]
|
||||||
|
|
||||||
let offset = go#util#OffsetCursor()
|
let offset = go#util#OffsetCursor()
|
||||||
let fname = expand("%:p:gs!\\!/!")
|
let fname = expand("%:p:gs!\\!/!")
|
||||||
|
|
|
@ -69,7 +69,10 @@ function! go#fmt#Format(withGoimport) abort
|
||||||
let bin_name = "goimports"
|
let bin_name = "goimports"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let current_col = col('.')
|
||||||
let out = go#fmt#run(bin_name, l:tmpname, expand('%'))
|
let out = go#fmt#run(bin_name, l:tmpname, expand('%'))
|
||||||
|
let diff_offset = len(readfile(l:tmpname)) - line('$')
|
||||||
|
|
||||||
if go#util#ShellError() == 0
|
if go#util#ShellError() == 0
|
||||||
call go#fmt#update_file(l:tmpname, expand('%'))
|
call go#fmt#update_file(l:tmpname, expand('%'))
|
||||||
elseif g:go_fmt_fail_silently == 0
|
elseif g:go_fmt_fail_silently == 0
|
||||||
|
@ -95,6 +98,9 @@ function! go#fmt#Format(withGoimport) abort
|
||||||
" Restore our cursor/windows positions.
|
" Restore our cursor/windows positions.
|
||||||
call winrestview(l:curw)
|
call winrestview(l:curw)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" be smart and jump to the line the new statement was added/removed
|
||||||
|
call cursor(line('.') + diff_offset, current_col)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" update_file updates the target file with the given formatted source
|
" update_file updates the target file with the given formatted source
|
||||||
|
@ -116,15 +122,25 @@ function! go#fmt#update_file(source, target)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" reload buffer to reflect latest changes
|
" reload buffer to reflect latest changes
|
||||||
silent! edit!
|
silent edit!
|
||||||
|
|
||||||
let &fileformat = old_fileformat
|
let &fileformat = old_fileformat
|
||||||
let &syntax = &syntax
|
let &syntax = &syntax
|
||||||
|
|
||||||
|
|
||||||
|
" the title information was introduced with 7.4-2200
|
||||||
|
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
|
||||||
|
if !has('patch-7.4-2200')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
" clean up previous location list
|
" clean up previous location list
|
||||||
let l:listtype = "locationlist"
|
let l:list_title = getqflist({'title': 1})
|
||||||
|
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"
|
||||||
|
let l:listtype = go#list#Type("quickfix")
|
||||||
call go#list#Clean(l:listtype)
|
call go#list#Clean(l:listtype)
|
||||||
call go#list#Window(l:listtype)
|
call go#list#Window(l:listtype)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" run runs the gofmt/goimport command for the given source file and returns
|
" run runs the gofmt/goimport command for the given source file and returns
|
||||||
|
@ -166,6 +182,7 @@ function! s:fmt_cmd(bin_name, source, target)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" start constructing the command
|
" start constructing the command
|
||||||
|
let bin_path = go#util#Shellescape(bin_path)
|
||||||
let cmd = [bin_path]
|
let cmd = [bin_path]
|
||||||
call add(cmd, "-w")
|
call add(cmd, "-w")
|
||||||
|
|
||||||
|
@ -228,7 +245,7 @@ endfunction
|
||||||
" show_errors opens a location list and shows the given errors. If the given
|
" show_errors opens a location list and shows the given errors. If the given
|
||||||
" errors is empty, it closes the the location list
|
" errors is empty, it closes the the location list
|
||||||
function! s:show_errors(errors) abort
|
function! s:show_errors(errors) abort
|
||||||
let l:listtype = go#list#Type("locationlist")
|
let l:listtype = go#list#Type("quickfix")
|
||||||
if !empty(a:errors)
|
if !empty(a:errors)
|
||||||
call go#list#Populate(l:listtype, a:errors, 'Format')
|
call go#list#Populate(l:listtype, a:errors, 'Format')
|
||||||
echohl Error | echomsg "Gofmt returned error" | echohl None
|
echohl Error | echomsg "Gofmt returned error" | echohl None
|
||||||
|
|
|
@ -33,7 +33,7 @@ function! go#impl#Impl(...) abort
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let result = go#util#System(printf("%s '%s' '%s'", binpath, recv, iface))
|
let result = go#util#System(join(go#util#Shelllist([binpath, recv, iface], ' ')))
|
||||||
if go#util#ShellError() != 0
|
if go#util#ShellError() != 0
|
||||||
call go#util#EchoError(result)
|
call go#util#EchoError(result)
|
||||||
return
|
return
|
||||||
|
|
|
@ -31,10 +31,6 @@ function go#job#Spawn(args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function cbs.exit_cb(job, exitval) dict
|
function cbs.exit_cb(job, exitval) dict
|
||||||
if has_key(self, 'custom_cb')
|
|
||||||
call self.custom_cb(a:job, a:exitval, self.messages)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has_key(self, 'error_info_cb')
|
if has_key(self, 'error_info_cb')
|
||||||
call self.error_info_cb(a:job, a:exitval, self.messages)
|
call self.error_info_cb(a:job, a:exitval, self.messages)
|
||||||
endif
|
endif
|
||||||
|
@ -47,6 +43,10 @@ function go#job#Spawn(args)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if has_key(self, 'custom_cb')
|
||||||
|
call self.custom_cb(a:job, a:exitval, self.messages)
|
||||||
|
endif
|
||||||
|
|
||||||
let l:listtype = go#list#Type("quickfix")
|
let l:listtype = go#list#Type("quickfix")
|
||||||
if a:exitval == 0
|
if a:exitval == 0
|
||||||
call go#list#Clean(l:listtype)
|
call go#list#Clean(l:listtype)
|
||||||
|
|
|
@ -10,7 +10,8 @@ function! go#keyify#Keyify()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Get result of command as json, that contains `start`, `end` and `replacement`
|
" Get result of command as json, that contains `start`, `end` and `replacement`
|
||||||
let command = printf("%s -json %s:#%s", bin_path, fname, go#util#OffsetCursor())
|
let command = printf("%s -json %s:#%s", go#util#Shellescape(bin_path),
|
||||||
|
\ go#util#Shellescape(fname), go#util#OffsetCursor())
|
||||||
let output = go#util#System(command)
|
let output = go#util#System(command)
|
||||||
silent! let result = json_decode(output)
|
silent! let result = json_decode(output)
|
||||||
|
|
||||||
|
|
|
@ -121,9 +121,10 @@ function! go#lint#Golint(...) abort
|
||||||
if empty(bin_path)
|
if empty(bin_path)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
let bin_path = go#util#Shellescape(bin_path)
|
||||||
|
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
let out = go#util#System(bin_path)
|
let out = go#util#System(bin_path . " " . go#util#Shellescape(go#package#ImportPath()))
|
||||||
else
|
else
|
||||||
let out = go#util#System(bin_path . " " . go#util#Shelljoin(a:000))
|
let out = go#util#System(bin_path . " " . go#util#Shelljoin(a:000))
|
||||||
endif
|
endif
|
||||||
|
@ -146,9 +147,9 @@ function! go#lint#Vet(bang, ...) abort
|
||||||
call go#cmd#autowrite()
|
call go#cmd#autowrite()
|
||||||
echon "vim-go: " | echohl Identifier | echon "calling vet..." | echohl None
|
echon "vim-go: " | echohl Identifier | echon "calling vet..." | echohl None
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
let out = go#tool#ExecuteInDir('go vet')
|
let out = go#util#System('go vet ' . go#util#Shellescape(go#package#ImportPath()))
|
||||||
else
|
else
|
||||||
let out = go#tool#ExecuteInDir('go tool vet ' . go#util#Shelljoin(a:000))
|
let out = go#util#System('go tool vet ' . go#util#Shelljoin(a:000))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:listtype = "quickfix"
|
let l:listtype = "quickfix"
|
||||||
|
@ -188,7 +189,7 @@ function! go#lint#Errcheck(...) abort
|
||||||
echon "vim-go: " | echohl Identifier | echon "errcheck analysing ..." | echohl None
|
echon "vim-go: " | echohl Identifier | echon "errcheck analysing ..." | echohl None
|
||||||
redraw
|
redraw
|
||||||
|
|
||||||
let command = bin_path . ' -abspath ' . import_path
|
let command = go#util#Shellescape(bin_path) . ' -abspath ' . import_path
|
||||||
let out = go#tool#ExecuteInDir(command)
|
let out = go#tool#ExecuteInDir(command)
|
||||||
|
|
||||||
let l:listtype = "quickfix"
|
let l:listtype = "quickfix"
|
||||||
|
|
|
@ -3,8 +3,10 @@ if !exists("g:go_list_type")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Window opens the list with the given height up to 10 lines maximum.
|
" Window opens the list with the given height up to 10 lines maximum.
|
||||||
" Otherwise g:go_loclist_height is used. If no or zero height is given it
|
" Otherwise g:go_loclist_height is used.
|
||||||
" closes the window
|
"
|
||||||
|
" If no or zero height is given it closes the window by default.
|
||||||
|
" To prevent this, set g:go_list_autoclose = 0
|
||||||
function! go#list#Window(listtype, ...) abort
|
function! go#list#Window(listtype, ...) abort
|
||||||
let l:listtype = go#list#Type(a:listtype)
|
let l:listtype = go#list#Type(a:listtype)
|
||||||
" we don't use lwindow to close the location list as we need also the
|
" we don't use lwindow to close the location list as we need also the
|
||||||
|
@ -13,11 +15,14 @@ function! go#list#Window(listtype, ...) abort
|
||||||
" location list increases/decreases, cwindow will not resize when a new
|
" location list increases/decreases, cwindow will not resize when a new
|
||||||
" updated height is passed. lopen in the other hand resizes the screen.
|
" updated height is passed. lopen in the other hand resizes the screen.
|
||||||
if !a:0 || a:1 == 0
|
if !a:0 || a:1 == 0
|
||||||
|
let autoclose_window = get(g:, 'go_list_autoclose', 1)
|
||||||
|
if autoclose_window
|
||||||
if l:listtype == "locationlist"
|
if l:listtype == "locationlist"
|
||||||
lclose
|
lclose
|
||||||
else
|
else
|
||||||
cclose
|
cclose
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,16 @@ function! go#path#Detect() abort
|
||||||
" fetched from a customizable list. The user should define any new package
|
" fetched from a customizable list. The user should define any new package
|
||||||
" management tool by it's own.
|
" management tool by it's own.
|
||||||
|
|
||||||
" src folder outside $GOPATH
|
" src folders outside $GOPATH
|
||||||
let src_root = finddir("src", current_dir .";")
|
let src_roots = finddir("src", current_dir .";", -1)
|
||||||
|
|
||||||
|
" for cases like GOPATH/src/foo/src/bar, pick up GOPATH/src instead of
|
||||||
|
" GOPATH/src/foo/src
|
||||||
|
let src_root = ""
|
||||||
|
if len(src_roots) > 0
|
||||||
|
let src_root = src_roots[-1]
|
||||||
|
endif
|
||||||
|
|
||||||
if !empty(src_root)
|
if !empty(src_root)
|
||||||
let src_path = fnamemodify(src_root, ':p:h:h') . go#util#PathSep()
|
let src_path = fnamemodify(src_root, ':p:h:h') . go#util#PathSep()
|
||||||
|
|
||||||
|
@ -129,6 +137,9 @@ function! go#path#BinPath() abort
|
||||||
let bin_path = $GOBIN
|
let bin_path = $GOBIN
|
||||||
else
|
else
|
||||||
let go_paths = split(go#path#Default(), go#util#PathListSep())
|
let go_paths = split(go#path#Default(), go#util#PathListSep())
|
||||||
|
if len(go_paths) == 0
|
||||||
|
return "" "nothing found
|
||||||
|
endif
|
||||||
let bin_path = expand(go_paths[0] . "/bin/")
|
let bin_path = expand(go_paths[0] . "/bin/")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -157,6 +168,11 @@ function! go#path#CheckBinPath(binpath) abort
|
||||||
let binpath = exepath(binpath)
|
let binpath = exepath(binpath)
|
||||||
endif
|
endif
|
||||||
let $PATH = old_path
|
let $PATH = old_path
|
||||||
|
|
||||||
|
if go#util#IsUsingCygwinShell() == 1
|
||||||
|
return go#path#CygwinPath(binpath)
|
||||||
|
endif
|
||||||
|
|
||||||
return binpath
|
return binpath
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -173,18 +189,15 @@ function! go#path#CheckBinPath(binpath) abort
|
||||||
|
|
||||||
let $PATH = old_path
|
let $PATH = old_path
|
||||||
|
|
||||||
" When you are using:
|
if go#util#IsUsingCygwinShell() == 1
|
||||||
" 1) Windows system
|
return go#path#CygwinPath(a:binpath)
|
||||||
" 2) Has cygpath executable
|
|
||||||
" 3) Use *sh* as 'shell'
|
|
||||||
"
|
|
||||||
" This converts your <path> to $(cygpath '<path>') to make cygwin working in
|
|
||||||
" shell of cygwin way
|
|
||||||
if go#util#IsWin() && executable('cygpath') && &shell !~ '.*sh.*'
|
|
||||||
return printf("$(cygpath '%s')", a:bin_path)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return go_bin_path . go#util#PathSep() . basename
|
return go_bin_path . go#util#PathSep() . basename
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#path#CygwinPath(path)
|
||||||
|
return substitute(a:path, '\\', '/', "g")
|
||||||
|
endfunction
|
||||||
|
|
||||||
" vim: sw=2 ts=2 et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
|
" mapped to :GoAddTags
|
||||||
function! go#tags#Add(start, end, count, ...) abort
|
function! go#tags#Add(start, end, count, ...) abort
|
||||||
let fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
|
let fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
|
||||||
if &modified
|
|
||||||
" Write current unsaved buffer to a temp file and use the modified content
|
|
||||||
let l:tmpname = tempname()
|
|
||||||
call writefile(getline(1, '$'), l:tmpname)
|
|
||||||
let fname = l:tmpname
|
|
||||||
endif
|
|
||||||
|
|
||||||
let offset = 0
|
let offset = 0
|
||||||
if a:count == -1
|
if a:count == -1
|
||||||
let offset = go#util#OffsetCursor()
|
let offset = go#util#OffsetCursor()
|
||||||
|
@ -14,22 +8,11 @@ function! go#tags#Add(start, end, count, ...) abort
|
||||||
|
|
||||||
let test_mode = 0
|
let test_mode = 0
|
||||||
call call("go#tags#run", [a:start, a:end, offset, "add", fname, test_mode] + a:000)
|
call call("go#tags#run", [a:start, a:end, offset, "add", fname, test_mode] + a:000)
|
||||||
|
|
||||||
" if exists, delete it as we don't need it anymore
|
|
||||||
if exists("l:tmpname")
|
|
||||||
call delete(l:tmpname)
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" mapped to :GoRemoveTags
|
||||||
function! go#tags#Remove(start, end, count, ...) abort
|
function! go#tags#Remove(start, end, count, ...) abort
|
||||||
let fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
|
let fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
|
||||||
if &modified
|
|
||||||
" Write current unsaved buffer to a temp file and use the modified content
|
|
||||||
let l:tmpname = tempname()
|
|
||||||
call writefile(getline(1, '$'), l:tmpname)
|
|
||||||
let fname = l:tmpname
|
|
||||||
endif
|
|
||||||
|
|
||||||
let offset = 0
|
let offset = 0
|
||||||
if a:count == -1
|
if a:count == -1
|
||||||
let offset = go#util#OffsetCursor()
|
let offset = go#util#OffsetCursor()
|
||||||
|
@ -37,11 +20,6 @@ function! go#tags#Remove(start, end, count, ...) abort
|
||||||
|
|
||||||
let test_mode = 0
|
let test_mode = 0
|
||||||
call call("go#tags#run", [a:start, a:end, offset, "remove", fname, test_mode] + a:000)
|
call call("go#tags#run", [a:start, a:end, offset, "remove", fname, test_mode] + a:000)
|
||||||
|
|
||||||
" if exists, delete it as we don't need it anymore
|
|
||||||
if exists("l:tmpname")
|
|
||||||
call delete(l:tmpname)
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" run runs gomodifytag. This is an internal test so we can test it
|
" run runs gomodifytag. This is an internal test so we can test it
|
||||||
|
@ -49,6 +27,10 @@ function! go#tags#run(start, end, offset, mode, fname, test_mode, ...) abort
|
||||||
" do not split this into multiple lines, somehow tests fail in that case
|
" do not split this into multiple lines, somehow tests fail in that case
|
||||||
let args = {'mode': a:mode,'start': a:start,'end': a:end,'offset': a:offset,'fname': a:fname,'cmd_args': a:000}
|
let args = {'mode': a:mode,'start': a:start,'end': a:end,'offset': a:offset,'fname': a:fname,'cmd_args': a:000}
|
||||||
|
|
||||||
|
if &modified
|
||||||
|
let args["modified"] = 1
|
||||||
|
endif
|
||||||
|
|
||||||
let result = s:create_cmd(args)
|
let result = s:create_cmd(args)
|
||||||
if has_key(result, 'err')
|
if has_key(result, 'err')
|
||||||
call go#util#EchoError(result.err)
|
call go#util#EchoError(result.err)
|
||||||
|
@ -57,8 +39,15 @@ function! go#tags#run(start, end, offset, mode, fname, test_mode, ...) abort
|
||||||
|
|
||||||
let command = join(result.cmd, " ")
|
let command = join(result.cmd, " ")
|
||||||
|
|
||||||
call go#cmd#autowrite()
|
if &modified
|
||||||
|
let filename = expand("%:p:gs!\\!/!")
|
||||||
|
let content = join(go#util#GetLines(), "\n")
|
||||||
|
let in = filename . "\n" . strlen(content) . "\n" . content
|
||||||
|
let out = go#util#System(command, in)
|
||||||
|
else
|
||||||
let out = go#util#System(command)
|
let out = go#util#System(command)
|
||||||
|
endif
|
||||||
|
|
||||||
if go#util#ShellError() != 0
|
if go#util#ShellError() != 0
|
||||||
call go#util#EchoError(out)
|
call go#util#EchoError(out)
|
||||||
return
|
return
|
||||||
|
@ -103,6 +92,16 @@ func s:write_out(out) abort
|
||||||
call setline(line, lines[index])
|
call setline(line, lines[index])
|
||||||
let index += 1
|
let index += 1
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
if has_key(result, 'errors')
|
||||||
|
let l:winnr = winnr()
|
||||||
|
let l:listtype = go#list#Type("quickfix")
|
||||||
|
call go#list#ParseFormat(l:listtype, "%f:%l:%c:%m", result['errors'], "gomodifytags")
|
||||||
|
call go#list#Window(l:listtype, len(result['errors']))
|
||||||
|
|
||||||
|
"prevent jumping to quickfix list
|
||||||
|
exe l:winnr . "wincmd w"
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,6 +115,7 @@ func s:create_cmd(args) abort
|
||||||
if empty(bin_path)
|
if empty(bin_path)
|
||||||
return {'err': "gomodifytags does not exist"}
|
return {'err': "gomodifytags does not exist"}
|
||||||
endif
|
endif
|
||||||
|
let bin_path = go#util#Shellescape(bin_path)
|
||||||
|
|
||||||
let l:start = a:args.start
|
let l:start = a:args.start
|
||||||
let l:end = a:args.end
|
let l:end = a:args.end
|
||||||
|
@ -127,9 +127,13 @@ func s:create_cmd(args) abort
|
||||||
" start constructing the command
|
" start constructing the command
|
||||||
let cmd = [bin_path]
|
let cmd = [bin_path]
|
||||||
call extend(cmd, ["-format", "json"])
|
call extend(cmd, ["-format", "json"])
|
||||||
call extend(cmd, ["-file", a:args.fname])
|
call extend(cmd, ["-file", go#util#Shellescape(a:args.fname)])
|
||||||
call extend(cmd, ["-transform", l:modifytags_transform])
|
call extend(cmd, ["-transform", l:modifytags_transform])
|
||||||
|
|
||||||
|
if has_key(a:args, "modified")
|
||||||
|
call add(cmd, "-modified")
|
||||||
|
endif
|
||||||
|
|
||||||
if l:offset != 0
|
if l:offset != 0
|
||||||
call extend(cmd, ["-offset", l:offset])
|
call extend(cmd, ["-offset", l:offset])
|
||||||
else
|
else
|
||||||
|
|
|
@ -21,7 +21,7 @@ function! go#template#create() abort
|
||||||
let l:template_file = get(g:, 'go_template_file', "hello_world.go")
|
let l:template_file = get(g:, 'go_template_file', "hello_world.go")
|
||||||
endif
|
endif
|
||||||
let l:template_path = go#util#Join(l:root_dir, "templates", l:template_file)
|
let l:template_path = go#util#Join(l:root_dir, "templates", l:template_file)
|
||||||
exe '0r ' . fnameescape(l:template_path)
|
silent exe '0r ' . fnameescape(l:template_path)
|
||||||
elseif l:package_name == -1 && l:go_template_use_pkg == 1
|
elseif l:package_name == -1 && l:go_template_use_pkg == 1
|
||||||
" cwd is now the dir of the package
|
" cwd is now the dir of the package
|
||||||
let l:path = fnamemodify(getcwd(), ':t')
|
let l:path = fnamemodify(getcwd(), ':t')
|
||||||
|
@ -33,9 +33,6 @@ function! go#template#create() abort
|
||||||
endif
|
endif
|
||||||
$delete _
|
$delete _
|
||||||
|
|
||||||
" Remove the '... [New File]' message line from the command line
|
|
||||||
echon
|
|
||||||
|
|
||||||
execute cd . fnameescape(dir)
|
execute cd . fnameescape(dir)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,42 @@
|
||||||
function! go#tool#Files() abort
|
" From "go list -h".
|
||||||
if go#util#IsWin()
|
function! go#tool#ValidFiles(...)
|
||||||
let format = '{{range $f := .GoFiles}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}'
|
let l:list = ["GoFiles", "CgoFiles", "IgnoredGoFiles", "CFiles", "CXXFiles",
|
||||||
else
|
\ "MFiles", "HFiles", "FFiles", "SFiles", "SwigFiles", "SwigCXXFiles",
|
||||||
let format = "{{range $f := .GoFiles}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}"
|
\ "SysoFiles", "TestGoFiles", "XTestGoFiles"]
|
||||||
|
|
||||||
|
" Used as completion
|
||||||
|
if len(a:000) > 0
|
||||||
|
let l:list = filter(l:list, 'strpart(v:val, 0, len(a:1)) == a:1')
|
||||||
endif
|
endif
|
||||||
let command = 'go list -f '.shellescape(format)
|
|
||||||
let out = go#tool#ExecuteInDir(command)
|
return l:list
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#tool#Files(...) abort
|
||||||
|
if len(a:000) > 0
|
||||||
|
let source_files = a:000
|
||||||
|
else
|
||||||
|
let source_files = ['GoFiles']
|
||||||
|
endif
|
||||||
|
|
||||||
|
let combined = ''
|
||||||
|
for sf in source_files
|
||||||
|
" Strip dot in case people used ":GoFiles .GoFiles".
|
||||||
|
let sf = substitute(sf, '^\.', '', '')
|
||||||
|
|
||||||
|
" Make sure the passed options are valid.
|
||||||
|
if index(go#tool#ValidFiles(), sf) == -1
|
||||||
|
echoerr "unknown source file variable: " . sf
|
||||||
|
endif
|
||||||
|
|
||||||
|
if go#util#IsWin()
|
||||||
|
let combined .= '{{range $f := .' . sf . '}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}'
|
||||||
|
else
|
||||||
|
let combined .= "{{range $f := ." . sf . "}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}"
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
let out = go#tool#ExecuteInDir('go list -f ' . shellescape(combined))
|
||||||
return split(out, '\n')
|
return split(out, '\n')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,14 @@ function! go#util#IsWin() abort
|
||||||
return 0
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Checks if using:
|
||||||
|
" 1) Windows system,
|
||||||
|
" 2) And has cygpath executable,
|
||||||
|
" 3) And uses *sh* as 'shell'
|
||||||
|
function! go#util#IsUsingCygwinShell()
|
||||||
|
return go#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#util#has_job() abort
|
function! go#util#has_job() abort
|
||||||
" job was introduced in 7.4.xxx however there are multiple bug fixes and one
|
" job was introduced in 7.4.xxx however there are multiple bug fixes and one
|
||||||
" of the latest is 8.0.0087 which is required for a stable async API.
|
" of the latest is 8.0.0087 which is required for a stable async API.
|
||||||
|
|
|
@ -167,7 +167,8 @@ COMMANDS *go-commands*
|
||||||
*:GoLint*
|
*:GoLint*
|
||||||
:GoLint [packages]
|
:GoLint [packages]
|
||||||
|
|
||||||
Run golint for the current directory, or for given packages.
|
Run golint for the directory under your current file, or for the given
|
||||||
|
packages.
|
||||||
|
|
||||||
*:GoDoc*
|
*:GoDoc*
|
||||||
:GoDoc [word]
|
:GoDoc [word]
|
||||||
|
@ -436,18 +437,22 @@ CTRL-t
|
||||||
Check for unchecked errors in you current package. Errors are populated in
|
Check for unchecked errors in you current package. Errors are populated in
|
||||||
the quickfix window.
|
the quickfix window.
|
||||||
|
|
||||||
You may optionally pass any valid errcheck flags/options. For a full list
|
You may optionally pass any valid errcheck flags/options. See
|
||||||
please see `errcheck -h`.
|
`errcheck -h` for a full list.
|
||||||
|
|
||||||
*:GoFiles*
|
*:GoFiles*
|
||||||
:GoFiles
|
:GoFiles [source_files]
|
||||||
|
|
||||||
Show source files that depends for the current package
|
Show source files for the current package. The [source_files] specifies
|
||||||
|
which file types to list. See the "// Source files" section of
|
||||||
|
`go list -h` for possible values; multiple values are accepted.
|
||||||
|
Command-line completion also works for this command.
|
||||||
|
The default is to use `GoFiles` if no arguments are given.
|
||||||
|
|
||||||
*:GoDeps*
|
*:GoDeps*
|
||||||
:GoDeps
|
:GoDeps
|
||||||
|
|
||||||
Show dependencies for the current package
|
Show dependencies for the current package.
|
||||||
|
|
||||||
*:GoInstallBinaries*
|
*:GoInstallBinaries*
|
||||||
:GoInstallBinaries
|
:GoInstallBinaries
|
||||||
|
@ -1129,7 +1134,7 @@ The dictionary version allows you to define options for multiple binaries:
|
||||||
<
|
<
|
||||||
*'g:go_fmt_fail_silently'*
|
*'g:go_fmt_fail_silently'*
|
||||||
|
|
||||||
Use this option to disable showing a location list when |'g:go_fmt_command'|
|
Use this option to disable showing a quickfix list when |'g:go_fmt_command'|
|
||||||
fails. By default the location list is shown. >
|
fails. By default the location list is shown. >
|
||||||
|
|
||||||
let g:go_fmt_fail_silently = 0
|
let g:go_fmt_fail_silently = 0
|
||||||
|
@ -1163,7 +1168,7 @@ Maximum height for the GoDoc window created with |:GoDoc|. Default is 20. >
|
||||||
|
|
||||||
Use this option to define the command to be used for |:GoDef|. By default
|
Use this option to define the command to be used for |:GoDef|. By default
|
||||||
`guru` is being used as it covers all edge cases. But one might also use
|
`guru` is being used as it covers all edge cases. But one might also use
|
||||||
`godef` as it's more faster. Current valid options are: `[guru, godef]` >
|
`godef` as it's faster. Current valid options are: `[guru, godef]` >
|
||||||
|
|
||||||
let g:go_def_mode = 'guru'
|
let g:go_def_mode = 'guru'
|
||||||
<
|
<
|
||||||
|
@ -1419,6 +1424,16 @@ Supported values are "", "quickfix", and "locationlist". >
|
||||||
|
|
||||||
let g:go_list_type = ""
|
let g:go_list_type = ""
|
||||||
<
|
<
|
||||||
|
|
||||||
|
*'g:go_list_autoclose'*
|
||||||
|
|
||||||
|
Specifies whether the quickfix/location list should be closed automatically
|
||||||
|
in the absence of errors. The default value is 1.
|
||||||
|
If you prefer to keep a long running error window open, you can disable
|
||||||
|
this by setting the value to 0.
|
||||||
|
>
|
||||||
|
let g:go_list_autoclose = 1
|
||||||
|
<
|
||||||
*'g:go_asmfmt_autosave'*
|
*'g:go_asmfmt_autosave'*
|
||||||
|
|
||||||
Use this option to auto |:AsmFmt| on save. By default it's disabled. >
|
Use this option to auto |:AsmFmt| on save. By default it's disabled. >
|
||||||
|
@ -1574,7 +1589,6 @@ default it's 60 seconds. Must be in milliseconds.
|
||||||
>
|
>
|
||||||
let g:go_statusline_duration = 60000
|
let g:go_statusline_duration = 60000
|
||||||
<
|
<
|
||||||
|
|
||||||
*'g:go_addtags_transform'*
|
*'g:go_addtags_transform'*
|
||||||
|
|
||||||
Sets the `transform` option for `gomodifytags` when using |:GoAddTags| or if
|
Sets the `transform` option for `gomodifytags` when using |:GoAddTags| or if
|
||||||
|
@ -1598,6 +1612,28 @@ By default "snakecase" is used. Current values are: ["snakecase",
|
||||||
>
|
>
|
||||||
let g:go_addtags_transform = 'snakecase'
|
let g:go_addtags_transform = 'snakecase'
|
||||||
<
|
<
|
||||||
|
*'g:go_fold_enable'*
|
||||||
|
|
||||||
|
Control syntax-based folding which takes effect when 'foldmethod' is set to
|
||||||
|
`syntax`.
|
||||||
|
You can enable specific fold regions by setting an array. Possible values are:
|
||||||
|
|
||||||
|
- "block" `{` .. `}` blocks.
|
||||||
|
- "import" `import` block.
|
||||||
|
- "varconst" `var` and `const` blocks.
|
||||||
|
|
||||||
|
By default they're all enabled:
|
||||||
|
>
|
||||||
|
let g:go_fold_enable = ['block', 'import', 'varconst']
|
||||||
|
<
|
||||||
|
Enable folding of only imports:
|
||||||
|
>
|
||||||
|
let g:go_fold_enable = ['import']
|
||||||
|
<
|
||||||
|
Disable everything (same as not setting 'foldmethod' to `syntax`):
|
||||||
|
>
|
||||||
|
let g:go_fold_enable = []
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
DEVELOPMENT *go-development*
|
DEVELOPMENT *go-development*
|
||||||
|
@ -1669,6 +1705,25 @@ example sometimes code.google.com times out. To test, just execute a simple
|
||||||
You'll see a more detailed error. If this works, vim-go will work too.
|
You'll see a more detailed error. If this works, vim-go will work too.
|
||||||
|
|
||||||
|
|
||||||
|
I want to use a different binary name than "go", can I do this?~
|
||||||
|
|
||||||
|
There is no way to directly configure the binary name; but you can use a
|
||||||
|
wrapper script; for example if you would like to run `goapp` instead of `go`:
|
||||||
|
|
||||||
|
1. In `~/gobin/go` (remember to make it executable):
|
||||||
|
>
|
||||||
|
#!/bin/sh
|
||||||
|
# Remove gobin from PATH and run goapp.
|
||||||
|
PATH=${PATH#$HOME/gobin} goapp "$@"
|
||||||
|
<
|
||||||
|
2. Start Vim with `~/gobin` as the first `PATH` entry so it will use the
|
||||||
|
wrapper script:
|
||||||
|
>
|
||||||
|
PATH="$HOME/gobin/:$PATH" vim
|
||||||
|
<
|
||||||
|
Alternatively you you could set `$PATH` in your vimrc with an |:autocmd|.
|
||||||
|
|
||||||
|
|
||||||
How do I use vim-go with syntastic?~
|
How do I use vim-go with syntastic?~
|
||||||
|
|
||||||
Sometimes when using both `vim-go` and `syntastic` Vim will start lagging
|
Sometimes when using both `vim-go` and `syntastic` Vim will start lagging
|
||||||
|
|
|
@ -23,7 +23,7 @@ command! -nargs=* -range GoAddTags call go#tags#Add(<line1>, <line2>, <count>, <
|
||||||
command! -nargs=* -range GoRemoveTags call go#tags#Remove(<line1>, <line2>, <count>, <f-args>)
|
command! -nargs=* -range GoRemoveTags call go#tags#Remove(<line1>, <line2>, <count>, <f-args>)
|
||||||
|
|
||||||
" -- tool
|
" -- tool
|
||||||
command! -nargs=0 GoFiles echo go#tool#Files()
|
command! -nargs=* -complete=customlist,go#tool#ValidFiles GoFiles echo go#tool#Files(<f-args>)
|
||||||
command! -nargs=0 GoDeps echo go#tool#Deps()
|
command! -nargs=0 GoDeps echo go#tool#Deps()
|
||||||
command! -nargs=* GoInfo call go#tool#Info(0)
|
command! -nargs=* GoInfo call go#tool#Info(0)
|
||||||
command! -nargs=0 GoAutoTypeInfoToggle call go#complete#ToggleAutoTypeInfo()
|
command! -nargs=0 GoAutoTypeInfoToggle call go#complete#ToggleAutoTypeInfo()
|
||||||
|
|
|
@ -89,12 +89,32 @@ if !exists("g:go_highlight_generate_tags")
|
||||||
let g:go_highlight_generate_tags = 0
|
let g:go_highlight_generate_tags = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:fold_block = 1
|
||||||
|
let s:fold_import = 1
|
||||||
|
let s:fold_varconst = 1
|
||||||
|
if exists("g:go_fold_enable")
|
||||||
|
if index(g:go_fold_enable, 'block') == -1
|
||||||
|
let s:fold_block = 0
|
||||||
|
endif
|
||||||
|
if index(g:go_fold_enable, 'import') == -1
|
||||||
|
let s:fold_import = 0
|
||||||
|
endif
|
||||||
|
if index(g:go_fold_enable, 'varconst') == -1
|
||||||
|
let s:fold_varconst = 0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn keyword goDirective package import
|
syn keyword goPackage package
|
||||||
syn keyword goDeclaration var const
|
syn keyword goImport import contained
|
||||||
|
syn keyword goVar var contained
|
||||||
|
syn keyword goConst const contained
|
||||||
|
|
||||||
hi def link goDirective Statement
|
hi def link goPackage Statement
|
||||||
|
hi def link goImport Statement
|
||||||
|
hi def link goVar Keyword
|
||||||
|
hi def link goConst Keyword
|
||||||
hi def link goDeclaration Keyword
|
hi def link goDeclaration Keyword
|
||||||
|
|
||||||
" Keywords within functions
|
" Keywords within functions
|
||||||
|
@ -189,8 +209,35 @@ syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=
|
||||||
hi def link goCharacter Character
|
hi def link goCharacter Character
|
||||||
|
|
||||||
" Regions
|
" Regions
|
||||||
syn region goBlock start="{" end="}" transparent fold
|
|
||||||
syn region goParen start='(' end=')' transparent
|
syn region goParen start='(' end=')' transparent
|
||||||
|
if s:fold_block
|
||||||
|
syn region goBlock start="{" end="}" transparent fold
|
||||||
|
else
|
||||||
|
syn region goBlock start="{" end="}" transparent
|
||||||
|
endif
|
||||||
|
|
||||||
|
" import
|
||||||
|
if s:fold_import
|
||||||
|
syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment
|
||||||
|
else
|
||||||
|
syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment
|
||||||
|
endif
|
||||||
|
|
||||||
|
" var, const
|
||||||
|
if s:fold_varconst
|
||||||
|
syn region goVar start='var (' end='^\s*)$' transparent fold
|
||||||
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
|
||||||
|
syn region goConst start='const (' end='^\s*)$' transparent fold
|
||||||
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
|
||||||
|
else
|
||||||
|
syn region goVar start='var (' end='^\s*)$' transparent
|
||||||
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
|
||||||
|
syn region goConst start='const (' end='^\s*)$' transparent
|
||||||
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Single-line var, const, and import.
|
||||||
|
syn match goSingleDecl /\(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
||||||
|
|
||||||
" Integers
|
" Integers
|
||||||
syn match goDecimalInt "\<-\=\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
syn match goDecimalInt "\<-\=\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
||||||
|
@ -321,7 +368,7 @@ hi def link goField Identifier
|
||||||
|
|
||||||
" Structs & Interfaces;
|
" Structs & Interfaces;
|
||||||
if g:go_highlight_types != 0
|
if g:go_highlight_types != 0
|
||||||
syn match goTypeConstructor /\<\w\+{\@=/he=e-1
|
syn match goTypeConstructor /\<\w\+{\@=/
|
||||||
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
||||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
||||||
syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl
|
syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl
|
||||||
|
|
|
@ -100,6 +100,17 @@ function! multiple_cursors#get_latency_debug_file()
|
||||||
return s:latency_debug_file
|
return s:latency_debug_file
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:fire_pre_triggers()
|
||||||
|
if !s:before_function_called
|
||||||
|
doautocmd User MultipleCursorsPre
|
||||||
|
if exists('*Multiple_cursors_before')
|
||||||
|
exe "call Multiple_cursors_before()"
|
||||||
|
endif
|
||||||
|
let s:before_function_called = 1
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Creates a new cursor. Different logic applies depending on the mode the user
|
" Creates a new cursor. Different logic applies depending on the mode the user
|
||||||
" is in and the current state of the buffer.
|
" is in and the current state of the buffer.
|
||||||
" 1. In normal mode, a new cursor is created at the end of the word under Vim's
|
" 1. In normal mode, a new cursor is created at the end of the word under Vim's
|
||||||
|
@ -111,13 +122,7 @@ endfunction
|
||||||
" attempted to be created at the next occurrence of the visual selection
|
" attempted to be created at the next occurrence of the visual selection
|
||||||
function! multiple_cursors#new(mode, word_boundary)
|
function! multiple_cursors#new(mode, word_boundary)
|
||||||
" Call before function if exists only once until it is canceled (<Esc>)
|
" Call before function if exists only once until it is canceled (<Esc>)
|
||||||
if !s:before_function_called
|
call s:fire_pre_triggers()
|
||||||
doautocmd User MultipleCursorsPre
|
|
||||||
if exists('*Multiple_cursors_before')
|
|
||||||
exe "call Multiple_cursors_before()"
|
|
||||||
endif
|
|
||||||
let s:before_function_called = 1
|
|
||||||
endif
|
|
||||||
let s:use_word_boundary = a:word_boundary
|
let s:use_word_boundary = a:word_boundary
|
||||||
if a:mode ==# 'n'
|
if a:mode ==# 'n'
|
||||||
" Reset all existing cursors, don't restore view and setting
|
" Reset all existing cursors, don't restore view and setting
|
||||||
|
@ -272,10 +277,7 @@ function! multiple_cursors#find(start, end, pattern)
|
||||||
|
|
||||||
" If we've created any cursors, we need to call the before function, end
|
" If we've created any cursors, we need to call the before function, end
|
||||||
" function will be called via normal routes
|
" function will be called via normal routes
|
||||||
if exists('*Multiple_cursors_before') && !s:before_function_called
|
call s:fire_pre_triggers()
|
||||||
exe "call Multiple_cursors_before()"
|
|
||||||
let s:before_function_called = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
call s:wait_for_user_input('v')
|
call s:wait_for_user_input('v')
|
||||||
endif
|
endif
|
||||||
|
@ -1014,13 +1016,28 @@ function! s:get_visual_region(pos)
|
||||||
return region
|
return region
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:strpart(s, i, l)
|
||||||
|
if a:l == 0
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
let [s, l] = ['', 0]
|
||||||
|
for c in split(a:s[a:i :], '\zs')
|
||||||
|
let s .= c
|
||||||
|
let l += len(c)
|
||||||
|
if l >= a:l
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return s
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Return the content of the buffer between the input region. This is used to
|
" Return the content of the buffer between the input region. This is used to
|
||||||
" find the next match in the buffer
|
" find the next match in the buffer
|
||||||
" Mode change: Normal -> Normal
|
" Mode change: Normal -> Normal
|
||||||
" Cursor change: None
|
" Cursor change: None
|
||||||
function! s:get_text(region)
|
function! s:get_text(region)
|
||||||
let lines = getline(a:region[0][0], a:region[1][0])
|
let lines = getline(a:region[0][0], a:region[1][0])
|
||||||
let lines[-1] = lines[-1][:a:region[1][1] - 1]
|
let lines[-1] = s:strpart(lines[-1], 0, a:region[1][1])
|
||||||
let lines[0] = lines[0][a:region[0][1] - 1:]
|
let lines[0] = lines[0][a:region[0][1] - 1:]
|
||||||
return join(lines, "\n")
|
return join(lines, "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- encoding: utf-8 -*-
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
def set_file_content(string)
|
def set_file_content(string)
|
||||||
|
@ -797,4 +798,20 @@ describe "Multiple Cursors" do
|
||||||
EOF
|
EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
|
specify "#multi-byte strings" do
|
||||||
|
before <<-EOF
|
||||||
|
こんにちわビム
|
||||||
|
世界の中心でビムを叫ぶ
|
||||||
|
ビム大好き
|
||||||
|
EOF
|
||||||
|
|
||||||
|
type '/ビム<CR><C-n><C-n><C-n>cヴィム<ESC>'
|
||||||
|
|
||||||
|
after <<-EOF
|
||||||
|
こんにちわヴィム
|
||||||
|
世界の中心でヴィムを叫ぶ
|
||||||
|
ヴィム大好き
|
||||||
|
EOF
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,13 +34,14 @@ hi Cursor guifg=black guibg=#b0b4b8
|
||||||
hi lCursor guifg=black guibg=white
|
hi lCursor guifg=black guibg=white
|
||||||
hi LineNr guifg=#ffffff guibg=#c0d0e0
|
hi LineNr guifg=#ffffff guibg=#c0d0e0
|
||||||
|
|
||||||
hi Normal guifg=#202020 guibg=#f0f0f0
|
hi Normal guifg=#404850 guibg=#f0f0f0
|
||||||
|
|
||||||
hi StatusLine guifg=white guibg=#8090a0 gui=bold,italic
|
hi StatusLine guifg=white guibg=#8090a0 gui=bold,italic
|
||||||
hi StatusLineNC guifg=#506070 guibg=#a0b0c0 gui=italic
|
hi StatusLineNC guifg=#506070 guibg=#a0b0c0 gui=italic
|
||||||
hi VertSplit guifg=#a0b0c0 guibg=#a0b0c0 gui=NONE
|
hi VertSplit guifg=#a0b0c0 guibg=#a0b0c0 gui=NONE
|
||||||
|
|
||||||
hi Folded guifg=#708090 guibg=#c0d0e0
|
" hi Folded guifg=#708090 guibg=#c0d0e0
|
||||||
|
hi Folded guifg=#a0a0a0 guibg=#e8e8e8 gui=italic
|
||||||
|
|
||||||
hi NonText guifg=#c0c0c0 guibg=#e0e0e0
|
hi NonText guifg=#c0c0c0 guibg=#e0e0e0
|
||||||
" Kommentare
|
" Kommentare
|
||||||
|
@ -81,7 +82,8 @@ hi Special guifg=#70a0d0 gui=italic
|
||||||
hi Operator guifg=#408010
|
hi Operator guifg=#408010
|
||||||
|
|
||||||
" color of <TAB>s etc...
|
" color of <TAB>s etc...
|
||||||
hi SpecialKey guifg=#d8a080 guibg=#e8e8e8 gui=italic
|
"hi SpecialKey guifg=#d8a080 guibg=#e8e8e8 gui=italic
|
||||||
|
hi SpecialKey guifg=#d0b0b0 guibg=#f0f0f0 gui=none
|
||||||
|
|
||||||
" Diff
|
" Diff
|
||||||
hi DiffChange guifg=NONE guibg=#e0e0e0 gui=italic,bold
|
hi DiffChange guifg=NONE guibg=#e0e0e0 gui=italic,bold
|
||||||
|
|
|
@ -292,25 +292,25 @@ endsnippet
|
||||||
|
|
||||||
snippet createview "Generic Create View" b
|
snippet createview "Generic Create View" b
|
||||||
class ${1:MODEL_NAME}CreateView(CreateView):
|
class ${1:MODEL_NAME}CreateView(CreateView):
|
||||||
model = ${1:MODEL_NAME}
|
model = $1
|
||||||
template_name = "${2:TEMPLATE_NAME}"
|
template_name = "${2:TEMPLATE_NAME}"
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet deleteview "Generic Delete View" b
|
snippet deleteview "Generic Delete View" b
|
||||||
class ${1:MODEL_NAME}DeleteView(DeleteView):
|
class ${1:MODEL_NAME}DeleteView(DeleteView):
|
||||||
model = ${1:MODEL_NAME}
|
model = $1
|
||||||
template_name = "${2:TEMPLATE_NAME}"
|
template_name = "${2:TEMPLATE_NAME}"
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet detailview "Generic Detail View" b
|
snippet detailview "Generic Detail View" b
|
||||||
class ${1:MODEL_NAME}DetailView(DetailView):
|
class ${1:MODEL_NAME}DetailView(DetailView):
|
||||||
model = ${1:MODEL_NAME}
|
model = $1
|
||||||
template_name = "${2:TEMPLATE_NAME}"
|
template_name = "${2:TEMPLATE_NAME}"
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet listview "Generic List View" b
|
snippet listview "Generic List View" b
|
||||||
class ${1:MODEL_NAME}ListView(ListView):
|
class ${1:MODEL_NAME}ListView(ListView):
|
||||||
model = ${1:MODEL_NAME}
|
model = $1
|
||||||
template_name = "${2:TEMPLATE_NAME}"
|
template_name = "${2:TEMPLATE_NAME}"
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ endsnippet
|
||||||
|
|
||||||
snippet updateview "Generic Update View" b
|
snippet updateview "Generic Update View" b
|
||||||
class ${1:MODEL_NAME}UpdateView(UpdateView):
|
class ${1:MODEL_NAME}UpdateView(UpdateView):
|
||||||
model = ${1:MODEL_NAME}
|
model = $1
|
||||||
template_name = "${2:TEMPLATE_NAME}"
|
template_name = "${2:TEMPLATE_NAME}"
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
|
9
sources_non_forked/vim-snippets/UltiSnips/elm.snippets
Normal file
9
sources_non_forked/vim-snippets/UltiSnips/elm.snippets
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
priority -50
|
||||||
|
|
||||||
|
snippet impa "Qualified import"
|
||||||
|
import ${1:Json.Encode} as ${0:`!p snip.rv = t[1].split(".")[-1]`}
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet impae "Qualified import with exposing"
|
||||||
|
import ${1:Json.Encode} as ${2:`!p snip.rv = t[1].split(".")[-1]`} exposing (${0:Value})
|
||||||
|
endsnippet
|
|
@ -7,6 +7,14 @@ priority -50
|
||||||
# The smart snippets use a global options called
|
# The smart snippets use a global options called
|
||||||
# "g:ultisnips_javascript.{option}" which can control the format
|
# "g:ultisnips_javascript.{option}" which can control the format
|
||||||
# of trailing semicolon, space before function paren, etc.
|
# of trailing semicolon, space before function paren, etc.
|
||||||
|
#
|
||||||
|
# e.g.
|
||||||
|
# let g:ultisnips_javascript = {
|
||||||
|
# \ 'keyword-spacing': 'always',
|
||||||
|
# \ 'semi': 'never',
|
||||||
|
# \ 'space-before-function-paren': 'always',
|
||||||
|
# \ }
|
||||||
|
|
||||||
|
|
||||||
global !p
|
global !p
|
||||||
from javascript_snippets import (
|
from javascript_snippets import (
|
||||||
|
|
|
@ -3,7 +3,7 @@ priority -50
|
||||||
global !p
|
global !p
|
||||||
def create_table(snip):
|
def create_table(snip):
|
||||||
# retrieving single line from current string and treat it like tabstops count
|
# retrieving single line from current string and treat it like tabstops count
|
||||||
placeholders_string = snip.buffer[snip.line].strip().split("x",1)
|
placeholders_string = snip.buffer[snip.line].strip()[2:].split("x",1)
|
||||||
rows_amount = int(placeholders_string[0])
|
rows_amount = int(placeholders_string[0])
|
||||||
columns_amount = int(placeholders_string[1])
|
columns_amount = int(placeholders_string[1])
|
||||||
|
|
||||||
|
@ -84,9 +84,8 @@ snippet fnt "Footnote"
|
||||||
[^$1]:${2:Text}
|
[^$1]:${2:Text}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
post_jump "create_table(snip)"
|
pre_expand "create_table(snip)"
|
||||||
snippet "tb(\d+x\d+)" "Customizable table" br
|
snippet "tb(\d+x\d+)" "Customizable table" br
|
||||||
`!p snip.rv = match.group(1)`
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
# vim:ft=snippets:
|
# vim:ft=snippets:
|
||||||
|
|
|
@ -326,4 +326,16 @@ snippet ###
|
||||||
=end
|
=end
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet priv "private " m
|
||||||
|
private
|
||||||
|
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet prot "protected" m
|
||||||
|
protected
|
||||||
|
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
# vim: set ts=2 sw=2 expandtab:
|
# vim: set ts=2 sw=2 expandtab:
|
||||||
|
|
|
@ -2,9 +2,11 @@ snippet mod
|
||||||
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` exposing (${1})
|
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` exposing (${1})
|
||||||
${0}
|
${0}
|
||||||
snippet imp
|
snippet imp
|
||||||
import ${0:List}
|
import ${0:Http}
|
||||||
snippet impe
|
snippet impe
|
||||||
import ${1:List} exposing (${0:map})
|
import ${1:Html} exposing (${0:..})
|
||||||
|
snippet impae
|
||||||
|
import ${1:Json.Encode} as ${2:Encode} exposing (${0:Value})
|
||||||
snippet fn
|
snippet fn
|
||||||
${1:fn} : ${2:a} -> ${3:a}
|
${1:fn} : ${2:a} -> ${3:a}
|
||||||
$1 ${4} =
|
$1 ${4} =
|
||||||
|
@ -49,3 +51,8 @@ snippet ty
|
||||||
snippet tya
|
snippet tya
|
||||||
type alias ${1:Model} =
|
type alias ${1:Model} =
|
||||||
${0}
|
${0}
|
||||||
|
snippet test
|
||||||
|
test "${1}" <| \_ -> $0
|
||||||
|
snippet doc
|
||||||
|
{-| ${0}
|
||||||
|
-}
|
||||||
|
|
|
@ -103,6 +103,21 @@ snippet spec
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec =
|
spec =
|
||||||
describe "${1}" $ do
|
describe "${1}" $ do
|
||||||
|
it "${2}" $
|
||||||
|
$0
|
||||||
|
snippet specf
|
||||||
|
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` (main, spec) where
|
||||||
|
|
||||||
|
import Test.Hspec
|
||||||
|
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = hspecWith defaultConfig {configFastFail = True} spec
|
||||||
|
|
||||||
|
spec :: Spec
|
||||||
|
spec =
|
||||||
|
describe "${1}" $ do
|
||||||
|
it "${2}" $
|
||||||
$0
|
$0
|
||||||
snippet desc
|
snippet desc
|
||||||
describe "${1}" $ do
|
describe "${1}" $ do
|
||||||
|
@ -113,3 +128,5 @@ snippet it
|
||||||
snippet itp
|
snippet itp
|
||||||
it "${1}" $ property $
|
it "${1}" $ property $
|
||||||
$0
|
$0
|
||||||
|
snippet sb
|
||||||
|
\`shouldBe\` $0
|
||||||
|
|
Loading…
Reference in a new issue