Updated plugins
This commit is contained in:
parent
6a16a9393c
commit
1dba960b75
156 changed files with 2657 additions and 1234 deletions
|
@ -9,7 +9,7 @@ ack from vim, and shows the results in a split window.
|
|||
|
||||
### Ack
|
||||
|
||||
You will need the ack, of course, to install it follow the
|
||||
You will need the ack(>= 2.0), of course, to install it follow the
|
||||
[manual](http://beyondgrep.com/install/)
|
||||
|
||||
### The Plugin
|
||||
|
@ -75,8 +75,8 @@ check out the docs for the Perl script 'ack', for obvious reasons:
|
|||
### Gotchas
|
||||
|
||||
Some characters have special meaning, and need to be escaped your search
|
||||
pattern. For instance, '#'. You have to escape it like this :Ack '\\\#define
|
||||
foo' to search for #define foo. (From blueyed in issue #5.)
|
||||
pattern. For instance, '#'. You have to escape it like this `:Ack '\\\#define
|
||||
foo'` to search for '#define foo'. (From blueyed in issue #5.)
|
||||
|
||||
## Changelog
|
||||
|
||||
|
@ -91,3 +91,41 @@ foo' to search for #define foo. (From blueyed in issue #5.)
|
|||
* Add g:ack_mapping
|
||||
* Add g:ack_default_options
|
||||
* Add a help toggle `?`(like NERDTree)
|
||||
|
||||
### 1.0.1
|
||||
|
||||
* Fixes #124. Bug with `g:ack_autofold_results`
|
||||
|
||||
### 1.0.2
|
||||
|
||||
* Add compatibility with [vim-dispatch](https://github.com/tpope/vim-dispatch)
|
||||
|
||||
### 1.0.3
|
||||
|
||||
* Fixes #127. Use `&l:hlsearch` instead of `v:hlsearch` to keep compatibility
|
||||
with versions that does not have this variable.
|
||||
|
||||
### 1.0.4
|
||||
|
||||
* Fixes #128. Always apply mappings, even when using vim-dispatch.
|
||||
|
||||
### 1.0.5
|
||||
|
||||
* Fixes #128. Fixes the `errorformat` for ack when using vim-dispatch.
|
||||
* Do not use vim-dispatch by default. To use vim-dispath must set
|
||||
`g:ack_use_dispatch`
|
||||
|
||||
### 1.0.6
|
||||
|
||||
* Fixes highlight function to work when user passes options. Ex.: Ack -i test
|
||||
Thank's @mannih. (#131, #134)
|
||||
|
||||
### 1.0.7
|
||||
|
||||
* Fixes highlight function to work when passes more than one option, or options
|
||||
with double dashes(--option) Thank's to @MiguelLatorre and @mannih
|
||||
|
||||
### 1.0.8
|
||||
|
||||
* Fixes (again) highlight, now using negative look behind.
|
||||
* Change mappings `o` and `O` to behave as documented
|
||||
|
|
|
@ -8,6 +8,7 @@ function! ack#Ack(cmd, args)
|
|||
else
|
||||
let l:grepargs = a:args . join(a:000, ' ')
|
||||
end
|
||||
echom l:grepargs
|
||||
let l:ackprg_run = g:ackprg
|
||||
|
||||
" Format, used to manage column jump
|
||||
|
@ -26,7 +27,14 @@ function! ack#Ack(cmd, args)
|
|||
try
|
||||
" NOTE: we escape special chars, but not everything using shellescape to
|
||||
" allow for passing arguments etc
|
||||
silent execute a:cmd . " " . escape(l:grepargs, '|#%')
|
||||
if g:ack_use_dispatch
|
||||
let &l:errorformat = g:ackformat
|
||||
let &l:makeprg=g:ackprg." " . escape(l:grepargs, '|#%')
|
||||
Make
|
||||
else
|
||||
silent execute a:cmd . " " . escape(l:grepargs, '|#%')
|
||||
endif
|
||||
|
||||
finally
|
||||
let &grepprg=grepprg_bak
|
||||
let &grepformat=grepformat_bak
|
||||
|
@ -42,7 +50,12 @@ function! ack#Ack(cmd, args)
|
|||
let s:close_cmd = ':cclose<CR>'
|
||||
endif
|
||||
|
||||
call ack#show_results()
|
||||
if !g:ack_use_dispatch
|
||||
call ack#show_results()
|
||||
else
|
||||
copen
|
||||
endif
|
||||
call <SID>apply_maps()
|
||||
call <SID>highlight(l:grepargs)
|
||||
|
||||
redraw!
|
||||
|
@ -50,7 +63,6 @@ endfunction
|
|||
|
||||
function! ack#show_results()
|
||||
execute s:handler
|
||||
call <SID>apply_maps()
|
||||
endfunction
|
||||
|
||||
function! s:apply_maps()
|
||||
|
@ -100,9 +112,8 @@ function! s:highlight(args)
|
|||
return
|
||||
endif
|
||||
|
||||
let @/ = matchstr(a:args, "\\v\\w+\>|['\"]\\zs[^\"]+\\ze['\"]")
|
||||
setlocal hlsearch
|
||||
call feedkeys(":let v:hlsearch=1 \| echo \<CR>", "n")
|
||||
let @/ = matchstr(a:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
|
||||
call feedkeys(":let &l:hlsearch=1 \| echo \<CR>", "n")
|
||||
endfunction
|
||||
|
||||
function! ack#AckFromSearch(cmd, args)
|
||||
|
|
|
@ -86,7 +86,7 @@ Example:
|
|||
let g:ackprg = "other-bin-ack"
|
||||
<
|
||||
|
||||
g:ack_default_options*
|
||||
*g:ack_default_options*
|
||||
g:ack_default_options
|
||||
Default: " -s -H --nocolor --nogroup --column"
|
||||
|
||||
|
@ -94,7 +94,7 @@ Use this option to specify the options used by ack
|
|||
|
||||
Example:
|
||||
>
|
||||
let g:ackprg =
|
||||
let g:ack_default_options =
|
||||
\ " -s -H --nocolor --nogroup --column --smart-case --follow"
|
||||
<
|
||||
|
||||
|
@ -203,6 +203,18 @@ Example:
|
|||
let g:ackpreview = 1
|
||||
<
|
||||
|
||||
*g:ack_use_dispatch*
|
||||
|
||||
g:ack_use_dispatch
|
||||
Default: 0
|
||||
|
||||
Use this option to use vim-dispatch to search the results in background
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:ack_use_dispatch = 1
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
MAPPINGS *ack-mappings*
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if g:ack_autofold_results
|
||||
if exists("g:ack_autofold_results") && g:ack_autofold_results
|
||||
setlocal foldlevel=0
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=matchstr(getline(v:lnum),'^[^\|]\\+')==#matchstr(getline(v:lnum+1),'^[^\|]\\+')?1:'<1'
|
||||
|
|
|
@ -22,12 +22,16 @@ if !exists("g:ack_apply_lmappings")
|
|||
let g:ack_apply_lmappings = !exists("g:ack_lhandler")
|
||||
endif
|
||||
|
||||
if !exists("g:ack_use_dispatch")
|
||||
let g:ack_use_dispatch = 0
|
||||
end
|
||||
|
||||
let s:ack_mappings = {
|
||||
\ "t": "<C-W><CR><C-W>T",
|
||||
\ "T": "<C-W><CR><C-W>TgT<C-W>j",
|
||||
\ "o": "<CR>",
|
||||
\ "O": "<CR><C-W><C-W>:ccl<CR>",
|
||||
\ "go": "<CR><C-W>j",
|
||||
\ "O": "<CR><C-W>p<C-W>c",
|
||||
\ "go": "<CR><C-W>p",
|
||||
\ "h": "<C-W><CR><C-W>K",
|
||||
\ "H": "<C-W><CR><C-W>K<C-W>b",
|
||||
\ "v": "<C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t",
|
||||
|
|
|
@ -104,13 +104,13 @@ function! s:tranquilize()
|
|||
\ 'StatusLine', 'StatusLineNC', 'SignColumn']
|
||||
" -1 on Vim / '' on GVim
|
||||
if bg == -1 || empty(bg)
|
||||
call s:set_color(grp, '', 'NONE')
|
||||
call s:set_color(grp, 'fg', get(g:, 'goyo_bg', 'black'))
|
||||
call s:set_color(grp, 'bg', 'NONE')
|
||||
else
|
||||
call s:set_color(grp, 'fg', bg)
|
||||
call s:set_color(grp, 'bg', bg)
|
||||
endif
|
||||
call s:set_color(grp, '', 'NONE')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
|
@ -244,6 +244,8 @@ function! s:goyo_off()
|
|||
let goyo_disabled_airline = t:goyo_disabled_airline
|
||||
let goyo_disabled_powerline = t:goyo_disabled_powerline
|
||||
let goyo_disabled_lightline = t:goyo_disabled_lightline
|
||||
let goyo_orig_buffer = t:goyo_master
|
||||
let [line, col] = [line('.'), col('.')]
|
||||
|
||||
if tabpagenr() == 1
|
||||
tabnew
|
||||
|
@ -252,6 +254,9 @@ function! s:goyo_off()
|
|||
endif
|
||||
tabclose
|
||||
execute 'normal! '.s:orig_tab.'gt'
|
||||
if winbufnr(0) == goyo_orig_buffer
|
||||
execute printf('normal! %dG%d|', line, col)
|
||||
endif
|
||||
|
||||
let wmh = remove(goyo_revert, 'winminheight')
|
||||
let wh = remove(goyo_revert, 'winheight')
|
||||
|
|
|
@ -60,7 +60,7 @@ Installation
|
|||
cd ~/.vim/bundle
|
||||
git clone https://github.com/scrooloose/nerdtree.git
|
||||
|
||||
Then reload vim, run `:helptags`, and check out `:help NERD_tree.txt`.
|
||||
Then reload vim, run `:Helptags`, and check out `:help NERD_tree.txt`.
|
||||
|
||||
|
||||
Faq
|
||||
|
@ -80,7 +80,10 @@ A. Stick this in your vimrc: `autocmd vimenter * NERDTree`
|
|||
|
||||
__Q. How can I open a NERDTree automatically when vim starts up if no files were specified?__
|
||||
|
||||
A. Stick this in your vimrc `autocmd vimenter * if !argc() | NERDTree | endif`
|
||||
A. Stick this in your vimrc
|
||||
|
||||
autocmd StdinReadPre * let s:std_in=1
|
||||
autocmd VimEnter * if !argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
||||
|
||||
__Q. How can I map a specific key or shortcut to open NERDTree?__
|
||||
|
||||
|
|
|
@ -513,7 +513,7 @@ function! nerdtree#dumpHelp()
|
|||
let @h=@h."\" ". g:NERDTreeMapHelp .": toggle help\n"
|
||||
let @h=@h."\"\n\" ----------------------------\n"
|
||||
let @h=@h."\" Bookmark commands~\n"
|
||||
let @h=@h."\" :Bookmark <name>\n"
|
||||
let @h=@h."\" :Bookmark [<name>]\n"
|
||||
let @h=@h."\" :BookmarkToRoot <name>\n"
|
||||
let @h=@h."\" :RevealBookmark <name>\n"
|
||||
let @h=@h."\" :OpenBookmark <name>\n"
|
||||
|
@ -1068,9 +1068,17 @@ function! s:closeCurrentDir(node)
|
|||
if parent ==# {} || parent.isRoot()
|
||||
call nerdtree#echo("cannot close tree root")
|
||||
else
|
||||
call a:node.parent.close()
|
||||
while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot()
|
||||
if parent.parent.getVisibleChildCount() == 1
|
||||
call parent.close()
|
||||
let parent = parent.parent
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
call parent.close()
|
||||
call nerdtree#renderView()
|
||||
call a:node.parent.putCursorHere(0, 0)
|
||||
call parent.putCursorHere(0, 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ The following features and functionality are provided by the NERD tree:
|
|||
<
|
||||
:NERDTreeFromBookmark <bookmark> *:NERDTreeFromBookmark*
|
||||
Opens a fresh NERD tree with the root initialized to the dir for
|
||||
<bookmark>. This only reason to use this command over :NERDTree is for
|
||||
<bookmark>. The only reason to use this command over :NERDTree is for
|
||||
the completion (which is for bookmarks rather than directories).
|
||||
|
||||
:NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
|
||||
|
@ -160,7 +160,7 @@ click bookmarks or use the |NERDTree-o| mapping to activate them. See also,
|
|||
|
||||
Note that the following commands are only available in the NERD tree buffer.
|
||||
|
||||
:Bookmark <name>
|
||||
:Bookmark [<name>]
|
||||
Bookmark the current node as <name>. If there is already a <name>
|
||||
bookmark, it is overwritten. <name> must not contain spaces.
|
||||
If <name> is not provided, it defaults to the file or directory name.
|
||||
|
@ -358,7 +358,7 @@ Default key: O
|
|||
Map option: NERDTreeMapOpenRecursively
|
||||
Applies to: directories.
|
||||
|
||||
Recursively opens the selelected directory.
|
||||
Recursively opens the selected directory.
|
||||
|
||||
All files and directories are cached, but if a directory would not be
|
||||
displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the
|
||||
|
@ -609,17 +609,19 @@ NERD tree. These options should be set in your vimrc.
|
|||
|
||||
|'loaded_nerd_tree'| Turns off the script.
|
||||
|
||||
|'NERDChristmasTree'| Tells the NERD tree to make itself colourful
|
||||
and pretty.
|
||||
|
||||
|'NERDTreeAutoCenter'| Controls whether the NERD tree window centers
|
||||
when the cursor moves within a specified
|
||||
distance to the top/bottom of the window.
|
||||
|
||||
|'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering.
|
||||
|
||||
|'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case
|
||||
sensitive or not when sorting nodes.
|
||||
|
||||
|'NERDTreeSortHiddenFirst'| Tells the NERD tree whether to take the dot
|
||||
at the beginning of the hidden file names
|
||||
into account when sorting nodes.
|
||||
|
||||
|'NERDTreeChDirMode'| Tells the NERD tree if/when it should change
|
||||
vim's current working directory.
|
||||
|
||||
|
@ -631,8 +633,13 @@ NERD tree. These options should be set in your vimrc.
|
|||
|
||||
|'NERDTreeIgnore'| Tells the NERD tree which files to ignore.
|
||||
|
||||
|'NERDTreeRespectWildIgnore'| Tells the NERD tree to respect |'wildignore'|.
|
||||
|
||||
|'NERDTreeBookmarksFile'| Where the bookmarks are stored.
|
||||
|
||||
|'NERDTreeBookmarksSort'| Whether the bookmarks list is sorted on
|
||||
display.
|
||||
|
||||
|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse
|
||||
clicks.
|
||||
|
||||
|
@ -667,8 +674,8 @@ NERD tree. These options should be set in your vimrc.
|
|||
|'NERDTreeDirArrows'| Tells the NERD tree to use arrows instead of
|
||||
+ ~ chars when displaying directories.
|
||||
|
||||
|'NERDTreeCasadeOpenSingleChildDir'|
|
||||
Casade open while selected directory has only
|
||||
|'NERDTreeCascadeOpenSingleChildDir'|
|
||||
Cascade open while selected directory has only
|
||||
one child that also is a directory.
|
||||
|
||||
|'NERDTreeAutoDeleteBuffer'| Tells the NERD tree to automatically remove
|
||||
|
@ -686,15 +693,6 @@ If this plugin is making you feel homicidal, it may be a good idea to turn it
|
|||
off with this line in your vimrc: >
|
||||
let loaded_nerd_tree=1
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDChristmasTree'*
|
||||
Values: 0 or 1.
|
||||
Default: 1.
|
||||
|
||||
If this option is set to 1 then some extra syntax highlighting elements are
|
||||
added to the nerd tree to make it more colourful.
|
||||
|
||||
Set it to 0 for a more vanilla looking tree.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeAutoCenter'*
|
||||
|
@ -817,6 +815,13 @@ line: >
|
|||
The file filters can be turned on and off dynamically with the |NERDTree-f|
|
||||
mapping.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeRespectWildIgnore'*
|
||||
Values: 0 or 1.
|
||||
Default: 0.
|
||||
|
||||
If set to 1, the |'wildignore'| setting is respected.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeBookmarksFile'*
|
||||
Values: a path
|
||||
|
@ -824,6 +829,14 @@ Default: $HOME/.NERDTreeBookmarks
|
|||
|
||||
This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeBookmarksSort'*
|
||||
Values: 0 or 1
|
||||
Default: 1
|
||||
|
||||
If set to 0 then the bookmarks list is not sorted.
|
||||
If set to 1 the bookmarks list is sorted.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeMouseMode'*
|
||||
Values: 1, 2 or 3.
|
||||
|
@ -987,16 +1000,17 @@ option: >
|
|||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeCasadeOpenSingleChildDir'*
|
||||
*'NERDTreeCascadeOpenSingleChildDir'*
|
||||
Values: 0 or 1
|
||||
Default: 1.
|
||||
|
||||
When opening dir nodes, this option tells NERDTree to recursively open dirs
|
||||
that have only one child which is also a dir. NERDTree will stop when it finds
|
||||
a dir that contains anything but another single dir. This option may be useful
|
||||
for Java projects. Use one of the follow lines to set this option: >
|
||||
let NERDTreeCasadeOpenSingleChildDir=0
|
||||
let NERDTreeCasadeOpenSingleChildDir=1
|
||||
a dir that contains anything but another single dir. This option also causes
|
||||
the |NERDTree-x| mapping to close dirs in the same manner. This option may be
|
||||
useful for Java projects. Use one of the follow lines to set this option: >
|
||||
let NERDTreeCascadeOpenSingleChildDir=0
|
||||
let NERDTreeCascadeOpenSingleChildDir=1
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
@ -1062,8 +1076,8 @@ NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()*
|
|||
call NERDTreeAddKeyMap({
|
||||
\ 'key': 'foo',
|
||||
\ 'callback': 'NERDTreeCDHandler',
|
||||
\ 'quickhelpText': 'echo full path of current node' })
|
||||
\ 'scope': 'DirNode'
|
||||
\ 'quickhelpText': 'echo full path of current node',
|
||||
\ 'scope': 'DirNode' })
|
||||
|
||||
function! NERDTreeCDHandler(dirnode)
|
||||
call a:dirnode.changeToDir()
|
||||
|
|
|
@ -19,7 +19,9 @@ function! s:Bookmark.AddBookmark(name, path)
|
|||
endif
|
||||
endfor
|
||||
call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path))
|
||||
call s:Bookmark.Sort()
|
||||
if g:NERDTreeBookmarksSort ==# 1
|
||||
call s:Bookmark.Sort()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: Bookmark.Bookmarks() {{{1
|
||||
|
@ -101,7 +103,9 @@ function! s:Bookmark.CacheBookmarks(silent)
|
|||
call nerdtree#echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.")
|
||||
endif
|
||||
endif
|
||||
call s:Bookmark.Sort()
|
||||
if g:NERDTreeBookmarksSort ==# 1
|
||||
call s:Bookmark.Sort()
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -279,8 +279,8 @@ function! s:Creator._setCommonBufOptions()
|
|||
let b:NERDTreeShowFiles = g:NERDTreeShowFiles
|
||||
let b:NERDTreeShowHidden = g:NERDTreeShowHidden
|
||||
let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks
|
||||
setfiletype nerdtree
|
||||
call self._bindMappings()
|
||||
setlocal filetype=nerdtree
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:Creator._setupStatusline() {{{1
|
||||
|
|
|
@ -90,7 +90,7 @@ endfunction
|
|||
"callback
|
||||
function! s:MenuItem.execute()
|
||||
if len(self.children)
|
||||
let mc = s:MenuController.New(self.children)
|
||||
let mc = g:NERDTreeMenuController.New(self.children)
|
||||
call mc.showMenu()
|
||||
else
|
||||
if self.callback != -1
|
||||
|
|
|
@ -103,6 +103,10 @@ function! s:Path.compareTo(path)
|
|||
elseif thisSS > thatSS
|
||||
return 1
|
||||
else
|
||||
if !g:NERDTreeSortHiddenFirst
|
||||
let thisPath = substitute(thisPath, '^[._]', '', '')
|
||||
let thatPath = substitute(thatPath, '^[._]', '', '')
|
||||
endif
|
||||
"if the sort sequences are the same then compare the paths
|
||||
"alphabetically
|
||||
let pathCompare = g:NERDTreeCaseSensitiveSort ? thisPath <# thatPath : thisPath <? thatPath
|
||||
|
@ -141,6 +145,7 @@ function! s:Path.Create(fullpath)
|
|||
|
||||
"assume its a file and create
|
||||
else
|
||||
call s:Path.createParentDirectories(a:fullpath)
|
||||
call writefile([], a:fullpath)
|
||||
endif
|
||||
catch
|
||||
|
@ -161,6 +166,8 @@ function! s:Path.copy(dest)
|
|||
throw "NERDTree.CopyingNotSupportedError: Copying is not supported on this OS"
|
||||
endif
|
||||
|
||||
call s:Path.createParentDirectories(a:dest)
|
||||
|
||||
let dest = s:Path.WinToUnixPath(a:dest)
|
||||
|
||||
let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), nerdtree#escChars()) . " " . escape(dest, nerdtree#escChars())
|
||||
|
@ -197,6 +204,20 @@ function! s:Path.copyingWillOverwrite(dest)
|
|||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: Path.createParentDirectories(path) {{{1
|
||||
"
|
||||
"create parent directories for this path if needed
|
||||
"without throwing any errors is those directories already exist
|
||||
"
|
||||
"Args:
|
||||
"path: full path of the node whose parent directories may need to be created
|
||||
function! s:Path.createParentDirectories(path)
|
||||
let dir_path = fnamemodify(a:path, ':h')
|
||||
if !isdirectory(dir_path)
|
||||
call mkdir(dir_path, 'p')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: Path.delete() {{{1
|
||||
"
|
||||
"Deletes the file represented by this path.
|
||||
|
|
|
@ -229,7 +229,7 @@ function! s:TreeDirNode._initChildren(silent)
|
|||
let globDir = dir.str({'format': 'Glob'})
|
||||
|
||||
if version >= 703
|
||||
let filesStr = globpath(globDir, '*', 1) . "\n" . globpath(globDir, '.*', 1)
|
||||
let filesStr = globpath(globDir, '*', !g:NERDTreeRespectWildIgnore) . "\n" . globpath(globDir, '.*', !g:NERDTreeRespectWildIgnore)
|
||||
else
|
||||
let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*')
|
||||
endif
|
||||
|
@ -500,7 +500,7 @@ function! s:TreeDirNode.toggleOpen(...)
|
|||
if self.isOpen ==# 1
|
||||
call self.close()
|
||||
else
|
||||
if g:NERDTreeCasadeOpenSingleChildDir == 0
|
||||
if g:NERDTreeCascadeOpenSingleChildDir == 0
|
||||
call self.open(opts)
|
||||
else
|
||||
call self.openAlong(opts)
|
||||
|
|
|
@ -82,13 +82,14 @@ endfunction
|
|||
function! s:promptToRenameBuffer(bufnum, msg, newFileName)
|
||||
echo a:msg
|
||||
if g:NERDTreeAutoDeleteBuffer || nr2char(getchar()) ==# 'y'
|
||||
let quotedFileName = "'" . a:newFileName . "'"
|
||||
" 1. ensure that a new buffer is loaded
|
||||
exec "badd " . a:newFileName
|
||||
exec "badd " . quotedFileName
|
||||
" 2. ensure that all windows which display the just deleted filename
|
||||
" display a buffer for a new filename.
|
||||
let s:originalTabNumber = tabpagenr()
|
||||
let s:originalWindowNumber = winnr()
|
||||
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':e! " . a:newFileName . "' | endif"
|
||||
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec \":e! " . quotedFileName . "\" | endif"
|
||||
exec "tabnext " . s:originalTabNumber
|
||||
exec s:originalWindowNumber . "wincmd w"
|
||||
" 3. We don't need a previous buffer anymore
|
||||
|
@ -114,7 +115,10 @@ function! NERDTreeAddNode()
|
|||
let parentNode = b:NERDTreeRoot.findNode(newPath.getParent())
|
||||
|
||||
let newTreeNode = g:NERDTreeFileNode.New(newPath)
|
||||
if parentNode.isOpen || !empty(parentNode.children)
|
||||
if empty(parentNode)
|
||||
call b:NERDTreeRoot.refresh()
|
||||
call nerdtree#renderView()
|
||||
elseif parentNode.isOpen || !empty(parentNode.children)
|
||||
call parentNode.addChild(newTreeNode, 1)
|
||||
call NERDTreeRender()
|
||||
call newTreeNode.putCursorHere(1, 0)
|
||||
|
@ -138,7 +142,7 @@ function! NERDTreeMoveNode()
|
|||
endif
|
||||
|
||||
try
|
||||
let bufnum = bufnr(curNode.path.str())
|
||||
let bufnum = bufnr("^".curNode.path.str()."$")
|
||||
|
||||
call curNode.rename(newNodePath)
|
||||
call NERDTreeRender()
|
||||
|
@ -186,7 +190,7 @@ function! NERDTreeDeleteNode()
|
|||
|
||||
"if the node is open in a buffer, ask the user if they want to
|
||||
"close that buffer
|
||||
let bufnum = bufnr(currentNode.path.str())
|
||||
let bufnum = bufnr("^".currentNode.path.str()."$")
|
||||
if buflisted(bufnum)
|
||||
let prompt = "\nNode deleted.\n\nThe file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
|
||||
call s:promptToDelBuffer(bufnum, prompt)
|
||||
|
@ -224,7 +228,10 @@ function! NERDTreeCopyNode()
|
|||
if confirmed
|
||||
try
|
||||
let newNode = currentNode.copy(newNodePath)
|
||||
if !empty(newNode)
|
||||
if empty(newNode)
|
||||
call b:NERDTreeRoot.refresh()
|
||||
call nerdtree#renderView()
|
||||
else
|
||||
call NERDTreeRender()
|
||||
call newNode.putCursorHere(0, 0)
|
||||
endif
|
||||
|
|
|
@ -45,28 +45,30 @@ function! s:initVariable(var, value)
|
|||
endfunction
|
||||
|
||||
"SECTION: Init variable calls and other random constants {{{2
|
||||
call s:initVariable("g:NERDChristmasTree", 1)
|
||||
call s:initVariable("g:NERDTreeAutoCenter", 1)
|
||||
call s:initVariable("g:NERDTreeAutoCenterThreshold", 3)
|
||||
call s:initVariable("g:NERDTreeCaseSensitiveSort", 0)
|
||||
call s:initVariable("g:NERDTreeSortHiddenFirst", 1)
|
||||
call s:initVariable("g:NERDTreeChDirMode", 0)
|
||||
call s:initVariable("g:NERDTreeMinimalUI", 0)
|
||||
if !exists("g:NERDTreeIgnore")
|
||||
let g:NERDTreeIgnore = ['\~$']
|
||||
endif
|
||||
call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBookmarks')
|
||||
call s:initVariable("g:NERDTreeBookmarksSort", 1)
|
||||
call s:initVariable("g:NERDTreeHighlightCursorline", 1)
|
||||
call s:initVariable("g:NERDTreeHijackNetrw", 1)
|
||||
call s:initVariable("g:NERDTreeMouseMode", 1)
|
||||
call s:initVariable("g:NERDTreeNotificationThreshold", 100)
|
||||
call s:initVariable("g:NERDTreeQuitOnOpen", 0)
|
||||
call s:initVariable("g:NERDTreeRespectWildIgnore", 0)
|
||||
call s:initVariable("g:NERDTreeShowBookmarks", 0)
|
||||
call s:initVariable("g:NERDTreeShowFiles", 1)
|
||||
call s:initVariable("g:NERDTreeShowHidden", 0)
|
||||
call s:initVariable("g:NERDTreeShowLineNumbers", 0)
|
||||
call s:initVariable("g:NERDTreeSortDirs", 1)
|
||||
call s:initVariable("g:NERDTreeDirArrows", !nerdtree#runningWindows())
|
||||
call s:initVariable("g:NERDTreeCasadeOpenSingleChildDir", 1)
|
||||
call s:initVariable("g:NERDTreeCascadeOpenSingleChildDir", 1)
|
||||
|
||||
if !exists("g:NERDTreeSortOrder")
|
||||
let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$']
|
||||
|
|
|
@ -7,38 +7,54 @@ syn match NERDTreeFlag #\[RO\]#
|
|||
"highlighting for the .. (up dir) line at the top of the tree
|
||||
execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
|
||||
|
||||
"highlighting for the ~/+ symbols for the directory nodes
|
||||
syn match NERDTreeClosable #\~\<#
|
||||
syn match NERDTreeClosable #\~\.#
|
||||
syn match NERDTreeOpenable #+\<#
|
||||
syn match NERDTreeOpenable #+\.#he=e-1
|
||||
|
||||
"highlighting for the tree structural parts
|
||||
syn match NERDTreePart #|#
|
||||
syn match NERDTreePart #`#
|
||||
syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart
|
||||
|
||||
"quickhelp syntax elements
|
||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1
|
||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1
|
||||
syn match NERDTreeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=NERDTreeFlag
|
||||
syn match NERDTreeToggleOn #".*(on)#hs=e-2,he=e-1 contains=NERDTreeHelpKey
|
||||
syn match NERDTreeToggleOff #".*(off)#hs=e-3,he=e-1 contains=NERDTreeHelpKey
|
||||
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 NERDTreeToggleOn #(on)#ms=s+1,he=e-1
|
||||
syn match NERDTreeToggleOff #(off)#ms=e-3,me=e-1
|
||||
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
|
||||
syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeFlag,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand
|
||||
|
||||
"highlighting for readonly files
|
||||
syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
|
||||
|
||||
"highlighting for sym links
|
||||
syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash
|
||||
syn match NERDTreeLinkTarget #->.*# containedin=NERDTreeDir,NERDTreeFile
|
||||
syn match NERDTreeLinkFile #.* ->#me=e-3 containedin=NERDTreeFile
|
||||
syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
|
||||
|
||||
"highlighing for directory nodes and file nodes
|
||||
syn match NERDTreeDirSlash #/#
|
||||
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable
|
||||
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark
|
||||
syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
||||
|
||||
if g:NERDTreeDirArrows
|
||||
syn match NERDTreeClosable #▾# containedin=NERDTreeDir,NERDTreeFile
|
||||
syn match NERDTreeOpenable #▸# containedin=NERDTreeDir,NERDTreeFile
|
||||
|
||||
syn match NERDTreeDir #[^▾▸ ].*/#
|
||||
syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark
|
||||
syn match NERDTreeFile #^[^"\.▾▸] *[^▾▸]*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile
|
||||
|
||||
"highlighting for readonly files
|
||||
syn match NERDTreeRO # *\zs.*\ze \[RO\]# contains=NERDTreeFlag,NERDTreeBookmark,NERDTreeFile
|
||||
else
|
||||
"highlighting for the ~/+ symbols for the directory nodes
|
||||
syn match NERDTreeClosable #\~\<#
|
||||
syn match NERDTreeClosable #\~\.#
|
||||
syn match NERDTreeOpenable #+\<#
|
||||
syn match NERDTreeOpenable #+\.#he=e-1
|
||||
|
||||
"highlighting for the tree structural parts
|
||||
syn match NERDTreePart #|#
|
||||
syn match NERDTreePart #`#
|
||||
syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart
|
||||
|
||||
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeOpenable,NERDTreeClosable
|
||||
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark
|
||||
syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
|
||||
"highlighting for readonly files
|
||||
syn match NERDTreeRO #|-.*\[RO\]#he=e-5 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
|
||||
endif
|
||||
|
||||
syn match NERDTreeCWD #^[</].*$#
|
||||
|
||||
"highlighting for bookmarks
|
||||
|
@ -50,19 +66,10 @@ syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmark
|
|||
syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader
|
||||
syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader
|
||||
|
||||
if exists("g:NERDChristmasTree") && g:NERDChristmasTree
|
||||
hi def link NERDTreePart Special
|
||||
hi def link NERDTreePartFile Type
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeExecFile Title
|
||||
hi def link NERDTreeDirSlash Identifier
|
||||
hi def link NERDTreeClosable Type
|
||||
else
|
||||
hi def link NERDTreePart Normal
|
||||
hi def link NERDTreePartFile Normal
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeClosable Title
|
||||
endif
|
||||
hi def link NERDTreePart Special
|
||||
hi def link NERDTreePartFile Type
|
||||
hi def link NERDTreeExecFile Title
|
||||
hi def link NERDTreeDirSlash Identifier
|
||||
|
||||
hi def link NERDTreeBookmarksHeader statement
|
||||
hi def link NERDTreeBookmarksLeader ignore
|
||||
|
@ -76,11 +83,16 @@ hi def link NERDTreeHelpTitle Macro
|
|||
hi def link NERDTreeToggleOn Question
|
||||
hi def link NERDTreeToggleOff WarningMsg
|
||||
|
||||
hi def link NERDTreeLinkTarget Type
|
||||
hi def link NERDTreeLinkFile Macro
|
||||
hi def link NERDTreeLinkDir Macro
|
||||
|
||||
hi def link NERDTreeDir Directory
|
||||
hi def link NERDTreeUp Directory
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeCWD Statement
|
||||
hi def link NERDTreeLink Macro
|
||||
hi def link NERDTreeOpenable Title
|
||||
hi def link NERDTreeClosable Title
|
||||
hi def link NERDTreeFlag ignore
|
||||
hi def link NERDTreeRO WarningMsg
|
||||
hi def link NERDTreeBookmark Statement
|
||||
|
|
|
@ -1,49 +1,105 @@
|
|||
# Bug reports / Github issues
|
||||
# CONTRIBUTING
|
||||
- - -
|
||||
1\. [Bug reports / GitHub issues](#bugreps)
|
||||
2\. [Submitting a patch](#patches)
|
||||
3\. [General style notes](#generalstyle)
|
||||
4\. [Syntax checker notes](#checkerstyle)
|
||||
- - -
|
||||
|
||||
When reporting a bug make sure you search the existing github issues for the
|
||||
same/similar issues. If you find one, feel free to add a `+1` comment with any
|
||||
additional information that may help us solve the issue.
|
||||
<a name="bugreps"></a>
|
||||
|
||||
## 1. Bug reports / GitHub issues
|
||||
|
||||
Please note that the preferred channel for posting bug reports is the
|
||||
[issue tracker at GitHub][0]. Reports posted elsewhere are less likely
|
||||
to be seen by the core team.
|
||||
|
||||
When reporting a bug make sure you search the existing GitHub issues
|
||||
for the same/similar issues. If you find one, feel free to add a `+1`
|
||||
comment with any additional information that may help us solve the
|
||||
issue.
|
||||
|
||||
When creating a new issue be sure to state the following:
|
||||
|
||||
* Steps to reproduce the bug.
|
||||
* The version of vim you are using.
|
||||
* The version of syntastic you are using.
|
||||
* steps to reproduce the bug;
|
||||
* the version of Vim you are using (run `:ver` to find out);
|
||||
* the version of syntastic you are using (see `:SyntasticInfo`).
|
||||
|
||||
For syntax checker bugs also state the version of the checker executable that you are using.
|
||||
For syntax checker bugs also state the version of the checker executable
|
||||
that you are using. Adding debugging information is typically useful
|
||||
too:
|
||||
|
||||
# Submitting a patch
|
||||
* open a file handled by your checker;
|
||||
* set `g:syntastic_debug` to 1 or 3;
|
||||
* run the checker;
|
||||
* copy the output of `:mes`.
|
||||
|
||||
* Fork the repo on github
|
||||
* Make a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches) and start hacking
|
||||
* Submit a pull request based off your topic branch
|
||||
<a name="patches"></a>
|
||||
|
||||
Small focused patches are preferred.
|
||||
## 2. Submitting a patch
|
||||
|
||||
Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say.
|
||||
Before you consider adding features to syntastic, _please_ spend a few
|
||||
minutes (re-)reading the latest version of the [manual][1]. Syntastic
|
||||
is changing rapidly at times, and it's quite possible that some of the
|
||||
features you want to add exist already.
|
||||
|
||||
# General style notes
|
||||
To submit a patch:
|
||||
|
||||
Following the coding conventions/styles used in the syntastic core:
|
||||
* fork the [repo][2] on GitHub;
|
||||
* make a [topic branch][3] and start hacking;
|
||||
* submit a pull request based off your topic branch.
|
||||
|
||||
* Use 4 space indents.
|
||||
* Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!).
|
||||
* Don't use `l:` prefixes for variables unless actually required (i.e. almost never).
|
||||
* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/extractVariable.html) to aid readability.
|
||||
Small, focused patches are preferred.
|
||||
|
||||
# Syntax checker style notes
|
||||
Large changes to the code should be discussed with the core team first.
|
||||
Create an issue and explain your plan and see what we say.
|
||||
|
||||
The preferred style for error format strings is one "clause" per line. E.g.
|
||||
(from the coffeelint checker):
|
||||
Also make sure to update the manual whenever applicable. Nobody can use
|
||||
features that aren't documented.
|
||||
|
||||
```viml
|
||||
let errorformat = '%E%f:%l:%c: %trror: %m,' .
|
||||
\ 'Syntax%trror: In %f\, %m on line %l,' .
|
||||
\ '%EError: In %f\, Parse error on line %l: %m,' .
|
||||
\ '%EError: In %f\, %m on line %l,' .
|
||||
\ '%W%f(%l): lint warning: %m,' .
|
||||
\ '%W%f(%l): warning: %m,' .
|
||||
\ '%E%f(%l): SyntaxError: %m,' .
|
||||
\ '%-Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
<a name="generalstyle"></a>
|
||||
|
||||
## 3. General style notes
|
||||
|
||||
Follow the coding conventions/styles used in the syntastic core:
|
||||
|
||||
* use 4 space indents;
|
||||
* don't use abbreviated keywords - e.g. use `endfunction`, not `endfun`
|
||||
(there's always room for more fun!);
|
||||
* don't use `l:` prefixes for variables unless actually required (i.e.
|
||||
almost never);
|
||||
* code for maintainability; we would rather a function be a couple of
|
||||
lines longer and have (for example) some [explaining variables][4] to
|
||||
aid readability.
|
||||
|
||||
<a name="checkerstyle"></a>
|
||||
|
||||
## 4. Syntax checker notes
|
||||
|
||||
Make sure to read the [guide][5] if you plan to add new syntax checkers.
|
||||
|
||||
Use the existing checkers as templates, rather than writing everything
|
||||
from scratch.
|
||||
|
||||
The preferred style for error format strings is one "clause" per line.
|
||||
E.g. (from the `coffee` checker):
|
||||
|
||||
```vim
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: %trror: %m,' .
|
||||
\ 'Syntax%trror: In %f\, %m on line %l,' .
|
||||
\ '%EError: In %f\, Parse error on line %l: %m,' .
|
||||
\ '%EError: In %f\, %m on line %l,' .
|
||||
\ '%W%f(%l): lint warning: %m,' .
|
||||
\ '%W%f(%l): warning: %m,' .
|
||||
\ '%E%f(%l): SyntaxError: %m,' .
|
||||
\ '%-Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
```
|
||||
|
||||
[0]: https://github.com/scrooloose/syntastic/issues
|
||||
[1]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
|
||||
[2]: https://github.com/scrooloose/syntastic
|
||||
[3]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches
|
||||
[4]: http://www.refactoring.com/catalog/extractVariable.html
|
||||
[5]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
|
|
|
@ -35,16 +35,16 @@ the user is notified and is happy because they didn't have to compile their
|
|||
code or execute their script to find them.
|
||||
|
||||
At the time of this writing, syntax checking plugins exist for ActionScript,
|
||||
Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bourne shell, C, C++, C#, Chef,
|
||||
CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir,
|
||||
Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
|
||||
Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal,
|
||||
Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust,
|
||||
Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
|
||||
Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP,
|
||||
LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++,
|
||||
OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property
|
||||
lists, Puppet, Python, Racket, R, reStructuredText, Ruby, Rust, SASS/SCSS,
|
||||
Scala, Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL,
|
||||
xHtml, XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh. See the
|
||||
[wiki][3] for details about the corresponding supported checkers.
|
||||
lists, Puppet, Python, Racket, R, reStructuredText, Ruby, SASS/SCSS, Scala,
|
||||
Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml,
|
||||
XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3]
|
||||
for details about the corresponding supported checkers.
|
||||
|
||||
Below is a screenshot showing the methods that Syntastic uses to display syntax
|
||||
errors. Note that, in practise, you will only have a subset of these methods
|
||||
|
@ -76,9 +76,8 @@ First I'll show you how to install Tim Pope's [pathogen][1] so that it's easy to
|
|||
install syntastic. Do this in your terminal so that you get the `pathogen.vim`
|
||||
file and the directories it needs:
|
||||
```sh
|
||||
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
|
||||
curl -so ~/.vim/autoload/pathogen.vim \
|
||||
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
|
||||
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
|
||||
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
|
||||
```
|
||||
Next you *need* to add this to your `~/.vimrc`:
|
||||
```vim
|
||||
|
@ -92,7 +91,7 @@ execute pathogen#infect()
|
|||
You now have pathogen installed and can put syntastic into `~/.vim/bundle` like
|
||||
this:
|
||||
```sh
|
||||
cd ~/.vim/bundle
|
||||
cd ~/.vim/bundle && \
|
||||
git clone https://github.com/scrooloose/syntastic.git
|
||||
```
|
||||
Quit vim and start it back up to reload it, then type:
|
||||
|
@ -143,6 +142,14 @@ still producing useful results, the checker is now disabled by default. To
|
|||
let g:syntastic_enable_perl_checker = 1
|
||||
```
|
||||
|
||||
<a name="faqrust"></a>
|
||||
|
||||
__Q. What happened to the `rustc` checker?__
|
||||
|
||||
A. It has been included in the [Rust compiler package][12]. If you have
|
||||
a recent version of the Rust compiler, the checker should be picked up
|
||||
automatically by syntastic.
|
||||
|
||||
<a name="faqloclist"></a>
|
||||
|
||||
__Q. I run a checker and the location list is not updated...__
|
||||
|
@ -272,8 +279,10 @@ cabbrev <silent> bd lclose\|bdelete
|
|||
## 4\. Other resources
|
||||
|
||||
The preferred place for posting suggestions, reporting bugs, and general
|
||||
discussions related to syntastic is the [issue tracker at GitHub][4]. There
|
||||
are also a [google group][5], and a [syntastic tag at StackOverflow][6].
|
||||
discussions related to syntastic is the [issue tracker at GitHub][4].
|
||||
A guide for writing syntax checkers can be found in the [wiki][11].
|
||||
There are also a dedicated [google group][5], and a
|
||||
[syntastic tag at StackOverflow][6].
|
||||
|
||||
Syntastic aims to provide a common interface to syntax checkers for as many
|
||||
languages as possible. For particular languages, there are, of course, other
|
||||
|
@ -291,3 +300,5 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9].
|
|||
[8]: https://github.com/klen/python-mode
|
||||
[9]: http://valloric.github.io/YouCompleteMe/
|
||||
[10]: http://perldoc.perl.org/perlrun.html#*-c*
|
||||
[11]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
[12]: https://github.com/rust-lang/rust/
|
||||
|
|
|
@ -180,7 +180,7 @@ endfunction " }}}2
|
|||
function! s:getIncludeDirs(filetype) " {{{2
|
||||
let include_dirs = []
|
||||
|
||||
if a:filetype =~# '\v^%(c|cpp|d|objc|objcpp)$' &&
|
||||
if a:filetype =~# '\v^%(c|cpp|objc|objcpp)$' &&
|
||||
\ (!exists('g:syntastic_'.a:filetype.'_no_default_include_dirs') ||
|
||||
\ !g:syntastic_{a:filetype}_no_default_include_dirs)
|
||||
let include_dirs = copy(s:default_includes)
|
||||
|
|
|
@ -6,7 +6,7 @@ let g:loaded_syntastic_log_autoload = 1
|
|||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:deprecation_notices_issued = []
|
||||
let s:one_time_notices_issued = []
|
||||
|
||||
" Public functions {{{1
|
||||
|
||||
|
@ -27,15 +27,39 @@ function! syntastic#log#error(msg) " {{{2
|
|||
echohl None
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#log#deprecationWarn(msg) " {{{2
|
||||
if index(s:deprecation_notices_issued, a:msg) >= 0
|
||||
function! syntastic#log#oneTimeWarn(msg) " {{{2
|
||||
if index(s:one_time_notices_issued, a:msg) >= 0
|
||||
return
|
||||
endif
|
||||
|
||||
call add(s:deprecation_notices_issued, a:msg)
|
||||
call add(s:one_time_notices_issued, a:msg)
|
||||
call syntastic#log#warn(a:msg)
|
||||
endfunction " }}}2
|
||||
|
||||
" @vimlint(EVL102, 1, l:OLD_VAR)
|
||||
function! syntastic#log#deprecationWarn(old, new, ...) " {{{2
|
||||
if exists('g:syntastic_' . a:old) && !exists('g:syntastic_' . a:new)
|
||||
let msg = 'variable g:syntastic_' . a:old . ' is deprecated, please use '
|
||||
|
||||
if a:0
|
||||
let OLD_VAR = g:syntastic_{a:old}
|
||||
try
|
||||
let NEW_VAR = eval(a:1)
|
||||
let msg .= 'in its stead: let g:syntastic_' . a:new . ' = ' . string(NEW_VAR)
|
||||
let g:syntastic_{a:new} = NEW_VAR
|
||||
catch
|
||||
let msg .= 'g:syntastic_' . a:new . ' instead'
|
||||
endtry
|
||||
else
|
||||
let msg .= 'g:syntastic_' . a:new . ' instead'
|
||||
let g:syntastic_{a:new} = g:syntastic_{a:old}
|
||||
endif
|
||||
|
||||
call syntastic#log#oneTimeWarn(msg)
|
||||
endif
|
||||
endfunction " }}}2
|
||||
" @vimlint(EVL102, 0, l:OLD_VAR)
|
||||
|
||||
function! syntastic#log#debug(level, msg, ...) " {{{2
|
||||
if !s:isDebugEnabled(a:level)
|
||||
return
|
||||
|
@ -113,6 +137,7 @@ function! s:isDebugEnabled_dumb(level) " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
let s:isDebugEnabled = function(exists('*and') ? 's:isDebugEnabled_smart' : 's:isDebugEnabled_dumb')
|
||||
lockvar s:isDebugEnabled
|
||||
|
||||
function! s:logRedirect(on) " {{{2
|
||||
if exists("g:syntastic_debug_file")
|
||||
|
@ -138,6 +163,7 @@ function! s:logTimestamp_dumb() " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
let s:logTimestamp = function(has('reltime') ? 's:logTimestamp_smart' : 's:logTimestamp_dumb')
|
||||
lockvar s:logTimestamp
|
||||
|
||||
function! s:formatVariable(name) " {{{2
|
||||
let vals = []
|
||||
|
|
|
@ -14,6 +14,8 @@ function! syntastic#postprocess#compressWhitespace(errors) " {{{2
|
|||
let e['text'] = substitute(e['text'], "\001", '', 'g')
|
||||
let e['text'] = substitute(e['text'], '\n', ' ', 'g')
|
||||
let e['text'] = substitute(e['text'], '\m\s\{2,}', ' ', 'g')
|
||||
let e['text'] = substitute(e['text'], '\m^\s\+', '', '')
|
||||
let e['text'] = substitute(e['text'], '\m\s\+$', '', '')
|
||||
endfor
|
||||
|
||||
return a:errors
|
||||
|
|
|
@ -8,6 +8,26 @@ set cpo&vim
|
|||
|
||||
" Public functions {{{1
|
||||
|
||||
function! syntastic#preprocess#cabal(errors) " {{{2
|
||||
let out = []
|
||||
let star = 0
|
||||
for err in a:errors
|
||||
if star
|
||||
if err == ''
|
||||
let star = 0
|
||||
else
|
||||
let out[-1] .= ' ' . err
|
||||
endif
|
||||
else
|
||||
call add(out, err)
|
||||
if err =~ '\m^*\s'
|
||||
let star = 1
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return out
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#preprocess#checkstyle(errors) " {{{2
|
||||
let out = []
|
||||
let fname = expand('%')
|
||||
|
@ -95,6 +115,10 @@ function! syntastic#preprocess#rparse(errors) " {{{2
|
|||
return out
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#preprocess#tslint(errors) " {{{2
|
||||
return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")')
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#preprocess#validator(errors) " {{{2
|
||||
let out = []
|
||||
for e in a:errors
|
||||
|
|
|
@ -88,6 +88,7 @@ endfunction " }}}2
|
|||
" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen()
|
||||
" and hope for the best :)
|
||||
let s:width = function(exists('*strwidth') ? 'strwidth' : 'strlen')
|
||||
lockvar s:width
|
||||
|
||||
"print as much of a:msg as possible without "Press Enter" prompt appearing
|
||||
function! syntastic#util#wideMsg(msg) " {{{2
|
||||
|
|
|
@ -38,9 +38,10 @@ CONTENTS *syntastic-contents*
|
|||
6.1.Handling of composite filetypes........|syntastic-composite|
|
||||
6.2.Interaction with python-mode...........|syntastic-pymode|
|
||||
6.3.Interaction with the fish shell........|syntastic-fish|
|
||||
6.4.Using syntastic with the fizsh shell...|syntastic-fizsh|
|
||||
6.5.Interaction with Eclim.................|syntastic-eclim|
|
||||
6.6.Interaction with vim-virtualenv........|syntastic-vim-virtualenv|
|
||||
6.4.Interaction with PowerShell............|syntastic-powershell|
|
||||
6.5.Using syntastic with the fizsh shell...|syntastic-fizsh|
|
||||
6.6.Interaction with Eclim.................|syntastic-eclim|
|
||||
6.7.Interaction with vim-virtualenv........|syntastic-vim-virtualenv|
|
||||
7.About........................................|syntastic-about|
|
||||
8.License......................................|syntastic-license|
|
||||
|
||||
|
@ -83,7 +84,7 @@ see |syntastic-checker-options| for details. You can also change the arguments
|
|||
passed to a specific checker as well.
|
||||
|
||||
Use |:SyntasticCheck| to manually check right now. Use |:SyntasticToggleMode|
|
||||
to switch between active (checking on writting the buffer) and passive (manual)
|
||||
to switch between active (checking on writing the buffer) and passive (manual)
|
||||
checking.
|
||||
|
||||
==============================================================================
|
||||
|
@ -93,7 +94,7 @@ Syntax checking can be done automatically or on demand (see
|
|||
|'syntastic_mode_map'| and |:SyntasticToggleMode| for configuring this).
|
||||
|
||||
When syntax checking is done, the features below can be used to notify the
|
||||
user of errors. See |syntastic-options| for how to configure and
|
||||
user of errors. See |syntastic-global-options| for how to configure and
|
||||
activate/deactivate these features.
|
||||
|
||||
* A statusline flag
|
||||
|
@ -169,6 +170,8 @@ and the SpellCap group is used for warnings. If you wish to customize the
|
|||
colors for highlighting you can use the following groups:
|
||||
SyntasticError - Links to 'SpellBad' by default
|
||||
SyntasticWarning - Links to 'SpellCap' by default
|
||||
SyntasticStyleError - Links to SyntasticError by default
|
||||
SyntasticStyleWarning - Links to SyntasticWarning by default
|
||||
|
||||
Example: >
|
||||
highlight SyntasticError guibg=#2f0000
|
||||
|
@ -288,10 +291,12 @@ to label error messages with the names of the checkers that created them. >
|
|||
<
|
||||
*'syntastic_sort_aggregated_errors'*
|
||||
Default: 1
|
||||
By default, when |syntastic_aggregate_errors| is enabled, errors are grouped
|
||||
by file, then sorted by line number, then grouped by type (namely, errors take
|
||||
precedence over warnings), then they are sorted by column number. If you want
|
||||
to leave messages grouped by checker output, set this variable to 0. >
|
||||
By default, when results from multiple checkers are aggregated in a single
|
||||
error list (that is either when |syntastic_aggregate_errors| is enabled, or
|
||||
when checking a file with a composite filetype), errors are grouped by file,
|
||||
then sorted by line number, then grouped by type (namely errors take precedence
|
||||
over warnings), then they are sorted by column number. If you want to leave
|
||||
messages grouped by checker output, set this variable to 0. >
|
||||
let g:syntastic_sort_aggregated_errors = 0
|
||||
<
|
||||
*'syntastic_echo_current_error'*
|
||||
|
@ -593,7 +598,7 @@ Checkers that use 'makeprgBuild()' construct a 'makeprg' like this: >
|
|||
\ 'tail': '> /tmp/output' })
|
||||
<
|
||||
The result is a 'makeprg' of the form: >
|
||||
<exe> <args> <filename> <post_args> <tail>
|
||||
<exe> <args> <fname> <post_args> <tail>
|
||||
<
|
||||
*'syntastic_<filetype>_<checker>_exe'*
|
||||
All arguments above are optional, and can be overridden by setting global
|
||||
|
@ -666,7 +671,16 @@ traditional shell, such as 'zsh', 'bash', 'ksh', or even the original Bourne
|
|||
set shell=bash
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
6.4. Using syntastic with the fizsh shell *syntastic-fizsh*
|
||||
6.4. Interaction with PowerShell *syntastic-powershell*
|
||||
|
||||
At the time of this writing, syntastic is not compatible with using 'Windows
|
||||
PowerShell' (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's
|
||||
'shell'. You may still run Vim from 'PowerShell', but you do have to point
|
||||
Vim's 'shell' to a more traditional program, such as 'cmd.exe': >
|
||||
set shell=cmd.exe
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
6.5. Using syntastic with the fizsh shell *syntastic-fizsh*
|
||||
|
||||
Using syntastic with the 'fizsh' shell (see https://github.com/zsh-users/fizsh)
|
||||
is possible, but potentially problematic. In order to do it you'll need to set
|
||||
|
@ -679,7 +693,7 @@ interactive features of 'fizsh'. Using a more traditional shell such as 'zsh',
|
|||
set shell=zsh
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
6.5. Interaction with Eclim *syntastic-eclim*
|
||||
6.6. Interaction with Eclim *syntastic-eclim*
|
||||
|
||||
As far as syntastic is concerned there shouldn't be any compatibility problems
|
||||
with the 'Eclim' Vim plugin (see http://eclim.org/). However, at the time of
|
||||
|
@ -688,7 +702,7 @@ makes syntastic forget some of its configuration parameters. No solutions or
|
|||
workarounds are known for now.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
6.6. Interaction with vim-virtualenv *syntastic-vim-virtualenv*
|
||||
6.7. Interaction with vim-virtualenv *syntastic-vim-virtualenv*
|
||||
|
||||
At the time of this writing, syntastic can't run checkers installed
|
||||
in Python virtual environments activated by 'vim-virtualenv' (see
|
||||
|
|
|
@ -16,9 +16,11 @@ let g:loaded_syntastic_plugin = 1
|
|||
|
||||
if has('reltime')
|
||||
let g:syntastic_start = reltime()
|
||||
lockvar! g:syntastic_start
|
||||
endif
|
||||
|
||||
let g:syntastic_version = '3.4.0-34'
|
||||
let g:syntastic_version = '3.4.0-90'
|
||||
lockvar g:syntastic_version
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
||||
|
@ -30,6 +32,8 @@ for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands'
|
|||
endfor
|
||||
|
||||
let s:running_windows = syntastic#util#isRunningWindows()
|
||||
lockvar s:running_windows
|
||||
|
||||
if !s:running_windows && executable('uname')
|
||||
try
|
||||
let s:uname = system('uname')
|
||||
|
@ -37,6 +41,7 @@ if !s:running_windows && executable('uname')
|
|||
call syntastic#log#error("your shell " . &shell . " doesn't use traditional UNIX syntax for redirections")
|
||||
finish
|
||||
endtry
|
||||
lockvar s:uname
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
|
@ -70,6 +75,7 @@ let g:syntastic_defaults = {
|
|||
\ 'style_warning_symbol': 'S>',
|
||||
\ 'warning_symbol': '>>'
|
||||
\ }
|
||||
lockvar! g:syntastic_defaults
|