mamot.fr is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mamot.fr est un serveur Mastodon francophone, géré par La Quadrature du Net.

Server stats:

3.3K
active users

#readline

0 posts0 participants0 posts today
Kevin Bowen :xfce:<p>More tech notes to myself</p><p>A very brief introduction to the <a href="https://fosstodon.org/tags/Readline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Readline</span></a> library, customizing the <a href="https://fosstodon.org/tags/Bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Bash</span></a> shell prompt with mode indicators, and the vi editing mode.</p><p>Customizing the Bash command prompt for vi editing mode <br><a href="https://suburbanalities.blogspot.com/2025/04/customizing-bash-command-prompt-for-vi.html" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">suburbanalities.blogspot.com/2</span><span class="invisible">025/04/customizing-bash-command-prompt-for-vi.html</span></a></p><p><a href="https://fosstodon.org/tags/Shell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Shell</span></a> <a href="https://fosstodon.org/tags/vi" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vi</span></a> <a href="https://fosstodon.org/tags/vim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vim</span></a> <a href="https://fosstodon.org/tags/inputrc" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>inputrc</span></a> <a href="https://fosstodon.org/tags/cli" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>cli</span></a></p>
Wolf<p>My friend and I are both <a href="https://hachyderm.io/tags/iterm2" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>iterm2</span></a> users. We’re both <a href="https://hachyderm.io/tags/Vim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Vim</span></a> users. He uses remote systems all the time and customizes as little as he possibly can because he has much less control over those remote systems. I customize way too much. We both use <a href="https://hachyderm.io/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> (though locally, he uses <a href="https://hachyderm.io/tags/zsh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>zsh</span></a>). Therefore, we both use <a href="https://hachyderm.io/tags/readline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>readline</span></a>. I prefer vim-mode on the <a href="https://hachyderm.io/tags/commandline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>commandline</span></a>. He uses the default, emacs-mode. We both realized we weren’t really using much of the tools those edit modes gave us so we found cheat sheets and started experimenting. For him, alt-b should go back a word, but it didn’t. It worked when I tried that mode. We tried all kinds of solutions for him including sharing our profiles. In the end the thing that succeeded was configuring his iTerm to send "Esc+” when he used the option key. So really, Esc-b went back a word, not alt-b. Mine worked because I was already configured that way.</p>
Wolf<p>Here’s something that puts your readline edit-mode into your prompt. I probably didn’t need to do this. I’m a <a href="https://hachyderm.io/tags/Vim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Vim</span></a> user (really <a href="https://hachyderm.io/tags/NeoVim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>NeoVim</span></a>) and so I have a `.inputrc` that makes my <a href="https://hachyderm.io/tags/commandline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>commandline</span></a> edit-mode (because of <a href="https://hachyderm.io/tags/readline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>readline</span></a>) always be <a href="https://hachyderm.io/tags/vi" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vi</span></a>. This is for <a href="https://hachyderm.io/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a>. It may work in other shells, I don’t know. I use <a href="https://hachyderm.io/tags/starship" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>starship</span></a>. The actual command I wrote uses <a href="https://hachyderm.io/tags/ripgrep" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ripgrep</span></a>. At least twenty other ways you could do it. I put all the changes into a gist: <a href="https://gist.github.com/wolf/e2bd126159961e3142350f6dfe04056a" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">gist.github.com/wolf/e2bd12615</span><span class="invisible">9961e3142350f6dfe04056a</span></a></p><p>Most people never change from the default edit-mode. If they do, they probably don’t switch back and forth. Starship narrows the field further. Almost certainly this is of no use to you unless you want to learn a little about some of the pieces. Enjoy anyway.</p>
profanity<a href="https://devlug.de/social?t=profanity" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#Profanity</a> is using <a href="https://devlug.de/social?t=readline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#readline</a>.<br><br>There are a lot of helpful Key Bindings: see <code>man 3 readline</code>.<br>
unixbhaskar<p><a href="https://youtu.be/qMWxrbhAFVQ" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">youtu.be/qMWxrbhAFVQ</span><span class="invisible"></span></a></p><p><a href="https://mastodon.social/tags/linuxadmin" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>linuxadmin</span></a> <a href="https://mastodon.social/tags/tool" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tool</span></a> <a href="https://mastodon.social/tags/fzf" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fzf</span></a> <a href="https://mastodon.social/tags/readline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>readline</span></a> <a href="https://mastodon.social/tags/opensource" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>opensource</span></a></p>
unixbhaskar<p><a href="https://youtu.be/qMWxrbhAFVQ" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">youtu.be/qMWxrbhAFVQ</span><span class="invisible"></span></a></p><p><a href="https://fosstodon.org/tags/linuxadmin" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>linuxadmin</span></a> <a href="https://fosstodon.org/tags/tool" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tool</span></a> <a href="https://fosstodon.org/tags/fzf" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fzf</span></a> <a href="https://fosstodon.org/tags/readline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>readline</span></a> <a href="https://fosstodon.org/tags/opensource" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>opensource</span></a></p>