So if you are not happy with the default bindings, feel free to customize them as you like. I placed jumping one word forward on Ctrl F and one word backward on Ctrl B "\C-f": forward-wordĪs you can see, you can make a shortcut, that leads to an action immediately, or you can make one, that just inits a character sequence and then you have to type one (or more) characters to cause an action to take place as shown in the example further above. If I type an "a", the whole line is actually deleted (everything before and after the cursor). Same goes for l and L regarding the whole line starting from the cursor. If I type an upper case, however, the word to the right of the cursor is killed. But if I then type a lower case w, the word to the left of the cursor is deleted. If I hit Ctrl D alone (I selected d for delete), nothing happens. These make sure that the characters alone just do nothing but making sure the character is "typed" (they insert themselves on the shell). disable the bell this can be all looked up on the bash webpage). ~ means home directory in bash, as stated above, you can name the file as you like and also place it where you like as long as you feed the right path name to bind. To make sure they are applied, you need to modify a file named ".bashrc" that bash reads in upon start-up (you must create it, if it does not exist) and make the following call there: bind -f ~/.bash_key_bindings There you can set some general bash options and you can also set key bindings. bash_key_bindings and put it into my home directory. You need to create a file, name as you wish, I named mine. Please also note that you can customize them. Here's a look of default bindings for Bash: Ctrl A and Ctrl E) are bindings you will find in many other programs and they are used for ages, BTW also work in most UI apps. I often hit the wrong button ( cmd / control / alt) with an arrow key and so i have my arrow key combinations with those buttons all set to jump forward and back words, but please do what fits you best.Īctually it depends on what shell you use, however most shells have similar bindings.
0 Comments
Leave a Reply. |