Live data from Hacker News

Modeless Vim

github.com

381–390 of 398 posts

Re: Modeless Vim

#381
post #182

Earlier quoted context omitted.

If you use gnome/xfce: gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs" xfconf-query -c xsettings -p /Gtk/KeyThemeName -s Emacs Try both commands.

Very cool! I also want to use Command (Super or Hyper?), which really improves keyboard shortcuts. Command + left/right = jump to beginning or end of line, Option + left/right = jump to beginning/end of word. I know you can do the same with Control + Shift, but some apps don't support it. Plus Cmd+c/x/v for copy/cut/paste works fine in terminals, I don't have to remember to "code switch" my shortcut "language". Cmd+B…

I bound WindowsKey-C to run the command "xsel|xsel -b" which copies the active selection to the clipboard. It's a small step in the right direction; it's possible to get paste working as well, but that takes awareness of apps (or reconfiguring all GUI applications to use the same shortcut as the terminal).

Re: Modeless Vim

#382
post #324

Earlier quoted context omitted.

Very cool! I also want to use Command (Super or Hyper?), which really improves keyboard shortcuts. Command + left/right = jump to beginning or end of line, Option + left/right = jump to beginning/end of word. I know you can do the same with Control + Shift, but some apps don't support it. Plus Cmd+c/x/v for copy/cut/paste works fine in terminals, I don't have to remember to "code switch" my shortcut "language". Cmd+B…

I just swap Ctrl and Caps Lock, much better. setkbmap us -option ctrlL:swapcaps -option compose:rwin You can place that command at XFCE's startup settings for applications.

You missed the point; Ctrl-C is never going to be "copy" in a terminal, since that shortcut is already in use. Cmd-C can work everywhere, but GUI applications on linux do not default to that.

Re: Modeless Vim

#383

My usual comment on any thread touching vim, as an answer to all hypothetical comments talking about how vim never clicked : Remap the Escape key to CapsLock else you will never like vim (provided you are a normal person) It's the most important key and you should punctuate all your inserts with it. So it'd better not be the key that's the furthest away from your fingers. The reason that's the case is an historical a…

FWIW, my “jk” mapping is also global, as is my C-[ mapping. Karabiner FTW. In all seriousness I haven’t found a way to manage a “jk” mapping that so correctly and quickly handles all cases of input in anything else, on any platform. (Except of course built into the keyboard) Autohotkey can kinda sorta do it, but it takes a lot more code for an inferior result sadly.

Re: Modeless Vim

#384
From the README: > This is meant for people who normally use GUI editors (like VSCode), but sometimes need an editor that can run in a terminal.

There's always emacs -nw

Re: Modeless Vim

#385

I think it's funny how much emotional energy gets invested into any (neo)vim posts. But the energy is mostly people that never learned vim and feel super insecure about it. I'm not going to make the same mistake of judging this. If you are someone who has always hated vim and never want to touch it, go for it, this might make your day easier on some machine if you can load this repo really quick (although as others h…

>learn vim After starting the (neo)vim tutorial, all I could think about was if people who "learned" vim never learned how to edit text in a normal text/code editor. And I don't mean this in an inflammatory way. I mean: hjkl = Arrow keys b = Ctrl + Left w = Ctrl + Right df = Ctrl + Delete $d = Shift + End, Delete dd = Home, Shift + End, Delete 2 = just press the keyboard command twice?? ddp = Alt + Down ddkP = Alt +…

>I mean how do you even use the numbers? Who looks at code and says "no, this should be exactly 8 lines below this one." I just Alt + Down until it's right. I'd spend more time trying to write the command right than I'd spend just pressing the keys multiple times.

With relative line numbers it's really easy actually. Typing dd7jp takes less effort than pressing alt + down multiple times and I have hard time believing you'd be make this argument if you were comfortable with modal editing.

In fact, none of the alternatives you listed seem attractive if you're accustomed to modal editing. How is Home, Shift + End, Delete a good alternative to dd? So much movement to do a simple operation.

I would highly recommend you giving it an honest try and if it doesn't work, you can always go back to editing the traditional way but once it clicks, "the old" way feels super awkward.

Re: Modeless Vim

#386

T.b.h. I mostly use vim with keyboard movement in insert mode enabled, so ... 80% time I don't really use modes.

It's like using a bike as a scooter. It works but... Have you tried remapping CapsLock to Escape so now you have a quick access to the most important key of your editor and can actually enjoy it ? Most vim users do it but they never talk about it and the beginners have no clue and suffer needlessly from this historical accident.

I have thinkpad, and fortunately they still make esc big enough, so that I was not compelled to rebind.

It is more like ... when I am writing I like to stay in insert mode as long as possible - and this is where I would put the 80% of the time in vim.

Once I put on my edit/refactor hat, that is where normal-mode shines :)

And of course, special shout out to visual-selection mode.

Re: Modeless Vim

#387
post #320

Earlier quoted context omitted.

> In most countries outside the US [and Canada], squash is called pumpkin.

If you actually want to be pedantic, note that I did not say all countries, therefore my original statement was just as correct as your edit.

If YOU actually want to be pedantic, I was making the point that it's a North American thing, not a US thing.

Re: Modeless Vim

#388

Earlier quoted context omitted.

This sounds good but not the kind of coffee cake I’m used to

yellow or moist white cake (or marbled cake) with butter crumble brown sugar top and an espresso glaze. The coffee cake of coffee lovers.

Reading this thread I can't help but feel like HN readers need a reactordev recipe book.

Re: Modeless Vim

#389

Earlier quoted context omitted.

That is only the case if you think you have to press Ctrl using your pinky. You can use the side if your palm instead. Then CUA suddenly becomes very ergonomic. Try it. I've done this for over 15 years now across a plethora of different keyboards and also survived several years of Emacs unharmed thanks to it.

I used to do approximately this, from maybe the mid-90s to 2015-ish, but finally that keyboard died (RIP dear friend) and I find that it doesn't work properly on any keyboard I've found since. Not quite the side of my palm, but the joint where my pinky meets my palm. My hands are relatively large, dunno if that's relevant. I should put more work into buying a keyboard that it does work on, I think using my finger for…

Most of the time the joint that you describe works for me. Sometimes I use the side of my palm. It has worked for me on pretty much any keyboard so far, regardless of the height of the caps or the travel. On those with an fn-key I have had to remap the key somehow, sometimes in the BIOS sometimes using software. The exception is a smallish bluetooth keyboard I bought for a tablet. It's fn-key is hard to remap inside mobile OSes.

Re: Modeless Vim

#390

Earlier quoted context omitted.

That is only the case if you think you have to press Ctrl using your pinky. You can use the side if your palm instead. Then CUA suddenly becomes very ergonomic. Try it. I've done this for over 15 years now across a plethora of different keyboards and also survived several years of Emacs unharmed thanks to it.

I just tried this on my laptop and it is the most uncomfortable thing I've done on a keyboard.

It's probably due to my shoddy description. You put your fingers into the touch typing homerow. Shift your left hand enough for the edge of your palm to be above the ctrl key. It might also be the base joint of your pinky, depending on the size of your hand. Now press that side down enough to activate the ctrl key while keeping your fingers on the homerow. It's like having an eleventh finger to control the keyboard.
Post reply on HN