Skip to content
Browse files

Make C-W delete word using filename boundaries

The `werase` property from stty takes precedence over bash's.
This patch makes sure `werase` is unset when we're using a terminal
and binds Control-W to the readline 'unix-filename-rubout' command,
which does exactly what I want.
  • Loading branch information...
1 parent bdfd307 commit 8ebcdf4b1dc39101c784b9bd70f3b5c79a5cf38c @caio committed Jul 14, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 bashrc
  2. +1 −0 inputrc
View
2 bashrc
@@ -66,7 +66,7 @@ do_source ~/.source.local.d/*
[ -f ~/.dircolors ] && eval $(dircolors ~/.dircolors)
# Disable flow control if stdin is a terminal
-[ -t 0 ] && stty -ixon -ixoff
+[ -t 0 ] && (stty -ixon -ixoff; stty werase undef)
# {{{ Colors
col_txtblk='\[\e[0;30m\]' # Black - Regular
View
1 inputrc
@@ -50,4 +50,5 @@ $if Bash
Control-g: " |grep --color=auto -i "
Control-e: "\eA"
Control-a: "\eI"
+ Control-w: unix-filename-rubout
$endif

0 comments on commit 8ebcdf4

Please sign in to comment.
Something went wrong with that request. Please try again.