From b334295664c42d8448db127876f92e0c4d17c4be Mon Sep 17 00:00:00 2001 From: Steffen Rademacker Date: Tue, 21 Jan 2014 22:26:44 +0100 Subject: [PATCH] some nice shortcuts for vim / signify vs. gitgutter + aliases + brew / imagemagick --- aliases | 21 +++++++++++++++------ install/brew.sh | 1 + vimrc | 16 ++++++++++++++-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/aliases b/aliases index 9442940..3b40b55 100644 --- a/aliases +++ b/aliases @@ -57,12 +57,6 @@ alias t='tmux -u -2' alias ta='tmux attach' -# random usefull stuff -alias dnsflush='sudo dscacheutil -flushcache' -alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" -alias psa="ps aux" - - # all in one homebrew, gem update commands alias brewup='brew update && brew upgrade && brew cleanup && brew linkapps' alias gemup='gem update --system && gem update && gem cleanup' @@ -93,3 +87,18 @@ alias rep='cd ~/Repositories && ls -al' alias dot='cd ~/Dotfiles && ls -al' +# random usefull stuff +alias dnsflush='sudo dscacheutil -flushcache' +alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" +alias psa="ps aux" + + +# imagemagick downsampling shortcuts (c&p retina folder, run, done!) +# http://www.imagemagick.org/Usage/filter/nicolas/#downsample +alias png25='find . -name "*.png" | xargs mogrify -colorspace RGB -filter LanczosRadius -distort Resize 25% -colorspace sRGB' +alias jpg25='find . -name "*.jpg" | xargs mogrify -colorspace RGB -filter LanczosRadius -distort Resize 25% -colorspace sRGB' +alias png50='find . -name "*.png" | xargs mogrify -colorspace RGB -filter LanczosRadius -distort Resize 50% -colorspace sRGB' +alias jpg50='find . -name "*.jpg" | xargs mogrify -colorspace RGB -filter LanczosRadius -distort Resize 50% -colorspace sRGB' + + + diff --git a/install/brew.sh b/install/brew.sh index 7975f1f..762a37b 100755 --- a/install/brew.sh +++ b/install/brew.sh @@ -8,6 +8,7 @@ brew install curl brew install ghostscript brew install git-flow brew install httpd +brew install imagemagick brew install macvim brew install markdown brew install mcrypt diff --git a/vimrc b/vimrc index cc0649f..2af3b1a 100644 --- a/vimrc +++ b/vimrc @@ -14,7 +14,6 @@ Bundle 'gmarik/vundle' " plugins Bundle 'Raimondi/delimitMate' Bundle 'SirVer/ultisnips' -Bundle 'airblade/vim-gitgutter' Bundle 'bling/vim-airline' Bundle 'chrisbra/NrrwRgn' Bundle 'editorconfig/editorconfig-vim' @@ -27,6 +26,7 @@ Bundle 'kshenoy/vim-signature' Bundle 'mattn/gist-vim' Bundle 'mattn/webapi-vim' Bundle 'mbbill/undotree' +Bundle 'mhinz/vim-signify' Bundle 'rizzatti/dash.vim' Bundle 'rizzatti/funcoo.vim' Bundle 'rking/ag.vim' @@ -43,7 +43,6 @@ Bundle 'tpope/vim-unimpaired' " Additional syntaxes -" Bundle '2072/PHP-Indenting-for-VIm' Bundle 'beyondwords/vim-twig' Bundle 'elzr/vim-json' Bundle 'hail2u/vim-css3-syntax' @@ -76,6 +75,9 @@ set relativenumber " relative line numbers are mothereffin awesome -- see how fa set nowrap " dont wrap lines around set sidescroll=10 " smoother side-scrolling set sidescrolloff=5 +set scrolljump=5 " Lines to scroll when cursor leaves screen +set scrolloff=3 " Minimum lines to keep above and below cursor + set lazyredraw " Don't redraw while executing macros @@ -126,6 +128,7 @@ set background=dark colorscheme solarized let g:solarized_termtrans = 1 let g:solarized_contrast = 'high' + " minor optical fix vor vim-gitgutter / syntastic / vim-signature highlight SignColumn ctermbg=8 @@ -297,6 +300,15 @@ nnoremap c :execute "vimgrep /" . expand("") . "/j **" cnex " short command to strip trainling whitepsace nnoremap s ms:%s/\s\+$//e:noh`s +" Find merge conflict markers +map fc /\v^[<\|=>]{7}( .*\|$) + +" For when you forget to sudo.. Really Write the file. +cmap w!! w !sudo tee % >/dev/null + +" Map ff to display all lines with keyword under cursor and ask which one to jump to +nmap j [I:let nr = input("Which one: ")exe "normal " . nr ."[\t" + " Plugins " ====================================================================== "