Quit all :qa
Go to top of file :gg
Go to bottom of file Shift-g
Go back Ctrl-o
Go back to previous file Ctrl-^
Move to next word w
Move up/down half screen Ctrl-u
Ctrl-d
Move to next function ]]
Move to prev function [[
Goto line [line#] Shift-g
Move to beginning of line 0
Move to end of line $
Explorer :Ex
Terminal :term
(vim8 only)
Close quickfix list :ccl
Close scratch preview :pc
Split screen Ctrl-w v
Go to right screen Ctrl-w l
Go to left screen Ctrl-w h
Undo u
Delete line dd
Search/replace in file :%s/search/replace/g
Find word under cursor *
\\
(mapped to gcc
via Commentry plugin)
-
Ctrl-v
to enter visual block mode -
select lines with
↑
↓
, orif
for inner function -
Shift-i
for insert mode -
//
(or other comment symbol) -
ESC
Select a line V
(enters visual selection mode)
Cut d
Copy y
(yank)
Paste p
Save session :mks
(or :mks!
if already exists)
Load session vim -S Session.vim
or :source Session.vim
Goto def gd
Show godoc K
Run tests F10
Show coverage F9
Toggle test \ga
, \gah
horizontal, \gav
vertical split
Toggle \p
(mapped to :NERDTreeToggle
)
Open verticle split s
Open horizontal split i
:AirlineTheme <theme>
Git commands :Git [command]
, i.e: :Git blame
, :Git status
:LspInfo
Format code :RustFmt
Run test under cursor :RustTest
Rust setup: https://sharksforarms.dev/posts/neovim-rust/