Add Vim like tab features in Atom
Create virtual window that can have multiple pane. It emulate vim tab features.
atom-vim-like-tab:new
: crate new tabatom-vim-like-tab:close
: close current tabatom-vim-like-tab:previous
: show previous tabatom-vim-like-tab:next
: show next tabatom-vim-like-tab:list
: open tab select panel
No default keymaps. Here is my example
'.editor.vim-mode-plus:not(.insert-mode)':
't c': 'atom-vim-like-tab:new' # mean 'tab create'
': t a b c': 'atom-vim-like-tab:close'
't p': 'atom-vim-like-tab:previous'
't n': 'atom-vim-like-tab:next'
'space t': 'atom-vim-like-tab:list'
If you're using ex-mode here are a few additional shortcuts to be more like Real Vim (plus, it should be easy to see how to add your own!)
// keymap.cson
'.editor.vim-mode-plus:not(.insert-mode)':
'g t': 'atom-vim-like-tab:next'
'g T': 'atom-vim-like-tab:previous'
// init.coffee
atom.packages.onDidActivatePackage (pack) ->
if pack.name == 'ex-mode'
Ex = pack.mainModule.provideEx()
Ex.registerCommand 'tabs', ->
atomWorkspace = atom.views.getView(atom.workspace)
setTimeout ->
atom.commands.dispatch(atomWorkspace, 'atom-vim-like-tab:list')
, 0
Ex.registerCommand 'tab', ->
atomWorkspace = atom.views.getView(atom.workspace)
setTimeout ->
atom.commands.dispatch(atomWorkspace, 'atom-vim-like-tab:new')
, 0
Ex.registerCommand 'tabn', ->
atomWorkspace = atom.views.getView(atom.workspace)
setTimeout ->
atom.commands.dispatch(atomWorkspace, 'atom-vim-like-tab:next')
, 0
Ex.registerCommand 'tabp', ->
atomWorkspace = atom.views.getView(atom.workspace)
setTimeout ->
atom.commands.dispatch(atomWorkspace, 'atom-vim-like-tab:previous')
, 0
Ex.registerCommand 'tabclose', ->
atomWorkspace = atom.views.getView(atom.workspace)
setTimeout ->
atom.commands.dispatch(atomWorkspace, 'atom-vim-like-tab:close')
, 0
- Add packages menu
- Add list view feature for show and select tab
- Always show how many tab and which is current tab. inspire by vim
MIT