From 2ab837ae9e56198f5a68607b521dd381c85eccde Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 5 Aug 2013 22:07:01 -0400 Subject: [PATCH] Alias and vim changes...mostly --- .aliases | 10 ++++++++++ .gitconfig | 3 ++- .vimrc | 19 +++++++++++++++++++ .zshrc | 4 ++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.aliases b/.aliases index f4ff245..be9036e 100644 --- a/.aliases +++ b/.aliases @@ -1,9 +1,13 @@ +alias ....="cd ../../.." +alias .....="cd ../../../.." alias a="ls -l --all" alias agi="sudo apt-get install" alias agl="dpkg --get-selections" alias agL="dpkg --listfiles" alias agu="sudo apt-get update && sudo apt-get upgrade" alias al="zsh_stats" +alias be="bundle exec" +alias beg="bundle exec guard" alias ber="bundle exec rake" alias c="clear" alias g="g" # overwrite g alias in git plugin so function will work @@ -13,8 +17,12 @@ alias gcf="git commit --file" alias gcm="git commit --message" alias gco="git checkout" alias gd="git diff" +alias gfl="git log -u" alias gl="git log" alias gh="git hist" +alias ghd="git hist-details" +alias gr="git reset" +alias grh="git reset --hard" alias grm="git rm" alias gs="git status" alias Grep='grep' @@ -22,6 +30,8 @@ alias l="ls" alias ll="ls -lv --human-readable --color=auto" alias ms="tmux -S /tmp/pair && chmod 777 /tmp/pair" alias mw="mux work" +alias rd="popd" +alias sd="pwd | pushd" alias s="cd ~/Source" alias sfs="map-sshfs" alias sz="source ~/.zshrc" diff --git a/.gitconfig b/.gitconfig index 351fdfa..58983e9 100644 --- a/.gitconfig +++ b/.gitconfig @@ -7,7 +7,8 @@ [apply] whitespace = fix [alias] - hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative + hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative + hist-details = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat [color] ui = auto [color "branch"] diff --git a/.vimrc b/.vimrc index d84ee41..ff11a7d 100644 --- a/.vimrc +++ b/.vimrc @@ -65,18 +65,26 @@ filetype indent on map :w imap :w +" Still using arrow keys when in insert mode sometimes +map +map +map +map + " Leaders (whatever that means) let mapleader = "," map bi :BundleInstall map lf :call LargeFileToggle() map s :e ~/Source/ +map sa :call RenameFile() map se :e ~/.vimrc map sz :so ~/.vimrc map t :Tabularize / map ts :sp ~/tool-sharpener.txt " Set style +set t_Co=256 set guifont=Ubuntu\ Mono\ 10 colorscheme vividchalk @@ -99,3 +107,14 @@ function! LargeFileToggle() set cursorline! set cursorcolumn! endfunction + +" Rename current file - from github/garybernhardt +function! RenameFile() + let old_name = expand('%') + let new_name = input('New file name: ', expand('%'), 'file') + if new_name != '' && new_name != old_name + exec ':saveas ' . new_name + exec ':silent !rm ' . old_name + redraw! + endif +endfunction diff --git a/.zshrc b/.zshrc index 736a4aa..baff07a 100644 --- a/.zshrc +++ b/.zshrc @@ -18,9 +18,9 @@ chpwd() { } # Larger history -HISTSIZE=10000 +HISTSIZE=20000 HISTFILE=~/.zsh_history -SAVEHIST=10000 +SAVEHIST=20000 # Make sure C-s works in vim stty start undef