From 93d3415aa4d1790254c97b7465c94dfa1bd1a1b2 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Sun, 27 Jul 2014 13:01:52 +0200 Subject: [PATCH 1/3] add tpope's surround to vim --- vimrc | 82 ++++++++++++++++++++++++++--------------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/vimrc b/vimrc index c81dd2c..010a996 100644 --- a/vimrc +++ b/vimrc @@ -2,6 +2,7 @@ set nocompatible " Vundle + filetype off " required! " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim @@ -17,6 +18,8 @@ Plugin 'scrooloose/nerdtree' Plugin 'kien/ctrlp.vim' Plugin 'maxbrunsfeld/vim-yankstack', {'name': 'yankstack'} +Plugin 'surround.vim' + Plugin 'editorconfig/editorconfig-vim' Plugin 'pangloss/vim-javascript' @@ -34,6 +37,7 @@ Plugin 'snipMate' Plugin 'mustache/vim-mustache-handlebars' +Plugin 'mhinz/vim-startify' " All of your Plugins must be added before the following line call vundle#end() " required @@ -44,12 +48,7 @@ filetype plugin indent on " required set t_Co=256 -" MAP LEADER -noremap , \ -let mapleader = "," - " CONFIGURATION MAPPING -set scrolloff=3 " show 3 lines of context around the cursor set autoread " set to auto read when a file is changed from the outside "set mouse=a " allow for full mouse support set autowrite @@ -105,7 +104,6 @@ endif " VIM 7.3 FEATURES - if v:version >= 703 set undofile set undodir=$HOME/.vim/.undo @@ -123,7 +121,12 @@ set foldenable " enable folding set foldmethod=marker " detect triple-{ style fold markers set foldlevel=99 -" ADDITIONAL KEY MAPPINGS +" KEY MAPPINGS + +" MAP LEADER +noremap , \ +let mapleader = "," + " fast saving nmap w :update " fast escaping @@ -141,9 +144,9 @@ nmap gy ggVGy nnoremap j gj nnoremap k gk " auto complete {} indent and position the cursor in the middle line -inoremap { {}O -inoremap ( ()O -inoremap [ []O +"inoremap { {}O +"inoremap ( ()O +"inoremap [ []O " fast window switching map , w " cycle between buffers @@ -151,11 +154,13 @@ map . :b# " change directory to current buffer map cd :cd %:p:h " swap implementations of ` and ' jump to prefer row and column jumping -nnoremap ' ` -nnoremap ` ' +" nnoremap ' ` +" nnoremap ` ' " indent visual selected code without unselecting and going back to normal mode vmap > >gv vmap < r :%s#\<=expand("")\># " strip all trailing whitespace in the current file @@ -181,13 +186,21 @@ nmap nn :set invnumber nmap pp :set invpaste nmap ii :set invrelativenumber +" remap [] to <> for german keyboard +nmap < [ +nmap > ] +omap < [ +omap > ] +xmap < [ +xmap > ] + " accomondate with german keyboard -nnoremap ß -nnoremap Ä } -nnoremap Ö { -nnoremap ä ] -nnoremap ö [ +"nnoremap ß +"nnoremap Ä } +"nnoremap Ö { +"nnoremap ä ] +"nnoremap ö [ if exists('+relativenumber') set relativenumber @@ -196,31 +209,10 @@ endif "" ADDITIONAL AUTOCOMMANDS " saving when focus lost (after tabbing away or switching buffers) -au FocusLost,BufLeave,WinLeave,TabLeave * silent! up +"au FocusLost,BufLeave,WinLeave,TabLeave * silent! up " open in last edit place -au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif -au QuickFixCmdPost *grep* cwindow - - -"" ADDITIONAL GUI SETTINGS - -if has("gui_running") - set guioptions-=T - " set guioptions-=m - set linespace=6 - set columns=160 lines=26 - set guioptions-=T - - " crazy hack to get gvim to remove all scrollbars - set guioptions+=LlRrb - set guioptions-=LlRrb - - if has("mac") - set guifont=DejaVu\ Sans\ Mono\:h14 - else - set guifont=DejaVu\ Sans\ Mono\ 9 - endif -endif +"au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif +"au QuickFixCmdPost *grep* cwindow "" PLUGIN SETTINGS @@ -231,9 +223,6 @@ let g:NERDTreeDirArrows=1 let g:NERDTreeQuitOnOpen=1 let g:NERDTreeShowHidden=1 -" Super Tab -" let g:SuperTabDefaultCompletionType = "context" - " Unimpaired " bubble single lines nmap k [e @@ -246,12 +235,13 @@ vmap j ]egv nmap p yankstack_substitute_older_paste nmap P yankstack_substitute_newer_paste + +" FILETYPE SPECIFIC + " MAIL HUMAN TEX au BufNewFile,BufRead *.txt set filetype=human au FileType human,mail,tex set expandtab textwidth=78 nocindent -"" LANGUAGE SPECIFIC - " Python au FileType python set noexpandtab From b13e46a88956bfe0fa0fc2fdc66e2a9a866d31ca Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Sat, 2 Aug 2014 23:56:20 +0200 Subject: [PATCH 2/3] fix oh-my-zilsh submodule commit --- zsh/bundle/oh-my-zilsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/bundle/oh-my-zilsh b/zsh/bundle/oh-my-zilsh index 22016bd..176f978 160000 --- a/zsh/bundle/oh-my-zilsh +++ b/zsh/bundle/oh-my-zilsh @@ -1 +1 @@ -Subproject commit 22016bd5512a09ef310ed5a56eaf03f660d83387 +Subproject commit 176f97872e7c7c66ea2ef26224259fbe4dc30f33 From 4c409767fa9a7970c4af7a248c6a8f2a0f0725f3 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Sun, 3 Aug 2014 00:14:24 +0200 Subject: [PATCH 3/3] remove zilsh wrapper --- .gitmodules | 9 ++---- oh-my-zsh | 1 + zsh/bundle/keybindings/init.zsh | 40 ------------------------- zsh/bundle/npm/init.zsh | 53 --------------------------------- zsh/bundle/oh-my-zilsh | 1 - zsh/zilsh | 1 - zshrc | 28 ++++++----------- 7 files changed, 13 insertions(+), 120 deletions(-) create mode 160000 oh-my-zsh delete mode 100644 zsh/bundle/keybindings/init.zsh delete mode 100644 zsh/bundle/npm/init.zsh delete mode 160000 zsh/bundle/oh-my-zilsh delete mode 160000 zsh/zilsh diff --git a/.gitmodules b/.gitmodules index 7fe50f7..cf92bea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ -[submodule "zsh/zilsh"] - path = zsh/zilsh - url = git@github.com:zilsh/zilsh.git -[submodule "zsh/bundle/oh-my-zilsh"] - path = zsh/bundle/oh-my-zilsh - url = git@github.com:zilsh/oh-my-zilsh.git [submodule "vim/bundle/Vundle.vim"] path = vim/bundle/Vundle.vim url = https://github.com/gmarik/Vundle.vim.git +[submodule "oh-my-zsh"] + path = oh-my-zsh + url = git@github.com:robbyrussell/oh-my-zsh.git diff --git a/oh-my-zsh b/oh-my-zsh new file mode 160000 index 0000000..1b7a3ea --- /dev/null +++ b/oh-my-zsh @@ -0,0 +1 @@ +Subproject commit 1b7a3ea99a8b566510ab7881063148c43be6b98d diff --git a/zsh/bundle/keybindings/init.zsh b/zsh/bundle/keybindings/init.zsh deleted file mode 100644 index 941c092..0000000 --- a/zsh/bundle/keybindings/init.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# create a zkbd compatible hash; -# to add other keys to this hash, see: man 5 terminfo -typeset -A key - -key[Home]=${terminfo[khome]} - -key[End]=${terminfo[kend]} -key[Insert]=${terminfo[kich1]} -key[Delete]=${terminfo[kdch1]} -key[Up]=${terminfo[kcuu1]} -key[Down]=${terminfo[kcud1]} -key[Left]=${terminfo[kcub1]} -key[Right]=${terminfo[kcuf1]} -key[PageUp]=${terminfo[kpp]} -key[PageDown]=${terminfo[knp]} - -# setup key accordingly -[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line -[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line -[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode -[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char -[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history -[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history -[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char -[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char -[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history -[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history - -# Finally, make sure the terminal is in application mode, when zle is -# active. Only then are the values from $terminfo valid. -if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-line-init () { - printf '%s' "${terminfo[smkx]}" - } - function zle-line-finish () { - printf '%s' "${terminfo[rmkx]}" - } - zle -N zle-line-init - zle -N zle-line-finish -fi diff --git a/zsh/bundle/npm/init.zsh b/zsh/bundle/npm/init.zsh deleted file mode 100644 index da9818d..0000000 --- a/zsh/bundle/npm/init.zsh +++ /dev/null @@ -1,53 +0,0 @@ -###-begin-npm-completion-### -# -# npm command completion script -# -# Installation: npm completion >> ~/.bashrc (or ~/.zshrc) -# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm -# - -COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} -COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} -export COMP_WORDBREAKS - -if type complete &>/dev/null; then - _npm_completion () { - local si="$IFS" - IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ - COMP_LINE="$COMP_LINE" \ - COMP_POINT="$COMP_POINT" \ - npm completion -- "${COMP_WORDS[@]}" \ - 2>/dev/null)) || return $? - IFS="$si" - } - complete -F _npm_completion npm -elif type compdef &>/dev/null; then - _npm_completion() { - si=$IFS - compadd -- $(COMP_CWORD=$((CURRENT-1)) \ - COMP_LINE=$BUFFER \ - COMP_POINT=0 \ - npm completion -- "${words[@]}" \ - 2>/dev/null) - IFS=$si - } - compdef _npm_completion npm -elif type compctl &>/dev/null; then - _npm_completion () { - local cword line point words si - read -Ac words - read -cn cword - let cword-=1 - read -l line - read -ln point - si="$IFS" - IFS=$'\n' reply=($(COMP_CWORD="$cword" \ - COMP_LINE="$line" \ - COMP_POINT="$point" \ - npm completion -- "${words[@]}" \ - 2>/dev/null)) || return $? - IFS="$si" - } - compctl -K _npm_completion npm -fi -###-end-npm-completion-### diff --git a/zsh/bundle/oh-my-zilsh b/zsh/bundle/oh-my-zilsh deleted file mode 160000 index 176f978..0000000 --- a/zsh/bundle/oh-my-zilsh +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 176f97872e7c7c66ea2ef26224259fbe4dc30f33 diff --git a/zsh/zilsh b/zsh/zilsh deleted file mode 160000 index 7b1881d..0000000 --- a/zsh/zilsh +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7b1881de4b77c52dfabe3278d2add6d9e3d8ccda diff --git a/zshrc b/zshrc index b6a1a63..601dcb5 100644 --- a/zshrc +++ b/zshrc @@ -1,35 +1,25 @@ -ZILSH_VERBOSITY=2 +export ZSH=$HOME/.oh-my-zsh -autoload -U colors && colors -source ~/.zsh/zilsh/zilsh.zsh +ZSH_THEME="pygmalion" -# oh-my-zilch config -# - -omz_plugins=(bower gitfast git-extras node npm pass screen vi-mode) +plugins=(bower gitfast git-extras node npm pass screen vi-mode) case $(hostname) in t430s-arch) - omz_plugins+=(archlinux systemd) + plugins+=(archlinux systemd) ;; cassiopeia.uberspace.de) - omz_plugins+=() + plugins+=() ;; everard) - omz_plugins+=(debian jira) + plugins+=(debian jira) ;; esac +source $ZSH/oh-my-zsh.sh -ZILSH_THEME="pygmalion.zsh-theme" - -_zilsh_init "~/.zsh/bundle/" - -############ -## Settings -############# -PATH="$PATH:$HOME/local/bin" -EDITOR="vim" +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 # turn of autocorrection unsetopt correct_all