1. Edit the / usr / share / vim / vimrc this document, the vimrc configuration is in force all users.
2. vim configuration available shortcuts
ctrl + c corresponding to: tabprevious
:map <C-P> :tabprevious<CR>
----------
ctrl+p 对应 :tabnext
:map <C-N> :tabnext<CR>
After 3. vim -p * .go plurality of disposable tab can open multiple files, and the second step can be configured using a shortcut, ctrl + p before switching to a tab, ctrl + n is switched to a tab of .
4.ctrl + t to open a new tab
:map <C-T> :tabnew<CR>
After this you can, but generally open a new tab, will need to select a file to open, they need to do: e xx xx to open this file, you can look at this a little adjustment here you can set up shortcuts.
:map <C-T> :tabnew .<CR>
Plus a., Represents, it will prompt in the current folder, choose File Open.
-------------------------------------
Reference: https://www.cnblogs.com/mliudong/p/3309725.html
Vim flexible operation in Tabsgaleki post @ On November 16, 2007 in Ri PM 05:07 Vim Tips with Tags: vim tabs
Vim supports Tabs, which is tab editor, so cool ~
The basic operation command tab follows:
- : Tabnew: Open a new tab.
- : Tabprevious: Back to the previous tab.
- : Tabnext: to the next tab.
But each new or switch between tabs, should be marked with such a long list of commands, it is trouble, we can set up some shortcuts in the configuration file, as follows:
:map <F5> :tabprevious<CR>
:map <F6> :tabnext<CR>
:map ^T :tabnew<CR>
:imap <F5> <ESC>:tabprevious<CR>i
:imap <F6> <ESC>:tabnext<CR>i
:imap ^T <ESC>:tabnew<CR>i
Such forward F5, F6 is backwards, Ctrl + t open a new tab in insert mode, it works - of course, you can put the above set of keys into your habits -
However, open a new tab every time to open a blank tab, then select the file again, it seems a bit frustrating, if the files in the current directory displayed newly opened tab, you can choose from, so much the better -
Very simple to achieve, in: tabnew given directory name behind it, the current directory, then, is:
:map <F5> :tabprevious<CR>
:map <F6> :tabnext<CR>
:map ^T :tabnew .<CR>
:imap <F5> <ESC>:tabprevious<CR>i
:imap <F6> <ESC>:tabnext<CR>i
:imap ^T <ESC>:tabnew .<CR>i
You can also '' replace your favorite directory -
So be minor changes, tabs convenient than the original a lot ~