Updated plugins
This commit is contained in:
parent
46195e4ca4
commit
dbcdace7be
32 changed files with 644 additions and 664 deletions
|
@ -5,10 +5,10 @@ BufExplorer Plugin for Vim
|
||||||
|
|
||||||
With bufexplorer, you can quickly and easily switch between buffers by using the one of the default public interfaces:
|
With bufexplorer, you can quickly and easily switch between buffers by using the one of the default public interfaces:
|
||||||
|
|
||||||
'<Leader>be' (normal open) or
|
'\<Leader\>be' (normal open) or
|
||||||
'<Leader>bt' (toggle open / close) or
|
'\<Leader\>bt' (toggle open / close) or
|
||||||
'<Leader>bs' (force horizontal split open) or
|
'\<Leader\>bs' (force horizontal split open) or
|
||||||
'<Leader>bv' (force vertical split open)
|
'\<Leader\>bv' (force vertical split open)
|
||||||
|
|
||||||
Once the bufexplorer window is open you can use the normal movement keys (hjkl) to move around and then use <Enter> or <Left-Mouse-Click> to select the buffer you would like to open. If you would like to have the selected buffer opened in a new tab, simply press either <Shift-Enter> or 't'. Please note that when opening a buffer in a tab, that if the buffer is already in another tab, bufexplorer can switch to that tab automatically for you if you would like. More about that in the supplied VIM help.
|
Once the bufexplorer window is open you can use the normal movement keys (hjkl) to move around and then use <Enter> or <Left-Mouse-Click> to select the buffer you would like to open. If you would like to have the selected buffer opened in a new tab, simply press either <Shift-Enter> or 't'. Please note that when opening a buffer in a tab, that if the buffer is already in another tab, bufexplorer can switch to that tab automatically for you if you would like. More about that in the supplied VIM help.
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ This plugin can also be found at http://www.vim.org/scripts/script.php?script_id
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
### Manually
|
### Manually
|
||||||
1. If you do not want to use on the the bundle handlers, you can take the zip
|
1. If you do not want to use one of the the bundle handlers, you can take the
|
||||||
file from vim.org and unzip it and copy the plugin to your vimfiles\plugin
|
zip file from vim.org and unzip it and copy the plugin to your vimfiles\plugin
|
||||||
directory and the txt file to your vimfiles\doc directory. If you do that,
|
directory and the txt file to your vimfiles\doc directory. If you do that,
|
||||||
make sure you generate the help by executing
|
make sure you generate the help by executing
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ This plugin can also be found at http://www.vim.org/scripts/script.php?script_id
|
||||||
git clone https://github.com/jlanzarotta/bufexplorer.git ~/.vim/bundle/bufexplorer.vim
|
git clone https://github.com/jlanzarotta/bufexplorer.git ~/.vim/bundle/bufexplorer.vim
|
||||||
|
|
||||||
## License
|
## License
|
||||||
Copyright (c) 2001-2019, Jeff Lanzarotta
|
Copyright (c) 2001-2020, Jeff Lanzarotta
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
|
|
@ -919,7 +919,7 @@ function! s:SelectBuffer(...)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Switch to the selected buffer.
|
" Switch to the selected buffer.
|
||||||
execute "keepalt silent b!" _bufNbr
|
execute "keepjumps keepalt silent b!" _bufNbr
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Make the buffer 'listed' again.
|
" Make the buffer 'listed' again.
|
||||||
|
@ -957,12 +957,6 @@ function! s:RemoveBuffer(mode)
|
||||||
|
|
||||||
let mode = a:mode
|
let mode = a:mode
|
||||||
|
|
||||||
" Do not allow this buffer to be deleted if it is the last one.
|
|
||||||
if len(s:MRUList) == 1
|
|
||||||
call s:Error("Sorry, you are not allowed to delete the last buffer")
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
" These commands are to temporarily suspend the activity of winmanager.
|
" These commands are to temporarily suspend the activity of winmanager.
|
||||||
if exists("b:displayMode") && b:displayMode == "winmanager"
|
if exists("b:displayMode") && b:displayMode == "winmanager"
|
||||||
call WinManagerSuspendAUs()
|
call WinManagerSuspendAUs()
|
||||||
|
|
|
@ -266,6 +266,9 @@ Then gist-vim will ask for your password in order to create an access
|
||||||
token. If you have two-factor authentication enabled, gist-vim will also
|
token. If you have two-factor authentication enabled, gist-vim will also
|
||||||
prompt you to enter the two-factor key you receive.
|
prompt you to enter the two-factor key you receive.
|
||||||
|
|
||||||
|
NOTE:
|
||||||
|
If you want you can set it directly to `g:github_user` and `g:gist_token`.
|
||||||
|
|
||||||
Whichever type of authentication you use, your GitHub password will not be
|
Whichever type of authentication you use, your GitHub password will not be
|
||||||
stored, only a OAuth access token produced specifically for gist-vim. The
|
stored, only a OAuth access token produced specifically for gist-vim. The
|
||||||
token is stored in `~/.gist-vim`. If you stop using the plugin, you can
|
token is stored in `~/.gist-vim`. If you stop using the plugin, you can
|
||||||
|
|
|
@ -961,7 +961,9 @@ function! s:GistGetAuthHeader() abort
|
||||||
return printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password))
|
return printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password))
|
||||||
endif
|
endif
|
||||||
let auth = ''
|
let auth = ''
|
||||||
if filereadable(s:gist_token_file)
|
if !empty(get(g:, 'gist_token', $GITHUB_TOKEN))
|
||||||
|
let auth = 'token ' . get(g:, 'gist_token', $GITHUB_TOKEN)
|
||||||
|
elseif filereadable(s:gist_token_file)
|
||||||
let str = join(readfile(s:gist_token_file), '')
|
let str = join(readfile(s:gist_token_file), '')
|
||||||
if type(str) == 1
|
if type(str) == 1
|
||||||
let auth = str
|
let auth = str
|
||||||
|
|
|
@ -30,6 +30,7 @@ let g:lightline = {}
|
||||||
|
|
||||||
let g:lightline.component_expand = {
|
let g:lightline.component_expand = {
|
||||||
\ 'linter_checking': 'lightline#ale#checking',
|
\ 'linter_checking': 'lightline#ale#checking',
|
||||||
|
\ 'linter_infos': 'lightline#ale#infos',
|
||||||
\ 'linter_warnings': 'lightline#ale#warnings',
|
\ 'linter_warnings': 'lightline#ale#warnings',
|
||||||
\ 'linter_errors': 'lightline#ale#errors',
|
\ 'linter_errors': 'lightline#ale#errors',
|
||||||
\ 'linter_ok': 'lightline#ale#ok',
|
\ 'linter_ok': 'lightline#ale#ok',
|
||||||
|
@ -40,17 +41,18 @@ let g:lightline.component_expand = {
|
||||||
|
|
||||||
```viml
|
```viml
|
||||||
let g:lightline.component_type = {
|
let g:lightline.component_type = {
|
||||||
\ 'linter_checking': 'left',
|
\ 'linter_checking': 'right',
|
||||||
|
\ 'linter_infos': 'right',
|
||||||
\ 'linter_warnings': 'warning',
|
\ 'linter_warnings': 'warning',
|
||||||
\ 'linter_errors': 'error',
|
\ 'linter_errors': 'error',
|
||||||
\ 'linter_ok': 'left',
|
\ 'linter_ok': 'right',
|
||||||
\ }
|
\ }
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Add the components to the lightline, for example to the right side:
|
3. Add the components to the lightline, for example to the right side:
|
||||||
|
|
||||||
```viml
|
```viml
|
||||||
let g:lightline.active = { 'right': [[ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_ok' ]] }
|
let g:lightline.active = { 'right': [[ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok' ]] }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
@ -59,6 +61,10 @@ let g:lightline.active = { 'right': [[ 'linter_checking', 'linter_errors', 'lint
|
||||||
|
|
||||||
The indicator to use when ALE is in progress. Default is `Linting...`.
|
The indicator to use when ALE is in progress. Default is `Linting...`.
|
||||||
|
|
||||||
|
##### `g:lightline#ale#indicator_infos`
|
||||||
|
|
||||||
|
The indicator to use when there are infos. Default is `I:`.
|
||||||
|
|
||||||
##### `g:lightline#ale#indicator_warnings`
|
##### `g:lightline#ale#indicator_warnings`
|
||||||
|
|
||||||
The indicator to use when there are warnings. Default is `W:`.
|
The indicator to use when there are warnings. Default is `W:`.
|
||||||
|
@ -78,6 +84,7 @@ If you would like to replace the default indicators with symbols like on the scr
|
||||||
The following icons from the Font Awesome font are used in the screenshot:
|
The following icons from the Font Awesome font are used in the screenshot:
|
||||||
|
|
||||||
* Checking: [f110](https://fontawesome.com/icons/spinner)
|
* Checking: [f110](https://fontawesome.com/icons/spinner)
|
||||||
|
* Infos: [f129](https://fontawesome.com/icons/info)
|
||||||
* Warnings: [f071](https://fontawesome.com/icons/exclamation-triangle)
|
* Warnings: [f071](https://fontawesome.com/icons/exclamation-triangle)
|
||||||
* Errors: [f05e](https://fontawesome.com/icons/ban)
|
* Errors: [f05e](https://fontawesome.com/icons/ban)
|
||||||
* OK: [f00c](https://fontawesome.com/icons/check) (although I prefer to disable this component)
|
* OK: [f00c](https://fontawesome.com/icons/check) (although I prefer to disable this component)
|
||||||
|
@ -93,6 +100,7 @@ Here's the configuration snippet used in the screenshot:
|
||||||
|
|
||||||
```viml
|
```viml
|
||||||
let g:lightline#ale#indicator_checking = "\uf110"
|
let g:lightline#ale#indicator_checking = "\uf110"
|
||||||
|
let g:lightline#ale#indicator_infos = "\uf129"
|
||||||
let g:lightline#ale#indicator_warnings = "\uf071"
|
let g:lightline#ale#indicator_warnings = "\uf071"
|
||||||
let g:lightline#ale#indicator_errors = "\uf05e"
|
let g:lightline#ale#indicator_errors = "\uf05e"
|
||||||
let g:lightline#ale#indicator_ok = "\uf00c"
|
let g:lightline#ale#indicator_ok = "\uf00c"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
let s:indicator_infos = get(g:, 'lightline#ale#indicator_infos', 'I: ')
|
||||||
let s:indicator_warnings = get(g:, 'lightline#ale#indicator_warnings', 'W: ')
|
let s:indicator_warnings = get(g:, 'lightline#ale#indicator_warnings', 'W: ')
|
||||||
let s:indicator_errors = get(g:, 'lightline#ale#indicator_errors', 'E: ')
|
let s:indicator_errors = get(g:, 'lightline#ale#indicator_errors', 'E: ')
|
||||||
let s:indicator_ok = get(g:, 'lightline#ale#indicator_ok', 'OK')
|
let s:indicator_ok = get(g:, 'lightline#ale#indicator_ok', 'OK')
|
||||||
|
@ -7,14 +8,21 @@ let s:indicator_checking = get(g:, 'lightline#ale#indicator_checking', 'Linting.
|
||||||
""""""""""""""""""""""
|
""""""""""""""""""""""
|
||||||
" Lightline components
|
" Lightline components
|
||||||
|
|
||||||
|
function! lightline#ale#infos() abort
|
||||||
|
if !lightline#ale#linted()
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
|
return l:counts.info == 0 ? '' : printf(s:indicator_infos . '%d', l:counts.info)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! lightline#ale#warnings() abort
|
function! lightline#ale#warnings() abort
|
||||||
if !lightline#ale#linted()
|
if !lightline#ale#linted()
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let l:counts = ale#statusline#Count(bufnr(''))
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
let l:all_errors = l:counts.error + l:counts.style_error
|
let l:all_warnings = l:counts.warning + l:counts.style_warning
|
||||||
let l:all_non_errors = l:counts.total - l:all_errors
|
return l:all_warnings == 0 ? '' : printf(s:indicator_warnings . '%d', all_warnings)
|
||||||
return l:all_non_errors == 0 ? '' : printf(s:indicator_warnings . '%d', all_non_errors)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! lightline#ale#errors() abort
|
function! lightline#ale#errors() abort
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2013-2019 itchyny
|
Copyright (c) 2013-2020 itchyny
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -246,7 +246,7 @@ let g:lightline = {
|
||||||
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
|
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
|
||||||
\ },
|
\ },
|
||||||
\ 'component_function': {
|
\ 'component_function': {
|
||||||
\ 'gitbranch': 'fugitive#head'
|
\ 'gitbranch': 'FugitiveHead'
|
||||||
\ },
|
\ },
|
||||||
\ }
|
\ }
|
||||||
```
|
```
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
" Filename: autoload/lightline.vim
|
" Filename: autoload/lightline.vim
|
||||||
" Author: itchyny
|
" Author: itchyny
|
||||||
" License: MIT License
|
" License: MIT License
|
||||||
" Last Change: 2019/08/20 14:00:00.
|
" Last Change: 2020/01/27 19:41:58.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
|
@ -432,7 +432,7 @@ function! s:line(tabline, inactive) abort
|
||||||
let _ .= i < l + len(lt) - len(l_) && ll[i] < l || ll[i] != ll[i + 1] ? p.left : len(lt[i]) ? s.left : ''
|
let _ .= i < l + len(lt) - len(l_) && ll[i] < l || ll[i] != ll[i + 1] ? p.left : len(lt[i]) ? s.left : ''
|
||||||
endfor
|
endfor
|
||||||
let _ .= '%#LightlineMiddle_' . mode . '#%='
|
let _ .= '%#LightlineMiddle_' . mode . '#%='
|
||||||
for i in reverse(range(len(rt)))
|
for i in range(len(rt) - 1, 0, -1)
|
||||||
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '_' . rl[i + 1] . '#'
|
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '_' . rl[i + 1] . '#'
|
||||||
let _ .= i < r + len(rt) - len(r_) && rl[i] < r || rl[i] != rl[i + 1] ? p.right : len(rt[i]) ? s.right : ''
|
let _ .= i < r + len(rt) - len(r_) && rl[i] < r || rl[i] != rl[i + 1] ? p.right : len(rt[i]) ? s.right : ''
|
||||||
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '#'
|
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '#'
|
||||||
|
|
|
@ -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: 2019/12/27 18:23:29.
|
Last Change: 2020/01/28 18:40:21.
|
||||||
|
|
||||||
CONTENTS *lightline-contents*
|
CONTENTS *lightline-contents*
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ OPTIONS *lightline-option*
|
||||||
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
|
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
|
||||||
\ },
|
\ },
|
||||||
\ 'component_function': {
|
\ 'component_function': {
|
||||||
\ 'gitbranch': 'fugitive#head'
|
\ 'gitbranch': 'FugitiveHead'
|
||||||
\ },
|
\ },
|
||||||
\ }
|
\ }
|
||||||
<
|
<
|
||||||
|
@ -316,8 +316,8 @@ nice.
|
||||||
return &readonly ? '' : ''
|
return &readonly ? '' : ''
|
||||||
endfunction
|
endfunction
|
||||||
function! LightlineFugitive()
|
function! LightlineFugitive()
|
||||||
if exists('*fugitive#head')
|
if exists('*FugitiveHead')
|
||||||
let branch = fugitive#head()
|
let branch = FugitiveHead()
|
||||||
return branch !=# '' ? ''.branch : ''
|
return branch !=# '' ? ''.branch : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
|
@ -341,8 +341,8 @@ look nice.
|
||||||
return &readonly ? '⭤' : ''
|
return &readonly ? '⭤' : ''
|
||||||
endfunction
|
endfunction
|
||||||
function! LightlineFugitive()
|
function! LightlineFugitive()
|
||||||
if exists('*fugitive#head')
|
if exists('*FugitiveHead')
|
||||||
let branch = fugitive#head()
|
let branch = FugitiveHead()
|
||||||
return branch !=# '' ? '⭠ '.branch : ''
|
return branch !=# '' ? '⭠ '.branch : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
|
@ -742,8 +742,8 @@ A nice example for non-patched font users.
|
||||||
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
|
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
|
||||||
endfunction
|
endfunction
|
||||||
function! LightlineFugitive()
|
function! LightlineFugitive()
|
||||||
if &ft !~? 'vimfiler' && exists('*fugitive#head')
|
if &ft !~? 'vimfiler' && exists('*FugitiveHead')
|
||||||
return fugitive#head()
|
return FugitiveHead()
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -777,8 +777,8 @@ A nice example for |vim-powerline| font users:
|
||||||
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
|
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
|
||||||
endfunction
|
endfunction
|
||||||
function! LightlineFugitive()
|
function! LightlineFugitive()
|
||||||
if &ft !~? 'vimfiler' && exists('*fugitive#head')
|
if &ft !~? 'vimfiler' && exists('*FugitiveHead')
|
||||||
let branch = fugitive#head()
|
let branch = FugitiveHead()
|
||||||
return branch !=# '' ? '⭠ '.branch : ''
|
return branch !=# '' ? '⭠ '.branch : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
|
@ -836,9 +836,9 @@ For users who uses lots of plugins:
|
||||||
|
|
||||||
function! LightlineFugitive()
|
function! LightlineFugitive()
|
||||||
try
|
try
|
||||||
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*FugitiveHead')
|
||||||
let mark = '' " edit here for cool mark
|
let mark = '' " edit here for cool mark
|
||||||
let branch = fugitive#head()
|
let branch = FugitiveHead()
|
||||||
return branch !=# '' ? mark.branch : ''
|
return branch !=# '' ? mark.branch : ''
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
|
|
|
@ -7,7 +7,12 @@
|
||||||
in an unordered list. The format is:
|
in an unordered list. The format is:
|
||||||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||||
-->
|
-->
|
||||||
|
#### 6.5
|
||||||
|
- **.0**: `NERDTreeToggle <start-directory>` always sets NERDTree root. (PhilRunninger) [#1083](https://github.com/preservim/nerdtree/pull/1083)
|
||||||
#### 6.4
|
#### 6.4
|
||||||
|
- **.6**: NERDTreeFind shows expected message if file doesn't exist e.g. with vim-startify (andys8). [#1081](https://github.com/preservim/nerdtree/pull/1081)
|
||||||
|
- **.5**: Ensure events are (or aren't) being ignored correctly. (PhilRunninger) [#1080](https://github.com/preservim/nerdtree/pull/1080)
|
||||||
|
- **.4**: Prevent overwriting existing files/dirs on node move. (PhilRunninger) [#1079](https://github.com/preservim/nerdtree/pull/1079)
|
||||||
- **.3**: Fix regex that finds keyword for minimal menu. (PhilRunninger) [#1075](https://github.com/preservim/nerdtree/pull/1075)
|
- **.3**: Fix regex that finds keyword for minimal menu. (PhilRunninger) [#1075](https://github.com/preservim/nerdtree/pull/1075)
|
||||||
- **.2**: Lint vimscript, fix errors and warnings, add CI job to review PRs (Caleb Maclennan) [#1071](https://github.com/preservim/nerdtree/pull/1071)
|
- **.2**: Lint vimscript, fix errors and warnings, add CI job to review PRs (Caleb Maclennan) [#1071](https://github.com/preservim/nerdtree/pull/1071)
|
||||||
- **.1**: Ensure backward compatibility. v:t_func is not available before Vim 8.0 (Phil Runninger)
|
- **.1**: Ensure backward compatibility. v:t_func is not available before Vim 8.0 (Phil Runninger)
|
||||||
|
|
|
@ -169,8 +169,11 @@ function! nerdtree#exec(cmd, ignoreAll) abort
|
||||||
if a:ignoreAll
|
if a:ignoreAll
|
||||||
set eventignore=all
|
set eventignore=all
|
||||||
endif
|
endif
|
||||||
|
try
|
||||||
exec a:cmd
|
exec a:cmd
|
||||||
|
finally
|
||||||
let &eventignore = old_ei
|
let &eventignore = old_ei
|
||||||
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: nerdtree#has_opt(options, name) {{{2
|
" FUNCTION: nerdtree#has_opt(options, name) {{{2
|
||||||
|
|
|
@ -284,15 +284,16 @@ endfunction
|
||||||
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
||||||
function! s:findAndRevealPath(pathStr) abort
|
function! s:findAndRevealPath(pathStr) abort
|
||||||
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
||||||
if !filereadable(l:pathStr)
|
|
||||||
let l:pathStr = fnamemodify(l:pathStr, ':h')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if empty(l:pathStr)
|
if empty(l:pathStr)
|
||||||
call nerdtree#echoWarning('no file for the current buffer')
|
call nerdtree#echoWarning('no file for the current buffer')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !filereadable(l:pathStr)
|
||||||
|
let l:pathStr = fnamemodify(l:pathStr, ':h')
|
||||||
|
endif
|
||||||
|
|
||||||
try
|
try
|
||||||
let l:pathStr = g:NERDTreePath.Resolve(l:pathStr)
|
let l:pathStr = g:NERDTreePath.Resolve(l:pathStr)
|
||||||
let l:pathObj = g:NERDTreePath.New(l:pathStr)
|
let l:pathObj = g:NERDTreePath.New(l:pathStr)
|
||||||
|
|
|
@ -122,8 +122,9 @@ The following features and functionality are provided by the NERDTree:
|
||||||
|
|
||||||
:NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
|
:NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
|
||||||
If a NERDTree already exists for this tab, it is reopened and rendered
|
If a NERDTree already exists for this tab, it is reopened and rendered
|
||||||
again. If no NERDTree exists for this tab then this command acts the
|
again. If <start-directory> or <bookmark> is given, the root of NERDTree
|
||||||
same as the |:NERDTree| command.
|
is set to that path. If no NERDTree exists for this tab then this command
|
||||||
|
acts the same as the |:NERDTree| command.
|
||||||
|
|
||||||
:NERDTreeToggleVCS [<start-directory> | <bookmark>] *:NERDTreeToggleVCS*
|
:NERDTreeToggleVCS [<start-directory> | <bookmark>] *:NERDTreeToggleVCS*
|
||||||
Like |:NERDTreeToggle|, but searches up the directory tree to find the top of
|
Like |:NERDTreeToggle|, but searches up the directory tree to find the top of
|
||||||
|
|
|
@ -333,6 +333,7 @@ function! s:Creator._tabpagevar(tabnr, var)
|
||||||
let old_ei = &eventignore
|
let old_ei = &eventignore
|
||||||
set eventignore=all
|
set eventignore=all
|
||||||
|
|
||||||
|
try
|
||||||
exec 'tabnext ' . a:tabnr
|
exec 'tabnext ' . a:tabnr
|
||||||
let v = -1
|
let v = -1
|
||||||
if exists('t:' . a:var)
|
if exists('t:' . a:var)
|
||||||
|
@ -340,7 +341,9 @@ function! s:Creator._tabpagevar(tabnr, var)
|
||||||
endif
|
endif
|
||||||
exec 'tabnext ' . currentTab
|
exec 'tabnext ' . currentTab
|
||||||
|
|
||||||
|
finally
|
||||||
let &eventignore = old_ei
|
let &eventignore = old_ei
|
||||||
|
endtry
|
||||||
|
|
||||||
return v
|
return v
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -352,17 +355,20 @@ function! s:Creator.ToggleTabTree(dir)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: s:Creator.toggleTabTree(dir) {{{1
|
" FUNCTION: s:Creator.toggleTabTree(dir) {{{1
|
||||||
" Toggles the NERD tree. I.e the NERD tree is open, it is closed, if it is
|
" Toggles the NERD tree. I.e if the NERD tree is open, it is closed. If it is
|
||||||
" closed it is restored or initialized (if it doesnt exist)
|
" closed, it is restored or initialized. If dir is not empty, it will be set
|
||||||
|
" as the new root.
|
||||||
"
|
"
|
||||||
" Args:
|
" Args:
|
||||||
" dir: the full path for the root node (is only used if the NERD tree is being
|
" dir: the full path for the root node (is used if the NERD tree is being
|
||||||
" initialized.
|
" initialized, or to change the root to a new dir.)
|
||||||
function! s:Creator.toggleTabTree(dir)
|
function! s:Creator.toggleTabTree(dir)
|
||||||
if g:NERDTree.ExistsForTab()
|
if g:NERDTree.ExistsForTab()
|
||||||
if !g:NERDTree.IsOpen()
|
if !g:NERDTree.IsOpen()
|
||||||
call self._createTreeWin()
|
call self._createTreeWin()
|
||||||
if !&hidden
|
if !empty(a:dir)
|
||||||
|
call self.createTabTree(a:dir)
|
||||||
|
elseif !&hidden
|
||||||
call b:NERDTree.render()
|
call b:NERDTree.render()
|
||||||
endif
|
endif
|
||||||
call b:NERDTree.ui.restoreScreenState()
|
call b:NERDTree.ui.restoreScreenState()
|
||||||
|
|
|
@ -141,12 +141,12 @@ function! s:renameBuffer(bufNum, newNodeName, isDirectory)
|
||||||
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
|
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
|
||||||
endif
|
endif
|
||||||
" 1. ensure that a new buffer is loaded
|
" 1. ensure that a new buffer is loaded
|
||||||
call nerdtree#exec('badd ' . quotedFileName, 1)
|
call nerdtree#exec('badd ' . quotedFileName, 0)
|
||||||
" 2. ensure that all windows which display the just deleted filename
|
" 2. ensure that all windows which display the just deleted filename
|
||||||
" display a buffer for a new filename.
|
" display a buffer for a new filename.
|
||||||
let s:originalTabNumber = tabpagenr()
|
let s:originalTabNumber = tabpagenr()
|
||||||
let s:originalWindowNumber = winnr()
|
let s:originalWindowNumber = winnr()
|
||||||
call nerdtree#exec('tabdo windo if winbufnr(0) ==# ' . a:bufNum . " | exec ':e! " . editStr . "' | endif", 1)
|
call nerdtree#exec('tabdo windo if winbufnr(0) ==# ' . a:bufNum . " | exec ':e! " . editStr . "' | endif", 0)
|
||||||
call nerdtree#exec('tabnext ' . s:originalTabNumber, 1)
|
call nerdtree#exec('tabnext ' . s:originalTabNumber, 1)
|
||||||
call nerdtree#exec(s:originalWindowNumber . 'wincmd w', 1)
|
call nerdtree#exec(s:originalWindowNumber . 'wincmd w', 1)
|
||||||
" 3. We don't need a previous buffer anymore
|
" 3. We don't need a previous buffer anymore
|
||||||
|
@ -196,6 +196,11 @@ function! NERDTreeMoveNode()
|
||||||
let curNode = g:NERDTreeFileNode.GetSelected()
|
let curNode = g:NERDTreeFileNode.GetSelected()
|
||||||
let prompt = s:inputPrompt('move')
|
let prompt = s:inputPrompt('move')
|
||||||
let newNodePath = input(prompt, curNode.path.str(), 'file')
|
let newNodePath = input(prompt, curNode.path.str(), 'file')
|
||||||
|
while filereadable(newNodePath)
|
||||||
|
call nerdtree#echoWarning('This destination already exists. Try again.')
|
||||||
|
let newNodePath = input(prompt, curNode.path.str(), 'file')
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
|
||||||
if newNodePath ==# ''
|
if newNodePath ==# ''
|
||||||
call nerdtree#echo('Node Renaming Aborted.')
|
call nerdtree#echo('Node Renaming Aborted.')
|
||||||
|
|
|
@ -51,22 +51,27 @@ For help with secure cipher selection, visit [Mozillas SSL Configuration Generat
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Pathogen
|
Install using any vim plugin manager. If you're not familiar with any, go with Plug ([``vim-plug``](https://github.com/junegunn/vim-plug)).
|
||||||
|
Then install this plugin using the your vim's plugin manager as follows:
|
||||||
|
|
||||||
```bash
|
### Plug
|
||||||
git clone https://github.com/chr4/nginx.vim ~/.vim/bundle/nginx.vim
|
```
|
||||||
|
Plug 'chr4/nginx.vim'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Other (Plug, Dein.vim, Vundle)
|
### Dein.vim
|
||||||
```vim
|
```
|
||||||
" Plug
|
|
||||||
Plug 'chr4/nginx.vim'
|
|
||||||
|
|
||||||
" Dein.vim
|
|
||||||
call dein#add('chr4/nginx.vim')
|
call dein#add('chr4/nginx.vim')
|
||||||
|
```
|
||||||
|
|
||||||
" Vundle
|
### Vundle
|
||||||
|
```
|
||||||
Plugin 'chr4/nginx.vim'
|
Plugin 'chr4/nginx.vim'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Pathogen
|
||||||
|
```
|
||||||
|
git clone https://github.com/chr4/nginx.vim ~/.vim/bundle/nginx.vim
|
||||||
|
```
|
||||||
|
|
||||||
Optionally, if you like [Jinja](http://jinja.pocoo.org/) template syntax highlighting, install `lepture/vim-jinja`, too.
|
Optionally, if you like [Jinja](http://jinja.pocoo.org/) template syntax highlighting, install `lepture/vim-jinja`, too.
|
||||||
|
|
|
@ -65,6 +65,10 @@ function! cargo#build(args)
|
||||||
call cargo#cmd("build " . a:args)
|
call cargo#cmd("build " . a:args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! cargo#check(args)
|
||||||
|
call cargo#cmd("check " . a:args)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! cargo#clean(args)
|
function! cargo#clean(args)
|
||||||
call cargo#cmd("clean " . a:args)
|
call cargo#cmd("clean " . a:args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
@ -60,18 +60,19 @@ function! s:RustfmtWriteMode()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:RustfmtConfig()
|
function! s:RustfmtConfigOptions()
|
||||||
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
|
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
|
||||||
if l:rustfmt_toml !=# ''
|
if l:rustfmt_toml !=# ''
|
||||||
return '--config-path '.l:rustfmt_toml
|
return '--config-path '.fnamemodify(l:rustfmt_toml, ":p")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';')
|
let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';')
|
||||||
if l:_rustfmt_toml !=# ''
|
if l:_rustfmt_toml !=# ''
|
||||||
return '--config-path '.l:_rustfmt_toml
|
return '--config-path '.fnamemodify(l:_rustfmt_toml, ":p")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ''
|
" Default to edition 2018 in case no rustfmt.toml was found.
|
||||||
|
return '--edition 2018'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:RustfmtCommandRange(filename, line1, line2)
|
function! s:RustfmtCommandRange(filename, line1, line2)
|
||||||
|
@ -82,7 +83,7 @@ function! s:RustfmtCommandRange(filename, line1, line2)
|
||||||
|
|
||||||
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
|
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
|
||||||
let l:write_mode = s:RustfmtWriteMode()
|
let l:write_mode = s:RustfmtWriteMode()
|
||||||
let l:rustfmt_config = s:RustfmtConfig()
|
let l:rustfmt_config = s:RustfmtConfigOptions()
|
||||||
|
|
||||||
" FIXME: When --file-lines gets to be stable, add version range checking
|
" FIXME: When --file-lines gets to be stable, add version range checking
|
||||||
" accordingly.
|
" accordingly.
|
||||||
|
@ -96,14 +97,9 @@ function! s:RustfmtCommandRange(filename, line1, line2)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:RustfmtCommand()
|
function! s:RustfmtCommand()
|
||||||
if g:rustfmt_emit_files
|
let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display'
|
||||||
let l:write_mode = "--emit=stdout"
|
let config = s:RustfmtConfigOptions()
|
||||||
else
|
return join([g:rustfmt_command, write_mode, config, g:rustfmt_options])
|
||||||
let l:write_mode = "--write-mode=display"
|
|
||||||
endif
|
|
||||||
" rustfmt will pick on the right config on its own due to the
|
|
||||||
" current directory change.
|
|
||||||
return g:rustfmt_command . " ". l:write_mode . " " . g:rustfmt_options
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:DeleteLines(start, end) abort
|
function! s:DeleteLines(start, end) abort
|
||||||
|
|
|
@ -7,6 +7,7 @@ set cpoptions&vim
|
||||||
|
|
||||||
command! -nargs=+ Cargo call cargo#cmd(<q-args>)
|
command! -nargs=+ Cargo call cargo#cmd(<q-args>)
|
||||||
command! -nargs=* Cbuild call cargo#build(<q-args>)
|
command! -nargs=* Cbuild call cargo#build(<q-args>)
|
||||||
|
command! -nargs=* Ccheck call cargo#check(<q-args>)
|
||||||
command! -nargs=* Cclean call cargo#clean(<q-args>)
|
command! -nargs=* Cclean call cargo#clean(<q-args>)
|
||||||
command! -nargs=* Cdoc call cargo#doc(<q-args>)
|
command! -nargs=* Cdoc call cargo#doc(<q-args>)
|
||||||
command! -nargs=+ Cnew call cargo#new(<q-args>)
|
command! -nargs=+ Cnew call cargo#new(<q-args>)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -16,14 +16,18 @@ These commands are local to the buffers in which they work (generally, buffers
|
||||||
that are part of Git repositories).
|
that are part of Git repositories).
|
||||||
|
|
||||||
*:Git* *fugitive-:G*
|
*:Git* *fugitive-:G*
|
||||||
:Git {args} Run an arbitrary git command. Similar to :!git [args]
|
:Git {args} Run an arbitrary git command and display any output.
|
||||||
:G {args} but chdir to the repository tree first. For some
|
:G {args} On UNIX this uses a pty and on other platforms it uses
|
||||||
subcommands, a Fugitive command is called instead.
|
a pipe, which will cause some behavior differences
|
||||||
|
such as the absence of progress bars. Any file the
|
||||||
|
command edits (for example, a commit message) will be
|
||||||
|
loaded into a split window. Closing that window will
|
||||||
|
resume running the command. A few Git subcommands
|
||||||
|
have different behavior; these are documented below.
|
||||||
|
|
||||||
*:Git!*
|
:Git! {args} Run an arbitrary git command, capture output to a temp
|
||||||
:Git! {args} Like |:Git|, but capture the output into a temp file,
|
:Git --paginate {args} file, and |:split| that temp file. Use :0Git to
|
||||||
:Git --no-pager {args} and |:split| that temp file. Use :0Git to
|
:Git -p {args} |:edit| the temp file instead. A temp file is always
|
||||||
:Git -P {args} |:edit| the temp file instead. A temp file is always
|
|
||||||
used for diff and log commands.
|
used for diff and log commands.
|
||||||
|
|
||||||
*:Gstatus*
|
*:Gstatus*
|
||||||
|
@ -31,44 +35,6 @@ that are part of Git repositories).
|
||||||
:G Press g? or see |fugitive-maps| for usage.
|
:G Press g? or see |fugitive-maps| for usage.
|
||||||
:Gstatus
|
:Gstatus
|
||||||
|
|
||||||
*:Git-commit* *:Gcommit*
|
|
||||||
:Git commit [args] A wrapper around git-commit. Unless the arguments
|
|
||||||
:Gcommit [args] given would skip the invocation of an editor (e.g.,
|
|
||||||
-m), a split window will be used to obtain a commit
|
|
||||||
message, or a new tab if -v is given. Write and close
|
|
||||||
the window (:wq) to finish the commit. To cancel, use
|
|
||||||
an empty message.
|
|
||||||
|
|
||||||
*:Git-revert* *:Grevert*
|
|
||||||
:Git revert [args] A wrapper around git-revert. Similar to |:Gcommit|.
|
|
||||||
:Grevert [args]
|
|
||||||
|
|
||||||
*:Git-merge* *:Gmerge*
|
|
||||||
:Git merge [args] Calls git-merge and loads errors and conflicted files
|
|
||||||
:Gmerge [args] into the |quickfix| list. Opens a |:Gcommit| style
|
|
||||||
split window for the commit message if the merge
|
|
||||||
succeeds. If called during a merge conflict, the
|
|
||||||
conflicted files from the current index are loaded
|
|
||||||
into the |quickfix| list.
|
|
||||||
|
|
||||||
*:Git-pull* *:Gpull*
|
|
||||||
:Git pull [args] Like |:Gmerge|, but for git-pull.
|
|
||||||
:Gpull [args]
|
|
||||||
|
|
||||||
*:Git-rebase* *:Grebase*
|
|
||||||
:Git rebase [args] Like |:Gmerge|, but for git-rebase. Interactive
|
|
||||||
:Grebase [args] rebase is experimentally supported.
|
|
||||||
|
|
||||||
*:Git-push* *:Gpush*
|
|
||||||
:Git push [args] Invoke git-push, load the results into the |quickfix|
|
|
||||||
:Gpush [args] list, and invoke |:cwindow| to reveal any errors.
|
|
||||||
|:Dispatch| is used if available for asynchronous
|
|
||||||
invocation.
|
|
||||||
|
|
||||||
*:Git-fetch* *:Gfetch*
|
|
||||||
:Git fetch [args] Like |:Gpush|, but for git-fetch.
|
|
||||||
:Gfetch [args]
|
|
||||||
|
|
||||||
*:Git-blame* *:Gblame*
|
*:Git-blame* *:Gblame*
|
||||||
:Git blame [flags] Run git-blame [flags] on the current file and open the
|
:Git blame [flags] Run git-blame [flags] on the current file and open the
|
||||||
:Gblame [flags] results in a scroll-bound vertical split. The
|
:Gblame [flags] results in a scroll-bound vertical split. The
|
||||||
|
@ -111,12 +77,39 @@ that are part of Git repositories).
|
||||||
change unless [!] is given.
|
change unless [!] is given.
|
||||||
|
|
||||||
:Git difftool -y [args] Invoke `git diff [args]`, open each changed file in a
|
:Git difftool -y [args] Invoke `git diff [args]`, open each changed file in a
|
||||||
new tab, and invoke `:Gdiffsplit` against the
|
new tab, and invoke `:Gdiffsplit!` against the
|
||||||
appropriate commit.
|
appropriate commit.
|
||||||
|
|
||||||
*:Git-mergetool*
|
*:Git-mergetool*
|
||||||
:Git mergetool [args] Like |:Git-difftool|, but target merge conflicts.
|
:Git mergetool [args] Like |:Git-difftool|, but target merge conflicts.
|
||||||
|
|
||||||
|
*:Git-push* *:Gpush*
|
||||||
|
:Git push [args] Invoke git-push, load the results into the |quickfix|
|
||||||
|
:Gpush [args] list, and invoke |:cwindow| to reveal any errors.
|
||||||
|
|:Dispatch| is used if available for asynchronous
|
||||||
|
invocation.
|
||||||
|
|
||||||
|
*:Git-fetch* *:Gfetch*
|
||||||
|
:Git fetch [args] Like |:Gpush|, but for git-fetch.
|
||||||
|
:Gfetch [args]
|
||||||
|
|
||||||
|
*:Git-merge* *:Gmerge*
|
||||||
|
:Gmerge [args] Deprecated alias for |:Git| merge. Use |:Git-mergetool|
|
||||||
|
to get the old behavior of loading merge conflicts
|
||||||
|
into the quickfix list.
|
||||||
|
|
||||||
|
*:Git-pull* *:Gpull*
|
||||||
|
:Gpull [args] Deprecated alias for |:Git| pull.
|
||||||
|
|
||||||
|
*:Git-rebase* *:Grebase*
|
||||||
|
:Grebase [args] Deprecated alias for |:Git| rebase.
|
||||||
|
|
||||||
|
*:Git-commit* *:Gcommit*
|
||||||
|
:Gcommit [args] Deprecated alias for |:Git| commit.
|
||||||
|
|
||||||
|
*:Git-revert* *:Grevert*
|
||||||
|
:Grevert [args] Deprecated alias for |:Git| revert.
|
||||||
|
|
||||||
*:Gclog* *:Glog*
|
*:Gclog* *:Glog*
|
||||||
:Gclog[!] [args] Use git-log [args] to load the commit history into the
|
:Gclog[!] [args] Use git-log [args] to load the commit history into the
|
||||||
:Glog[!] [args] |quickfix| list. Jumps to the first commit unless [!]
|
:Glog[!] [args] |quickfix| list. Jumps to the first commit unless [!]
|
||||||
|
@ -208,7 +201,7 @@ that are part of Git repositories).
|
||||||
focus on the current window. During a merge conflict,
|
focus on the current window. During a merge conflict,
|
||||||
this is a three-way diff against the "ours" and
|
this is a three-way diff against the "ours" and
|
||||||
"theirs" ancestors. Additional d2o and d3o maps are
|
"theirs" ancestors. Additional d2o and d3o maps are
|
||||||
provided to to obtain the hunk from the "ours" or
|
provided to obtain the hunk from the "ours" or
|
||||||
"theirs" ancestor, respectively.
|
"theirs" ancestor, respectively.
|
||||||
|
|
||||||
:Gdiffsplit! {object} Like |:Gdiffsplit|, but retain focus on the current
|
:Gdiffsplit! {object} Like |:Gdiffsplit|, but retain focus on the current
|
||||||
|
@ -315,7 +308,7 @@ P under the cursor. On untracked files, this instead
|
||||||
*fugitive_d*
|
*fugitive_d*
|
||||||
Diff maps ~
|
Diff maps ~
|
||||||
*fugitive_dp*
|
*fugitive_dp*
|
||||||
dp Invoke |:Git!| diff on the file under the cursor.
|
dp Invoke |:Git| diff on the file under the cursor.
|
||||||
Deprecated in favor of inline diffs.
|
Deprecated in favor of inline diffs.
|
||||||
|
|
||||||
*fugitive_dd*
|
*fugitive_dd*
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
" fugitive.vim - A Git wrapper so awesome, it should be illegal
|
" fugitive.vim - A Git wrapper so awesome, it should be illegal
|
||||||
" Maintainer: Tim Pope <http://tpo.pe/>
|
" Maintainer: Tim Pope <http://tpo.pe/>
|
||||||
" Version: 3.1
|
" Version: 3.2
|
||||||
" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim
|
" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim
|
||||||
|
|
||||||
if exists('g:loaded_fugitive')
|
if exists('g:loaded_fugitive')
|
||||||
|
@ -66,8 +66,8 @@ function! FugitivePath(...) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FugitiveParse() takes a fugitive:// URL and returns a 2 element list
|
" FugitiveParse() takes a fugitive:// URL and returns a 2 element list
|
||||||
" containing the Git dir and an object name ("commit:file"). It's effectively
|
" containing an object name ("commit:file") and the Git dir. It's effectively
|
||||||
" then inverse of FugitiveFind().
|
" the inverse of FugitiveFind().
|
||||||
function! FugitiveParse(...) abort
|
function! FugitiveParse(...) abort
|
||||||
let path = s:Slash(a:0 ? a:1 : @%)
|
let path = s:Slash(a:0 ? a:1 : @%)
|
||||||
if path !~# '^fugitive:'
|
if path !~# '^fugitive:'
|
||||||
|
@ -103,6 +103,24 @@ function! FugitiveConfig(...) abort
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Retrieve a Git configuration value. An optional second argument provides
|
||||||
|
" the Git dir as with FugitiveFind(). Pass a blank string to limit to the
|
||||||
|
" global config.
|
||||||
|
function! FugitiveConfigGet(name, ...) abort
|
||||||
|
return call('FugitiveConfig', [a:name] + a:000)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Like FugitiveConfigGet(), but return a list of all values.
|
||||||
|
function! FugitiveConfigGetAll(name, ...) abort
|
||||||
|
if a:0 && type(a:1) ==# type({})
|
||||||
|
let config = a:1
|
||||||
|
else
|
||||||
|
let config = fugitive#Config(FugitiveGitDir(a:0 ? a:1 : -1))
|
||||||
|
endif
|
||||||
|
let name = substitute(a:name, '^[^.]\+\|[^.]\+$', '\L&', 'g')
|
||||||
|
return copy(get(config, name, []))
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! FugitiveRemoteUrl(...) abort
|
function! FugitiveRemoteUrl(...) abort
|
||||||
return fugitive#RemoteUrl(a:0 ? a:1 : '', FugitiveGitDir(a:0 > 1 ? a:2 : -1))
|
return fugitive#RemoteUrl(a:0 ? a:1 : '', FugitiveGitDir(a:0 > 1 ? a:2 : -1))
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -261,9 +279,23 @@ function! FugitiveDetect(path) abort
|
||||||
let b:git_dir = dir
|
let b:git_dir = dir
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if exists('b:git_dir')
|
if !exists('b:git_dir') || !exists('#User#Fugitive')
|
||||||
return fugitive#Init()
|
return ''
|
||||||
endif
|
endif
|
||||||
|
if v:version >= 704 || (v:version == 703 && has('patch442'))
|
||||||
|
doautocmd <nomodeline> User Fugitive
|
||||||
|
elseif &modelines > 0
|
||||||
|
let modelines = &modelines
|
||||||
|
try
|
||||||
|
set modelines=0
|
||||||
|
doautocmd User Fugitive
|
||||||
|
finally
|
||||||
|
let &modelines = modelines
|
||||||
|
endtry
|
||||||
|
else
|
||||||
|
doautocmd User Fugitive
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitiveVimPath(path) abort
|
function! FugitiveVimPath(path) abort
|
||||||
|
@ -339,6 +371,10 @@ augroup fugitive
|
||||||
\ if len(FugitiveGitDir()) |
|
\ if len(FugitiveGitDir()) |
|
||||||
\ call fugitive#MapCfile('fugitive#MessageCfile()') |
|
\ call fugitive#MapCfile('fugitive#MessageCfile()') |
|
||||||
\ endif
|
\ endif
|
||||||
|
autocmd FileType git,gitcommit
|
||||||
|
\ if len(FugitiveGitDir()) && &foldtext ==# 'foldtext()' |
|
||||||
|
\ setlocal foldtext=fugitive#Foldtext() |
|
||||||
|
\ endif
|
||||||
autocmd FileType fugitive
|
autocmd FileType fugitive
|
||||||
\ if len(FugitiveGitDir()) |
|
\ if len(FugitiveGitDir()) |
|
||||||
\ call fugitive#MapCfile('fugitive#StatusCfile()') |
|
\ call fugitive#MapCfile('fugitive#StatusCfile()') |
|
||||||
|
|
|
@ -234,6 +234,20 @@ gitgutter#fold#foldtext(): +-- 45 lines (*): abcdef
|
||||||
You can use `gitgutter#fold#is_changed()` in your own `foldtext` expression to find out whether the folded lines have been changed.
|
You can use `gitgutter#fold#is_changed()` in your own `foldtext` expression to find out whether the folded lines have been changed.
|
||||||
|
|
||||||
|
|
||||||
|
### Status line
|
||||||
|
|
||||||
|
Call the `GitGutterGetHunkSummary()` function from your status line to get a list of counts of added, modified, and removed lines in the current buffer. For example:
|
||||||
|
|
||||||
|
```viml
|
||||||
|
" Your vimrc
|
||||||
|
function! GitStatus()
|
||||||
|
let [a,m,r] = GitGutterGetHunkSummary()
|
||||||
|
return printf('+%d ~%d -%d', a, m, r)
|
||||||
|
endfunction
|
||||||
|
set statusline+=%{GitStatus()}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Customisation
|
### Customisation
|
||||||
|
|
||||||
You can customise:
|
You can customise:
|
||||||
|
|
|
@ -4,7 +4,7 @@ let s:hunk_re = '^@@ -\(\d\+\),\?\(\d*\) +\(\d\+\),\?\(\d*\) @@'
|
||||||
|
|
||||||
" True for git v1.7.2+.
|
" True for git v1.7.2+.
|
||||||
function! s:git_supports_command_line_config_override() abort
|
function! s:git_supports_command_line_config_override() abort
|
||||||
call system(g:gitgutter_git_executable.' '.g:gitgutter_git_args.' -c foo.bar=baz --version')
|
call gitgutter#utility#system(g:gitgutter_git_executable.' '.g:gitgutter_git_args.' -c foo.bar=baz --version')
|
||||||
return !v:shell_error
|
return !v:shell_error
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ CONTENTS *gitgutter*
|
||||||
Commands ..................... |gitgutter-commands|
|
Commands ..................... |gitgutter-commands|
|
||||||
Mappings ..................... |gitgutter-mappings|
|
Mappings ..................... |gitgutter-mappings|
|
||||||
Autocommand .................. |gitgutter-autocommand|
|
Autocommand .................. |gitgutter-autocommand|
|
||||||
|
Status line .................. |gitgutter-statusline|
|
||||||
Options ...................... |gitgutter-options|
|
Options ...................... |gitgutter-options|
|
||||||
Highlights ................... |gitgutter-highlights|
|
Highlights ................... |gitgutter-highlights|
|
||||||
FAQ .......................... |gitgutter-faq|
|
FAQ .......................... |gitgutter-faq|
|
||||||
|
@ -244,6 +245,23 @@ trailing empty lines.
|
||||||
<
|
<
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
STATUS LINE *gitgutter-statusline*
|
||||||
|
|
||||||
|
|
||||||
|
Call the `GitGutterGetHunkSummary()` function from your status line to get a
|
||||||
|
list of counts of added, modified, and removed lines in the current buffer.
|
||||||
|
For example:
|
||||||
|
>
|
||||||
|
" Your vimrc
|
||||||
|
function! GitStatus()
|
||||||
|
let [a,m,r] = GitGutterGetHunkSummary()
|
||||||
|
return printf('+%d ~%d -%d', a, m, r)
|
||||||
|
endfunction
|
||||||
|
set statusline+=%{GitStatus()}
|
||||||
|
<
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
OPTIONS *gitgutter-options*
|
OPTIONS *gitgutter-options*
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ syntax match jsDestructuringNoise contained /[,[\]]/
|
||||||
syntax region jsDestructuringPropertyComputed contained matchgroup=jsDestructuringBraces start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringValueAssignment,jsDestructuringNoise extend fold
|
syntax region jsDestructuringPropertyComputed contained matchgroup=jsDestructuringBraces start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringValueAssignment,jsDestructuringNoise extend fold
|
||||||
|
|
||||||
" Comments
|
" Comments
|
||||||
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD
|
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD NOTE
|
||||||
syntax region jsComment start=+//+ end=/$/ contains=jsCommentTodo,@Spell extend keepend
|
syntax region jsComment start=+//+ end=/$/ contains=jsCommentTodo,@Spell extend keepend
|
||||||
syntax region jsComment start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell fold extend keepend
|
syntax region jsComment start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell fold extend keepend
|
||||||
syntax region jsEnvComment start=/\%^#!/ end=/$/ display
|
syntax region jsEnvComment start=/\%^#!/ end=/$/ display
|
||||||
|
|
|
@ -57,6 +57,9 @@ au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
|
||||||
" SimpleCov
|
" SimpleCov
|
||||||
au BufNewFile,BufRead .simplecov call s:setf('ruby')
|
au BufNewFile,BufRead .simplecov call s:setf('ruby')
|
||||||
|
|
||||||
|
" Sorbet RBI files
|
||||||
|
au BufNewFile,BufRead *.rbi call s:setf('ruby')
|
||||||
|
|
||||||
" Thor
|
" Thor
|
||||||
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
|
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ if exists("ruby_operators") || exists("ruby_pseudo_operators")
|
||||||
syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||"
|
syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||"
|
||||||
syn match rubyRangeOperator "\.\.\.\="
|
syn match rubyRangeOperator "\.\.\.\="
|
||||||
syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^="
|
syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^="
|
||||||
syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant
|
syn match rubyAssignmentOperator "=>\@!" contained containedin=rubyBlockParameterList " TODO: this is inelegant
|
||||||
syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~"
|
syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~"
|
||||||
|
|
||||||
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop
|
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop
|
||||||
|
@ -192,7 +192,7 @@ SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':
|
||||||
|
|
||||||
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@="
|
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@="
|
||||||
|
|
||||||
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList
|
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop contained containedin=rubyBlockParameterList
|
||||||
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator
|
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator
|
||||||
|
|
||||||
if exists('ruby_global_variable_error')
|
if exists('ruby_global_variable_error')
|
||||||
|
|
|
@ -220,4 +220,25 @@ ${2:${VISUAL:code}}
|
||||||
|
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet gln "New glossary item" b
|
||||||
|
\newglossaryentry{${1:identifier}}
|
||||||
|
{
|
||||||
|
name={${2:name}},
|
||||||
|
first={${3:first occurrence}},
|
||||||
|
sort={${4:sort value}},
|
||||||
|
description={${0:description}},
|
||||||
|
}
|
||||||
|
endsnippet
|
||||||
|
snippet glnl "New long glossary item" b
|
||||||
|
\longnewglossaryentry{${1:identifier}}
|
||||||
|
{
|
||||||
|
name={${2:name}},
|
||||||
|
first={${3:first occurrence}},
|
||||||
|
sort={${4:sort value}},
|
||||||
|
}
|
||||||
|
{
|
||||||
|
${0:description}
|
||||||
|
}
|
||||||
|
endsnippet
|
||||||
# vim:ft=snippets:
|
# vim:ft=snippets:
|
||||||
|
|
|
@ -188,6 +188,8 @@ snippet try try .. rescue .. end
|
||||||
snippet pry
|
snippet pry
|
||||||
require IEx; IEx.pry
|
require IEx; IEx.pry
|
||||||
${0}
|
${0}
|
||||||
|
snippet ppry
|
||||||
|
|> (fn x -> require IEx; IEx.pry; x end).()${0}
|
||||||
snippet qu
|
snippet qu
|
||||||
quote do
|
quote do
|
||||||
${1}
|
${1}
|
||||||
|
|
|
@ -4,10 +4,10 @@ snippet #!
|
||||||
|
|
||||||
snippet s#!
|
snippet s#!
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
set -euo pipefail
|
set -eu
|
||||||
|
|
||||||
snippet safe
|
snippet safe
|
||||||
set -euo pipefail
|
set -eu
|
||||||
|
|
||||||
snippet bash
|
snippet bash
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
Loading…
Reference in a new issue