rans>Skip to main content

Vim

  • ctrl + f: move down one page
  • ctrl + b: move up one page
  • ctrl + u: move up half page
  • ctrl + d: move down half page
  • G: move cursor to the bottom of the file
  • gg: move cursor to the top of the file
  • H: capital H, to move to the top of the screen
  • L: capital L, to move to the bottom of the screen
  • w: move to the next word
  • b: move to the previous word
  • u: undo
  • ctrl + r: redo

Delete to the line start

Deleting to the beginning of line when line starts with whitespace characters:

  1. Press ESC.
  2. Press d0.

Switch to Directory Browsing after opening a File

  1. Use :b# to go back to the last buffer.

💡 If you just opened a file, then it will bring you just back to the directory browsing.

  1. Return to the explorer using :Rex.
  2. Open the explorer using :Ex.
  3. Jump back to the previous location using ctrl + 0.

Delete

  • d0: Delete from the cursor position to the line start
  • c0: Delete from the cursor position to the line start and enter the insert mode

Switch off Auto Identation

Run all the commands below to turn off the auto indentation:

  • set nocindent
  • set nosmartindent
  • set noautoindent
  • set indentexpr=
  • filetype indent off
  • filetype plugin indent off

💡 To solve the identation problem when pasting code, you can use set paste, paste whatever you want to and then eventually use set nopaste.

:Sex, :Vex, :Tex and :Ex are all usefull commands for ex(ploring) the files on your system, where S/V/T stands for Split/Vertical/Tab.


Edit this page on GitHub
Blog
Tutorials
Notes
About