Recently had to edit the hosts-file on a remote host, and I don’t know if using two proxy jumps to SSH into it broke it, but it just wouldn’t let me select text with the mouse.
I had to duplicate seven lines and edit the IP addresses, and without being able to copy-paste, I already saw myself manually typing it out.Then I remembered that in Vim, you can do
d5↓to delete 5 lines. Surely that would also work with copying/yanking. And yep, ay7↓and apaste later and I had duplicated the lines.Then use the multi-line cursor like I routinely do for changing all 7 IP addresses…
…and now I feel like I’ve crossed the line where people will think I’m just a wizard.I’ve been using vim as my primary text editor and IDE for near a decade. I forgot that this was a thing so, I’ve been using visual mode like a peasant.
The real question is why you’re torturing yourself by manually fixing that stuff? Don’t you terraform your Ansibles?
That is a very good question. It all started as a dainty test setup, and I guess, we had lost the routine of always scripting hardware setups, because our previous project hadn’t required it.
Obviously, the second-best time to start doing it is now, but I’d need to properly learn one of these first to be able to lead the way on that.
Which collides with me not really wanting to use any of the ones I’ve experienced so far (Ansible, Puppet) in my freetime. 🫠Ansible is actually pretty nice, if you get the hang of it. Not perfect, but better than triple tunnel ssh.
You could simply automate step by step, each time you change something, you add that to the playbook and over time you should end up with a good setup.
Flakey dev setups are productivity killers.
One of the things that really, really annoys me when I get lazy and use a pre-bundled set of (neo)vim plugins is how every one of them uses mouse functionality. I only use the mouse to copy/paste from the terminal to system clipboard. I don’t want it hijacking him and entering visual mode.
does this suggest that copy/paste from the terminal is broken by design and we need find a better way?
I like your thinking. Give me Firefox with a TUI and POSIX shell i/o redirection support.
Vim has a better way, it’s called
:set clipboard=unnamedplus(alternatively, one can bind anything else to copy/paste to/from system cliboards). Not sure why would one use a mouse for this, honestlyI think if you want to copy a specific selection to a mouse-based, different program then it makes sense to use the mouse for precision selection.
Might I suggest a common set of keybinds… maybe C for copy, and v for vaste… maybe use ctrl as well?
Ctrl is already used my a large number of commands in POSIX shells. This is one of the places that I really like Apple’s solution (despite really not liking most of what they do). Super/GUI/Command + c/v is a great improvement in the terminal.
pee bundled neovim add-ons might as well use helix.
You know, if I can use vim bindings and regex, I might try it out. I tend to try to keep my neovim plugins fairly lightweight when I config myself. Not being electron is a big plus.
yah helix has vim motions.
their search mode and select is a bit different but once you do the tutorial it makes complete sense why youd want to scope your regex replace.
What stopped me personally was reading they use a different order of operations, so to say. Where vim goes action + range, helix goes (or at least used to go) range + action (like replacing
ci"byi"c). Mb that makes more sense for them, but I’m too lazy to re-learn that for no particular reason
Imagine using you mouser to click on all the things, like a pleb.
Mice are for fps.
/s
(well, only like 62% sarcasm tbh)ive been doing this for long enough to know you can use any text editor without a mouse.
Why are you using Vim for this? Vim actually allows you to change the cursor position and select text with the mouse if your terminal supports it.



