Bash: delete word ahead of cursor Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Bash: delete from cursor till end of line with a keyboard shortcutDelete characters from cursor up to the beginningTerminal word navigation/deletionCursor positioning using mouse in bash possible?bash - wrong answer by word count commandBash: what is the meaning of $parameter##wordMoving to a word in bash in Emacs modeDelete lines with a word using sedHow can I delete from cursor to start in terminal (delete, not cut)How to delete bash history for specific date range
Letter Boxed validator
What LEGO pieces have "real-world" functionality?
G-Code for resetting to 100% speed
How can I make names more distinctive without making them longer?
Does surprise arrest existing movement?
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
Should I discuss the type of campaign with my players?
Is 1 ppb equal to 1 μg/kg?
Is there a service that would inform me whenever a new direct route is scheduled from a given airport?
Why is black pepper both grey and black?
How much radiation do nuclear physics experiments expose researchers to nowadays?
How do I keep my slimes from escaping their pens?
List *all* the tuples!
Is there a documented rationale why the House Ways and Means chairman can demand tax info?
Storing hydrofluoric acid before the invention of plastics
The logistics of corpse disposal
What makes black pepper strong or mild?
Why does Python start at index -1 when indexing a list from the end?
Why is "Consequences inflicted." not a sentence?
If a contract sometimes uses the wrong name, is it still valid?
Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?
Determinant is linear as a function of each of the rows of the matrix.
What is the correct way to use the pinch test for dehydration?
What are the motives behind Cersei's orders given to Bronn?
Bash: delete word ahead of cursor
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Bash: delete from cursor till end of line with a keyboard shortcutDelete characters from cursor up to the beginningTerminal word navigation/deletionCursor positioning using mouse in bash possible?bash - wrong answer by word count commandBash: what is the meaning of $parameter##wordMoving to a word in bash in Emacs modeDelete lines with a word using sedHow can I delete from cursor to start in terminal (delete, not cut)How to delete bash history for specific date range
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Consider the following bash prompt, where ^ denotes the prompt location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
add a comment |
Consider the following bash prompt, where ^ denotes the prompt location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
2
Ctrl u
is an option for erasing from cursor location to beginning...
– nutty about natty
Apr 8 '13 at 15:23
23
Tryalt + d
, that might be useful, when emacs editing mode is set.
– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatanset -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.
– user76204
Apr 9 '13 at 9:25
add a comment |
Consider the following bash prompt, where ^ denotes the prompt location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
Consider the following bash prompt, where ^ denotes the prompt location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
command-line bash shortcut-keys
edited Apr 8 '13 at 15:17
Adam Matan
asked Apr 8 '13 at 15:12
Adam MatanAdam Matan
4,924195887
4,924195887
2
Ctrl u
is an option for erasing from cursor location to beginning...
– nutty about natty
Apr 8 '13 at 15:23
23
Tryalt + d
, that might be useful, when emacs editing mode is set.
– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatanset -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.
– user76204
Apr 9 '13 at 9:25
add a comment |
2
Ctrl u
is an option for erasing from cursor location to beginning...
– nutty about natty
Apr 8 '13 at 15:23
23
Tryalt + d
, that might be useful, when emacs editing mode is set.
– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatanset -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.
– user76204
Apr 9 '13 at 9:25
2
2
Ctrl u
is an option for erasing from cursor location to beginning...– nutty about natty
Apr 8 '13 at 15:23
Ctrl u
is an option for erasing from cursor location to beginning...– nutty about natty
Apr 8 '13 at 15:23
23
23
Try
alt + d
, that might be useful, when emacs editing mode is set.– user76204
Apr 8 '13 at 16:20
Try
alt + d
, that might be useful, when emacs editing mode is set.– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatan
set -o emacs
enables it, but it is usually the default; if not, you can put that line in .bashrc
or .bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.– user76204
Apr 9 '13 at 9:25
@AdamMatan
set -o emacs
enables it, but it is usually the default; if not, you can put that line in .bashrc
or .bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.– user76204
Apr 9 '13 at 9:25
add a comment |
2 Answers
2
active
oldest
votes
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment |
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
3
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
1
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f279254%2fbash-delete-word-ahead-of-cursor%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment |
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment |
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
edited 3 hours ago
Pablo Bianchi
3,13521836
3,13521836
answered Apr 10 '13 at 16:04
NykakinNykakin
3,0151217
3,0151217
24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment |
24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
24
24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
1
In short, add e.g. this to your $HOME/.inputrc file:
"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)– user964970
Jul 6 '17 at 10:17
In short, add e.g. this to your $HOME/.inputrc file:
"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)– user964970
Jul 6 '17 at 10:17
add a comment |
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
3
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
1
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
3
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
1
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
edited Nov 30 '15 at 19:39
Gayan Weerakutti
1,9441428
1,9441428
answered Nov 30 '15 at 16:24
visyoualvisyoual
7713
7713
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
3
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
1
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
3
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
1
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
12
12
Option + d
gives me ∂ on OSX– Ivan Balashov
Apr 16 '16 at 7:35
Option + d
gives me ∂ on OSX– Ivan Balashov
Apr 16 '16 at 7:35
3
3
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra– mfink
Aug 9 '18 at 17:42
control + d
on mac Sierra– mfink
Aug 9 '18 at 17:42
1
1
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f279254%2fbash-delete-word-ahead-of-cursor%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Ctrl u
is an option for erasing from cursor location to beginning...– nutty about natty
Apr 8 '13 at 15:23
23
Try
alt + d
, that might be useful, when emacs editing mode is set.– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatan
set -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.– user76204
Apr 9 '13 at 9:25