tabline: simplify creation of maps
instead of typing all the mapping commands, create a loop that will create the new maps.
This commit is contained in:
parent
105e9daaf7
commit
999c40fcf3
@ -190,15 +190,9 @@ endfunction
|
|||||||
|
|
||||||
function! s:map_keys()
|
function! s:map_keys()
|
||||||
if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
|
if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
|
||||||
noremap <silent> <Plug>AirlineSelectTab1 :call <SID>select_tab(1)<CR>
|
for i in range(1, 9)
|
||||||
noremap <silent> <Plug>AirlineSelectTab2 :call <SID>select_tab(2)<CR>
|
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :call <SID>select_tab(%d)<CR>', i, i)
|
||||||
noremap <silent> <Plug>AirlineSelectTab3 :call <SID>select_tab(3)<CR>
|
endfor
|
||||||
noremap <silent> <Plug>AirlineSelectTab4 :call <SID>select_tab(4)<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab5 :call <SID>select_tab(5)<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab6 :call <SID>select_tab(6)<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab7 :call <SID>select_tab(7)<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab8 :call <SID>select_tab(8)<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab9 :call <SID>select_tab(9)<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
|
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
|
||||||
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
|
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
|
||||||
" Enable this for debugging
|
" Enable this for debugging
|
||||||
|
@ -104,15 +104,9 @@ function! airline#extensions#tabline#tabs#map_keys()
|
|||||||
if maparg('<Plug>AirlineSelectTab1', 'n') is# ':1tabn<CR>'
|
if maparg('<Plug>AirlineSelectTab1', 'n') is# ':1tabn<CR>'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
noremap <silent> <Plug>AirlineSelectTab1 :1tabn<CR>
|
for i in range(1, 9)
|
||||||
noremap <silent> <Plug>AirlineSelectTab2 :2tabn<CR>
|
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :%dtabn<CR>', i, i)
|
||||||
noremap <silent> <Plug>AirlineSelectTab3 :3tabn<CR>
|
endfor
|
||||||
noremap <silent> <Plug>AirlineSelectTab4 :4tabn<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab5 :5tabn<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab6 :6tabn<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab7 :7tabn<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab8 :8tabn<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectTab9 :9tabn<CR>
|
|
||||||
noremap <silent> <Plug>AirlineSelectPrevTab gT
|
noremap <silent> <Plug>AirlineSelectPrevTab gT
|
||||||
" tabn {count} goes to count tab does not go {count} tab pages forward!
|
" tabn {count} goes to count tab does not go {count} tab pages forward!
|
||||||
noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr>
|
noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr>
|
||||||
|
Loading…
Reference in New Issue
Block a user