:set mouse=a
Mappings jk or kj to <ESC>
For a better solution without visual distraction, you can consider using https://github.com/zhou13/vim-easyescape/
Use your favourite plugin manager, e.g., vim-plug:
Plug "zhou13/vim-easyescape"
put easyescape.vim to ~/.vim/plugin/
Configuration : map of jk and kj
The unit of timeout is in ms. A very small timeout makes an input of real jk or kj possible (Python3 is required for this feature)!
let g:easyescape_chars = { "j": 1, "k": 1 }
let g:easyescape_timeout = 100
cnoremap jk <ESC>cnoremap kj <ESC>
Vi is a powerful text editor included on most Linux systems. Many people swear by vi and find it faster than any other editor once they’ve learned its key bindings. You can even use vi key bindings in Bash.
As a short recap, vi is a modal editor – there’s an insert mode and a standard command mode. In insert mode, vi functions similar to a normal text editor. In command mode, you take advantage of these key bindings.
Vi uses the hjkl keys to move the cursor in command mode. Early computer systems didn’t always have arrow keys, so these keys were used instead. One advantage of these keyboard shortcuts is that you don’t have to move your fingers from the home row to use them.
You can also use search commands to quickly move the cursor.
Use these commands to quickly move to locations in the file:
Moving between words:
Vi refers to the act of copying as “yanking.”
Some commands – including the y and v commands above and the d (delete) command accept cursor motion commands.
For example, when you press d to delete some text, nothing will happen until you enter a cursor motion command. For example:
As you can see, the combination of combining a command with a cursor movement command is very powerful.
Vi’s repeat command is very powerful, as it can repeat complex, combined commands.
Once you’ve mastered the vi key bindings, you may want to use them elsewhere on your system. No problem – you can set the Bash shell to use vi-style key bindings.
Try this out in the current session by running the following command in a Bash terminal:
set -o vi
Bash will start in insert mode – press Escape to enter command mode and use these key bindings.
If you like this, you can add the command to your ~/.bashrc file and it will be automatically run each time you log in. Use the vi .bashrc command to open and edit the file in vi.
Install vim-scripts to install plugins. Can use vim-addons to show what plugins have been installed.
winmanager: A classical windows type environment for vim6.0
taglist: The "Tag List" plugin is a source code browser plugin for Vim and provides an overview of the structure of source code files and allows you to efficiently browse through source code files for different programming languages (can be combine with winmanager)
snippetsEmu : An attempt to emulate TextMate's snippet expansion (works for C language)