Merge pull request #932 from chrisbra/updated-doc
clarify buffer_idx mode mappings
This commit is contained in:
commit
698db37591
@ -45,6 +45,7 @@ function! airline#extensions#tabline#buffers#invalidate()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#tabline#buffers#get()
|
function! airline#extensions#tabline#buffers#get()
|
||||||
|
call <sid>map_keys()
|
||||||
let cur = bufnr('%')
|
let cur = bufnr('%')
|
||||||
if cur == s:current_bufnr
|
if cur == s:current_bufnr
|
||||||
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
|
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
|
||||||
@ -180,16 +181,18 @@ function! s:jump_to_tab(offset)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if s:buffer_idx_mode
|
function s:map_keys()
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
|
if s:buffer_idx_mode
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
|
noremap <silent> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
|
noremap <silent> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
|
noremap <silent> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
|
noremap <silent> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
|
noremap <silent> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
|
noremap <silent> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
|
noremap <silent> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
|
noremap <silent> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
|
noremap <silent> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
|
||||||
noremap <silent><unique> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
|
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
|
||||||
endif
|
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
@ -31,6 +31,7 @@ endfunction
|
|||||||
function! airline#extensions#tabline#tabs#get()
|
function! airline#extensions#tabline#tabs#get()
|
||||||
let curbuf = bufnr('%')
|
let curbuf = bufnr('%')
|
||||||
let curtab = tabpagenr()
|
let curtab = tabpagenr()
|
||||||
|
call s:map_keys()
|
||||||
if curbuf == s:current_bufnr && curtab == s:current_tabnr
|
if curbuf == s:current_bufnr && curtab == s:current_tabnr
|
||||||
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
|
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
|
||||||
return s:current_tabline
|
return s:current_tabline
|
||||||
@ -80,3 +81,18 @@ function! airline#extensions#tabline#tabs#get()
|
|||||||
let s:current_tabline = b.build()
|
let s:current_tabline = b.build()
|
||||||
return s:current_tabline
|
return s:current_tabline
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function s:map_keys()
|
||||||
|
noremap <silent> <Plug>AirlineSelectTab1 :1tabn<CR>
|
||||||
|
noremap <silent> <Plug>AirlineSelectTab2 :2tabn<CR>
|
||||||
|
noremap <silent> <Plug>AirlineSelectTab3 :3tabn<CR>
|
||||||
|
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
|
||||||
|
" 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>
|
||||||
|
endfunction
|
||||||
|
@ -493,9 +493,16 @@ exposed.
|
|||||||
nmap <leader>7 <Plug>AirlineSelectTab7
|
nmap <leader>7 <Plug>AirlineSelectTab7
|
||||||
nmap <leader>8 <Plug>AirlineSelectTab8
|
nmap <leader>8 <Plug>AirlineSelectTab8
|
||||||
nmap <leader>9 <Plug>AirlineSelectTab9
|
nmap <leader>9 <Plug>AirlineSelectTab9
|
||||||
|
nmap <leader>- <Plug>AirlineSelectPrevTab
|
||||||
|
nmap <leader>+ <Plug>AirlineSelectNextTab
|
||||||
|
|
||||||
Note: Mappings will be ignored within a NERDTree buffer.
|
Note: Mappings will be ignored within a NERDTree buffer.
|
||||||
|
|
||||||
|
Note: In buffer_idx_mode these mappings won't change the
|
||||||
|
current tab, but switch to the buffer visible in that tab.
|
||||||
|
Use |gt| for switching tabs.
|
||||||
|
In tabmode, those mappings will switch to the specified tab.
|
||||||
|
|
||||||
* defines the name of a formatter for how buffer names are displayed. >
|
* defines the name of a formatter for how buffer names are displayed. >
|
||||||
let g:airline#extensions#tabline#formatter = 'default'
|
let g:airline#extensions#tabline#formatter = 'default'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user