1
0
Fork 0
mirror of synced 2024-11-22 08:45:34 -05:00

Updated plugins

This commit is contained in:
amix 2019-12-30 14:28:38 +01:00
parent cb57890701
commit b56966e13c
16 changed files with 145 additions and 84 deletions

View file

@ -16,8 +16,7 @@ cache:
- $HOME/vim-$VIM_VERSION
env:
- VIM_VERSION=8.1.1775
- VIM_VERSION=8.1.1700
- VIM_VERSION=8.2.0000
- VIM_VERSION=8.1.0000
- VIM_VERSION=8.0.0000
- VIM_VERSION=7.4

View file

@ -87,6 +87,13 @@ For screenshots of all available colorshemes, see [this file](colorscheme.md).
2. Install with `:PlugInstall`.
### [dein.vim](https://github.com/Shougo/dein.vim)
1. Add the following configuration to your `.vimrc`.
call dein#add('itchyny/lightline.vim')
2. Install with `:call dein#install()`
## Introduction
After installing this plugin, you restart the editor and will get a cool statusline.
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/1.png)
@ -323,7 +330,7 @@ let g:lightline = {
\ }
function! LightlineMode()
return expand('%:t') ==# '__Tagbar__' ? 'Tagbar':
return expand('%:t') =~# '^__Tagbar__' ? 'Tagbar':
\ expand('%:t') ==# 'ControlP' ? 'CtrlP' :
\ &filetype ==# 'unite' ? 'Unite' :
\ &filetype ==# 'vimfiler' ? 'VimFiler' :
@ -377,6 +384,40 @@ endfunction
You can control the visibility and contents by writing simple functions.
Now you notice how much function component is important for the configurability of lightline.vim.
### more tips
#### Mode names are too long. Can I use shorter mode names?
Yes, configure `g:lightline.mode_map`.
```vim
let g:lightline = {
\ 'mode_map': {
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'v' : 'V',
\ 'V' : 'VL',
\ "\<C-v>": 'VB',
\ 'c' : 'C',
\ 's' : 'S',
\ 'S' : 'SL',
\ "\<C-s>": 'SB',
\ 't': 'T',
\ },
\ }
```
#### How can I truncate the components from the right in narrow windows?
Please include `%<` to one of the right components.
```vim
let g:lightline = {
\ 'component': {
\ 'lineinfo': '%3l:%-2v%<',
\ },
\ }
```
#### Where can I find the default components?
See `:h g:lightline.component`.
## Note for developers of other plugins
Appearance consistency matters.

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/08/14 10:46:55.
Last Change: 2019/12/27 18:23:29.
CONTENTS *lightline-contents*
@ -674,11 +674,11 @@ In order to define your own component:
\ }
\ }
function! LightlineFilename()
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
return (LightlineReadonly() !=# '' ? LightlineReadonly() . ' ' : '') .
\ (&ft ==# 'vimfiler' ? vimfiler#get_status_string() :
\ &ft ==# 'unite' ? unite#get_status_string() :
\ expand('%:t') !=# '' ? expand('%:t') : '[No Name]') .
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
endfunction
function! LightlineReadonly()
return &ft !~? 'help' && &readonly ? 'RO' : ''
@ -728,18 +728,18 @@ A nice example for non-patched font users.
\ }
\ }
function! LightlineModified()
return &ft =~ 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
return &ft =~# 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightlineReadonly()
return &ft !~? 'help\|vimfiler' && &readonly ? 'RO' : ''
endfunction
function! LightlineFilename()
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
return (LightlineReadonly() !=# '' ? LightlineReadonly() . ' ' : '') .
\ (&ft ==# 'vimfiler' ? vimfiler#get_status_string() :
\ &ft ==# 'unite' ? unite#get_status_string() :
\ &ft ==# 'vimshell' ? vimshell#get_status_string() :
\ expand('%:t') !=# '' ? expand('%:t') : '[No Name]') .
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
endfunction
function! LightlineFugitive()
if &ft !~? 'vimfiler' && exists('*fugitive#head')
@ -763,18 +763,18 @@ A nice example for |vim-powerline| font users:
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
\ }
function! LightlineModified()
return &ft =~ 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
return &ft =~# 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightlineReadonly()
return &ft !~? 'help\|vimfiler' && &readonly ? '⭤' : ''
endfunction
function! LightlineFilename()
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
return (LightlineReadonly() !=# '' ? LightlineReadonly() . ' ' : '') .
\ (&ft ==# 'vimfiler' ? vimfiler#get_status_string() :
\ &ft ==# 'unite' ? unite#get_status_string() :
\ &ft ==# 'vimshell' ? vimshell#get_status_string() :
\ expand('%:t') !=# '' ? expand('%:t') : '[No Name]') .
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
endfunction
function! LightlineFugitive()
if &ft !~? 'vimfiler' && exists('*fugitive#head')
@ -815,7 +815,7 @@ For users who uses lots of plugins:
\ }
function! LightlineModified()
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
return &ft ==# 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightlineReadonly()
@ -824,15 +824,14 @@ For users who uses lots of plugins:
function! LightlineFilename()
let fname = expand('%:t')
return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
\ fname == '__Tagbar__' ? g:lightline.fname :
\ fname =~ '__Gundo\|NERD_tree' ? '' :
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ ('' != fname ? fname : '[No Name]') .
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
return fname ==# 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
\ fname =~# '^__Tagbar__\|__Gundo\|NERD_tree' ? '' :
\ &ft ==# 'vimfiler' ? vimfiler#get_status_string() :
\ &ft ==# 'unite' ? unite#get_status_string() :
\ &ft ==# 'vimshell' ? vimshell#get_status_string() :
\ (LightlineReadonly() !=# '' ? LightlineReadonly() . ' ' : '') .
\ (fname !=# '' ? fname : '[No Name]') .
\ (LightlineModified() !=# '' ? ' ' . LightlineModified() : '')
endfunction
function! LightlineFugitive()
@ -861,19 +860,19 @@ For users who uses lots of plugins:
function! LightlineMode()
let fname = expand('%:t')
return fname == '__Tagbar__' ? 'Tagbar' :
\ fname == 'ControlP' ? 'CtrlP' :
\ fname == '__Gundo__' ? 'Gundo' :
\ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
\ fname =~ 'NERD_tree' ? 'NERDTree' :
\ &ft == 'unite' ? 'Unite' :
\ &ft == 'vimfiler' ? 'VimFiler' :
\ &ft == 'vimshell' ? 'VimShell' :
return fname =~# '^__Tagbar__' ? 'Tagbar' :
\ fname ==# 'ControlP' ? 'CtrlP' :
\ fname ==# '__Gundo__' ? 'Gundo' :
\ fname ==# '__Gundo_Preview__' ? 'Gundo Preview' :
\ fname =~# 'NERD_tree' ? 'NERDTree' :
\ &ft ==# 'unite' ? 'Unite' :
\ &ft ==# 'vimfiler' ? 'VimFiler' :
\ &ft ==# 'vimshell' ? 'VimShell' :
\ winwidth(0) > 60 ? lightline#mode() : ''
endfunction
function! CtrlPMark()
if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item')
if expand('%:t') ==# 'ControlP' && has_key(g:lightline, 'ctrlp_item')
call lightline#link('iR'[g:lightline.ctrlp_regex])
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
\ , g:lightline.ctrlp_next], 0)
@ -902,7 +901,6 @@ For users who uses lots of plugins:
let g:tagbar_status_func = 'TagbarStatusFunc'
function! TagbarStatusFunc(current, sort, fname, ...) abort
let g:lightline.fname = a:fname
return lightline#statusline(0)
endfunction

View file

@ -7,6 +7,9 @@
in an unordered list. The format is:
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 6.4
- **.1**: Ensure backward compatibility. v:t_func is not available before Vim 8.0 (Phil Runninger)
- **.0**: Allow use of function references as callbacks (HiPhish) [#1067](https://github.com/scrooloose/nerdtree/pull/1067)
#### 6.3
- **.0**: Add new command that behaves like NERDTreeToggle but defaults to the root of a VCS repository. (willfindlay) [#1060](https://github.com/scrooloose/nerdtree/pull/1060)
#### 6.2

View file

@ -1315,6 +1315,10 @@ following code conventions are used:
See this blog post for more details:
http://got-ravings.blogspot.com/2008/09/vim-pr0n-prototype-based-objects.html
A number of API functions take a callback argument to call. The callback can
be either a string with the name of a function to call, or a |Funcref| object
which will be called directly.
------------------------------------------------------------------------------
4.1. Key map API *NERDTreeKeymapAPI*

View file

@ -66,7 +66,7 @@ endfunction
"FUNCTION: KeyMap.invoke() {{{1
"Call the KeyMaps callback function
function! s:KeyMap.invoke(...)
let Callback = function(self.callback)
let Callback = type(self.callback) == type(function("tr")) ? self.callback : function(self.callback)
if a:0
call Callback(a:1)
else

View file

@ -79,7 +79,7 @@ endfunction
"specified
function! s:MenuItem.enabled()
if self.isActiveCallback != -1
return {self.isActiveCallback}()
return type(self.isActiveCallback) == type(function("tr")) ? self.isActiveCallback() : {self.isActiveCallback}()
endif
return 1
endfunction
@ -94,7 +94,11 @@ function! s:MenuItem.execute()
call mc.showMenu()
else
if self.callback != -1
call {self.callback}()
if type(self.callback) == type(function("tr"))
call self.callback()
else
call {self.callback}()
endif
endif
endif
endfunction

View file

@ -14,8 +14,9 @@ endfunction
function! s:Notifier.NotifyListeners(event, path, nerdtree, params)
let event = g:NERDTreeEvent.New(a:nerdtree, a:path, a:event, a:params)
for listener in s:Notifier.GetListenersForEvent(a:event)
call {listener}(event)
for Listener in s:Notifier.GetListenersForEvent(a:event)
let Callback = type(Listener) == type(function("tr")) ? Listener : function(Listener)
call Callback(event)
endfor
endfunction

View file

@ -500,8 +500,9 @@ function! s:Path.ignore(nerdtree)
endif
endfor
for callback in g:NERDTree.PathFilters()
if {callback}({'path': self, 'nerdtree': a:nerdtree})
for Callback in g:NERDTree.PathFilters()
let Callback = type(Callback) == type(function("tr")) ? Callback : function(Callback)
if Callback({'path': self, 'nerdtree': a:nerdtree})
return 1
endif
endfor

View file

@ -128,10 +128,9 @@ g:rustfmt_autosave~
*g:rustfmt_autosave_if_config_present*
g:rustfmt_autosave_if_config_present~
Set this option to 1 to to have *b:rustfmt_autosave* be set automatically
Set this option to 1 to have *b:rustfmt_autosave* be set automatically
if a `rustfmt.toml` file is present in any parent directly leading to
the file being edited. If not set, default to 0: >
let g:rustfmt_autosave_if_config_present = 0
<
This is useful to have `rustfmt` only execute on save, on projects
@ -161,6 +160,7 @@ g:rustfmt_emit_files~
provided) instead of '--write-mode=overwrite'. >
let g:rustfmt_emit_files = 0
*g:rust_playpen_url*
g:rust_playpen_url~
Set this option to override the url for the playpen to use: >
@ -192,7 +192,7 @@ Integration with Syntastic *rust-syntastic*
--------------------------
This plugin automatically integrates with the Syntastic checker. There are two
checkers provided: 'rustc', and 'cargo'. The later invokes 'Cargo' in order to
checkers provided: 'rustc', and 'cargo'. The latter invokes 'Cargo' in order to
build code, and the former delivers a single edited '.rs' file as a compilation
target directly to the Rust compiler, `rustc`.
@ -354,7 +354,8 @@ Playpen integration
|g:rust_clip_command| is the command to run to copy the
playpen url to the clipboard of your system.
Evaulation of a single Rust file
Evaluation of a single Rust file
--------------------------------
NOTE: These commands are useful only when working with standalone Rust files,

View file

@ -11,11 +11,16 @@ and other features for TypeScript editing.
Install
-------
From Vim 8 onward, the plugin can be installed as simply as:
From Vim 8 onward, the plugin can be installed as simply as (Unix/Mac):
```
git clone https://github.com/leafgarland/typescript-vim.git ~/.vim/pack/typescript/start/typescript-vim
```
On Windows/Powershell, use the following:
```
git clone https://github.com/leafgarland/typescript-vim.git $home/vimfiles/pack/typescript/start/typescript-vim
```
For older versions of Vim, the simplest way to install is via a Vim add-in manager such as
[Plug](https://github.com/junegunn/vim-plug),
[Vundle](https://github.com/gmarik/vundle) or

View file

@ -267,7 +267,7 @@ if version >= 508 || !exists("did_typescript_syn_inits")
HiLink typescriptStorageClass StorageClass
HiLink typescriptRepeat Repeat
HiLink typescriptStatement Statement
HiLink typescriptFuncKeyword Function
HiLink typescriptFuncKeyword Keyword
HiLink typescriptMessage Keyword
HiLink typescriptDeprecated Exception
HiLink typescriptError Error

View file

@ -934,7 +934,7 @@ function! fugitive#Find(object, ...) abort
let commit = matchstr(s:ChompDefault('', [dir, 'merge-base'] + commits + ['--']), '\<[0-9a-f]\{40,\}\>')
endif
if commit !~# '^[0-9a-f]\{40,\}$'
let commit = matchstr(s:ChompDefault('', [dir, 'rev-parse', '--verify', commit, '--']), '\<[0-9a-f]\{40,\}\>')
let commit = matchstr(s:ChompDefault('', [dir, 'rev-parse', '--verify', commit . (len(file) ? '^{}' : ''), '--']), '\<[0-9a-f]\{40,\}\>')
endif
if len(commit)
let f = 'fugitive://' . dir . '//' . commit . file
@ -1559,7 +1559,7 @@ function! s:ReplaceCmd(cmd) abort
endtry
call delete(temp)
if s:cpath(fnamemodify(bufname('$'), ':p'), temp)
silent execute 'bwipeout '.bufnr('$')
silent! execute 'bwipeout '.bufnr('$')
endif
endtry
endfunction

View file

@ -304,6 +304,9 @@ function! s:ProjectionistDetect() abort
endif
endfunction
if v:version + has('patch061') < 703
runtime! autoload/fugitive.vim
endif
let g:io_fugitive = {
\ 'simplify': function('fugitive#simplify'),
\ 'resolve': function('fugitive#resolve'),

View file

@ -67,7 +67,8 @@ endsnippet
snippet exec "Exec resource type" b
exec { '${1:command}':
refreshonly => true,
command => "${2:$1}",
user => "${3:root}",
}
endsnippet

View file

@ -29,14 +29,14 @@ snippet #! "#!/usr/bin/env (!env)" b
`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n" `
endsnippet
snippet sbash "safe bash options"
snippet sbash "safe bash options" b
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
`!p snip.rv ='\n\n' `
endsnippet
snippet temp "Tempfile"
snippet temp "Tempfile" b
${1:TMPFILE}="$(mktemp -t ${3:--suffix=${4:.SUFFIX}} ${2:`!p
snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"
`}.XXXXXX)"
@ -44,27 +44,27 @@ ${5:${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'}${6/(.+)/" 0 # EXIT\
endsnippet
snippet case "case .. esac (case)"
snippet /case|sw(itch)?/ "case .. esac (case)" rb
case ${1:word} in
${2:pattern} )
$0;;
${0:${VISUAL}};;
esac
endsnippet
snippet elif "elif .. (elif)"
snippet elif "elif .. (elif)" b
elif ${2:[[ ${1:condition} ]]}; then
${0:#statements}
${0:${VISUAL}}
endsnippet
snippet for "for ... done (for)"
snippet for "for ... done (for)" b
for (( i = 0; i < ${1:10}; i++ )); do
${0:#statements}
${0:${VISUAL}}
done
endsnippet
snippet forin "for ... in ... done (forin)"
snippet forin "for ... in ... done (forin)" b
for ${1:i}${2/.+/ in /}${2:words}; do
${0:#statements}
${0:${VISUAL}}
done
endsnippet
@ -74,21 +74,21 @@ snippet here "here document (here)"
${1/['"`](.+)['"`]/$1/}
endsnippet
snippet if "if ... then (if)"
snippet if "if ... then (if)" b
if ${2:[[ ${1:condition} ]]}; then
${0:#statements}
${0:${VISUAL}}
fi
endsnippet
snippet until "until ... (done)"
snippet until "until ... (done)" b
until ${2:[[ ${1:condition} ]]}; do
${0:#statements}
${0:${VISUAL}}
done
endsnippet
snippet while "while ... (done)"
snippet /wh(ile)?/ "while ... (done)" rb
while ${2:[[ ${1:condition} ]]}; do
${0:#statements}
${0:${VISUAL}}
done
endsnippet