From: Ian Kelling Date: Sat, 21 Jun 2014 06:21:30 +0000 (-0400) Subject: added my .inputrc X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=bb96da25e745fc77a9cd6c22559ac076aa1df94b added my .inputrc --- diff --git a/.bashrc b/.bashrc index e33d153..712d599 100644 --- a/.bashrc +++ b/.bashrc @@ -158,7 +158,7 @@ C_DEFAULT_DIR=/a for x in $HOME/bin/bash-programs-by-ian/repos/*/*-function; do source "$x" done -source $HOME/bin/identify-distro-functions +source $HOME/identify-distro-functions source $HOME/bin/semi-private # so I can share my bashrc source $HOME/path_add-function path_add --ifexists /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools @@ -281,12 +281,12 @@ bashrcpush () { cd ~ for x in "$@"; do ssh $x mkdir -p bin - tar cz bin/bash-programs-by-ian bin/semi-private .profile | ssh $x tar xz + tar cz bin/bash-programs-by-ian bin/semi-private | ssh $x tar xz done cd $(mktemp -d) - cp ~/path_add-function ~/.bashrc ~/.bash_profile ~/.profile ~/.inputrc . + cp /a/c/repos/bash/!(.git) . for x in "$@"; do - tar cz path_add-function .bashrc | ssh $x tar xz + tar cz * | ssh $x tar xz done cd "$startdir" } diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..76a38b2 --- /dev/null +++ b/.inputrc @@ -0,0 +1,220 @@ +# case insensitive completion +set completion-ignore-case on +# - to _ insensitive completion +set completion-map-case on + +# todo: explain this :) +set menu-complete-display-prefix on + +# for readline-complete.el +set bell-style none +set completion-display-width 0 + +# preserve cusror location in history items. +# unfortunately, this does not work when using vi-mode and j or k +# I would like to make a patch to fix this. +set history-preserve-point on + + +# show all completions all the time +set show-all-if-ambiguous on +# this does a partial complete if it can before showing completions +set show-all-if-unmodified on + + +# nice in bash, but messes up completion in emacs shell +#set visible-stats on +set visible-stats offmv f + +# turn off pager for completion +set page-completions off + +# to answer this question in bash-completion README: +# Q. When completing on a symlink to a directory, bash does not append +# the trailing / and I have to hit again. I don't like this. +set mark-symlinked-directories on + + +# makes the c-u keybind work. +# perhaps other binds that didn't work would work with this. +# todo, try it out +set bind-tty-special-chars off + + + +# key bindings: + +"\C-q": exchange-point-and-mark +"\C-w": kill-region +"\C-e": yank-last-arg +"\C-a": insert-comment +"\C-s": yank-nth-arg + +"\C-f": menu-complete +"\C-b": menu-complete-backward + +# arrow keys. for other terminals, see http://unix.stackexchange.com/questions/10806/how-to-change-previous-next-word-shortcut-in-bash +# this can be conditioned based on the term, see the term keyword in +# bash's readline manual section +#"\eOc": forward-word +#"\eOd": backward-word +"\e[1;5C": forward-word +"\e[1;5D": backward-word + +Control-Space: set-mark + + +"\C-t": shell-expand-line + +#C-RETURN: undo + +# ctrl-delete +"\e[3;5~": kill-word + + +"\C-g": edit-and-execute-command + +"\C-v": yank + +"\C-\M-v": yank-pop + +"\C-p": dabbrev-expand # similar menu-complete, except for commands in history +"\C-\M-q": quoted-insert + +"\C-d": undo + +"\C-u": backward-kill-word + + + + + + + + +####### commented out stuff ########### + +# in bash, bind -p helped me figure out how to make some binds work +# i don't see this documented anywhere. not sure where I got it from but it doesn't work now +#"\C-p": paste-from-clipboard + + +# vi mode settings and observatoins +# double pound indicates it is only commented because I am not using vi mode +##set editing-mode vi + +# completion from history. how cool +##Control-SPACE: dynamic-complete-history + +# if this is a command in history, execute it and bring up the next command in history. +##"\C-o": operate-and-get-next + +# this is just kinda cool to show off: +##"\M-{": complete-into-braces + + +# by default / and ? do a non-incremental search. This changes that. +# the downside is that you have to type ctrl-v then / to get the actual char. +##set keymap vi-command +##"/": reverse-search-history +##"?": forward-search-history +# make g go to the end of history. emacs has some meta key for this, +# but we are not using g, so why not. +##"g": end-of-history +# yank-pop from emacs mode, hacked into vim-mode. +##"o": vi-yank-pop +# vim uses m to set a mark and ` to return to a mark specified +# by letter. On a single line, this doesn't make much sense. So I'm using the +# emacs way of a single mark. In vi-mode, you can do dm to delete a +# mark. Emacs has its own delete and copy region commands. I'd like to hack the +# source code to make d` delete to the mark and y` yank to the mark. I'm +# leaving it for now, we will see how this works out in actual emacs when I get +# my vi keybinds setup there. +##"`": exchange-point-and-mark +##"v": set-mark +##"m": kill-region +##"-": yank-last-arg +##"_": yank-nth-arg + + + +# w and b are normally always tripping over punctuation as word separators, I +# think having W and B act like that is a bit more efficient default. And this +# "shell" functions see words as the shell does, which is cool. +# These are also only included as bash commands. +# this is enables in .bashrc, after testing if bash version is > 4 +# "b": shell-backward-word +# "w": shell-forward-word +# here we are with the unwrapped word, back and end functions, (that should get fixed). +#"w": vi-fWord +#"W": vi-fword +#b: vi-bWord +#B: vi-bword +#"e": vi-eWord +#"E": vi-eword +# +#unfortunately thre is another bug: binding for example W to vi-fword makes it +#show that its bound to that and also vi-fWord, and the upper case one is what +# word.now +#happens +# +# I added a hack to the readline sources to reverse the upper/lowercase check on these + +# I would like to make a patch to make the command 'shell-end-word' + + + +# for some reason, binding the '=' key doesn't work. + +# for some reason, the documentation of the same commands seems to be more +# extensive in bash. There are extra commands listed in the bash documentation +# too, but so far they seem to be shell specific. + +# "p": yank +#set keymap vi-insert +# +#notes: +# +#normal mode has this, which doesn't make sense. 'i' still works fine. whatever. +# vi-insertion-mode (not bound) +# +# normal mode default keybinds also have this: +# vi-fword (not bound) +# vi-fWord (not bound) +# +# vi-bword (not bound) +# vi-bWord (not bound) +# +# Looking in the readline sources, those are the real forward and back +# commands, but they are wrapped in this: and its corresponding back version. +# "W": vi-next-word +# "w": vi-next-word +# What this wrapper does is check for upper/lower case, do terminal ding if its +# at the eol, and handle negative counts prefixed to it. +# +# This command: +# "_": vi-yank-arg +# works like this emacs command: +# yank-last-arg +# except it puts you in insert mode afterwards, so you can't make successive +# calls to go to earlier last arguments. +# +# Emacs has a kill ring. yank means paste. yank-pop means go down the kill +# ring, this only has an effect after a yank, or a yank-pop that was after a +# yank. Vim also has a kill ring plugin, that has a yank-pop, and a yank-push, +# to browse forward in the kill ring. In emacs there is no forward function, +# you simply undo the yank. In bash vi-mode, undoing the yank undoes it +# entirely, not each item in the kill ring. This isn't a big deal. In both +# emacs and vi-mode, the kill ring stays in the new position regardless of the +# undo. Vi-mode does not allow you to yank-pop after the vi pastes 'p' and 'P', +# 1 problem is the cursor is in a little different position than an emacs yank. +# I think I can modify the readline sources fairly easily to make this +# possible. +# There is an interesting incompatibility between vi and emacs mode. Emacs mode +# always has the block be 1 square after the cursor. Same in vi-insert, but in +# vi-normal, its on top of the character and can't go beyond the last +# character, so if you do a yank at the last character in vi-normal, it does +# not put the cursor after the last character like a normal yank because it +# cant, and then you can't yank-pop because the cursor is in the wrong spot. +# +#