From fe89b5671d65560b57d51485789c23c38885e28d Mon Sep 17 00:00:00 2001
From: Max Christian Pohle
Date: Tue, 24 May 2016 14:14:54 +0200
Subject: major update: plugins, colorscheme, shortcuts, new git submodule!

* using nelstroms mac color scheme
* 'fixed' some keyboard shortcuts to behave more like in other editors
* added some plugins
---
 vimrc | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 66 insertions(+), 15 deletions(-)

(limited to 'vimrc')

diff --git a/vimrc b/vimrc
index e57b242..2443738 100644
--- a/vimrc
+++ b/vimrc
@@ -7,22 +7,30 @@ set rtp+=~/.vim/bundle/Vundle.vim                    | " set runtimepath (requir
 call vundle#begin('~/.vim/bundle/')                  | " location where Vundle searches&installs plugins
 
 " Plugin dependant configurations...
-Plugin 'VundleVim/Vundle.vim'                         | " Vundle itself (required)
+Plugin 'Valloric/YouCompleteMe'                       | " syntax checker and code completion
 Plugin 'cscope_plus.vim'                              | " run cscope -R -b in project folder then use
 Plugin 'autoload_cscope.vim'                          | " CTRL+\ s searches word under cursor, CTRL+T back
 Plugin 'tpope/vim-fugitive'                           | " the most complete GIT integration plugin
 Plugin 'jeaye/color_coded'                            | " semantic highlighting with vim
 Plugin 'terryma/vim-multiple-cursors'                 | " displays visual block mode as cursors
-
 Plugin 'taglist-plus'                                 | " quick code navigator
 Plugin 'jdonaldson/vaxe'                              | " code completion for haxe
 Plugin 'sheerun/vim-polyglot'                         | " better syntax highlighting/indentation for multiple languages
 Plugin 'loremipsum'                                   | " Sample text generator
+Plugin 'vim-airline/vim-airline'                      | " beautification of the mode line
+Plugin 'nathanaelkane/vim-indent-guides'              | " shows indentation guidelines by pressing <leader>ig 
+Plugin 'gregsexton/matchtag'                          | " highlights closing ML tags like braces 
+Plugin 'indenthtml.vim'                               | " works better with mixed html/css/javascript
+Plugin 'easymotion/vim-easymotion'                    | " speed up navigation: try \\w or \\f, then one of the highlighted chars
+Plugin 'tpope/vim-surround'                           | " plugin makes cs"' inside a line replace " with '
+
+
+
 let Tlist_Compact_Format = 1                          | "
 let Tlist_GainFocus_On_ToggleOpen = 1                 | "
 let Tlist_Close_On_Select = 1                         | "
 
-Plugin 'Valloric/YouCompleteMe'                       | " syntax checker and code completion
+Plugin 'VundleVim/Vundle.vim'                         | " Vundle itself (required)
 let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py' | " fallback, right one should be in the applications path
 let g:ycm_confirm_extra_conf = 0                      | " disable 'do you really want to execute .py?'
 let g:ycm_key_select_completion = '<Tab>'             | " key completion key
@@ -34,12 +42,27 @@ let g:ycm_autoclose_preview_window_after_insertion=1  | " close the window when
 
 let b:html_omni_flavor='xhtml'                        | " prever xhtml over html because that makes inline php code possible without hassle
 let html_use_css = 1                                  | " when using :TOhtml no font-tags will be used, but proper css
+let g:vim_markdown_folding_disabled=1                 | " disable code folding with vimdiff (also see set nofoldenable)
+
+let g:netrw_liststyle=3                               | " Explore mode: 3 shows a complete tree instead of the current directory
+let g:netrw_list_hide='^\..*'                         | " Explore mode: hide files starting with dot
+
+
+" speed up CTRL-P Menu...
+let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
+      \ --ignore .git
+      \ --ignore .svn
+      \ --ignore .hg
+      \ --ignore .DS_Store
+      \ --ignore "**/*.pyc"
+      \ -g ""'
 
 call vundle#end()             | " required by Vundle
 filetype plugin indent on     | " required by Vundle
 "================================================================================ 
 " custom config
-colorscheme coderonline
+colorscheme mac_classic
+" colorscheme coderonline
 syntax enable
 
 set noswapfile                | " noundofile, nobackup, nowritebackup
@@ -57,7 +80,7 @@ set selection=exclusive       | " includes last character of the selection into
 
 set whichwrap=b,s,<,>,[,]     | " beyond beginning/end line causes cusor to wrap
 set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap
