Skip to content

Commit 1a21b9a

Browse files
committed
another cool vim solution
1 parent df36286 commit 1a21b9a

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

vim/wiki/dicasvim.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# dicasvim.md Intro - Last Change: 2018 mar 22 08:49
1+
# dicasvim.md Intro - Last Change: 2018 mar 23 06:49
22
vim: set ts=4 et:
33

44
+ http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/#navigation
@@ -3418,6 +3418,30 @@ OBS: These commands above do exactly the same
34183418
endfunction
34193419
nnoremap <Leader>k :call DeleteAbove()<CR>
34203420

3421+
# Modify eachline charectors between two patterns
3422+
+ https://stackoverflow.com/a/49446424/2571881
3423+
3424+
I need to modify the certain charactors between two patterns in each line.
3425+
Eample:: (File content saved as myfile.txt)
3426+
3427+
abc, def, 1, {jsdfsd kfgdsf lgfgd}, 2, pqr, stu
3428+
abc, def, 1, {jsdfsqwe k fdfsfl}, 2, pqr, stu
3429+
abc, def, 1, {asdasdj kgfdgdf ldsfsdf}, 2, pqr, stu
3430+
abc, def, 1, {jsds kfdsf fdsl}, 2, pqr, stu
3431+
3432+
Remove commas inside { block
3433+
3434+
abc, def, 1, {jsdfsd kfgdsf lgfgd} 2 pqr stu
3435+
abc, def, 1, {jsdfsqwe k fdfsfl} 2 pqr stu
3436+
abc, def, 1, {asdasdj kgfdgdf ldsfsdf} 2 pqr stu
3437+
abc, def, 1, {jsds kfdsf fdsl} 2 pqr stu
3438+
3439+
My solution:
3440+
3441+
OBS: we have to substitute <space> bellow
3442+
3443+
:%normal! 4f,xf,r f,r<space>
3444+
34213445
# Test if cursor is at the end of the line
34223446
+ https://superuser.com/a/723715/45032
34233447

0 commit comments

Comments
 (0)