-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_bash.sh
39 lines (32 loc) · 1.37 KB
/
config_bash.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# If this shell supports line editing, bind settings. (If interactive shell)
if [[ "$(set -o | grep 'emacs\|\bvi\b' | cut -f2 | tr '\n' ':')" != 'off:off:' ]]
then
# Enable some of my favorite shell options.
# See available options with shopt -p.
set -o noclobber # do not clobber files with redirection without prompt
shopt -s histappend # append to history file, not overwrite
shopt -s histverify # verify history commands before running them
shopt -s cdspell # automatically correct small errors in names with cd
shopt -s interactive_comments # allow comments in interactive shell
# Smarter Tab Completion
bind "set completion-ignore-case on"
bind "set show-all-if-ambiguous on"
# Menu Tab Completion
bind "TAB:menu-complete"
bind "set show-all-if-ambiguous on"
bind "set menu-complete-display-prefix on"
# History Search
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
# Fix some common keybinds.
# To see keys, run cat, press enter, then hit key combo to see output.
bind '"\e\e[C": forward-word'
bind '"\e\e[D": backward-word'
# No history if space.
export HISTCONTROL=ignorespace
# Control history line count in memory for session.
export HISTSIZE=10000
# Control history line count on disk for persistence.
export HISTFILESIZE=10000
fi