-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheatsheet.txt
More file actions
50 lines (35 loc) · 1.45 KB
/
cheatsheet.txt
File metadata and controls
50 lines (35 loc) · 1.45 KB
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
" vim: filetype=help foldmethod=marker foldmarker=<<<,>>> modifiable noreadonly
You need the noreadonly and modifiable keywords in the vim modeline above.
Help files are by default regarded as readonly and nomodifiable files by vim.
Notes about sed *sed* *sfsed* <<<
Swapping word's in stream (I know, you don't need the cat)
cat Myfile.h|sed 's/foo/fyy/g'
Notes about vim *vim* *sfvim* <<<
Stuff I have learned about vim.
Create a help link like this |add-local-help|
Regenerate help tags: |helptags|
A realy big section closed with a tag <<<
--- lots of stuf ---
Closing tag >>>
Telephonelist *sfphone* <<<
person1: 555-676767-333
person2: 555-767676-222
>>>
Echo the value of a variable :echo &var_name, not a variable but rather a cmd.
In insert mode use <Ctrl>-V-<Tab> to insert a \t
:echo @% def/my.txt directory/name of file
:echo expand('%:t') my.txt name of file ('tail')
:echo expand('%:p') /abc/def/my.txt full path
:echo expand('%:p:h') /abc/def directory containing file ('head')
"vim -" starts vim with a buffer from text read from stdin
====
Vim scripting the hardway.
Toggling Boolean Options :set number! "Use the ! char to toggle
Checking the value of boolean options :set number?
viw = will highlight the entire word
diw = will delete the entire word
ciw
daw, vaw, caw are possible too
*map and *noremap mappings
leader and localleader global variables
vim -u NONE " Runs without loading plugins or reading vimrc