1. 9
  1.  

  2. 4
    (car (reverse (split-string (getenv "SHELL") "/" t)))
    

    isn’t

    (file-name-nondirectory (getenv "SHELL"))
    

    more idiomatic?

    In my configuration, I just use registers for files I just a lot. Binding jump-to-register to a better key (I suggest C-x j) is the key in getting used to it.

    1. 1

      more idiomatic?

      Absolutely! I definitely overcomplicated that one! :-)

      In my configuration, I just use registers for files I just a lot. Binding jump-to-register to a better key (I suggest C-x j) is the key in getting used to it.

      I like registers for jumping to single files, but when you want to have some universal command to discovers files you can’t really apply them. For an individual config they’d be fine though. And yeah - C-x r j is not a very convenient keybinding for sure. I’m thinking something like s-j might be cool.

      1. 1

        I like registers for jumping to single files, but when you want to have some universal command to discovers files you can’t really apply them.

        Sure, you mention using various shells but I’m not the kind of person that changes my shell mid-session ^^.

        1. 1

          For a single person the only practical implication is having to remember 3-4 registers for all the possible shell init files for their current shell. Yeah, most of the time you do end up editing just one on them (e.g. .bashrc or .zshrc), but still.

    2. 1

      Honestly, I’m more interested in why somebody needs a function like this.

      I suppose it makes sense as a library function, but then why bind to a keyboard shortcut?

      1. 1

        Because people tend to edit their shell configuration. I do this quite often and I appreciate having some small utility to help with that (as opposed to having 4 register bindings).

        1. 1

          That’s fair, I guess. I didn’t realize people edited their shell configuration often enough to warrant an editor shortcut for it.

          1. 1

            To be honest its a bit weird to me, just keep a buffer open and switch to it like any other is the strategy I use for all text files. I normally view me effing with dotfiles to be a temporary thing, not so often that I’d want to keybind it. The latter seems more like avoiding work and automating/optimizing that problem than anything else. But my goal tends to be one and done try not to mess with your tools more than use the tools so axiomatically I disagree with the idea in general I guess.