mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
* OMB - Major Refactor - Aliases and completions now works like plugins (need to enabled in .bashrc) - Removed the compatible check in spectrum.sh, OMB now works with Bash v3.x like the old days. - Removed core plugin, added those bash functions into base.sh and load during startup. - Updated OSH template for new installations - Added history config and few other stuff from #17 @TODO: Added a shell script to update old version of .bashrc to new one. * Fixed ShellCheck issues * Fixed ShellCheck issues
58 lines
1.9 KiB
Bash
58 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Various shell options collected in single file
|
|
# taken from bash-sensible and other sources
|
|
## GENERAL OPTIONS ##
|
|
|
|
# Prevent file overwrite on stdout redirection
|
|
# Use `>|` to force redirection to an existing file
|
|
set -o noclobber
|
|
|
|
# Update window size after every command
|
|
shopt -s checkwinsize
|
|
|
|
# Automatically trim long paths in the prompt (requires Bash 4.x)
|
|
PROMPT_DIRTRIM=2
|
|
|
|
# Enable history expansion with space
|
|
# E.g. typing !!<space> will replace the !! with your last command
|
|
bind Space:magic-space
|
|
|
|
# Turn on recursive globbing (enables ** to recurse all directories)
|
|
shopt -s globstar 2> /dev/null
|
|
|
|
# Case-insensitive globbing (used in pathname expansion)
|
|
shopt -s nocaseglob;
|
|
|
|
## SMARTER TAB-COMPLETION (Readline bindings) ##
|
|
|
|
# Perform file completion in a case insensitive fashion
|
|
bind "set completion-ignore-case on"
|
|
|
|
# Treat hyphens and underscores as equivalent
|
|
bind "set completion-map-case on"
|
|
|
|
# Display matches for ambiguous patterns at first tab press
|
|
bind "set show-all-if-ambiguous on"
|
|
|
|
# Immediately add a trailing slash when autocompleting symlinks to directories
|
|
bind "set mark-symlinked-directories on"
|
|
|
|
## BETTER DIRECTORY NAVIGATION ##
|
|
|
|
# Prepend cd to directory names automatically
|
|
shopt -s autocd 2> /dev/null
|
|
# Correct spelling errors during tab-completion
|
|
shopt -s dirspell 2> /dev/null
|
|
# Correct spelling errors in arguments supplied to cd
|
|
shopt -s cdspell 2> /dev/null
|
|
|
|
# This defines where cd looks for targets
|
|
# Add the directories you want to have fast access to, separated by colon
|
|
# Ex: CDPATH=".:~:~/projects" will look for targets in the current working directory, in home and in the ~/projec
|
|
CDPATH="."
|
|
|
|
# This allows you to bookmark your favorite places across the file system
|
|
# Define a variable containing a path and you will be able to cd into it regardless of the directory you're in
|
|
shopt -s cdable_vars
|