-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
215 lines (150 loc) · 6.01 KB
/
notes.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
This file contains all things I've learned and those that I still need to
=== TODOs ===
" TODO : mouse integration for linux console
mousefocus : auto focus window under cursor
mousehide : hide mouse when characters are typed
mousemodel : set right click behavior
= extend : same behavior as xterm
TODO : mouse scrolling : scroll-mouse-wheel
" TODO : enable/disable spell check (with a function key??)
TODO see what wildmode does to wildmenu
TODO vim 7.3 new features : relativenumber and undofile
TODO use standard regex for search ?
add a \v to search pattern, see what it means for regex and refs
nnoremap / /\v
vnoremap / /\v
TODO long lines and text formatting : 'wrap', 'textwidth', 'formatoptions', 'colorcolumn'
TODO : create a mapping to execute d[o|p] + move to next change for quick
diff apply (+bonus if it can be repeated)
TODO : custom keyboard mappings
create a map that shows all possibilities (should be a nice graph/visu project)
TODO : find/create a plugin that enable to have per-project and per-environment configurations
http://stackoverflow.com/questions/456792/vim-apply-settings-on-files-in-directory
- using a local file that .vimrc uses to detect which parameters should be used
-> there is a plugin that creates .localvimrc configurations files
TODO : search how to use buffers batch operations (bufdo)
TODO : display marks in buffers
-> sounds like it is not possible (according to help)
TODO : find how to manipulate XML tags
-> nothing more than cit, cat, dit, dat, ... => find a plugin for xml
TODO search highlight
'hl' variable defines all search highlight types
:[no]hlsearch disables current highlight
TODO text formatting
right center and left commands
look at fmt command line tool
TODO truncate long lines when typing
wrapmargin : right margin, inserts an <CR> when closer than n characters from left border
???? : hard margin (can't exceed)
soft margin (shows what is extra)
TODO open search in right window instead of top half window
this mapping does open a new in a separate tab : "noremap <F1> :tabnew<CR>:help<CR><C-W>o"
issue: must reuse current help window if already available
TODO : set "shell" option to select which shell is used when calling commands from vim
=== Spell Check ===
[no]spell : enable/disable spell check
spellang : select spell check language
z= : prompts for suggestions
=== Keyboard Mappings ===
add <silent> : avoids command to be printed in command line after its execution
add <unique> : avoids to override an already defined mapping
add <expr> : string is an expression and have to be evaluated (ex: function calls)
Note: not all features are available within function, but returning characters allow to execute stuff after return
=== Surround ===
yss : surround whole line
ySS : surround whole line and indent it
ySw : surround word and indent it
ysw : surround word
- in visual mode -
s : surround selection
S : surround selection and indent it (if in visual-line)
=== NerdTree ===
I : show/hide hidden files
o : expand folder/ open item
O : expand folder and children
t : open in new tab
T : open in background tab
=== Motion ===
hjkl
{,}: previous/next paragraph
Move in current line :
g^ or ^ : first non blank character
g_ : last non blank character
=== Normal Mode ===
g? : rot13 selection !!!
Ctrl-a : increment numeric value under cursor
Ctrl-x : decrement numeric value under cursor
-> both do not work with alphabetic characters
=== Visual Mode ===
gv : retrieve previous visual selection (from normal mode)
operators :
~ : switch case ( also works for current character in normal mode )`:w
=== Insert Mode ===
Ctrl-w : delete word before cursor
Ctrl-r{reg} : insert content of register {reg}, as if typed
Ctrl-r Ctrl-r{reg} : insert content of register {reg} literally
Ctrl-y : insert caracter above in previous line
-- Auto-Completion --
Ctrl-n : Next Keyword
Ctrl-p : Next Keyword
=== Buffers ===
Ctrl+^ : switch with alternate buffer
=== Windows ===
Ctrl+w then <x> where <x> is :
o : only current window
s : split horizontally
s : split horizontally
h,j,k,l : move cursor to window
Ctrl+w : switch to next window
Ctrl+n : create a new empty window (defaults to hsplit)
=== Folds ===
zf + motion to fold manually an item
{Visual}zf to fold selection
zo to delete current fold
=== Macros ===
q[register] : records typed characters to register (q by default)
@[register] : execute content of register
@@ : re-execute last macro
=== Jumps ===
:jumps for list
Ctrl+O : move to previous jump
Ctrl+I : move to next jump
'' : return to previous position after a jump (like a search, go to start/end of file, ...)
=== Help ===
:helpg {pattern} : help grep
-> then navigate results using quickfix window through :cwindow and :cnext
=== Command Line mode ===
<Up> : search cmd history with current cmd as prefix
Ctrl+r : insert value of a register into command line
named registers (not exhaustive)
% current file name
* clipboard content
/ last search pattern
: last command line
-- Auto-Completion --
Ctrl+d : list names that match the pattern in front of the cursor
=== Tags ===
vim -t bidule : open vim on matching "bidule" tag
Ctrl+] : jump to tag definition
Ctrl+t : return from tag jump
Ctrl+w ] : open tag definition in a new window
Ctrl+w } : open tag definition in preview window
g] : displays and select tag occurences
Ctrl+w g] : displays and select tag occurences in a new window
TODO : create convenient mappings for :tnext :tprev to navigate tag occurences
== Preview Window ==
Ctrl+w z : close any preview window (in current tab)
=== Text Objects ===
examples:
cip : change inner paragraph
das : delete whole sentence
text objects :
- p : paragraph
- s : sentence
- t : xml tag
- " : between double quotes
- ' : between single quotes
- ) : between parentheses, also works with (
- } : between curly braces, also works with {
- ] : between square braces, also works with [
- > : xml opening tag, also works with <, useful to edit tag and its attributes