Refactoring and some tweaks.
This commit is contained in:
92
tilde/bash_profile.bash
Normal file
92
tilde/bash_profile.bash
Normal file
@ -0,0 +1,92 @@
|
||||
# Don't put duplicate lines in the history
|
||||
export HISTCONTROL=ignoreboth:erasedups
|
||||
|
||||
# Set history length
|
||||
HISTFILESIZE=1000000000
|
||||
HISTSIZE=1000000
|
||||
|
||||
# Append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
# Check the window size after each command and, if necessary, update the values of LINES and COLUMNS
|
||||
shopt -s checkwinsize
|
||||
# Autocorrect typos in path names when using `cd`
|
||||
shopt -s cdspell
|
||||
# Save all lines of a multiple-line command in the same history entry (allows easy re-editing of multi-line commands)
|
||||
shopt -s cmdhist
|
||||
# Do not autocomplete when accidentally pressing Tab on an empty line. (It takes forever and yields "Display all 15 gazillion possibilites?")
|
||||
shopt -s no_empty_cmd_completion;
|
||||
|
||||
# Do not overwrite files when redirecting using ">". Note that you can still override this with ">|"
|
||||
set -o noclobber;
|
||||
|
||||
# Enable some Bash 4 features when possible:
|
||||
# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
|
||||
# * Recursive globbing, e.g. `echo **/*.txt`
|
||||
for option in autocd globstar; do
|
||||
shopt -s "$option" 2> /dev/null
|
||||
done
|
||||
|
||||
# Locale
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG="en_US"
|
||||
|
||||
# Extend $PATH
|
||||
[ -d ~/bin ] && PATH="~/bin:$PATH"
|
||||
PATH="/usr/local/bin:$PATH"
|
||||
command -v brew >/dev/null 2>&1 && PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
|
||||
export PATH
|
||||
|
||||
# Load prompt and aliases
|
||||
for file in ~/dotfiles/includes/{bash_prompt,bash_aliases,bash_functions}; do
|
||||
[ -r "$file.bash" ] && source "$file.bash"
|
||||
done
|
||||
unset file
|
||||
|
||||
# If possible, add tab completion for many commands
|
||||
[ -f /etc/bash_completion ] && source /etc/bash_completion
|
||||
|
||||
# Bash completion (installed via Homebrew; source after `brew` is added to PATH)
|
||||
command -v brew >/dev/null 2>&1 && [ -r "$(brew --prefix)/etc/bash_completion" ] && source "$(brew --prefix)/etc/bash_completion"
|
||||
|
||||
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
|
||||
[ -e "~/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
|
||||
|
||||
# Nano is default editor
|
||||
export EDITOR='nano'
|
||||
|
||||
# Tell ls to be colourful
|
||||
export CLICOLOR=1
|
||||
|
||||
# Tell grep to highlight matches
|
||||
export GREP_OPTIONS='--color=auto'
|
||||
|
||||
# Make less the default pager, and specify some useful defaults.
|
||||
less_options=(
|
||||
# If the entire text fits on one screen, just show it and quit. (Be more
|
||||
# like "cat" and less like "more".)
|
||||
--quit-if-one-screen
|
||||
|
||||
# Do not clear the screen first.
|
||||
--no-init
|
||||
|
||||
# Like "smartcase" in Vim: ignore case unless the search pattern is mixed.
|
||||
--ignore-case
|
||||
|
||||
# Do not automatically wrap long lines.
|
||||
--chop-long-lines
|
||||
|
||||
# Allow ANSI colour escapes, but no other escapes.
|
||||
--RAW-CONTROL-CHARS
|
||||
|
||||
# Do not ring the bell when trying to scroll past the end of the buffer.
|
||||
--quiet
|
||||
|
||||
# Do not complain when we are on a dumb terminal.
|
||||
--dumb
|
||||
);
|
||||
export LESS="${less_options[*]}";
|
||||
unset less_options;
|
||||
export PAGER='less';
|
||||
|
||||
# Load extra (private) settings
|
||||
[ -r "~/.bashlocal" ] && source "~/.bashlocal"
|
4
tilde/bashrc.bash
Normal file
4
tilde/bashrc.bash
Normal file
@ -0,0 +1,4 @@
|
||||
# https://github.com/janmoesen/tilde/blob/master/.bashrc
|
||||
echo $TERM_PROGRAM
|
||||
alias xxx="ls"
|
||||
[ -n "$PS1" ] && source ~/.bash_profile;
|
2
tilde/gitattributes
Normal file
2
tilde/gitattributes
Normal file
@ -0,0 +1,2 @@
|
||||
# Automatically normalize line endings for all text-based files
|
||||
* text=auto
|
55
tilde/gitconfig
Normal file
55
tilde/gitconfig
Normal file
@ -0,0 +1,55 @@
|
||||
[color]
|
||||
ui = auto
|
||||
[color "diff"]
|
||||
meta = blue bold
|
||||
frag = black bold
|
||||
old = red bold
|
||||
new = magenta bold
|
||||
[core]
|
||||
editor = nano
|
||||
# http://stackoverflow.com/questions/136178/git-diff-handling-long-lines
|
||||
# If doesn't work, try: pager = less -+$LESS -FRX
|
||||
pager = less -r
|
||||
autocrlf = false
|
||||
excludesfile = ~/.gitignore
|
||||
attributesfile = ~/.gitattributes
|
||||
[alias]
|
||||
a = add
|
||||
ua = reset HEAD
|
||||
b = branch
|
||||
c = commit
|
||||
ca = commit -a
|
||||
cam = commit -am
|
||||
co = checkout
|
||||
d = diff --color-words
|
||||
s = status -sb
|
||||
l = log --graph --pretty=format:'%C(magenta)%h%C(blue)%d%Creset %s %C(blue bold)- %an, %ar%Creset'
|
||||
ll = log --stat --abbrev-commit
|
||||
ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo $2 >> .gitignore
|
||||
this = !git init && git add . && git commit -m \"initial commit\"
|
||||
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
|
||||
[push]
|
||||
default = current
|
||||
|
||||
# URL shorthands
|
||||
[url "git@github.com:"]
|
||||
insteadOf = "gh:"
|
||||
pushInsteadOf = "github:"
|
||||
pushInsteadOf = "git://github.com/"
|
||||
[url "git://github.com/"]
|
||||
insteadOf = "github:"
|
||||
[url "git@gist.github.com:"]
|
||||
insteadOf = "gst:"
|
||||
pushInsteadOf = "gist:"
|
||||
pushInsteadOf = "git://gist.github.com/"
|
||||
[url "git://gist.github.com/"]
|
||||
insteadOf = "gist:"
|
||||
|
||||
# Include local settings
|
||||
# Example:
|
||||
# [user]
|
||||
# name = Artem Sapegin
|
||||
# email = artem@sapegin.ru
|
||||
[include]
|
||||
path = ~/.gitlocal
|
||||
|
17
tilde/gitignore
Normal file
17
tilde/gitignore
Normal file
@ -0,0 +1,17 @@
|
||||
# Compiled Python files
|
||||
*.pyc
|
||||
|
||||
# Folder view configuration files
|
||||
.DS_Store
|
||||
Desktop.ini
|
||||
|
||||
# Thumbnail cache files
|
||||
._*
|
||||
Thumbs.db
|
||||
|
||||
# Files that might appear on external disks
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
|
||||
# Installed NPM modules
|
||||
node_modules
|
4
tilde/hushlogin
Normal file
4
tilde/hushlogin
Normal file
@ -0,0 +1,4 @@
|
||||
# The mere presence of this file in the home directory disables the system copyright notice, the date and time of the
|
||||
# last login, the message of the day as well as other information that may otherwise appear on login.
|
||||
# See `man login`.
|
||||
# Source: https://github.com/mathiasbynens/dotfiles/blob/master/.hushlogin
|
72
tilde/inputrc.bash
Normal file
72
tilde/inputrc.bash
Normal file
@ -0,0 +1,72 @@
|
||||
# Inspired by: https://github.com/janmoesen/tilde/blob/master/.inputrc
|
||||
|
||||
#
|
||||
# Autocompletion
|
||||
#
|
||||
|
||||
# Make Tab autocompletion case-insensitive (cd ~/dow<Tab> => cd ~/Downloads/)
|
||||
set completion-ignore-case On
|
||||
|
||||
# When autocompleting symlinks to directories, immediately add a trailing "/"
|
||||
set mark-symlinked-directories on
|
||||
|
||||
# Do not expand "~" to the home directory when completing. (The actual value passed on to the command still is expanded,
|
||||
# though. Which is good.) "Off" is the default value, but some servers override this
|
||||
set expand-tilde off
|
||||
|
||||
# Flip through autocompletion matches with Shift-Tab
|
||||
"\e[Z": menu-complete
|
||||
|
||||
# Do not autocomplete hidden files ("dot files") unless the pattern explicitly begins with a dot
|
||||
set match-hidden-files off
|
||||
|
||||
# Show all autocomplete results at once
|
||||
set page-completions off
|
||||
|
||||
# If there are more than 200 possible completions for a word, ask to show them all
|
||||
set completion-query-items 200
|
||||
|
||||
# Immediately show all possible completions
|
||||
set show-all-if-ambiguous on
|
||||
|
||||
# Show extra file information when completing, like ls -F does
|
||||
set visible-stats on
|
||||
|
||||
# Be more intelligent when autocompleting by also looking at the text after the cursor. For example, when the current
|
||||
# line is "cd ~/src/mozil", and the cursor is on the "z", pressing Tab will not autocomplete it to "cd ~/src/mozillail",
|
||||
# but to "cd ~/src/mozilla". (This is supported by the Readline used by Bash 4.)
|
||||
set skip-completed-text on
|
||||
|
||||
# Use the text that has already been typed as the prefix for searching through commands (i.e. more intelligent Up/Down behavior)
|
||||
"\e[B": history-search-forward
|
||||
"\e[A": history-search-backward
|
||||
|
||||
|
||||
#
|
||||
# Line editing
|
||||
#
|
||||
|
||||
# Allow UTF-8 input and output, instead of showing them like $'\0123\0456'
|
||||
set input-meta on
|
||||
set output-meta on
|
||||
set convert-meta off
|
||||
|
||||
# Delete for wonky terminals
|
||||
"\e[3~": delete-char
|
||||
|
||||
# Use Ctrl+← and Ctrl+→ (or Alt/Meta, or Esc) to move between words
|
||||
"\e[1;5D": backward-word
|
||||
"\e[1;3D": backward-word
|
||||
"\e[5D": backward-word
|
||||
"\e\e[D": backward-word
|
||||
"\e[1;5C": forward-word
|
||||
"\e[1;3C": forward-word
|
||||
"\e[5C": forward-word
|
||||
"\e\e[C": forward-word
|
||||
|
||||
|
||||
#
|
||||
# Misc
|
||||
#
|
||||
|
||||
set bell-style none
|
Reference in New Issue
Block a user