Skip to content

Commit

Permalink
Updated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
amix committed Dec 30, 2019
1 parent cb57890 commit b56966e
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 84 deletions.
3 changes: 1 addition & 2 deletions sources_non_forked/lightline.vim/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 42 additions & 1 deletion sources_non_forked/lightline.vim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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' :
Expand Down Expand Up @@ -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.

Expand Down
78 changes: 38 additions & 40 deletions sources_non_forked/lightline.vim/doc/lightline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down Expand Up @@ -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' : ''
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions sources_non_forked/nerdtree/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions sources_non_forked/nerdtree/doc/NERDTree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
2 changes: 1 addition & 1 deletion sources_non_forked/nerdtree/lib/nerdtree/key_map.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions sources_non_forked/nerdtree/lib/nerdtree/menu_item.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions sources_non_forked/nerdtree/lib/nerdtree/notifier.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions sources_non_forked/nerdtree/lib/nerdtree/path.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions sources_non_forked/rust.vim/doc/rust.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,14 @@ 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
if a `rustfmt.toml` file is present in any parent directly leading to
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
that have `rustfmt.toml` configuration.

There is also a buffer-local b:rustfmt_autosave_if_config_present
that can be set for the same purpose, which can overrides the global
setting.
Expand All @@ -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: >
Expand Down Expand Up @@ -192,9 +192,9 @@ 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`.
target directly to the Rust compiler, `rustc`.

Because Cargo is almost exclusively being used for building Rust code these
days, 'cargo' is the default checker. >
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion sources_non_forked/typescript-vim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit b56966e

Please sign in to comment.