Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Learn Some Vim And Save Your Time #2

Open
hulin32 opened this issue Nov 21, 2017 · 0 comments
Open

Learn Some Vim And Save Your Time #2

hulin32 opened this issue Nov 21, 2017 · 0 comments
Labels

Comments

@hulin32
Copy link
Owner

hulin32 commented Nov 21, 2017

自己学vim使用的一些命令,大多数在文后的链接能找到

Survive

  • vi/vim -> open the editor
  • :q -> Quit
  • :wq -> Save and Quit
  • :q! -> Quit and Not Save
  • i -> Insert mode
  • x -> Delete the char under the cursor
  • dd -> Delete the current line
  • pP -> Paste to above or under the current line
  • yy -> Copy current line
  • hjkl -> Right, Down, Up, Left

Feel comfortable

  • a -> Insert after the cursor
  • oO -> Insert a new line after/before the current one
  • 0 -> Go to the first column
  • ^ -> go to the first non-blank character of the line
  • $ -> go to the end of line
  • g_ -> go to the last non-blank character of line
  • /pattern -> search for pattern
  • u -> undo
  • <C-r> -> redo
  • :e <path/to/file> -> open file
  • bn,bp -> show next/previous file (buffer)

Feel Better, Stronger, Faster

  • . -> Repeat the last command
  • N<command> -> Repeat the command N times.
  • NG -> Go to N line
  • gg -> Go to first line
  • G -> Go to last line
  • b -> Open one buffer file
  • % -> Go to the corresponding (, {, [.
  • * -> go to next/previous(#) occurrence of the word under the cursor

Vim Superpowers

  • f<char>, ;, , -> Find one char on the current line, ; go to the next same char, ',' go back to the last same char
  • t, -> Go to just before the character ,
  • F,T -> Like f and t but backward
  • <C-p> -> Go to the previous line
  • <C-n> -> GO to the next line
  • <C-d> -> Go down a half screen
  • <c-u> -> Go up a half screen
  • {,} -> previous/next empty line
  • v,V,<C-v> -> Visual mode
  • :split, :vsplit -> split the window
  • tabnew -> open a new tab

Learn Vim Progressively

简明 VIM 练级攻略

Learn Vimscript the Hard Way

Practical Vim: Edit Text at the Speed of Thought

Practical-Vim 整理

@hulin32 hulin32 added the Vim label Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant