-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim_notes.txt
56 lines (50 loc) · 1.58 KB
/
vim_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
Comments in .vimrc are with " (no closing apostrophes)
when it doesn't seem to be doing anything ctrl-Q exits into insert.
-Window Management:
- C-w C-w opens other window
- C-w = sets all windows to same size
- :split opens new window vertically
-Commenting blocks of code:
- C-V goes into visual mode to select block of code
- then Shift-I goes into insert
- type in commenting character
- ESC now copies that onto start of all lines in selection.
- to uncomment do selection and press x that deletes vertically.
-Tabs:
- tabedit <filename> opens tab
- gt goes front one tab, gT goes back one tab
-Python:
- insert syntax on
filetype indent plugin on
-in vimrc
-Custom file extensions syntax highlighting;
-put file specific commands to ~/.vim/ftdetect/<filename>.vim file
-Navigation
- C-f jump forward full screen
- C-b jump back full screen
- C-d jump forward half screen
- C-u jump back half screen
-How to do text wrapping
-Fix indentation in whole file
-gg=G
-get last yank
- "0p
-Plugins
- use vim plug (search for install instructions github)
-Macros
- q<letter> to start recording macro into respective register
- q stops recording
- play back with @<letter> (not in the prompt)
- <num>@<letter> for multiple times
-Folding
-set fdm=indent makes folds based on indent
-za toggles fold, zc closes, zo opens
-Turn tabs into spaces
you can see tabs with first doing this:
:set list
then to make it possible to replace tabs then do this:
:set expandtab
then
:retab
now all tabs have been replaced with spaces you can then go back to normal viewing like this :
:set nolist