-set diffopt+=iwhite,filler    | " lets diff ignore white spaces
+set diffopt+=vertical,iwhite,filler    | " lets diff ignore white spaces
 set spell spelllang=en,de     | " enable spell checker
 set virtualedit=onemore       | " one character beyond the line length should be navigatable (options: all,insert,block,onemore)
 set breakindent cpoptions+=n  | " when wrapping lines indent wrapped line to align with the previews
@@ -66,6 +89,7 @@ set showcmd                   | " displays status line messages while selecting
 set nofoldenable              | " do not fold code automatically
 set tags+=~/.vim/systags      | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include
 set wildmenu wildmode=full    | " wildmenu code completion
+set guifont="Droid Sans Mono for Powerline 10"
 
 " search...
 set ignorecase smartcase      | " if search pattern contains uppercase then search is case sensitive
@@ -76,6 +100,10 @@ set novisualbell              | " don't beep
 set noerrorbells              | " don't beep
 set clipboard=unnamedplus     | " makes copy and paste work (autoselectplus might work as well)
 set number                    | " toggle line numbers
+set formatprg=par             | " set external formatting program to par, use gwip to format with this
+set laststatus=2              | " this is required for airline
+set cmdheight=1               | " controls how many lines the command line has
+set relativenumber            | " displays current lines line no as zero point from where relative numbers are getting counted
 
 if has("multi_byte")
   set encoding=utf-8          | " we need default utf-8 encoding to use cool chars as line break and so on (see below)
@@ -108,6 +136,7 @@ if has("autocmd")
             \	setlocal omnifunc=syntaxcomplete#Complete |
             \	setlocal completeopt=longest,menuone |
             \	endif
+      autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
     endif
   augroup END
 
@@ -158,6 +187,30 @@ endif
 
 "================================================================================ 
 " custom commands...
+"
+" assign selection keys (these i missed a lot)
+nmap <S-Left> vh|                      " shift-left selects to the left
+xmap <S-Left> h|                       " ^^
+nmap <S-Right> vl|                     " shift-right selects to the right
+xmap <S-Right> l|                      " ^^
+nmap <S-Up> vk|                        " shift-up selects like other text editors
+xmap <S-Up> k|                         " ^^
+nmap <S-Down> vj|                      " shift down selects like other text editors
+xmap <S-Down> j|                       " ^^
+nmap <Home> ^|                         " default homing in code editors is the first letter of a line
+xmap <Home> 0|                         " go to the beginning of the line
+xmap <S-Home> 0|                       " ^^
+xmap <Tab> >gv|                        " indent lines (and retain selection)
+xmap <S-Tab> <gv|                      " unindent lines (and retain selection)
+nmap <S-PageUp> VH|                    " selects predessing paragraph 
+nmap <S-PageDown> VL|                  " selects following paragraph
+nmap <C-S-PageUp> V{|                  " selects predessing paragraph 
+nmap <C-S-PageDown> V}|                " selects following paragraph
+
+
+
+
+
 map <C-h> <C-w>h|map <C-j> <C-w>j|     " window navigation shortcuts
 map <C-k> <C-w>k|map <C-l> <C-w>l|     " window navigation shortcuts
 
@@ -171,15 +224,14 @@ nnoremap j gj|nnoremap k gk|           " do not jump over wrapped lines
 
 nnoremap $ g$|                         " and make the $ key position the cursor after the last char of that line, not before
 nnoremap <End> g$|                     " and make the <End> key position the cursor after the last char of that line
-function ExtendedHome()
-    let column = col('.')
-    normal! ^
-    if column == col('.')
-        normal! 0
-    endif
-endfunction
-noremap <Home> ^
-noremap <silent> <Home> :call ExtendedHome()<CR>
+" function ExtendedHome()
+"     let column = col('.')
+"     normal! ^
+"     if column == col('.')
+"         normal! 0
+"     endif
+" endfunction
+" noremap <silent> <Home> :call ExtendedHome()<CR>
 
 nnoremap <C-z> u
 
@@ -198,7 +250,6 @@ inoremap <buffer> ( <C-X><C-o><C-p>(|  " when opening a bracket: call the OmniCo
 set makeprg=make\ test
 nnoremap <F5> :!make<CR>|              " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that)
 
-
 "================================================================================
 " deactivated on-demand commands (just in case one needs them one day)
 "
-- 
cgit v1.2.3