1. 1

    I stumbled across this video (and demo) and was hoping there’d be more of a thread here on lobste.rs.

    I’d highly recommend viewing! I particularly appreciated the visualization of showing blocks of different sizes. I was somehow caught up on the idea that blocks needed to be the same size. Now I can better appreciate the idea of timed block releases.

    1. 5

      inoremap jk <esc>

      inoremap kj <esc>

      home row escape key that is faster than jj (which i used for a long time) as you can just mash both keys at the same time and it will get you out of insert mode. Has the benefit of being a nop in normal mode too.

      1. 1

        I like that - use both and mash away!

        Now what do you map fd/df to?

        1. 1

          well fd and df are both default commands(find the letter d and delete find next character in normal mode) so I don’t have them bound to anything other than the normal find and delete in normal and in insert mode they are just insert f and d separately.

      1. 1

        I was wondering if this is even an issue with something like a retina display… Anyone know?

        1. 2

          I just realized you can search tags and commit histories with fzf in vim.. (:Tags and :Commits) Very cool.

          1. 1

            I like the idea of this - especially for apps where rails is implemented more as an api server. I’ll be wanting to take a look at this asap. The fact that this is possible really highlights, IMO, that the the client and server can and should be neatly decoupled.

            1. [Comment removed by author]

              1. 1

                I’ve been doing that of late by adding another repo… and a csrf exception. I guess I interpreted this as a move by rails to decouple and play a bit better with front-end frameworks. We’ll see! I’m with you though in that I’m kind of liking separate repos for front and back ends

            1. 8

              There is, of course, the ever classic alternative: Caps Lock! Specifically, rebinding Caps Lock to Escape, or have it pull double-duty as both a control key and escape.

              1. 1

                I used to use seil and karibiner on a mac to dual map caps lock - hold for ctrl, tap for esc - but those stopped working in Sierra.

                Has anyone got those working?

                1. 1

                  I haven’t upgraded to Sierra yet, but Karabiner Elements may work although a “double setup” for a key may not be supported. Am curious to hear how you get on.

                  1. 1

                    All the current solutions are hacky and haven’t worked very well.

                    I just map it to Ctrl and make Crtl-] my new Escape key.

                    1. 1

                      Mind sharing your configuration? I don’t see a preset for that behaviour in Karabiner or Seil. (And I’m still using El Capitan :)

                      1. 2

                        See here.

                      2. 1

                        You can remap caps lock to escape directly in the settings in Sierra, no need for third party extensions.

                      3. 1

                        That works pretty well, but I prefer to Control on Caps (with Backspace on left control, and Caps moved across to Backspace). Makes both chord-ing and editing easier in general. Still haven’t found a good place for Escape instead. Maybe switch with tilde? Just close enough to reach without moving my entire hand, far enough away to not knock?

                        1. 1

                          pull double-duty as both a control key and escape.

                          is there a way to do this on gnome?

                          1. 1

                            There’s a little program called xcape that does this.

                          2. 1

                            That’s what I do, I never use caps lock anyway. :)

                          1. 10

                            I like using inoremap jk <Esc> instead of inoremap jj <Esc>. It’s quicker to hit two keys in quick succession and it has the benefit of being mostly being a no-op in normal mode since you just go down a line and then up a line; which is nice if you have a nervous habit of returning to normal mode even though you might already be in it.

                            1. 2

                              I am a big fan of using jk, and like you have never run into any issues where I need to type “jk” in insert mode. I recently switched to spacemacs, where they introduce a default of “fd” which I have found similarly ergonomic.

                              1. 1

                                So doing that would cause typing ‘jk’ in insert mode to return you to normal mode? What would happen if you actually wanted to type ‘jk’?

                                1. 4

                                  In three years that I’ve used jk, it’s never been an issue.

                                  That would change when someone invents texting integration into vim.

                                  1. 4

                                    You need a small delay so that the chord doesn’t register, it’s about one second. So you type j, wait a second, then k.

                                    1. 3

                                      Please keep in mind this timeout is configurable via timeout and ttimeout.

                                    2. 1

                                      Hasn’t ever happened to me either. If it did, you would just have to hit j, then wait a second for the multi-key timeout to expire and the j to actually appear, then hit k.

                                    3. 1

                                      Me too! IMO, jj just doesn’t feel right… It will probably become more of a habit when I start using a new mbp.

                                      1. 1

                                        some people remap jk and kj to esc so all you need to do is press both j and k at the same time to get esc. I am too used to jj to do that but you might want to try that.

                                      1. 3

                                        Interesting! Where did you hear of this? :)

                                        1. 1

                                          It was mentioned at Seattle Lean Coffee by one of the participants there. :)

                                          1. 2

                                            Is that the Lean Coffee being run by Adam Yuret, or someone else?