summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2015-05-05 10:11:22 +0100
committerUrbain Vaes <urbain@vaes.uk>2015-05-05 10:11:22 +0100
commit4bc51e7b9de161d88499809fdbfde9b1f14f0574 (patch)
treeb5cad37b3ce552254c58deed21f475979b95b2b3
parentde0abc242b09222489ed667a9becdb42a7a602fd (diff)
parentb512cd2427ce23bcd36c8b0bbdc9fcb6f6047e93 (diff)
Merge branch 'master' of github.com:uvaes/dotfiles
Conflicts: vimrc
-rw-r--r--vim/after/ftplugin/vim/folding.vim50
l---------vim/vim1
-rw-r--r--vimrc70
3 files changed, 58 insertions, 63 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/vim/vim b/vim/vim
new file mode 120000
index 0000000..7c09735
--- /dev/null
+++ b/vim/vim
@@ -0,0 +1 @@
+/home/urbain/dotfiles/vim \ No newline at end of file
diff --git a/vimrc b/vimrc
index 7f8698c..3526948 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 <Space> <Leader>
-
-" 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
-" Leader-maps
+"" Maps
+
+" Definition of leaders
+let mapleader = "\\"
+let maplocalleader = "-"
+nmap <Space> <Leader>
" Tabs
nnoremap <Leader>we :tabedit
@@ -161,14 +157,15 @@ nnoremap <Leader>wn :tabnew<cr>
nnoremap <Leader>wo :tabonly<cr>
" Toggles
+nnoremap <Leader>tb :let &background = ( &background == "dark"? "light" : "dark" )<CR>
+nnoremap <Leader>tg :GitGutterToggle<cr>
nnoremap <Leader>th :set hlsearch!<cr>
-nnoremap <Leader>tr :set relativenumber!<cr>
+nnoremap <Leader>tl :set list!<cr>
nnoremap <Leader>tn :set number!<cr>
nnoremap <Leader>tp :set paste!<cr>
-nnoremap <Leader>tg :GitGutterToggle<cr>
+nnoremap <Leader>tr :set relativenumber!<cr>
nnoremap <Leader>tt :NERDTreeToggle<cr>
nnoremap <Leader>tu :GundoToggle<cr>
-nnoremap <Leader>tb :let &background = ( &background == "dark"? "light" : "dark" )<CR>
" Sourcing
nnoremap <Leader>sv :source ~/.vimrc<cr>
@@ -189,21 +186,21 @@ nnoremap <Leader>et :e ~/.tmux.conf<cr>
nnoremap <Leader>fw :%s/\s\+$//<cr>
nnoremap <Leader>fi zzmxgg=G'x
+" Navigation
+nnoremap <c-y> 3<c-y>
+nnoremap <c-e> 3<c-e>
+nnoremap <Return> o<Esc>
+nnoremap <s-Return> O<Esc>
+
" Misc
nnoremap <tab> <C-^>
nnoremap Q :bd!<cr>
nnoremap _ :w<cr>
nnoremap <Leader>q :q!<cr>
-
nnoremap <LocalLeader>h :e %:p:s,.hpp$,.X123X,:s,.cpp$,.hpp,:s,.X123X$,.cpp,<CR>
-
-nnoremap <Return> o<Esc>
-nnoremap <s-Return> O<Esc>
nnoremap J mzJ`z
nnoremap Y y$
-
-nnoremap <c-y> 3<c-y>
-nnoremap <c-e> 3<c-e>
+nnoremap + za
" Dvorak specific
nnoremap : ,
@@ -215,6 +212,3 @@ vnoremap , :
if has('nvim')
tmap jk <C-\><C-n>
endif
-
-"" Colorscheme
-try | colorscheme solarized | catch | endtry