💾 Archived View for 1436.ninja › Phlog › gmi › 20231016.gmi captured on 2024-07-09 at 00:31:40. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

-=-=-=-=-=-=-

bindings in bash

so there I was, living under a rock

I setup fzf as a bash history fuzzy finder recently (a month or two ago). The code that I found and used from the web included, of course, a binding to C-r to trigger this. Which set off an excited "what?" in my mind. I knew, that bash had bindings such as C-r, C-l, etc. but I never even thought of setting custom bindings.

my new favorite thing

I added a binding to C-e to start emacsclient in the current directory (dired). Here is the code to add to ~/.bashrc:

# start emacs daemon if it is not running
if [[ ! $(ps -e | grep emacs) ]] ; then
  (emacs --daemon=ec) &> /dev/null &
  disown -a
fi

bind -x '"\C-e": emacsclient -s /var/run/user/1000/emacs/ec -c -a "" ./'

# or something like this for termux...
# bind -x '"\C-e": emacsclient -s /data/data/com.termux/files/usr/var/run/emacs10090/ec -c -a "" ./'

Then source your .bashrc and Bob's your uncle, ctrl e starts dired in emacsclient in the current directory. So damned nice. Apparently it doesn't take much to make me happy?