tab functions
This commit is contained in:
parent
9b42ef227b
commit
1c318712eb
1 changed files with 49 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ set rtp+=~/dotfiles/misc-files/powerline/powerline/bindings/vim
|
||||||
"
|
"
|
||||||
""" Easymotion
|
""" Easymotion
|
||||||
map / <Plug>(easymotion-sn)
|
map / <Plug>(easymotion-sn)
|
||||||
map / <Plug>(easymotion-tn)
|
omap / <Plug>(easymotion-tn)
|
||||||
map n <Plug>(easymotion-next)
|
map n <Plug>(easymotion-next)
|
||||||
map N <Plug>(easymotion-prev)
|
map N <Plug>(easymotion-prev)
|
||||||
let g:EasyMotion_landing_highlight = 1
|
let g:EasyMotion_landing_highlight = 1
|
||||||
|
|
@ -253,3 +253,51 @@ function! s:RunShellCommand(cmdline)
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
1
|
1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! MoveToPrevTab()
|
||||||
|
"there is only one window
|
||||||
|
if tabpagenr('$') == 1 && winnr('$') == 1
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
"preparing new window
|
||||||
|
let l:tab_nr = tabpagenr('$')
|
||||||
|
let l:cur_buf = bufnr('%')
|
||||||
|
if tabpagenr() != 1
|
||||||
|
close!
|
||||||
|
if l:tab_nr == tabpagenr('$')
|
||||||
|
tabprev
|
||||||
|
endif
|
||||||
|
sp
|
||||||
|
else
|
||||||
|
close!
|
||||||
|
exe "0tabnew"
|
||||||
|
endif
|
||||||
|
"opening current buffer in new window
|
||||||
|
exe "b".l:cur_buf
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
function! MoveToNextTab()
|
||||||
|
"there is only one window
|
||||||
|
if tabpagenr('$') == 1 && winnr('$') == 1
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
"preparing new window
|
||||||
|
let l:tab_nr = tabpagenr('$')
|
||||||
|
let l:cur_buf = bufnr('%')
|
||||||
|
if tabpagenr() < tab_nr
|
||||||
|
close!
|
||||||
|
if l:tab_nr == tabpagenr('$')
|
||||||
|
tabnext
|
||||||
|
endif
|
||||||
|
sp
|
||||||
|
else
|
||||||
|
close!
|
||||||
|
tabnew
|
||||||
|
endif
|
||||||
|
"opening current buffer in new window
|
||||||
|
exe "b".l:cur_buf
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
nnoremap <C-m> :call MoveToNextTab()<CR><C-w>H
|
||||||
|
nnoremap <C-n> :call MoveToPrevTab()<CR><C-w>H
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue