Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split project into "bash-sensible" and "inputrc-sensible" #18

Open
justfortherec opened this issue Mar 1, 2017 · 3 comments
Open

Split project into "bash-sensible" and "inputrc-sensible" #18

justfortherec opened this issue Mar 1, 2017 · 3 comments

Comments

@justfortherec
Copy link

I love the idea of this project and appreciate the great defaults it gives me. Thank you.

To make the project even better I propose to split the defaults into "bash-sensible and "inputrc-sensible" for two reasons:

  1. Avoid shadowing preferences set in ~/.inputrc (e.g. I have set show-all-if-ambiguous off in my .inputrc which is overwritten by bash-sensible. Thus, I need to set it a second time in .bashrc after loading bash-sensible.)
  2. Make these great defaults also available to other programs that use readline (python REPL, etc).
@flatcap
Copy link

flatcap commented Jun 3, 2017

I'm a Unix as an IDE kinda guy -- I spend a lot of time manipulating files on the command line. As such, I have a heavily overridden .inputrc

Beyond the normal line-editing keys, I use readline as keyboard shortcuts.
These bindings are useful to me and might serve as a springboard for others.

Duplicate common shifted (or distant) characters onto the home keys:

# RSI prevention (Alt lower-case letter):
"\ej" "-"       # <Alt-j> = hyphen
"\ek" "_"       # <Alt-k> = underscore
"\ef" "+"       # <Alt-f> = plus
"\ed" "="       # <Alt-d> = equals
"\eh" "~"       # <Alt-h> = tilda
"\em" "\n"      # <Alt-m> = return
"\es" "*"       # <Alt-s> = star
"\ew" "\\*"     # <Alt-w> = backslash-star

Shortcuts for common Unix filters (Alt upper-case letter):
Most of the key letters are memorable.

"\eA" "$(!!) "                  # ALL the previous command
"\eC" "| column -t " 
"\eD" "| uniq -d "              # show Duplicates
"\eE" "| uniq -c "              # Enumerate (count uniq)
"\eG" "| grep -i "
"\eH" "| head "
"\eL" "| nl -nrz -w4 -ba "      # Line numbers
"\eM" "| less\n"
"\eN" "| sort -n "
"\eP" "$(pwd) "
"\eR" "| rev "                  # Reverse lines
"\eS" "| sort -f "
"\eT" "| tac "                  # Reverse file
"\eU" "| uniq "                 # Uniq-ify
"\eV" "| grep -v "
"\eW" "| wc -l\n"
"\eX" "| shuf "                 # miX up
"\eZ" "| cat -s " 
"\e0" "> /dev/null "

Most of them end in (space), so they can be chained together, e.g.
program Alt-Shift-SAlt-Shift-EAlt-Shift-NAlt-Shift-TAlt-Shift-HEnter

Take the output of program, then sort the output, count the duplicates, sort by count, reverse the sort, show the top ten.

program | sort -f | uniq -c | sort -n | tac | head

How do you (ab)use readline?

@ao2
Copy link

ao2 commented Apr 4, 2018

I second this. It doesn't have to be necessarily a separate project, having all the readline settings in a inputrc.sensible file would be enough.

How do you (ab)use readline?

https://ao2.it/en/blog/2012/11/23/autoexpanding-aliases-readline-story-suod

Ciao,
Antonio

@Agent-E11
Copy link

@flatcap Those key bindings look really cool, and I might even add them to my own .bashrc, but I don't think they count as "sensible defaults"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants