Skip to content

Instantly share code, notes, and snippets.

@reed-sandberg
Created January 23, 2014 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reed-sandberg/8574661 to your computer and use it in GitHub Desktop.
Save reed-sandberg/8574661 to your computer and use it in GitHub Desktop.
Tab-completion in bash is extremely useful (almost necessary), however default settings are too restrictive for me - many times I'll use it to quickly browse a directory looking for a file before I cd there, whereas default tab completion for the cd command limits output to directory entries only (tab-tab does not produce a complete list directo…
--- /usr/share/bash-completion/bash_completion.stock 2013-04-09 08:48:59.000000000 -0700
+++ /usr/share/bash-completion/bash_completion 2013-09-19 11:25:30.469804939 -0700
@@ -54,7 +54,7 @@
# completion examples provided with the bash 2.04 source distribution
# Make directory commands see only directories
-complete -d pushd
+#complete -d pushd
# start of section containing compspecs that can be handled within bash
@@ -1585,7 +1585,7 @@
# Use standard dir completion if no CDPATH or parameter starts with /,
# ./ or ../
if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then
- _filedir -d
+ _filedir
return 0
fi
@@ -1604,7 +1604,7 @@
done
done
- _filedir -d
+ _filedir
if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
i=${COMPREPLY[0]}
@@ -1754,7 +1754,7 @@
return 0
;;
--*dir*)
- _filedir -d
+ _filedir
return 0
;;
--*file*|--*path*)
@@ -1766,7 +1766,7 @@
"s|.*$prev\[\{0,1\}=[<[]\{0,1\}\([-A-Za-z0-9_]\{1,\}\).*|\1|p" )
case ${argtype,,} in
*dir*)
- _filedir -d
+ _filedir
return 0
;;
*file*|*path*)
@@ -1785,7 +1785,7 @@
-- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
elif [[ "$1" == @(mk|rm)dir ]]; then
- _filedir -d
+ _filedir
else
_filedir
fi
@@ -1887,7 +1887,7 @@
_install_xspec '!*.@(mid?(i)|cmf)' playmidi
_install_xspec '!*.@(mid?(i)|rmi|rcp|[gr]36|g18|mod|xm|it|x3m|s[3t]m|kar)' timidity
_install_xspec '!*.@(669|abc|am[fs]|d[bs]m|dmf|far|it|mdl|m[eo]d|mid?(i)|mt[2m]|okta|p[st]m|s[3t]m|ult|umx|wav|xm)' modplugplay modplug123
-_install_xspec '*.@(o|so|so.!(conf|*/*)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
+#_install_xspec '*.@(o|so|so.!(conf|*/*)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
_install_xspec '!*.@(zip|z|gz|tgz)' bzme
# konqueror not here on purpose, it's more than a web/html browser
_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment