Wednesday, June 12, 2019

vim 总结



toturial: https://vimhelp.org/





vim - A modal editor based on the classic ‘vi’ editor by Bill Joy.


Vim quick reference


Changing modes


Enter command mode: :


Enter typing mode: i (insert at cursor), a (append after cursor), A (append at end of line)


Exit command or typing mode: ESC


Moving (you must not be in command or typing mode)


By line or column: use the arrow keys or h (left), j (down), k (up), l (right)


Go to beginning/end of line: 0 or $


Go to beginning/end of file: 1G or G


Go to particular line: type the linenumber and press G


Prev/next word: gE or W


Beginning/end of word: e or b


Search: /search term or regex


Opening, saving and closing files


Open a file: :e filename or path


Save and exit: :x


Save without exiting: :w


Exit without saving: :q!


Getting help


In-editor help: :help





The less command allows you to use these key-commands to move around the file
x

No comments:

Post a Comment