Skip to content

Instantly share code, notes, and snippets.

@cfobel
Last active November 27, 2019 17:00
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 cfobel/895f7413bf355dbe9822f0d6438fb813 to your computer and use it in GitHub Desktop.
Save cfobel/895f7413bf355dbe9822f0d6438fb813 to your computer and use it in GitHub Desktop.
Bash config
[user]
name = "Christian Fobel"
email = "christian@fobel.net"
editor = vim
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset - [%an] %s %Cgreen(%cr)%Creset %d' --abbrev-commit --date=relative
tree = log --graph --decorate --pretty=oneline --abbrev-commit
[color]
pager = true
ui = auto
diff = auto
status = auto
branch = auto
[merge]
tool = vimdiff
[push]
default = current
# GNU readline .inputrc
# Brendan O'Connor (dotfiles.org/~brendano) (brenocon at gmail)
#
# See [here][1] also.
#
# Prefix search! Type "s" then press up -- only search through history that
# started with "s" -- e.g. "ssh", "source", etc.
#
# Since this is .inputrc, this is automatically turned on for many different
# programs: bash, irb, python, mysql, octave, etc etc. sweet.
#
# For any of these programs, if you configure history to persist across
# sessions, then this becomes a usage search feature. For example, I type "ss"
# then start pressing up to scroll through all machines I've ssh'd to in the
# last several months. (C-r reverse search can do this too, but for some
# reason prefix search feels much nicer.) If I can't remember how to type a
# specific command, I can just prefix search for its beginning, e.g. "ki"
# reveals "kill -9 %1".
#
# dotfiles.org/~brendano has bash, irb, and zsh configuration for persistent
# history.
#
# [1]: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/
set editing-mode vi
set keymap vi-insert
# i cant believe this is not default
set blink-matching-paren on
"\e[A": history-search-backward
"\e[B": history-search-forward
"\eOA": history-search-backward
"\eOB": history-search-forward
# C-p and C-n still do normal history navigation, but to override:
#"\C-p": history-search-backward
#"\C-n": history-search-forward
unbind C-b
set -g prefix C-a
set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind-key | split-window -h
bind-key - split-window
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
set -g history-limit 10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment