From bbb0f76872375f7e3eba3b37c2fd49fa2cbcccfb Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Fri, 5 Jul 2013 18:49:04 +0200 Subject: [PATCH] some nice vim and zshrc stuff --- gitconfig | 3 +++ oh-my-zsh | 2 +- vim/snippets/css.snippets | 15 ++++++++++--- vimrc | 44 ++++++++++++++++++++++++++------------- zshrc | 8 +++++-- 5 files changed, 51 insertions(+), 21 deletions(-) diff --git a/gitconfig b/gitconfig index 4d178d6..c31ced7 100644 --- a/gitconfig +++ b/gitconfig @@ -34,6 +34,9 @@ ps = push pl = pull mg = merge + ffs = flow feature start + fff = flow feature finish + fi = flow init unst = reset HEAD hub = push origin master fac = push origin refac diff --git a/oh-my-zsh b/oh-my-zsh index 63d086b..4a6e84e 160000 --- a/oh-my-zsh +++ b/oh-my-zsh @@ -1 +1 @@ -Subproject commit 63d086b86106010a3dde5aa2214dd4fd12a59b8c +Subproject commit 4a6e84e658af84931f66713c4684d61fb9ec5a5d diff --git a/vim/snippets/css.snippets b/vim/snippets/css.snippets index f1e663d..9836469 100644 --- a/vim/snippets/css.snippets +++ b/vim/snippets/css.snippets @@ -21,6 +21,15 @@ snippet mix "create a mixin" !b endsnippet +snippet fe "each in sass" !b +@each $${1:item} in $${2:variable} { + $0 +} + +endsnippet + + + ######################################### # css3 stuff and using compass mixins # @@ -379,15 +388,15 @@ endsnippet # lists -snippet li "list-style" +snippet ls "list-style" list-style: ${1:none/disc/circle/square/decimal/zero};$0 endsnippet -snippet lin "list-style: none" +snippet lsn "list-style: none" list-style: none;$0 endsnippet -snippet lid "list-style: disc" +snippet lsd "list-style: disc" list-style: disc;$0 endsnippet diff --git a/vimrc b/vimrc index c602078..33fa1e8 100644 --- a/vimrc +++ b/vimrc @@ -21,11 +21,9 @@ Bundle 'editorconfig/editorconfig-vim' Bundle 'edsono/vim-matchit' Bundle 'ervandew/supertab' Bundle 'godlygeek/tabular' -Bundle 'jeetsukumaran/vim-buffergator' Bundle 'kien/ctrlp.vim' Bundle 'mattn/gist-vim' Bundle 'mattn/webapi-vim' -Bundle 'maxbrunsfeld/vim-yankstack' Bundle 'rking/ag.vim' Bundle 'scrooloose/nerdtree' Bundle 'scrooloose/syntastic' @@ -53,7 +51,6 @@ Bundle 'webgefrickel/vim-typoscript' " Color themes Bundle 'altercation/vim-colors-solarized' -Bundle 'nanotech/jellybeans.vim' Bundle 'stephenmckinney/vim-solarized-powerline' @@ -155,7 +152,9 @@ set nowritebackup set noswapfile " no swp-files " Better folding +" TODO rework this and start using folds set foldmethod=indent +setlocal foldignore= set foldnestmax=20 " max 20 levels of folding set nofoldenable " dont fold by default - let me do it set foldlevelstart=1 " deactivate folding on fileload @@ -165,6 +164,18 @@ set visualbell " don't beep " ========== Custom Keymappings ========== + +" Typos +command! -bang E e +command! -bang Q q +command! -bang W w +command! -bang QA qa +command! -bang Qa qa +command! -bang Wa wa +command! -bang WA wa +command! -bang Wq wq +command! -bang WQ wq + " set the leader to comma , and ; == : -- faster commands let mapleader = "," nnoremap ; : @@ -207,8 +218,9 @@ nnoremap s :source ~/.vimrc " Opens an edit command with the path of the currently edited file filled in nnoremap e :e =expand("%:p:h") . "/" -" start a new document-wide seach-replace using abolish -nnoremap f :%S/ +" start a new document-wide seach-replace using abolish or normal search +nnoremap f :%s/ +nnoremap F :%S/ " dont use the arrow keys in insert mode inoremap @@ -264,8 +276,16 @@ nmap w :s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/`' nnoremap d :cd %:p:h:pwd " reload files when set autoread is active with F5 +" TODO make this awesome reloading NERDtree + ctrl+p as well nnoremap :checktime +" folding shortcuts +nnoremap za + + +" when over a class in html hit fc to find that class in css/scss/js +nnoremap c :execute "vimgrep /" . expand("") . "/j **" cnext + " ========== PLugins leaders and other config ========== " search using Ag - the Silver Surfer ftw! @@ -289,7 +309,7 @@ nnoremap gw :Gwrite20+ " TComment nnoremap / :TComment vnoremap / :TComment -inoremap / :TCommenti +inoremap / :TComment " Tabularize a == think align nmap a= :Tabularize /= @@ -318,18 +338,12 @@ let g:syntastic_mode_map = { 'mode': 'active', \ 'active_filetypes': ['ruby', 'php', 'javascript'], \ 'passive_filetypes': ['xhtml', 'html', 'scss', 'scss.css'] } -" Buffergator -let g:buffergator_display_regime='filepath' -" no default keymappings -- needing for command-t to work -let g:buffergator_suppress_keymaps=1 -let g:buffergator_viewport_split_policy='B' -let g:buffergator_split_size=12 -nnoremap b :BuffergatorToggle - " CtrlP +nnoremap b :CtrlPBuffer +nnoremap r :CtrlPMRU let g:ctrlp_map = 't' let g:ctrlp_switch_buffer = 0 " easier split screens -let g:ctrlp_working_path_mode = 0 +let g:ctrlp_working_path_mode = 0 " dont try to change my working directory let g:ctrlp_max_height = 12 let g:ctrlp_custom_ignore = { 'dir': '\v[\/](\.git|\.hg|\.svn|node_modules|\.sass-cache)$', \ 'file': '\.exe$\|\.so$\|\.dll$\|\.psd$\|\.png$\|\.jpg$\|\.gif$', diff --git a/zshrc b/zshrc index 7527060..c559c28 100644 --- a/zshrc +++ b/zshrc @@ -3,7 +3,7 @@ ZSH=$HOME/.oh-my-zsh ZSH_THEME="webgefrickel" # default plugins to load -plugins=(brew git git-flow-completion github grunt history-substring-search jake-node npm node gem osx zsh-syntax-highlighting) +plugins=(brew git git-flow github history-substring-search jake-node npm node gem osx zsh-syntax-highlighting) source $ZSH/oh-my-zsh.sh unsetopt correct_all @@ -12,7 +12,7 @@ unsetopt correct_all export TERM="screen-256color" # brew CASK -export HOMEBREW_CASK_OPTS="--appdir=/Applications" +# export HOMEBREW_CASK_OPTS="--appdir=/Applications" # paths export PATH=/usr/local/bin:/usr/local/sbin:$HOME/.rvm/bin:$PATH @@ -73,6 +73,7 @@ alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..' alias l='ls -al' +alias e='exit' # Shortcuts alias drop='cd ~/Dropbox && ls -al' @@ -88,15 +89,18 @@ function grepkill() { ps -axf | grep -v grep | grep "$@" | awk '{print $2}' | xa # Gitty gitgit alias gitrm='git rm $(git ls-files --deleted)' +alias gsmu='git submodule init && git submodule update' # THIS is evil. only use for private stuff and useless stuff # squish those commits afterwards with rebase! alias ggg='git add . && git commit -a -m "-"' + # dandelion deployment shortcuts alias deploy='dandelion deploy' alias status='dandelion status' # grunt +alias gr='grunt' alias grw='grunt watch' alias grd='grunt deploy'