Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Even better idea: How about if you pressed the comma, it would temporarily cause all subsequent keystrokes to be interpreted as if with the Ctrl modifier? Then you could press another key to go back to inserting text. In fact, the editor could even start in the “comma” state because usually after opening a file, you want to first navigate around before inserting text. And to allow typing commas easily, we could just use the escape key instead. I'm sure no one has ever thought of this before.


The idea that a comma is nearly always followed by space or new line, and can therefor be useful is pretty genius though.

A few years ago someone mentioned they map "jj" to escape in vim and I've been doing it ever since. Have you ever had to type two j's' next to each other? I haven't in several years now. :D Only problem is inserting a dozen 'j's before I realize what's going on when I'm on a remote machine...


["string","string"] and [1,2], that is comma-quote and comma-number are both fairly common. Granted ModKey-(#|") is also pretty unlikely to be a command


I always put a space after a comma in an inline array, personally.


I often don't. Let the formatter do that. Why waste keystrokes on formatting?


Hey now … you’re describing vi ;)


That's the joke


I know. It’s a very good joke.


Sounds too modal. I'll be forever toggling back and forth.


Devil is non-modal. As soon as you type a complete key sequence, Devil executes the command and gets out of your way. There is no toggling back because Devil deactivates itself automatically on command execution. And then Devil remains idle until you type the Devil key again.


I believe this was their point, see gp


The advantages of modal systems are more apparent once RSI gets to your wrists.


Well, not me; I moved the modifier key to a foot pedal.

("It's free real estate..." ;) )


Way to get your daily steps in…


You have just described Hydra:

https://github.com/abo-abo/hydra


Devil is more like god-mode than Hydra. Hydra is useful for defining your own nested menu of key-bindings. Devil, on the other hand, lets you use the vanilla Emacs keybindings using a different “notation”. This is pretty much what god-mode does too. However god-mode is modal but Devil is not.




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

Search: