1 # case insensitive completion
2 set completion-ignore-case on
3 # - to _ insensitive completion
4 set completion-map-case on
6 # todo: explain this :)
7 set menu-complete-display-prefix on
9 # for readline-complete.el
11 set completion-display-width 0
13 # preserve cusror location in history items.
14 # unfortunately, this does not work when using vi-mode and j or k
15 # I would like to make a patch to fix this.
16 set history-preserve-point on
19 # show all completions all the time
20 set show-all-if-ambiguous on
21 # this does a partial complete if it can before showing completions
22 set show-all-if-unmodified on
25 # nice in bash, but messes up completion in emacs shell
27 set visible-stats offmv f
29 # turn off pager for completion
30 set page-completions off
32 # to answer this question in bash-completion README:
33 # Q. When completing on a symlink to a directory, bash does not append
34 # the trailing / and I have to hit <Tab> again. I don't like this.
35 set mark-symlinked-directories on
38 # makes the c-u keybind work.
39 # perhaps other binds that didn't work would work with this.
41 set bind-tty-special-chars off
47 "\C-q": exchange-point-and-mark
50 "\C-a": insert-comment
54 "\C-b": menu-complete-backward
56 # arrow keys. for other terminals, see http://unix.stackexchange.com/questions/10806/how-to-change-previous-next-word-shortcut-in-bash
57 # this can be conditioned based on the term, see the term keyword in
58 # bash's readline manual section
60 #"\eOd": backward-word
61 "\e[1;5C": forward-word
62 "\e[1;5D": backward-word
64 Control-Space: set-mark
67 "\C-t": shell-expand-line
75 "\C-g": edit-and-execute-command
81 "\C-p": dabbrev-expand # similar menu-complete, except for commands in history
82 "\C-\M-q": quoted-insert
86 "\C-u": backward-kill-word
95 ####### commented out stuff ###########
97 # in bash, bind -p helped me figure out how to make some binds work
98 # i don't see this documented anywhere. not sure where I got it from but it doesn't work now
99 #"\C-p": paste-from-clipboard
102 # vi mode settings and observatoins
103 # double pound indicates it is only commented because I am not using vi mode
104 ##set editing-mode vi
106 # completion from history. how cool
107 ##Control-SPACE: dynamic-complete-history
109 # if this is a command in history, execute it and bring up the next command in history.
110 ##"\C-o": operate-and-get-next
112 # this is just kinda cool to show off:
113 ##"\M-{": complete-into-braces
116 # by default / and ? do a non-incremental search. This changes that.
117 # the downside is that you have to type ctrl-v then / to get the actual char.
118 ##set keymap vi-command
119 ##"/": reverse-search-history
120 ##"?": forward-search-history
121 # make g go to the end of history. emacs has some meta key for this,
122 # but we are not using g, so why not.
123 ##"g": end-of-history
124 # yank-pop from emacs mode, hacked into vim-mode.
126 # vim uses m<letter> to set a mark and `<letter> to return to a mark specified
127 # by letter. On a single line, this doesn't make much sense. So I'm using the
128 # emacs way of a single mark. In vi-mode, you can do dm<letter> to delete a
129 # mark. Emacs has its own delete and copy region commands. I'd like to hack the
130 # source code to make d` delete to the mark and y` yank to the mark. I'm
131 # leaving it for now, we will see how this works out in actual emacs when I get
132 # my vi keybinds setup there.
133 ##"`": exchange-point-and-mark
141 # w and b are normally always tripping over punctuation as word separators, I
142 # think having W and B act like that is a bit more efficient default. And this
143 # "shell" functions see words as the shell does, which is cool.
144 # These are also only included as bash commands.
145 # this is enables in .bashrc, after testing if bash version is > 4
146 # "b": shell-backward-word
147 # "w": shell-forward-word
148 # here we are with the unwrapped word, back and end functions, (that should get fixed).
156 #unfortunately thre is another bug: binding for example W to vi-fword makes it
157 #show that its bound to that and also vi-fWord, and the upper case one is what
161 # I added a hack to the readline sources to reverse the upper/lowercase check on these
163 # I would like to make a patch to make the command 'shell-end-word'
167 # for some reason, binding the '=' key doesn't work.
169 # for some reason, the documentation of the same commands seems to be more
170 # extensive in bash. There are extra commands listed in the bash documentation
171 # too, but so far they seem to be shell specific.
174 #set keymap vi-insert
178 #normal mode has this, which doesn't make sense. 'i' still works fine. whatever.
179 # vi-insertion-mode (not bound)
181 # normal mode default keybinds also have this:
182 # vi-fword (not bound)
183 # vi-fWord (not bound)
185 # vi-bword (not bound)
186 # vi-bWord (not bound)
188 # Looking in the readline sources, those are the real forward and back
189 # commands, but they are wrapped in this: and its corresponding back version.
192 # What this wrapper does is check for upper/lower case, do terminal ding if its
193 # at the eol, and handle negative counts prefixed to it.
197 # works like this emacs command:
199 # except it puts you in insert mode afterwards, so you can't make successive
200 # calls to go to earlier last arguments.
202 # Emacs has a kill ring. yank means paste. yank-pop means go down the kill
203 # ring, this only has an effect after a yank, or a yank-pop that was after a
204 # yank. Vim also has a kill ring plugin, that has a yank-pop, and a yank-push,
205 # to browse forward in the kill ring. In emacs there is no forward function,
206 # you simply undo the yank. In bash vi-mode, undoing the yank undoes it
207 # entirely, not each item in the kill ring. This isn't a big deal. In both
208 # emacs and vi-mode, the kill ring stays in the new position regardless of the
209 # undo. Vi-mode does not allow you to yank-pop after the vi pastes 'p' and 'P',
210 # 1 problem is the cursor is in a little different position than an emacs yank.
211 # I think I can modify the readline sources fairly easily to make this
213 # There is an interesting incompatibility between vi and emacs mode. Emacs mode
214 # always has the block be 1 square after the cursor. Same in vi-insert, but in
215 # vi-normal, its on top of the character and can't go beyond the last
216 # character, so if you do a yank at the last character in vi-normal, it does
217 # not put the cursor after the last character like a normal yank because it
218 # cant, and then you can't yank-pop because the cursor is in the wrong spot.