mirror of
1
0
Fork 0

Updated plugins

This commit is contained in:
Amir 2020-01-28 23:07:36 -03:00
parent 46195e4ca4
commit dbcdace7be
32 changed files with 644 additions and 664 deletions

View File

@ -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:
'<Leader>be' (normal open) or
'<Leader>bt' (toggle open / close) or
'<Leader>bs' (force horizontal split open) or
'<Leader>bv' (force vertical split open)
'\<Leader\>be' (normal open) or
'\<Leader\>bt' (toggle open / close) or
'\<Leader\>bs' (force horizontal split open) or
'\<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.
@ -28,8 +28,8 @@ This plugin can also be found at http://www.vim.org/scripts/script.php?script_id
## Installation
### Manually
1. If you do not want to use on the the bundle handlers, you can take the zip
file from vim.org and unzip it and copy the plugin to your vimfiles\plugin
1. If you do not want to use one of the the bundle handlers, you can take the
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,
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
## License
Copyright (c) 2001-2019, Jeff Lanzarotta
Copyright (c) 2001-2020, Jeff Lanzarotta
All rights reserved.

View File

@ -919,7 +919,7 @@ function! s:SelectBuffer(...)
endif
" Switch to the selected buffer.
execute "keepalt silent b!" _bufNbr
execute "keepjumps keepalt silent b!" _bufNbr
endif
" Make the buffer 'listed' again.
@ -957,12 +957,6 @@ function! s:RemoveBuffer(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.
if exists("b:displayMode") && b:displayMode == "winmanager"
call WinManagerSuspendAUs()

View File

@ -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
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
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

View File

@ -961,7 +961,9 @@ function! s:GistGetAuthHeader() abort
return printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password))
endif
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), '')
if type(str) == 1
let auth = str

View File

