Hacker News new | past | comments | ask | show | jobs | submit login

This is cool and all, but nearly useless for any experienced vimmer.

I almost never press `i` to enter insert mode, and I don't expect most vimmers to do so either. My most common ways to enter insert mode are, off the top of my head...

o -- Open new line below current line, enter insert mode.

O -- Open new line above current line, enter insert mode.

ci( -- Delete all text between the nearest parenthesis and enter insert mode within the parens.

A -- Jump to end of line and enter insert mode.

I -- Jump to start of line and enter insert mode.

C -- Delete to end of line, enter insert mode.

cc -- Delete entire current line and enter insert mode.

ctX -- Delete to the character X where X is whatever character I see ahead of my cursor that I want to delete up to, and leave me in insert mode.

cfX -- Same as ctX except include the found character in the deletion, then enter insert mode.




Seems like you just need more pedals.


Hey, maybe we could put these pedals somewhere more accessible. Like under your fingers.


Well, what makes thumb keys so great is that the thumbs are particularly independent of what your other fingers are doing. Foot switches fill the same purpose.

You can only have so many keys under your other fingers, and the more you add, the more movement will be required of your hand.


lol


Imagine that with emacs: it's easy! Simply double-clutch the "Ctrl" and "Super" pedals while pressing Alt+Shift+T on the keyboard to open a new block context and auto-indent to the correct tab stop. ;)


"Granny shifting when you should've been double clutching..."


I still don't understand why you would double clutch a Honda Civic. Especially if you were trying to like, go real fast.


Upshifting, it isn't usually necessary, though I'm not a street racer, so I can't comment on the validity of that particular quote [0].

Downshifting, particularly into first as you're coming to a stop sign, it'll save a fair amount of wear on the synchros. Or if you have a car with worn synchros, it'll help ensure a quicker, smoother downshift in general. A 5-3 downshift on an offramp usually benefits, for instance.

[0] Given the substantial liberties they took in general, your skepticism might be justified.


If you double clutch near redline on your RPMs, you can get marginally faster gear changes with less wear on your synchronizers.


Double clutching is changing into neutral, then into the target gear, right? How could that be faster?


Try it (shifting at high RPMs, specifically near redline) in a Honda Civic (or any other decent, but not higher end car) and you’ll see. Shift at normal RPM ranges and you’d be right to feel doubtful it would be faster.


With Emacs it's click one pedal to open parentheses; click another close.


One of these bad boys should do the trick. https://www.nordkeyboards.com/products/nord-pedal-keys-27

But maybe you'd be more efficient with a chording setup...


Organ pedals would work for that. I think typically those just use magnets and reed switches (when connected electronically rather than mechanically).

Not to be confused with reed organs, which usually just have one big pedal that operates the bellows. Though sometimes they also have levers you can push to the side with your knee.


You can do it with one pedal -- just tap out your preferred option in Morse.


I’m thinking of pedals that a pipe organ has.


Vim should support mouse, like Midnight Commander


:set mouse=a

And away you go. As you get more efficient at vim use you might find you want to turn that off again.

(and also without the colon in your vimrc file if you want it to stick)


In general yes, but there are still some cases where mouse is better than the equivalent keys. Mainly resizing splits (guess how many lines you want and then C-w <size>|, vs just dragging the divider).

:set ttymouse=sgr also makes it a lot smoother.


Moreover, where is the concurrency? I mean, you cannot start typing until you're in insert mode.

The i<text>ESC are serialized.

How is it faster if the i and ESC are foot operated? You can't start typing until the pedal is down. You can't lift the pedal until you've finished the entry, and you can't give a command until the pedal is up.


C??? And I've been doing c$ for years like a chump!


I’ve been using $a, well ESC $a just to be sure


I've been using Vim regularly for the last six years and I still learn new, basic things.

Thanks for that.


seems like it would be awfully slow for any experienced vimmer also. Seems like a really bad idea for a foot pedal / vim integration.

A, possibly, much better idea would be if you press the pedal, is turn the hjkl keys into sending actual arrow key keycodes so those annoying times when you need to arrow through OS menus etc you can use your vim instincts. Not that I'd ever want to incorporate a foot pedal myself, but seems like a better use. Vims keyboard drive approach is super quick as is, if you are having trouble with getting into and out of insert mode, maybe Vim isn't for you.


> if you are having trouble with getting into and out of insert mode, maybe Vim isn't for you.

I've got a question there actually. The only thing that throws off my flow while using Vim is exiting insert mode, as my keyboard has an inconvenient esc key. Is there a better way to exit? I've done some cursory looking but haven't found anything that looks useful.

(Remapping my keyboard isn't a viable option, as I game on my machine sometimes, and occasionally need weirdly specific keys.)


Ctrl-C and Ctrl-[ also work by default, but personally I use CapsLock after doing `setxkbmap -option caps:escape`.

> Remapping my keyboard isn't a viable option, as I game on my machine sometimes

You can also map something specifically on vim with :imap/:vmap/:cmap.


Please note that Ctrl-C does not do the same thing as Esc or Ctrl-[. More info: https://unix.stackexchange.com/questions/53633/does-using-ct...


> Quit insert mode, go back to Normal mode. Do not check for abbreviations. Does not trigger the InsertLeave autocommand event.

Well, it's the same if neither you nor a plugin uses abbreviations nor InsertLeave.

Also, if you don't need that particular behavior of <C-c>, you can do `:map <C-c> <Esc>` to make it behave exactly the same.


The best remap in my vimrc:

" Map jk to ESC in insert mode

inoremap jk <esc>

Once you've finished what you wanted to insert just hit jk. The combination never occurs in the English language and is right on the home row :)


That's fun. Does it type the j, then delete it when you press k?


Yes it does. I do the same thing but with jj.


It doesn’t type it into a buffer, iirc. I removed that from my config because it annoyed me that when I press j alone it only appears in a buffer after a delay.


yes, until you find yourself typing jk into word docs or other evil office software every time you finish a thoughtjk.


I remap capslock as escape, using autohotkey, and I game a lot, the dyson sphere program was the first game that actually had a problem, so you can either turn the script off while playing, or make the script smarter to not be active during the game. Having said that, it is worth getting used to Ctrl-[ which is the same thing, and is a standard binding which is useful when you are not on your own machine.


I use an autohotkey script to do that, on holding down space. Instant vim everywhere!


To add to this ci works for all sorts of things like [ { < “ ‘ etc.

There’s also di (delete in) and vi (visual select in) and probably a ton of others that I don’t know about. I’ll never know all of the wonderful ways to use vim


ci also can take a number for nesting level. For example, c2i( will change within the second level of surrounding parens rather than the innermost


And cit inside (html, xml) tags. And then there's a for around -- cat, daw, >a{...


I use cw and Cw a lot, but the point is made, c is more useful than "some delete op" + "insert mode".


I think you meant cW. Cw deletes 'till end of line then inserts a "w".


ce - change to end of word (consecutive identifier chars or consecutive punctuation)

cE - change to end of WORD (consecutive non-whitespace chars)

Those are probably the most common for me because I tend to navigate by word/WORD in a line with w, b, W, B.


I need to get in the habit of using those. I tend to do ct<space>


Been using vim for 20 years and didn’t know some of these, thanks.


I think 3 pedals are suggested: I, i and A


Minor improvement, cc can be replaced by S


Is shift-S faster than cc? The keys are farther away from each other, but I guess you can get some bonus by pressing them "in parallel"... For me, cc feels faster. Although I might feel differently if it was, say pp vs shift-S.


> Is shift-S faster than cc? The keys are farther away from each other

In my case, my left pinky rests on the shift and my left ring-finger rests on the "s", so shift-S is just pressing the keys my fingers are already resting on.


Your pinky rests on the shift key? My touch-typing teacher would have smacked my fingers with a ruler. :)


I guess it's a habit from using the left Shift (and left Ctrl) a lot more frequently than the "A". If I just used the keyboard for writing text, perhaps resting on "A" would make more sense for me.


Nothing wrong with that! Some of us were indoctrinated to rest our hands in a certain way, no matter what kind of typing we do. :)


cc keeps {my} cursor at the current indent. S does not.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: