Created
June 8, 2016 01:00
-
-
Save khalidchawtany/bb6564832df8a82224e6e2287897903d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin('~/.config/nvim/plugged') | |
set rtp+=/usr/local/opt/fzf | |
Plug 'junegunn/fzf.vim', | |
function! s:tablist() | |
redir => tabs | |
silent tabs | |
redir END | |
return filter(split(tabs, '\n'), 'v:val =~ "Tab page"') | |
endfunction | |
function! s:tabopen(e) | |
echomsg 'normal! '. matchstr(a:e, 'Tab page \zs[0-9]*\ze.*$').'gt' | |
execute 'normal! '. matchstr(a:e, 'Tab page \zs[0-9]*\ze.*$').'gt' | |
endfunction | |
nnoremap <silent> <c-p><c-i> :call fzf#run({ | |
\ 'source': reverse(<sid>tablist()), | |
\ 'sink': function('<sid>tabopen'), | |
\ 'options': '+m', | |
\ 'down': len(<sid>tablist()) + 2 | |
\ })<CR> | |
call plug#end() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment