I am using iTerm as a terminal in my mac. I am not able to delete a word in command line for ex in command cd /path/to/dir
, i want to delete just path
word , then how can i do that in iTerm.
basically what is the shortcut to delete a word in iTerm.
I looked at https://apple.stackexchange.com/questions/154292/iterm-going-one-word-backwards-and-forwards and fn+option+delete
is just deleting a single character, not the whole word.
Control + W Using this keyboard combination will delete the word immediately before, or to the left of, the cursor.
To select text without using the mouse, press cmd-f to open the find field. Enter the beginning of the text you wish to copy and the find feature will select it in your window. Then press tab and the end of the selection will advance by a word. To move the beginning of the selection to the left, press shift-tab.
Customize with iTerm2Go to iTerm2 preferences with ⌘ + , then go into profiles > Text. Then, if you don't like the default color, and prefer something similar to the above, you can update the color scheme. There's the Solarized Dark theme which is popular, but I went Tango Dark.
Go to your iTerm preferences select "profiles" then "key" and change your presets in "Natural Text Editing"
It should work immediately after.
It works with iTerm version 3.3.12
Edit:
In version 3.4, there's a slight UI change.
So you need to go specifically to your iTerm preferences select Profiles
> Keys
> Key Mappings
> Presets
> Nature Text Editing
This helped me.
Delete a word - Send Hex Codes - 0x1b 0x08
or 0x17
Delete a line - Send Hex Codes - 0x15
ctrl + w
in iTerm,
BTW, in text editorsalt + delete
to delete whole previous wordfn + delete
to delete next word
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With