@ -30,6 +30,7 @@ let g:lightline = {}
let g:lightline.component_expand = {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_infos': 'lightline#ale#infos',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
@ -40,17 +41,18 @@ let g:lightline.component_expand = {
```viml
let g:lightline.component_type = {
\ 'linter_checking': 'left',
\ 'linter_checking': 'right',
\ 'linter_infos': 'right',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'left',
\ 'linter_ok': 'right',
\ }
```
3. Add the components to the lightline, for example to the right side:
```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
@ -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...`.
##### `g:lightline#ale#indicator_infos`
The indicator to use when there are infos. Default is `I:`.
##### `g:lightline#ale#indicator_warnings`
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:
* Checking: [f110](https://fontawesome.com/icons/spinner)
* Infos: [f129](https://fontawesome.com/icons/info)
* Warnings: [f071](https://fontawesome.com/icons/exclamation-triangle)
* Errors: [f05e](https://fontawesome.com/icons/ban)
* 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
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_errors = "\uf05e"
let g:lightline#ale#indicator_ok = "\uf00c"

View File

@ -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_errors = get(g:, 'lightline#ale#indicator_errors', 'E: ')
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
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
if !lightline#ale#linted()
return ''
endif
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:all_non_errors == 0 ? '' : printf(s:indicator_warnings . '%d', all_non_errors)
let l:all_warnings = l:counts.warning + l:counts.style_warning
return l:all_warnings == 0 ? '' : printf(s:indicator_warnings . '%d', all_warnings)
endfunction
function! lightline#ale#errors() abort

View File

@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal

View File

@ -246,7 +246,7 @@ let g:lightline = {
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head'
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
```

View File

@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim
" Author: itchyny
" License: MIT License
" Last Change: 2019/08/20 14:00:00.
" Last Change: 2020/01/27 19:41:58.
" =============================================================================
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 : ''
endfor
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 _ .= 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] . '#'

View File

@ -4,7 +4,7 @@ Version: 0.1
Author: itchyny (https://github.com/itchyny)
License: MIT License
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*
@ -148,7 +148,7 @@ OPTIONS *lightline-option*
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head'
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
<
@ -316,8 +316,8 @@ nice.
return &readonly ? '' : ''
endfunction
function! LightlineFugitive()
if exists('*fugitive#head')
let branch = fugitive#head()
if exists('*FugitiveHead')
let branch = FugitiveHead()
return branch !=# '' ? ''.branch : ''
endif
return ''
@ -341,8 +341,8 @@ look nice.
return &readonly ? '⭤' : ''
endfunction
function! LightlineFugitive()
if exists('*fugitive#head')
let branch = fugitive#head()
if exists('*FugitiveHead')
let branch = FugitiveHead()
return branch !=# '' ? '⭠ '.branch : ''
endif
return ''
@ -742,8 +742,8 @@ A nice example for non-patched font users.
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
endfunction
function! LightlineFugitive()
if &ft !~? 'vimfiler' && exists('*fugitive#head')
return fugitive#head()
if &ft !~? 'vimfiler' && exists('*FugitiveHead')
return FugitiveHead()
endif
return ''
endfunction
@ -777,8 +777,8 @@ A nice example for |vim-powerline| font users:
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
endfunction
function! LightlineFugitive()
if &ft !~? 'vimfiler' && exists('*fugitive#head')
let branch = fugitive#head()
if &ft !~? 'vimfiler' && exists('*FugitiveHead')
let branch = FugitiveHead()
return branch !=# '' ? '⭠ '.branch : ''
endif
return ''
@ -836,9 +836,9 @@ For users who uses lots of plugins:
function! LightlineFugitive()
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 branch = fugitive#head()
let branch = FugitiveHead()
return branch !=# '' ? mark.branch : ''
endif
catch

View File

@ -7,7 +7,12 @@
in an unordered list. The format is:
- **.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**: 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)
- **.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)

View File

@ -169,8 +169,11 @@ function! nerdtree#exec(cmd, ignoreAll) abort
if a:ignoreAll
set eventignore=all
endif
exec a:cmd
let &eventignore = old_ei
try
exec a:cmd
finally
let &eventignore = old_ei
endtry
endfunction
" FUNCTION: nerdtree#has_opt(options, name) {{{2

View File

@ -284,15 +284,16 @@ endfunction
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
function! s:findAndRevealPath(pathStr) abort
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)
call nerdtree#echoWarning('no file for the current buffer')
return
endif
if !filereadable(l:pathStr)
let l:pathStr = fnamemodify(l:pathStr, ':h')
endif
try
let l:pathStr = g:NERDTreePath.Resolve(l:pathStr)
let l:pathObj = g:NERDTreePath.New(l:pathStr)

View File

@ -122,8 +122,9 @@ The following features and functionality are provided by the NERDTree:
:NERDTreeToggle [<start-directory> | <bookmark>] *:NERDTreeToggle*
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
same as the |:NERDTree| command.
again. If <start-directory> or <bookmark> is given, the root of NERDTree
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*
Like |:NERDTreeToggle|, but searches up the directory tree to find the top of

View File

@ -333,14 +333,17 @@ function! s:Creator._tabpagevar(tabnr, var)
let old_ei = &eventignore
set eventignore=all
exec 'tabnext ' . a:tabnr
let v = -1
if exists('t:' . a:var)
exec 'let v = t:' . a:var
endif
exec 'tabnext ' . currentTab
try
exec 'tabnext ' . a:tabnr
let v = -1
if exists('t:' . a:var)
exec 'let v = t:' . a:var
endif
exec 'tabnext ' . currentTab
let &eventignore = old_ei
finally
let &eventignore = old_ei
endtry
return v
endfunction
@ -352,17 +355,20 @@ function! s:Creator.ToggleTabTree(dir)
endfunction
" FUNCTION: s:Creator.toggleTabTree(dir) {{{1
" Toggles the NERD tree. I.e the NERD tree is open, it is closed, if it is
" closed it is restored or initialized (if it doesnt exist)
" 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 dir is not empty, it will be set
" as the new root.
"
" Args:
" dir: the full path for the root node (is only used if the NERD tree is being
" initialized.
" dir: the full path for the root node (is used if the NERD tree is being
" initialized, or to change the root to a new dir.)
function! s:Creator.toggleTabTree(dir)
if g:NERDTree.ExistsForTab()
if !g:NERDTree.IsOpen()
call self._createTreeWin()
if !&hidden
if !empty(a:dir)
call self.createTabTree(a:dir)
elseif !&hidden
call b:NERDTree.render()
endif
call b:NERDTree.ui.restoreScreenState()

View File

@ -141,12 +141,12 @@ function! s:renameBuffer(bufNum, newNodeName, isDirectory)
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
endif
" 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
" display a buffer for a new filename.
let s:originalTabNumber = tabpagenr()
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(s:originalWindowNumber . 'wincmd w', 1)
" 3. We don't need a previous buffer anymore
@ -196,6 +196,11 @@ function! NERDTreeMoveNode()
let curNode = g:NERDTreeFileNode.GetSelected()
let prompt = s:inputPrompt('move')
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 ==# ''
call nerdtree#echo('Node Renaming Aborted.')

View File

@ -51,22 +51,27 @@ For help with secure cipher selection, visit [Mozillas SSL Configuration Generat
## 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
git clone https://github.com/chr4/nginx.vim ~/.vim/bundle/nginx.vim
### Plug
```
Plug 'chr4/nginx.vim'
```
### Other (Plug, Dein.vim, Vundle)
```vim
" Plug
Plug 'chr4/nginx.vim'
" Dein.vim
### Dein.vim
```
call dein#add('chr4/nginx.vim')
```
" Vundle
### Vundle
```
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.

View File

@ -65,6 +65,10 @@ function! cargo#build(args)
call cargo#cmd("build " . a:args)
endfunction
function! cargo#check(args)
call cargo#cmd("check " . a:args)
endfunction
function! cargo#clean(args)
call cargo#cmd("clean " . a:args)
endfunction

View File

@ -60,18 +60,19 @@ function! s:RustfmtWriteMode()
endif
endfunction
function! s:RustfmtConfig()
function! s:RustfmtConfigOptions()
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
if l:rustfmt_toml !=# ''
return '--config-path '.l:rustfmt_toml
return '--config-path '.fnamemodify(l:rustfmt_toml, ":p")
endif
let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';')
if l:_rustfmt_toml !=# ''
return '--config-path '.l:_rustfmt_toml
return '--config-path '.fnamemodify(l:_rustfmt_toml, ":p")
endif
return ''
" Default to edition 2018 in case no rustfmt.toml was found.
return '--edition 2018'
endfunction
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: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
" accordingly.
@ -96,14 +97,9 @@ function! s:RustfmtCommandRange(filename, line1, line2)
endfunction
function! s:RustfmtCommand()
if g:rustfmt_emit_files
let l:write_mode = "--emit=stdout"
else
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
let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display'
let config = s:RustfmtConfigOptions()
return join([g:rustfmt_command, write_mode, config, g:rustfmt_options])
endfunction
function! s:DeleteLines(start, end) abort

View File

@ -7,6 +7,7 @@ set cpoptions&vim
command! -nargs=+ Cargo call cargo#cmd(<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=* Cdoc call cargo#doc(<q-args>)
command! -nargs=+ Cnew call cargo#new(<q-args>)

File diff suppressed because it is too large Load Diff

View File

@ -16,14 +16,18 @@ These commands are local to the buffers in which they work (generally, buffers
that are part of Git repositories).
*:Git* *fugitive-:G*
:Git {args} Run an arbitrary git command. Similar to :!git [args]
:G {args} but chdir to the repository tree first. For some
subcommands, a Fugitive command is called instead.
:Git {args} Run an arbitrary git command and display any output.
:G {args} On UNIX this uses a pty and on other platforms it uses
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} Like |:Git|, but capture the output into a temp file,
: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! {args} Run an arbitrary git command, capture output to a temp
:Git --paginate {args} file, and |:split| that temp file. Use :0Git to
:Git -p {args} |:edit| the temp file instead. A temp file is always
used for diff and log commands.
*:Gstatus*
@ -31,44 +35,6 @@ that are part of Git repositories).
:G Press g? or see |fugitive-maps| for usage.
: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 [flags] Run git-blame [flags] on the current file and open 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.
: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.
*:Git-mergetool*
: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[!] [args] Use git-log [args] to load the commit history into the
: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,
this is a three-way diff against the "ours" and
"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.
: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*
Diff maps ~
*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.
*fugitive_dd*

View File

@ -1,6 +1,6 @@
" fugitive.vim - A Git wrapper so awesome, it should be illegal
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 3.1
" Version: 3.2
" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim
if exists('g:loaded_fugitive')
@ -66,8 +66,8 @@ function! FugitivePath(...) abort
endfunction
" FugitiveParse() takes a fugitive:// URL and returns a 2 element list
" containing the Git dir and an object name ("commit:file"). It's effectively
" then inverse of FugitiveFind().
" containing an object name ("commit:file") and the Git dir. It's effectively
" the inverse of FugitiveFind().
function! FugitiveParse(...) abort
let path = s:Slash(a:0 ? a:1 : @%)
if path !~# '^fugitive:'
@ -103,6 +103,24 @@ function! FugitiveConfig(...) abort
endif
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
return fugitive#RemoteUrl(a:0 ? a:1 : '', FugitiveGitDir(a:0 > 1 ? a:2 : -1))
endfunction
@ -261,9 +279,23 @@ function! FugitiveDetect(path) abort
let b:git_dir = dir
endif
endif
if exists('b:git_dir')
return fugitive#Init()
if !exists('b:git_dir') || !exists('#User#Fugitive')
return ''
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
function! FugitiveVimPath(path) abort
@ -339,6 +371,10 @@ augroup fugitive
\ if len(FugitiveGitDir()) |
\ call fugitive#MapCfile('fugitive#MessageCfile()') |
\ endif
autocmd FileType git,gitcommit
\ if len(FugitiveGitDir()) && &foldtext ==# 'foldtext()' |
\ setlocal foldtext=fugitive#Foldtext() |
\ endif
autocmd FileType fugitive
\ if len(FugitiveGitDir()) |
\ call fugitive#MapCfile('fugitive#StatusCfile()') |

View File

@ -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.
### 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
You can customise:

View File

@ -4,7 +4,7 @@ let s:hunk_re = '^@@ -\(\d\+\),\?\(\d*\) +\(\d\+\),\?\(\d*\) @@'
" True for git v1.7.2+.
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
endfunction

View File

@ -17,6 +17,7 @@ CONTENTS *gitgutter*
Commands ..................... |gitgutter-commands|
Mappings ..................... |gitgutter-mappings|
Autocommand .................. |gitgutter-autocommand|
Status line .................. |gitgutter-statusline|
Options ...................... |gitgutter-options|
Highlights ................... |gitgutter-highlights|
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*

View File

@ -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
" 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 fold extend keepend
syntax region jsEnvComment start=/\%^#!/ end=/$/ display

View File

@ -57,6 +57,9 @@ au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
" SimpleCov
au BufNewFile,BufRead .simplecov call s:setf('ruby')
" Sorbet RBI files
au BufNewFile,BufRead *.rbi call s:setf('ruby')
" Thor
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')

View File

@ -91,7 +91,7 @@ if exists("ruby_operators") || exists("ruby_pseudo_operators")
syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||"
syn match rubyRangeOperator "\.\.\.\="
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 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 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
if exists('ruby_global_variable_error')

View File

@ -220,4 +220,25 @@ ${2:${VISUAL:code}}
$0
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:

View File

@ -188,6 +188,8 @@ snippet try try .. rescue .. end
snippet pry
require IEx; IEx.pry
${0}
snippet ppry
|> (fn x -> require IEx; IEx.pry; x end).()${0}
snippet qu
quote do
${1}

View File

@ -4,10 +4,10 @@ snippet #!
snippet s#!
#!/usr/bin/env sh
set -euo pipefail
set -eu
snippet safe
set -euo pipefail
set -eu
snippet bash
#!/usr/bin/env bash