vim-tips-and-tricks

JSON

rev 10  |  foxhop  |  1312492051000  |  JSON

rev 9
rev 10
2424
25    :%s/\t/ /g25    :%s/\t/ /g
tt26 
27 
26vimdiff or hg merge28vimdiff or hg merge
27-----------------------29-----------------------
rev 9  |  foxhop  |  1312492043000  |  JSON

rev 8
rev 9
18    set expandtab18    set expandtab
1919
tt20how to set replace all tabs with a space
21-----------------------------------------
22 
23.. code-block:: vim
24 
25    :%s/\t/ /g
20vimdiff or hg merge26vimdiff or hg merge
21-----------------------27-----------------------
rev 8  |  foxhop  |  1311431251000  |  JSON

rev 7
rev 8
10-----------------------------------------10-----------------------------------------
1111
nn12Add the following into your .vimrc file:
13 
12.. code-block:: vim14.. code-block:: vim
1315
t14    set ts=4t16    set tabstop=4
17    set shiftwidth=4
18    set expandtab
1519
16vimdiff or hg merge20vimdiff or hg merge
rev 7  |  foxhop  |  1311431024000  |  JSON

rev 6
rev 7
6As I learn more about vim, I plan to document the tips and tricks I learn here.6As I learn more about vim, I plan to document the tips and tricks I learn here.
77
tt8 
9how to set tab to 4 spaces in vim
10-----------------------------------------
11 
12.. code-block:: vim
13 
14    set ts=4
815
9vimdiff or hg merge16vimdiff or hg merge
rev 6  |  foxhop  |  1308868776000  |  JSON

rev 5
rev 6
15 switch windows15 switch windows
1616
nn17|
18 
17do19do
18 diff obtain, take the other window's differences. Pull the change.20 diff obtain, take the other window's differences. Pull the change.
nn21 
22|
1923
20dp24dp
21 diff put, give the other window our differences. Push the change.25 diff put, give the other window our differences. Push the change.
2226
nn27|
28 
23[c29[c
24 move focus to previous difference.30 move focus to previous difference.
nn31 
32|
2533
26]c34]c
27 move focus to next difference.35 move focus to next difference.
2836
nn37|
38 
29:diffupdate39:diffupdate
30 diff update 40 diff update 
nn41 
42|
3143
32:diffget <window number>44:diffget <window number>
33 get changes from specified window number and place them into current window.45 get changes from specified window number and place them into current window.
3446
nn47|
48 
35:diffput <window number>49:diffput <window number>
36 put changes from current window into specified window number.50 put changes from current window into specified window number.
nn51 
52|
3753
38zo54zo
39 open folded text55 open folded text
4056
nn57|
58 
41zc59zc
42 close folded text60 close folded text
tt61 
62|
rev 5  |  foxhop  |  1308868697000  |  JSON

rev 4
rev 5
10-----------------------10-----------------------
1111
n12Some common commands:n12This is a list of some common commands when using vimdiff:
1313
n14.. code-block:: nonen
15  
16 ctrl w (twice)14ctrl w (twice)
17 
18    switch windows15 switch windows
1916
n20 don17do
18 diff obtain, take the other window's differences. Pull the change.
2119
nn20dp
22    diff obtain, take the other window's differences. Pull the change.21 diff put, give the other window our differences. Push the change.
2322
n24 dpn23[c
24 move focus to previous difference.
2525
n26    diff put, give the other window our differences. Push the change.n26]c
27 move focus to next difference.
2728
n28 [cn29:diffupdate
29 30 diff update 
30    move focus to previous difference.
3131
n32 ]cn32:diffget <window number>
33 33 get changes from specified window number and place them into current window.
34    move focus to next difference.
3534
n36 :diffupdaten35:diffput <window number>
37 36 put changes from current window into specified window number.
38    diff update 
3937
nn38zo
39 open folded text
4040
t41 :diffget <window number>t
42 
43    get changes from specified window number and place them into current window.
44 
45 
46 :diffput <window number>
47 
48    put changes from current window into specified window number.
49 
50 
51 zo
52 
53    open folded text
54 
55 zc41zc
56 
57    close folded text42 close folded text
rev 4  |  foxhop  |  1301224658000  |  JSON

