From 93d3415aa4d1790254c97b7465c94dfa1bd1a1b2 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Sun, 27 Jul 2014 13:01:52 +0200 Subject: [PATCH] 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