Skip to content

Instantly share code, notes, and snippets.

@petrikoz
Last active December 11, 2020 07:15
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 petrikoz/2e848a184ac8185cecd5 to your computer and use it in GitHub Desktop.
Save petrikoz/2e848a184ac8185cecd5 to your computer and use it in GitHub Desktop.
Simple config for hostings: .bashrc, .vimrc
################################################################
# Utilities
################################################################
function hsi() {
history | grep -i $1
}
################################################################
# Aliases
################################################################
alias md='mkdir -p'
alias ll='ls -hl'
################################################################
# Completion
################################################################
#== Package installer for Python
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip
#== Pyhton virtualenv wrapper
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source $HOME/.local/bin/virtualenvwrapper.sh
[alias]
b = branch
co = checkout
fo = fetch -v origin
foc = !git fetch -v origin "$(git rev-parse --abbrev-ref HEAD)"
l = log
ll = log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
pl = pull
plc = !git pull origin "$(git rev-parse --abbrev-ref HEAD)"
res = reset
resh = reset --hard
s = status
ss = status -s
#== Base =======================================================
set -g default-terminal "$TERM"
set -g main-pane-width 160
#== Keys =======================================================
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Vim-style navigation in copy-mode
set-window-option -g mode-keys vi
# reloaded local config
bind R source-file "$HOME/.tmux.conf" \; display-message "Reload config from \"$HOME/.tmux.conf\"..."
# Un/Zoom current pane
bind F3 resize-pane -Z
syntax on
filetype indent plugin on
set modeline
" Put this file in $HOME/.vim/ftplugin/
set tabstop=8
set expandtab
set shiftwidth=4
set softtabstop=4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment