forked from starVader/.dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim.txt
47 lines (34 loc) · 1.33 KB
/
vim.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Hello mate
:e filename - edit another file
:split filename - split window and load another file
ctrl-w up arrow - move cursor up a window
ctrl-w ctrl-w - move cursor to another window (cycle)
ctrl-w_ - maximize current window
ctrl-w= - make all equal size
10 ctrl-w+ - increase window size by 10 lines
:vsplit file - vertical split
:sview file - same as split, but readonly
:hide - close current window
:only - keep only this window open
:ls - show current buffers
:b 2 - open buffer #2 in this window
searching
For basic searching:
/pattern - search forward for pattern
?pattern - search backward
n - repeat forward search
N - repeat backward
Some variables you might want to set:
:set ignorecase - case insensitive
:set smartcase - use case if any caps used
:set incsearch - show match as search proceeds
:set hlsearch - search highlighting
More cool searching tricks:
* - search for word currently under cursor
g* - search for partial word under cursor
(repeat with n)
ctrl-o, ctrl-i - go through jump locations
[I - show lines with matching word under cursor
plugins:
vimspell: spell checker
timestamp: automatically timestamp files