rev 3
rev 4
12Some common commands:12Some common commands:
1313
n14.. code-block:: pythonn14.. code-block:: none
15  15  
n16 ctrl wn16 ctrl w (twice)
17 17 
18    switch windows18    switch windows
38    diff update 38    diff update 
3939
nn40 
40 :diffget <window number>41 :diffget <window number>
4142
42    get changes from specified window number and place them into current window.43    get changes from specified window number and place them into current window.
4344
nn45 
44 :diffput <window number>46 :diffput <window number>
4547
46    put changes from current window into specified window number.48    put changes from current window into specified window number.
tt49 
4750
48 zo51 zo
rev 3  |  foxhop  |  1301224512000  |  JSON

rev 2
rev 3
12Some common commands:12Some common commands:
1313
n14**ctrl w**n14.. code-block:: python
15  
16 ctrl w
15 17 
16    switch windows18    switch windows
1719
n18**do**n20 do
1921
20    diff obtain, take the other window's differences. Pull the change.22    diff obtain, take the other window's differences. Pull the change.
2123
n22**dp**n24 dp
2325
24    diff put, give the other window our differences. Push the change.26    diff put, give the other window our differences. Push the change.
2527
n26**[c**n28 [c
27 29 
28    move focus to previous difference.30    move focus to previous difference.
2931
n30**]c**n32 ]c
31 33 
32    move focus to next difference.34    move focus to next difference.
3335
n34**:diffupdate**n36 :diffupdate
35 37 
36    diff update 38    diff update 
3739
n38**:diffget <window number>**n40 :diffget <window number>
3941
40    get changes from specified window number and place them into current window.42    get changes from specified window number and place them into current window.
4143
n42**diffput <window number>**n44 :diffput <window number>
4345
44    put changes from current window into specified window number.46    put changes from current window into specified window number.
4547
n46**zo**n48 zo
4749
48    open folded text50    open folded text
4951
t50**zc**t52 zc
5153
52    close folded text54    close folded text
rev 2  |  foxhop  |  1301224327000  |  JSON

rev 1
rev 2
12Some common commands:12Some common commands:
1313
n14**ctrl w** n14**ctrl w**
15 
15    switch windows16    switch windows
1617
17**do**18**do**
nn19 
18    diff obtain, take the other window's differences. Pull the change.20    diff obtain, take the other window's differences. Pull the change.
1921
20**dp**22**dp**
nn23 
21    diff put, give the other window our differences. Push the change.24    diff put, give the other window our differences. Push the change.
2225
n23**[c** n26**[c**
27 
24    move focus to previous difference.28    move focus to previous difference.
2529
n26**]c** n30**]c**
31 
27    move focus to next difference.32    move focus to next difference.
2833
n29**:diffupdate** n34**:diffupdate**
35 
30    diff update 36    diff update 
3137
nn38**:diffget <window number>**
39 
40    get changes from specified window number and place them into current window.
41 
42**diffput <window number>**
43 
44    put changes from current window into specified window number.
45 
32**zo**46**zo**
nn47 
33    open folded text48    open folded text
3449
35**zc**50**zc**
tt51 
36    close folded text52    close folded text
rev 1  |  foxhop  |  1301223342000  |  JSON

empty
rev 1
tt1Vim Tips and Tricks
2========================
3 
4.. contents::
5 
6As I learn more about vim, I plan to document the tips and tricks I learn here.
7 
8 
9vimdiff or hg merge
10-----------------------
11 
12Some common commands:
13 
14**ctrl w** 
15    switch windows
16 
17**do**
18    diff obtain, take the other window's differences. Pull the change.
19 
20**dp**
21    diff put, give the other window our differences. Push the change.
22 
23**[c** 
24    move focus to previous difference.
25 
26**]c** 
27    move focus to next difference.
28 
29**:diffupdate** 
30    diff update 
31 
32**zo**
33    open folded text
34 
35**zc**
36    close folded text