HackerTrans
TopNewTrendsCommentsPastAskShowJobs

sre2

no profile record

comments

sre2
·2 years ago·discuss
You are looking for

    bind -m emacs-meta '"\C-j": vi-editing-mode'
and possibly adding

    bind -m vi-insert '"\C-e": emacs-editing-mode'
sre2
·2 years ago·discuss
You could easily improve upon that. For example the following will change the cursor to a block in emacs mode, an underline in vi-command and a line in vi-insert in most terminals.

    set show-mode-in-prompt on
    set emacs-mode-string \1\e[1 q\2
    set vi-cmd-mode-string \1\e[3 q\2
    set vi-ins-mode-string \1\e[5 q\2
The worst thing about the bash config of readline is that bash disables the key combinations for going from emacs-mode to vi-mode (ctrl-alt-j) and back (ctrl-e). They work everywhere else (where I've checked anyways) and you can't turn it on again in inputrc, you have to bind it in your .bashrc, all that because the bash developers think it would be too confusing to have it work the same in bash as anywhere else were you have readline support.
sre2
·2 years ago·discuss
I've been doing this for at least a decade. Was introduced to the idea by a colleague who might have read this blog post.

I usually do the same with commands where you are able to create sub-commands too, like git-,home (which allows you to run `git ,home add -p` and it conveniently set GIT_DIR to something and GIT_WORKTREE to $HOME). Sadly you can't do it with git aliases, I have to live with them starting with a dot (via '[alias ""]' as a section).
sre2
·2 years ago·discuss
Heredocs (described in the docs[1] under "shell form") was introduced 3 years ago[1]. The flag '--squash' has been in podman for quite a while[2]. It might be time for you to upgrade your tooling.

[0]: https://docs.docker.com/reference/dockerfile/#shell-form

[1]: https://www.docker.com/blog/introduction-to-heredocs-in-dock...

[2]: https://docs.podman.io/en/latest/markdown/podman-build.1.htm...
sre2
·2 years ago·discuss
Curl has the ability to use the OS certificate store. There is also the option (at invocation) to not use any other certificate stores than the one provided by the user (at invocation). The version which is shipped by Apple does ignore this which introduces a backdoor.