|
1 | | -# dicasvim.md Intro - Last Change: 2018 mar 31 15:39 |
| 1 | +# dicasvim.md Intro - Last Change: 2018 abr 01 07:14 |
2 | 2 | vim: set ts=4 et: |
3 | 3 |
|
4 | 4 | + http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/#navigation |
|
28 | 28 | let l:winheight = winheight(win_getid()) |
29 | 29 | let l:winheight = winheight('%') |
30 | 30 |
|
| 31 | + see also winline() |
| 32 | + |
| 33 | +# How to replace first n occurrences of a character for each line? |
| 34 | ++ https://stackoverflow.com/a/49590581/2571881 |
| 35 | + |
| 36 | +Suppose, I have |
| 37 | + |
| 38 | + type,type,type,type,description,description,description. |
| 39 | + type,type,type,type,description,description. |
| 40 | + |
| 41 | +I want to - |
| 42 | + |
| 43 | + type|type|type|type|description,description,description. |
| 44 | + type|type|type|type|description,description. |
| 45 | + |
| 46 | +Solution: |
| 47 | + |
| 48 | +Nothing sofisticated but it get's the job done |
| 49 | + |
| 50 | + :%norm f,r|;.;.;. |
| 51 | + |
| 52 | +breakdown |
| 53 | + |
| 54 | + :%norm start a normal command on all lines |
| 55 | + f,r| f(ind) a ',' and r(eplace) with '|' |
| 56 | + ;.;.;. ';' jumps to next match and '.' repeats the change |
| 57 | + |
31 | 58 | # Save file only if it has changed |
32 | 59 |
|
33 | 60 | :update! |
@@ -1678,7 +1705,6 @@ I also have this line on my `~/.vimrc`, it allows me to insert the filename easi |
1678 | 1705 | iab fname <c-r>=expand("%:p")<cr> |
1679 | 1706 | ``` |
1680 | 1707 |
|
1681 | | - |
1682 | 1708 | # Ao digitar o caractere de fechamento o vim pula pra fora do bloco |
1683 | 1709 | + https://www.quora.com/What-are-your-favorite-Vim-key-mappings |
1684 | 1710 |
|
|
0 commit comments