Skip to content

Instantly share code, notes, and snippets.

@amiorin
Created April 22, 2013 09:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amiorin/5433515 to your computer and use it in GitHub Desktop.
Save amiorin/5433515 to your computer and use it in GitHub Desktop.
Change tab with <D-number> like in chrome.
let s:windowmapnr = 0
let s:wins='1234567890!@#$%^&*()'
while (s:windowmapnr < strlen(s:wins))
exe 'noremap <silent> <D-' . s:wins[s:windowmapnr] . '> ' . (s:windowmapnr + 1) . 'gt'
exe 'inoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-O>' . (s:windowmapnr + 1) . 'gt'
exe 'cnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt'
exe 'vnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt'
let s:windowmapnr += 1
endwhile
unlet s:windowmapnr s:wins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment