aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_completion.d/view.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-09-08 11:34:29 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-09-08 11:34:29 +1200
commitf9f70099edcadd2d7bf93ddf2fc91b2b0ae993e0 (patch)
tree46a4b4f7d66b9922628fca7b0bc0a0c01b87f9ba /bash/bash_completion.d/view.bash
parentFix an issue (silencing Git prompt errors) (diff)
downloaddotfiles-f9f70099edcadd2d7bf93ddf2fc91b2b0ae993e0.tar.gz
dotfiles-f9f70099edcadd2d7bf93ddf2fc91b2b0ae993e0.zip
Add text-filename heuristic completion
Filesystem type and filename extension-based to keep things quick and simple and not forking out to other tools. We'll see how well this works, but so far I really like it.
Diffstat (limited to 'bash/bash_completion.d/view.bash')
-rw-r--r--bash/bash_completion.d/view.bash5
1 files changed, 5 insertions, 0 deletions
diff --git a/bash/bash_completion.d/view.bash b/bash/bash_completion.d/view.bash
new file mode 100644
index 00000000..ce381ecf
--- /dev/null
+++ b/bash/bash_completion.d/view.bash
@@ -0,0 +1,5 @@
+# Completion for view(1) with files that look editable
+declare -F _text_filenames >/dev/null ||
+ source "$HOME"/.bash_completion.d/_text_filenames.bash
+complete -F _text_filenames -o filenames view
+