Skip to content

Instantly share code, notes, and snippets.

@kalashnikovisme
Last active October 27, 2019 11:52
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 kalashnikovisme/6722293 to your computer and use it in GitHub Desktop.
Save kalashnikovisme/6722293 to your computer and use it in GitHub Desktop.
config files
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
source ~/.rvm/scripts/rvm
export PS1='\w$(__git_ps1 "(%s)"): '
[user]
name = pavel
email = kalashnikovisme@gmail.com
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = auto
pager = true
[merge]
summary=true
[alias]
b = branch -v
r = remote -v
t = tag -l
cp = cherry-pick -x
co = checkout
br = branch
ci = commit
st = status -sb
ds = diff --staged
amend = commit --amend -C HEAD
undo = reset --soft HEAD^
unstage = reset HEAD --
uncommit = reset --soft HEAD^
conflict = diff --name-only --diff-filter=U
last = log -1 HEAD
up = pull --rebase
put = push origin HEAD
latest = for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short) [%(committername)]'
ls = log --decorate --date=short
lt = describe --abbrev=0 --tags
graph = log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset'
po = push origin
puh = push heroku master
rmad = rm $(git ls-files --deleted)
pt = push --tags
standup = !"git log --reverse --branches --since=$(if [[ "Mon" == "$(date +%a)" ]]; then echo "last friday"; else echo "yesterday"; fi) --author=$(git config --get user.email) --format=format:'%C(cyan) %ad %C(yellow)%h %Creset %s %Cgreen%d' --date=local" " "
[core]
editor = vim
excludesfile = /home/pavel/.gitignore
[push]
default = simple
Pry::Commands.delete 'c'
Pry::Commands.delete 'n'
Pry::Commands.delete 's'
Pry::Commands.create_command "html5tidy" do
description "Print indented, colorized HTML from the input: html5tidy [ARGS]"
command_options requires_gem: ['nokogiri']
def process
@object_to_interrogate = args.empty? ? target_self : target.eval(args.join(" "))
cleaned_html = Nokogiri::XML(@object_to_interrogate,&:noblanks)
colorized_text = Pry.config.color ? CodeRay.scan(cleaned_html, :html).term : cleaned_html
output.puts colorized_text
end
end
source ~/.vim/vimrc
set nu
set sw=2
set sts=2
let g:fuzzy_ignore = "gems/*"
let g:ackprg="ack-grep -H --nocolor --nogroup --column"
nnoremap <f3> :TlistToggle<cr>
nnoremap <f2> :NERDTreeToggle<CR>
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-rails.git'
Bundle 'junegunn/vim-easy-align'
Bundle 'bling/vim-airline'
Bundle 'airblade/vim-gitgutter'
Bundle 'tpope/vim-surround'
Bundle 'scrooloose/syntastic'
Bundle 'tpope/vim-commentary'
Bundle 'tpope/vim-repeat'
filetype plugin indent on
imap <F2> <Esc>:w<CR>
map <F2> <Esc>:w<CR>
imap <F3> <Esc>:q<CR>
map <F3> <Esc>:q<CR>
imap <F4> <Esc>:wq<CR>
map <F4> <Esc>:wq<CR>
imap <F5> <Esc>:set paste<CR>
map <F5> <Esc>:set paste<CR>
imap <F6> <Esc>:set nopaste<CR>
map <F6> <Esc>:set nopaste<CR>
imap <F7> <Esc>:%s/:\([^ ]*\)\(\s*\)=>/\1:/g<CR>
map <F7> <Esc>:%s/:\([^ ]*\)\(\s*\)=>/\1:/g<CR>
imap <F8> <Esc>:s#\%($\%(\k\+\)\)\@<=_\(\k\)#\u\1#g<CR>
map <F8> <Esc>:s#\%($\%(\k\+\)\)\@<=_\(\k\)#\u\1#g<CR>
nmap <F9> :%!html2haml --erb 2> /dev/null<CR>:set ft=haml<CR>
vmap <F9> :!html2haml --erb 2> /dev/null<CR>
set relativenumber
"allow to copy/paste between VIM instances
" "copy the current visual selection to ~/.vbuf
vmap <Leader>y :w! ~/.vbuf<CR>
" "copy the current line to the buffer file if no visual selection
nmap <Leader>y :.w! ~/.vbuf<CR>
" "paste the contents of the buffer file
nmap <Leader>p :r ~/.vbuf<CR>
#Vim files
*.swp
*.swn
*.swo
*.swm
*.swl
*.swk
#Dolphin files
*.directory
local all postgres trust
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
/.bundle
/db/*.sqlite3
/log/*.log
/tmp
*.rbc
*.sassc
.sass-cache
capybara-*.html
.rspec
.rvmrc
/.bundle
/vendor/bundle
/log/*
/tmp/*
/db/*.sqlite3
/public/system/*
/public/uploads/*
/public/assets/*
/coverage/
/spec/tmp/*
**.orig
rerun.txt
pickle-email-*.html
.project
config/initializers/secret_token.rb
config/database.yml
*.sqlite3-journal
*~
Gemfile.lock
.capistrano/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment