-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeymaps.txt
165 lines (103 loc) · 4.64 KB
/
keymaps.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# open & close files
:e - edit another file
:w - write file
:wq - write file and quit
:q! - quit without saving
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# motions
k - up
j - down
l - right
h - left
G - end of buffer
gg - beginning of buffer
^ - beginning of line
$ - end of line
{ - one para backward
} - one paragraph forward
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# switching to insert mode
i - insert text before the cursor
I - insert text from the beginning of the line
a - append text after the cursor
A - append text at the end of the line
o - insert text in a new line below the cursor
O - insert text in a new line above the cursor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# cut and paste
x - delete character under the cursor
X - delete character before the cursor
dd - delete line
D - delete from the cursor to the end of the line
p - paste after the cursor
P - paste at the cursor
+p - paste from system clipboard after cursor
+P - paste from system clipboard at the cursor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# select and copy
v - switch to visual mode
V - switch to visual line mode
y - copy (yank)
Y - copy to system clipboard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# undo and redo
u - undo
ctrl+r - redo
# hard line wrapping
gq - wrap selected lines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# search and replace
/{pattern} - search forward from the cursor
?{pattern} - search backward from cursor
n - next occurrence of search pattern
N - previous occurrence of search pattern
:%s/{pattern}/{string}/ - replace all matches of a pattern
:s/{pattern}/{string} - replace all matches of a pattern in the selected area (visual mode)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# sort lines
:sort - sort selected lines
:sort u - sort lines, removing dupplicates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# PROGRAMMING
--> Go To Variable Definition
> * - search for the exact word under the cursor
> g* - same as * but allows partial matches
> gd - goto (local) variable definition
> gD - goto (global) variable definition
--> Go To Function Definition
> ctrl+] - search for the tag under the cursor and jump to first match
> ctrl+T - jump back in the tagstack
> g] - search for tag under the cursor and list matches
> :ts - list matches for the last tag seacrh
> :tn - jump to the next matching tag
> :tp - jump to the previous matching tag
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# MY KEYMAPS
> jj - insert mode to normal mode
> <leader>c - cls search
> x - delete without copy
> <leader>+ - increment
> <leader>- - decrement
> <leader>sv - split window vertically
> <leader>sh - split window horizontally
> <leader>se - make split windows equal width & height
> <leader>sx - close current split window
> <leader>tn - open new tab
> <leader>tc - close current tab
> <leader>tr - go to next tab
> <leader>tl - go to previous tab
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# plugin keymaps
--> telescope
> <leader>ff - find files within current working directory, respects .gitignore
> <leader>fr - find recent files
> <leader>fs - find string in current working directory as you type
> <leader>fc - find string under cursor in current working directory
> <leader>fb - list open buffers in current neovim instance
> <leader>fh - list available help tags
--> vim maximizer
> <leader>sm - maximize the current split
--> nvim-tree
> tt - open nvim-tree
--> TransparentToggle
> bt - Transparent background Togglne #ffffff