/vimg/ - Vim General

Can we get a Vim thread going?

>cheatsheet
cs.cmu.edu/~15131/f17/topics/vim/vim-cheatsheet.pdf
vim.rtorr.com/

>plugins
github.com/akrawchyk/awesome-vim

>speed test
vimvalley.com/vim-movement-speed-challenge/

Attached: 881jik485q711.jpg (4032x3024, 1M)

i hate viggers

marge moment

I ve been using vim for years for config editing, but I still dont understand whats the big deal about it. Can someone explain to me the main advantages of the vim keybinding without calling me a retard ?

Good morning vimvisters
What are vir pronouns ?

Attached: IMG_20220531_021539.jpg (1080x1337, 189.36K)

vinegars*

bros...emacs thread made fun of us again...

What's the optimal way to split the sentence from
x = ["aaa bbb ccc ddd"] to
x = ["aaa",
"bbb",
"ccc",
"ddd"]?

I tried selecting the quote in visual mode and then use the command :s/\%V /",^M"/g, but I got only 1 newline between aaa and bbb. Not sure what's going on

Cool keycaps, where can I get them?

because after the first line break the rest isn't in the visual selection (`\%V`) anymore

I can't quite copy paste the right macro for it because I record some insert mode newline inserts but the basically logic is
_f[i (insert new line and exit)
:s/ /",\r"/g
?[X

enjoy your carpal tunnel emacs tranny

also: why the fuck does hhk have no delete key? that's fucking unusable

I don't use emacs, I'm white

Attached: 1643626516268.png (798x618, 28.2K)

I don't understand. You mean \%V only applies to the transformed text area? But why does :s/\%V /#####/g work and can change the sentence to x = ["aaa#####bbb#####ccc#####ddd"], which is longer than the visual mode selection?

I'm sure it's not the most efficient method, but my flow for when I have to deal with slightly more complex repetitive tasks like this is macros (q).
For this example, I'd delete the surrounding quotes, place the cursor at the start of the first word, then record a macro that finishes one 'step' of the task and ends with the cursor at the start of the next word. Then just repeat that macro multiple times (you can use the number syntax for this). I took a video.

This way you can use your existing vim navigation and editing knowledge to do the job instead of messing around with hard-to-remember vim substitution syntax.

Attached: a-2022-05-31_19.55.04.webm (678x468, 2.46M)

Thanks for the effort user. I was just wondering if theres a more efficient way than using macros

>I ve been using vim for years for config editing, but I still dont understand whats the big deal about it. Can someone explain to me the main advantages of the vim keybinding without calling me a retard ?
Compared to what? Compared to arrow keys and the mouse? If you've been using vim the answer to that is obvious. Compared to emacs keybindings? People say using emacs bindings cripples your hands but at the very least it's personal preference. Another benefit to learning vim bindings is being able to use them in many other places. VScode, the browser (vimium, qutebrowser, nyxt browser, etc.), emacs (viper, evil mode), file managers (ranger, lf, etc.), and so on.

Try this
s/\(\w*\)\ze[ "]/"\1",\r/g

This way the spaces around = would also get replaced to \r. I'm on vim 8.2

if there is a more efficient way it's going to have to do with some regex fuckery. I think macros are the best you can get because efficiency isn't as much a metric of how many keystrokes you can save, but time, and thinking about a "clever" solution to do it in one command takes too much time.
hey user, I'd recommend instead of doing macros by hand you type out the commands into another line, this makes it way easier to edit stuff if you get it wrong and also helps you "think" in vim commands. especially useful if you want to break a macro up into many reusable functions if you're doing something really complicated.