1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Add tabline shortcuts (Shift + 0...9 ) for tabbing to 10..20 (#3905)

This commit is contained in:
Matthew Strasiotto 2020-10-31 18:51:07 +11:00 committed by GitHub
parent e934189f6d
commit 939d8a617f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,8 +447,29 @@ function! SpaceVim#layers#core#tabline#config() abort
autocmd!
autocmd ColorScheme * call SpaceVim#layers#core#tabline#def_colors()
augroup END
for i in range(1, 9)
exe "call SpaceVim#mapping#def('nmap <silent>', '<leader>" . i
let shift_keys = {
\ '1': '!',
\ '2': '@',
\ '3': '#',
\ '4': '$',
\ '5': '%',
\ '6': '^',
\ '7': '&',
\ '8': '*',
\ '9': '(',
\ '0': ')'
\}
for i in range(1, 20)
let key = i % 10
if i > 10
let key = shift_keys[string(key)]
endif
exe "call SpaceVim#mapping#def('nmap <silent>', '<leader>" . key
\ . "', ':call SpaceVim#layers#core#tabline#jump("
\ . i . ")<cr>', 'Switch to airline tab " . i
\ . "', '', 'tabline index " . i . "')"