From b512cd2427ce23bcd36c8b0bbdc9fcb6f6047e93 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Tue, 5 May 2015 08:29:12 +0100 Subject: reorganised vimrc --- vim/after/ftplugin/vim/folding.vim | 50 +++++++++++++++--------------- vimrc | 62 +++++++++++++++++--------------------- 2 files changed, 53 insertions(+), 59 deletions(-) diff --git a/vim/after/ftplugin/vim/folding.vim b/vim/after/ftplugin/vim/folding.vim index 7f8f28d..1454cbe 100644 --- a/vim/after/ftplugin/vim/folding.vim +++ b/vim/after/ftplugin/vim/folding.vim @@ -1,25 +1,25 @@ -" function! VimFolds() -" let thisline = getline(v:lnum) -" if match(thisline,'^"" ') >= 0 -" return ">1" -" elseif match(thisline,'^" ') >=0 -" return ">1" -" else -" return "=" -" endif -" endfunction -" -" function! VimFoldText() -" let startline = getline(v:foldstart) -" if match(startline,'^"" ') >= 0 -" let title = substitute(startline,'^"" \(.*\)$','\1',"") -" return '# ' . title -" elseif match(startline,'^" ') >=0 -" let title = substitute(startline,'^" \(.*\)$','\1',"") -" return ' ## ' .title -" endif -" endfunction -" -" setlocal foldmethod=expr -" setlocal foldexpr=VimFolds() -" setlocal foldtext=VimFoldText() +function! VimFolds() + let thisline = getline(v:lnum) + if match(thisline,'^"" ') >= 0 + return ">1" + elseif match(thisline,'^" ') >=0 + return ">1" + else + return "=" + endif +endfunction + +function! VimFoldText() + let startline = getline(v:foldstart) + if match(startline,'^"" ') >= 0 + let title = substitute(startline,'^"" \(.*\)$','\1',"") + return '# ' . title + elseif match(startline,'^" ') >=0 + let title = substitute(startline,'^" \(.*\)$','\1',"") + return ' ## ' .title + endif +endfunction + +setlocal foldmethod=expr +setlocal foldexpr=VimFolds() +setlocal foldtext=VimFoldText() diff --git a/vimrc b/vimrc index 3072d86..114ada4 100644 --- a/vimrc +++ b/vimrc @@ -1,9 +1,10 @@ +"" Required by vundle set nocompatible filetype off set rtp+=~/.vim/bundle/vundle/ call vundle#rc() -"" Plugins +"" Plugins Plugin 'gmarik/vundle' Plugin 'LaTeX-Box-Team/latex-box' Plugin 'SirVer/ultisnips' @@ -33,13 +34,7 @@ Plugin 'tpope/vim-unimpaired' filetype plugin indent on syntax on -" Leader maps -let mapleader = "\\" -let maplocalleader = "-" -nmap - -" Plugins options - +"" Plugins options let g:LatexBox_Folding=0 let g:LatexBox_latexmk_preview_continuously=1 let g:LatexBox_quickfix=2 @@ -87,43 +82,37 @@ let g:tmuxline_preset = {'a':'#H','b':'#S','win':'#W','cwin':'#W','x':'%R','y':' let g:tmuxline_separators = {'left':'','left_alt':'>','right':'','right_alt':'<','space':' '} let g:tmuxline_theme='airline' -" let g:ycm_key_list_select_completion=[] -" let g:ycm_key_list_previous_completion=[] - let NERDTreeIgnore=['\.pdf$', '\~$','\.toc$', \ '\.fls$','\.bbl$','\.blg$', \ '\.out$', '\.log$','\.aux$','\.sty$', \ '\.fdb_latexmk$', '\.synctex.gz$','\.latexmain$'] -"" Options +"" Vim options -" Tabs and indent +" Tabs and indent set smartindent set expandtab set tabstop=4 set softtabstop=4 set shiftwidth=4 -" Folds +" Folds set foldcolumn=0 set foldenable set foldmethod=expr set foldlevel=0 -" Search -set nohlsearch - -" Back up files +" Back up files set noswapfile set nowritebackup set undofile set undodir=/home/urbain/.vim/vimundo/ -" Layout window +" Layout window set nonumber set listchars=tab:▸\ ,eol:¬,trail:- set fillchars=fold:\ ,vert:\ , -set showbreak=... +set showbreak=--▸\ , set breakindent set colorcolumn=0 set scrolloff=0 @@ -131,7 +120,7 @@ set t_Co=256 set guitablabel=%N\ %t\ %M set showcmd -" Layout text +" Layout text set nowrap set linebreak set textwidth=0 @@ -139,21 +128,28 @@ set conceallevel=2 set formatprg=par\ w70 set guifont=Monaco\ 11 -" Case and spell +" Case and spell set nospell set smartcase set ignorecase -" Misc +" Misc set noautochdir -set cpoptions+=I +set cpoptions+=Iq set encoding=utf-8 set mouse=a set clipboard=unnamedplus set lazyredraw +" Colorscheme +try | colorscheme solarized | catch | endtry + +"" Maps -" Leader-maps +" Definition of leaders +let mapleader = "\\" +let maplocalleader = "-" +nmap " Tabs nnoremap we :tabedit @@ -161,14 +157,15 @@ nnoremap wn :tabnew nnoremap wo :tabonly " Toggles +nnoremap tb :let &background = ( &background == "dark"? "light" : "dark" ) +nnoremap tg :GitGutterToggle nnoremap th :set hlsearch! -nnoremap tr :set relativenumber! +nnoremap tl :set list! nnoremap tn :set number! nnoremap tp :set paste! -nnoremap tg :GitGutterToggle +nnoremap tr :set relativenumber! nnoremap tt :NERDTreeToggle nnoremap tu :GundoToggle -nnoremap tb :let &background = ( &background == "dark"? "light" : "dark" ) " Sourcing nnoremap sv :source ~/.vimrc @@ -185,16 +182,16 @@ nnoremap q :bd! nnoremap i zzmxgg=G'x nnoremap sw :%s/\s\+$// nnoremap - -nnoremap h :e %:p:s,.hpp$,.X123X,:s,.cpp$,.hpp,:s,.X123X$,.cpp, - nnoremap o nnoremap O nnoremap J mzJ`z nnoremap Y y$ +nnoremap _ _ +nnoremap h :e %:p:s,.hpp$,.X123X,:s,.cpp$,.hpp,:s,.X123X$,.cpp, nnoremap 3 nnoremap 3 +nnoremap + za " Dvorak specific nnoremap : , @@ -206,6 +203,3 @@ vnoremap , : if has('nvim') tmap jk endif - -"" Colorscheme -try | colorscheme solarized | catch | endtry -- cgit v1.2.3