From 52fd0111c4f25de7cceb7db4ef8243931513ad57 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 14 Nov 2015 03:17:00 +0100 Subject: [PATCH] Added folding --- vim/.vimrc | 78 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 722fc7a..c59bfe6 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,14 +1,15 @@ set nocompatible filetype off -" --- init vundle +" --- init vundle {{{ set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " --- Let Vundle manage Vundle Plugin 'VundleVim/Vundle.vim' +" }}} -" --- My plugins +" --- My plugins {{{ Plugin 'scrooloose/nerdtree' " FileBrowser on the left side Plugin 'ervandew/supertab' "Auto completion Plugin 'ap/vim-templates' "File templates @@ -27,12 +28,14 @@ Plugin 'vim-scripts/L9' "dependency for FuzzyFinder Plugin 'vim-scripts/FuzzyFinder' "Fuzzy finding Plugin 'cohama/lexima.vim' "Auto pairs Plugin 'tpope/vim-surround' "Vim surround +" }}} -" --- End init vundle +" --- End init vundle {{{ call vundle#end() filetype plugin indent on +" }}} -" --- General configurations +" --- General configurations {{{ set whichwrap+=<,>,[,] set autoread "auto read file if changed set wildmenu "Command completion @@ -73,14 +76,27 @@ set backup set writebackup set backupdir=~/.vim/backup// set directory=~/.vim/backup// +" we dont need to show the mode +set noshowmode -" Abbreviations +" }}} + +" --- Abbreviations {{{ iab _DATE =strftime("%A, %d. %B %Y %H:%M") +" }}} -" Autoload when saving vimrc +" --- Autoload when saving vimrc {{{ au! BufWritePost .vimrc source ~/.vimrc +" }}} -" --- Own functions +" --- Vim file easyfolding {{{ +augroup ft_vim + au! + au FileType vim setlocal foldmethod=marker +augroup END +" }}} + +" --- Own functions {{{ function! AddSemicolon() normal m'A; normal `' @@ -99,8 +115,9 @@ function! IsModified() endif return '' endfunction +" }}} -" Show insert mode in statusbar +" --- ModeColor {{{ function! ModeColor(mode) if a:mode == 'i' if &paste @@ -115,17 +132,13 @@ function! ModeColor(mode) endif endfunction -" Remove current buffer -function! BufferClose() - -endfunction - au InsertEnter * call ModeColor(v:insertmode) au InsertChange * call ModeColor(v:insertmode) au InsertLeave * call ModeColor('n') call ModeColor('n') +" }}} -" --- Bindings +" --- Bindings {{{ let mapleader = "," " word movement with tab nnoremap W @@ -167,6 +180,7 @@ nnoremap l nnoremap h nnoremap j nnoremap k +nnoremap K :q " Quick macroing nnoremap Q @@ " --- Don't need a help @@ -178,13 +192,14 @@ map Y y$ " -- Easy indenting in visual vnoremap > >gv vnoremap < -nmap ) -nmap { -nmap } -nmap [ -nmap ] + +" Automatic running +autocmd filetype python nnoremap :w:!python % + +" Easy changing +nnoremap " f"ci" +nnoremap ( f)ci( +nnoremap ' f'ci' " Sudo to write cnoremap w!! w !sudo tee % >/dev/null @@ -200,12 +215,14 @@ ino " --- Different use of undo nnoremap U +" }}} -" --- We don't need useless whitespace at the end of the line +" --- Useless whitespaces {{{ highlight WhitespaceEOL ctermbg=Red guibg=Red match WhitespaceEOL /\s\+$/ +" }}} -" --- Rice +" --- Rice {{{ set statusline=\ %#Modified#%{IsModified()}%* set statusline+=%f set statusline+=\ %#ModeLine#%=%* @@ -215,11 +232,13 @@ hi Modified ctermfg=red hi StatusLine cterm=None ctermfg=green ctermbg=none hi Search cterm=NONE ctermfg=none ctermbg=none hi IncSearch cterm=underline ctermbg=none ctermfg=green +" }}} -" --- Supertab +" --- Supertab {{{ let g:SuperTabNoCompleteAfter = ['^',',','\s'] +" }}} -" --- NERDTree tabs +" --- NERDTree config {{{ nmap e :NERDTreeToggle autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif @@ -230,16 +249,17 @@ let NERDTreeIgnore=['\~$','\.pyc$','\.swp$'] let NERDTreeWinPos="left" let NERDTreeMinimalUI = 1 let NERDTreeQuitOnOpen = 1 +" }}} -" --- EasyMotion +" --- EasyMotion config {{{ map / (easymotion-sn) omap / (easymotion-tn) map ? (easymotion-bd-jk) map n (easymotion-next) map N (easymotion-prev) +" }}} -" --- Auto pairs +" --- Auto pairs config {{{ let g:lexima_enable_basic_rules = 1 - -" --- Sparkup +" }}}