Update Vim example: Rename functions
See: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.260
This commit is contained in:
parent
d7c734acd6
commit
d76a3646b7
@ -395,20 +395,20 @@ handy mapping that selects an open buffer.
|
|||||||
|
|
||||||
```vim
|
```vim
|
||||||
" List of buffers
|
" List of buffers
|
||||||
function! g:buflist()
|
function! BufList()
|
||||||
redir => ls
|
redir => ls
|
||||||
silent ls
|
silent ls
|
||||||
redir END
|
redir END
|
||||||
return split(ls, '\n')
|
return split(ls, '\n')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! g:bufopen(e)
|
function! BufOpen(e)
|
||||||
execute 'buffer '. matchstr(a:e, '^[ 0-9]*')
|
execute 'buffer '. matchstr(a:e, '^[ 0-9]*')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
nnoremap <silent> <Leader><Enter> :call fzf#run({
|
nnoremap <silent> <Leader><Enter> :call fzf#run({
|
||||||
\ 'source': reverse(g:buflist()),
|
\ 'source': reverse(BufList()),
|
||||||
\ 'sink': function('g:bufopen'),
|
\ 'sink': function('BufOpen'),
|
||||||
\ 'options': '+m',
|
\ 'options': '+m',
|
||||||
\ 'tmux_height': '40%'
|
\ 'tmux_height': '40%'
|
||||||
\ })<CR>
|
\ })<CR>
|
||||||
|
Loading…
Reference in New Issue
Block a user