diff --git a/defaults/main.yml b/defaults/main.yml index 988e71d..59c4e72 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,3 +12,8 @@ vimrc_users: [] vimrc_sys: - "syntax on" +vim_modeline: true +vim_modelines: 10 + +vim_syntax: true +vim_colorshell: true diff --git a/tasks/pathogen-plugins.yml b/tasks/pathogen-plugins.yml index 06c30ac..82a423c 100644 --- a/tasks/pathogen-plugins.yml +++ b/tasks/pathogen-plugins.yml @@ -1,4 +1,15 @@ --- +- file: + path: ~/.vim/ansible + state: directory + become: true + become_user: "{{item}}" + with_items: vimrc_users + +# +# Solarized +# + - name: Install Solarized plugin git: > repo=git://github.com/altercation/vim-colors-solarized.git @@ -9,6 +20,11 @@ become_user: "{{item}}" with_items: vimrc_users + +# +# NERDTREE +# + - name: Install Nerdtree plugin git: repo=https://github.com/scrooloose/nerdtree.git @@ -19,6 +35,20 @@ become_user: "{{item}}" with_items: vimrc_users +- template: + src=templates/plugin.nerdtree.j2 + dest=~/.vim/ansible/plugin.nerdtree + owner={{item}} + group={{item}} + mode=0644 + become: true + become_user: "{{item}}" + with_items: vimrc_users + + +# +# AutoComplPop +# - name: Install AutoComplPop plugin git: @@ -30,6 +60,9 @@ become_user: "{{item}}" with_items: vimrc_users +# +# Vim-fugitive +# - name: Install vim-fugitive plugin git: repo=https://github.com/tpope/vim-fugitive.git @@ -40,6 +73,17 @@ become_user: "{{item}}" with_items: vimrc_users +- template: + src=templates/plugin.fugitive.j2 + dest=~/.vim/ansible/plugin.fugitive + owner={{item}} + group={{item}} + mode=0644 + become: true + become_user: "{{item}}" + with_items: vimrc_users + + #- name: Install CtrlP # git: # repo=https://github.com/kien/ctrlp.vim.git @@ -130,30 +174,39 @@ become_user: "{{item}}" with_items: vimrc_users -- name: Install YouCompleteMe dependencies - apt: - name="{{item}}" - state=present - with_items: - - python-dev - - build-essential - - cmake - -- name: Fetch YouCompleteMe plugin - register: youcompleteme_git - git: - repo=https://github.com/Valloric/YouCompleteMe.git - dest=~/.vim/bundle/YouCompleteMe - update=yes - accept_hostkey=yes +- name: Uninstall YouCompleteMe plugin + file: + path: ~/.vim/bundle/YouCompleteMe + state: absent + #recurse: yes become: true become_user: "{{item}}" with_items: vimrc_users -- name: Build YouCompleteMe plugin - shell: cd ~/.vim/bundle/YouCompleteMe ; ./install.sh - become: true - become_user: "{{item}}" - with_items: vimrc_users - when: youcompleteme_git.changed - +# - name: Install YouCompleteMe dependencies +# apt: +# name="{{item}}" +# state=present +# with_items: +# - python-dev +# - build-essential +# - cmake +# +# - name: Fetch YouCompleteMe plugin +# register: youcompleteme_git +# git: +# repo=https://github.com/Valloric/YouCompleteMe.git +# dest=~/.vim/bundle/YouCompleteMe +# update=yes +# accept_hostkey=yes +# become: true +# become_user: "{{item}}" +# with_items: vimrc_users +# +# - name: Build YouCompleteMe plugin +# shell: cd ~/.vim/bundle/YouCompleteMe ; ./install.sh +# become: true +# become_user: "{{item}}" +# with_items: vimrc_users +# when: youcompleteme_git.changed + diff --git a/tasks/pathogen.yml b/tasks/pathogen.yml index ed4fb95..231124c 100644 --- a/tasks/pathogen.yml +++ b/tasks/pathogen.yml @@ -12,11 +12,12 @@ become_user: "{{item}}" with_items: vimrc_users -- lineinfile: > - dest=~/.vimrc - regexp=^execute.pathogen.infect - line="execute pathogen#infect()" - insertbefore="{{vimrc_boundary_end_regexp}}" - become: true - become_user: "{{item}}" - with_items: vimrc_users +# - lineinfile: > +# dest=~/.vimrc +# regexp=^execute.pathogen.infect +# line="source ~/.vim/ansible/pathogen.vim" +# insertbefore="{{vimrc_boundary_end_regexp}}" +# become: true +# become_user: "{{item}}" +# with_items: vimrc_users + diff --git a/tasks/vimrc.yml b/tasks/vimrc.yml index 585d9a1..b35c467 100644 --- a/tasks/vimrc.yml +++ b/tasks/vimrc.yml @@ -1,18 +1,28 @@ - -- lineinfile: > - dest=~/.vimrc - regexp="{{vimrc_boundary_begin_regexp}}" - line="{{vimrc_boundary_begin}}" - create=yes +- template: + src=templates/vimrc.j2 + dest=~/.vimrc + owner={{item}} + group={{item}} + mode=0644 become: true become_user: "{{item}}" with_items: vimrc_users -- lineinfile: > - dest=~/.vimrc - regexp="{{vimrc_boundary_end_regexp}}" - insertafter="{{vimrc_boundary_begin_regexp}}" - line="{{vimrc_boundary_end}}" - become: true - become_user: "{{item}}" - with_items: vimrc_users +# - lineinfile: > +# dest=~/.vimrc +# regexp="{{vimrc_boundary_begin_regexp}}" +# line="{{vimrc_boundary_begin}}" +# create=yes +# become: true +# become_user: "{{item}}" +# with_items: vimrc_users +# +# - lineinfile: > +# dest=~/.vimrc +# regexp="{{vimrc_boundary_end_regexp}}" +# insertafter="{{vimrc_boundary_begin_regexp}}" +# line="{{vimrc_boundary_end}}" +# become: true +# become_user: "{{item}}" +# with_items: vimrc_users +# diff --git a/templates/ft.mutt.j2 b/templates/ft.mutt.j2 new file mode 100644 index 0000000..ad761ae --- /dev/null +++ b/templates/ft.mutt.j2 @@ -0,0 +1,9 @@ + +autocmd BufRead,BufNewFile /tmp/mutt-* source $HOME/.vim/mutt.colors + +autocmd BufRead mutt* syntax on +autocmd BufRead mutt* set ft=mail +autocmd BufRead mutt* set textwidth=72 +autocmd BufRead mutt* set wrap + + diff --git a/templates/ft.ocaml-opam.j2 b/templates/ft.ocaml-opam.j2 new file mode 100644 index 0000000..b0c6a2b --- /dev/null +++ b/templates/ft.ocaml-opam.j2 @@ -0,0 +1,38 @@ + +" ## added by OPAM user-setup for vim / base ## 8a3125e39f347f6b9a1b167d8e564281 ## you can edit, but keep this line +let s:opam_share_dir = system("opam config var share") +let s:opam_share_dir = substitute(s:opam_share_dir, '[\r\n]*$', '', '') + +let s:opam_configuration = {} + +function! OpamConfOcpIndent() + let l:file = s:opam_share_dir . "/vim/syntax/ocp-indent.vim" + execute "source " . l:file +endfunction +let s:opam_configuration['ocp-indent'] = function('OpamConfOcpIndent') + +function! OpamConfOcpIndex() + let l:dir = s:opam_share_dir . "/ocp-index/vim" + execute "set rtp+=" . l:dir +endfunction +let s:opam_configuration['ocp-index'] = function('OpamConfOcpIndex') + +function! OpamConfMerlin() + let l:dir = s:opam_share_dir . "/merlin/vim" + execute "set rtp+=" . l:dir +endfunction +let s:opam_configuration['merlin'] = function('OpamConfMerlin') + +let s:opam_packages = ["ocp-indent", "ocp-index", "merlin"] +let s:opam_check_cmdline = ["opam list --installed --short --safe --color=never"] + s:opam_packages +let s:opam_available_tools = split(system(join(s:opam_check_cmdline, ' '))) +for tool in s:opam_available_tools + call s:opam_configuration[tool]() +endfor +" ## end of OPAM user-setup addition for vim / base ## keep this line + +" Ocaml Type Annotation +nnoremap :MerlinTypeOf +nnoremap :MerlinTypeOf + + diff --git a/templates/gui.j2 b/templates/gui.j2 new file mode 100644 index 0000000..161c47b --- /dev/null +++ b/templates/gui.j2 @@ -0,0 +1,2 @@ + +set guifont=DejaVu\ Sans\ Mono\ 11 diff --git a/templates/plugin.fugitive.j2 b/templates/plugin.fugitive.j2 new file mode 100644 index 0000000..a935475 --- /dev/null +++ b/templates/plugin.fugitive.j2 @@ -0,0 +1,7 @@ +" Fugitive : set key mapping +nnoremap gb :Gblame +nnoremap gs :Gstatus +nnoremap gd :Gdiff +nnoremap gw :Gwrite + + diff --git a/templates/plugin.nerdtree.j2 b/templates/plugin.nerdtree.j2 new file mode 100644 index 0000000..ca1bba8 --- /dev/null +++ b/templates/plugin.nerdtree.j2 @@ -0,0 +1,19 @@ +" NERDTree : Set NERDTree position +let NERDTreeWinPos="left" + +" NERDTree : Use as expected with mouse, (dir => single clic, file => double clic) +let NERDTreeMouseMode=2 + +" NERDTree : Run at startup +autocmd vimenter * NERDTree + +" NERDTree : Force focus to right buffer +autocmd vimenter * wincmd p + +" NERDTree : automatically close if it is the last window remaining +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif + +" NERDTree : map to ,nt +nnoremap nt :NERDTreeToggle +nnoremap nf :NERDTreeFind + diff --git a/templates/plugin.pencil.j2 b/templates/plugin.pencil.j2 new file mode 100644 index 0000000..71287d0 --- /dev/null +++ b/templates/plugin.pencil.j2 @@ -0,0 +1,9 @@ + +let g:pencil#wrapModeDefault = 'soft' " default is 'hard' + +augroup pencil + autocmd! + autocmd FileType markdown,mkd call pencil#init() + autocmd FileType text call pencil#init() +augroup END + diff --git a/templates/plugin.rails.j2 b/templates/plugin.rails.j2 new file mode 100644 index 0000000..bcd3b06 --- /dev/null +++ b/templates/plugin.rails.j2 @@ -0,0 +1,8 @@ + +" Rails : set key mapping +nnoremap rc :Rcontroller +nnoremap rv :Rview +nnoremap rh :Rhelper +nnoremap rm :Rmodel +nnoremap rs :Emodel + diff --git a/templates/plugin.rainbow-parentheses.j2 b/templates/plugin.rainbow-parentheses.j2 new file mode 100644 index 0000000..a6620fa --- /dev/null +++ b/templates/plugin.rainbow-parentheses.j2 @@ -0,0 +1,9 @@ + +" RainbowParenthesesActivate +" autocmd VimEnter * RainbowParenthesesActivate +au VimEnter * RainbowParenthesesToggle +au Syntax * RainbowParenthesesLoadRound +au Syntax * RainbowParenthesesLoadSquare +au Syntax * RainbowParenthesesLoadBraces + + diff --git a/templates/vimrc.j2 b/templates/vimrc.j2 new file mode 100644 index 0000000..ec6f590 --- /dev/null +++ b/templates/vimrc.j2 @@ -0,0 +1,180 @@ +" BEGIN Ansible glenux.vim -- DO NOT MODIFY +" vim: set ts=2 sw=2 et: + +{% if vim_modeline %} +set modeline +set modelines={{vim_modelines}} +{% endif %} + +{% if vim_syntax %} +syntax on +{%endif%} + +{% if vim_colorshell %} +set t_Co=256 +{%endif%} + +":set nu +set backupdir=$HOME/tmp +set dir=$HOME/tmp + +" Wild menu +set wildmenu +set wildmode=longest:list + +" Redefine key in vim +let mapleader = "," + +set colorcolumn=80,120 +nnoremap c :set cursorline! cursorcolumn! +"autocmd WinEnter * setlocal cursorline +"autocmd WinLeave * setlocal nocursorline + +nmap :w:make:cw + +" Make sure that your status line is always shown as the second last line in +" the editor window: +set laststatus=2 + + +{% if vim_colorshell %} +" Folds +" ===== + +set foldmethod=indent " Fold based on indent +set foldnestmax=3 " Deepest fold is 3 levels +set nofoldenable " Don't fold by default +set foldcolumn=2 +set foldmethod=marker +{%endif%} + +" Spell check parameters +set spelllang=fr_FR +set spellfile=$HOME/.vim/spell/generic.fr.add +highlight SpellBad ctermfg=NONE ctermbg=NONE cterm=underline,bold +highlight SpellCap ctermfg=NONE ctermbg=NONE cterm=underline,bold +highlight SpellLocal ctermfg=NONE ctermbg=NONE cterm=underline,bold +highlight MatchParen cterm=bold ctermfg=NONE ctermbg=NONE + + +" Cursor management +" ================= + +" Number of visible lines to keep above/below the cursor +set scrolloff=3 + +" Show cursor position (line, col) +set ruler + +set list + +"set smarttab softtabstop=8 tabstop=8 shiftwidth=4 noexpandtab list +set listchars=tab:~.,trail:.,nbsp:� + +" Mouse parameters +" ================ + +" mouse parameters +set mouse=a + +" send more characters for redraw +set ttyfast + +" Set this to the name of your terminal that supports mouse codes. +" Must be one of: xterm, xterm2, netterm, dec, jsbterm, pterm +set ttymouse=xterm2 + +set nocompatible + +call pathogen#infect() + +" Disable views when using Rails plugin +"" autocmd BufWinLeave * silent! mkview +"" autocmd BufWinEnter * silent! loadview + +"autocmd BufReadPost * +" \ if line("'\"") > 0 && line("'\"") <= line("$") | +" \ exe "normal g`\"" | +" \ endif + +filetype plugin indent on +filetype plugin on + +" Default text indent, tab, width +set noexpandtab copyindent preserveindent softtabstop=0 shiftwidth=4 tabstop=4 + +autocmd BufNewFile,BufRead *.t2t set ft=txt2tags +autocmd BufNewFile,BufRead *.md set ft=markdown + +autocmd FileType css,scss,less set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType javascript set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType markdown set tabstop=4 shiftwidth=4 softtabstop=0 nosmarttab expandtab list textwidth=0 +autocmd FileType haml set tabstop=2 shiftwidth=2 softtabstop=0 nosmarttab expandtab list textwidth=0 +autocmd FileType xhtml,html set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType c set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType cpp set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType java set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType python set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab list textwidth=0 +autocmd FileType ruby set tabstop=2 shiftwidth=2 softtabstop=0 smarttab expandtab nolist textwidth=0 +autocmd FileType php set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType sh set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 +autocmd FileType make set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab list textwidth=0 +autocmd FileType xsd,xml set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 + +autocmd BufNewFile,BufRead * + \ syntax match GNUX_TAGS /FIXME\s*:/ containedin=ALL contained | + \ syntax match GNUX_TAGS /TOREAD\s*:/ containedin=ALL contained | + \ highlight GNUX_TAGS ctermbg=darkred ctermfg=green + +"autocmd FileType python source ~/.vim/scripts/python.vim +highlight Folded guibg=gray15 guifg=gray50 + + +highlight TabLine term=none cterm=none +"highlight TabLineSel ctermbg=darkred + +syntax match TAB_CHAR /^[ ]*/ +"syntax match TAB_CHAR /\t/ +highlight link TAB_CHAR Error + +{% if false %} +"set cursorline +"highlight CursorLine term=reverse cterm=reverse +" +"au FileType haskell,vhdl,ada,ocaml let b:comment_leader = '-- ' +"au FileType vim let b:comment_leader = '" ' +"au FileType c,cpp,java let b:comment_leader = '// ' +"au FileType sh,make let b:comment_leader = '# ' +"au FileType tex let b:comment_leader = '% ' +"noremap ,c :sil s/^/=escape(b:comment_leader,'\/')/:noh +"noremap ,u :sil s/^\V=escape(b:comment_leader,'\/')//e:noh + +"set background=dark +"highlight PreProc ctermfg=5 cterm=bold "cyan +"highlight Comment ctermfg=9 "bright red +"highlight String ctermfg=7 "dark white +"highlight Normal guibg=Black guifg=White +{% endif %} + +" Display settings +"set background=light +set background=dark +"let g:solarized_termcolors=256 +colorscheme desert +hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white +hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white + + +" Buffer management : show buffer list & choose +nnoremap :buffers:buffer + +" Plugin-specific configuration +if filereadable($HOME . '/.vim/ansible/plugin.fugitive') + source ~/.vim/ansible/plugin.fugitive +endif +if filereadable($HOME . '/.vim/ansible/plugin.nerdtree') + source ~/.vim/ansible/plugin.nerdtree +endif + +" END Ansible glenux.vim + diff --git a/templates/vimrc.jinja2 b/templates/vimrc.jinja2 deleted file mode 100644 index b49ee2a..0000000 --- a/templates/vimrc.jinja2 +++ /dev/null @@ -1,261 +0,0 @@ - -{% if vim_modeline %} -set modeline -set modelines={{vim_modelines}} -{% endif %} - -{% if vim.syntax %} -syntax on -{%endif%} - -set t_Co=256 - -":set nu -set backupdir=$HOME/tmp -set dir=$HOME/tmp - -" Wild menu -set wildmenu -set wildmode=longest:list - -" Redefine key in vim -let mapleader = "," - -set colorcolumn=80,120 -nnoremap c :set cursorline! cursorcolumn! -"autocmd WinEnter * setlocal cursorline -"autocmd WinLeave * setlocal nocursorline - -nmap :w:make:cw - -" Make sure that your status line is always shown as the second last line in -" the editor window: -set laststatus=2 - - -" Folds -" ===== - -set foldmethod=indent " Fold based on indent -set foldnestmax=3 " Deepest fold is 3 levels -set nofoldenable " Don't fold by default -set foldcolumn=2 -set foldmethod=marker - -" Spell check parameters -set spelllang=fr_FR -set spellfile=$HOME/.vim/spell/generic.fr.add -highlight SpellBad ctermfg=NONE ctermbg=NONE cterm=underline,bold -highlight SpellCap ctermfg=NONE ctermbg=NONE cterm=underline,bold -highlight SpellLocal ctermfg=NONE ctermbg=NONE cterm=underline,bold -highlight MatchParen cterm=bold ctermfg=NONE ctermbg=NONE - -" Number of visible lines to keep above/below the cursor -set scrolloff=3 - -" Show cursor position (line, col) -set ruler - - -set list - -"set smarttab softtabstop=8 tabstop=8 shiftwidth=4 noexpandtab list -set listchars=tab:~.,trail:.,nbsp:� - -" Mouse parameters -" ================ - -" mouse parameters -set mouse=a - -" send more characters for redraw -set ttyfast - -" Set this to the name of your terminal that supports mouse codes. -" Must be one of: xterm, xterm2, netterm, dec, jsbterm, pterm -set ttymouse=xterm2 - -if !has("compatible") - call pathogen#infect() - - " Disable views when using Rails plugin - "" autocmd BufWinLeave * silent! mkview - "" autocmd BufWinEnter * silent! loadview - - "autocmd BufReadPost * - " \ if line("'\"") > 0 && line("'\"") <= line("$") | - " \ exe "normal g`\"" | - " \ endif - - filetype plugin indent on - filetype plugin on - - " Text indent, tab, width - set noexpandtab - set copyindent - set preserveindent - set softtabstop=0 - set shiftwidth=4 - set tabstop=4 - - autocmd BufRead mutt* syntax on - autocmd BufRead mutt* set ft=mail - autocmd BufRead mutt* set textwidth=72 - autocmd BufRead mutt* set wrap - - autocmd BufNewFile,BufRead *.t2t set ft=txt2tags - autocmd BufNewFile,BufRead *.md set ft=markdown - - let g:pencil#wrapModeDefault = 'soft' " default is 'hard' - - augroup pencil - autocmd! - autocmd FileType markdown,mkd call pencil#init() - autocmd FileType text call pencil#init() - augroup END - - autocmd FileType css,scss,less set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType javascript set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType markdown set tabstop=4 shiftwidth=4 softtabstop=0 nosmarttab expandtab list textwidth=0 - autocmd FileType haml set tabstop=2 shiftwidth=2 softtabstop=0 nosmarttab expandtab list textwidth=0 - autocmd FileType xhtml,html set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType c set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType cpp set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType java set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType python set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab list textwidth=0 - autocmd FileType ruby set tabstop=2 shiftwidth=2 softtabstop=0 smarttab expandtab nolist textwidth=0 - autocmd FileType php set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType sh set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd FileType make set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab list textwidth=0 - autocmd FileType xsd,xml set tabstop=4 shiftwidth=4 softtabstop=0 smarttab noexpandtab nolist textwidth=0 - autocmd BufRead,BufNewFile /tmp/mutt-* source $HOME/.vim/mutt.colors - - "autocmd FileType python set - "\ softtabstop=4 - " \ autoindent - " \ smartindent - - autocmd BufNewFile,BufRead * - \ syntax match GNUX_TAGS /FIXME\s*:/ containedin=ALL contained | - \ syntax match GNUX_TAGS /TOREAD\s*:/ containedin=ALL contained | - \ highlight GNUX_TAGS ctermbg=darkred ctermfg=green -endif - -"autocmd FileType python source ~/.vim/scripts/python.vim -highlight Folded guibg=gray15 guifg=gray50 - - -highlight TabLine term=none cterm=none -"highlight TabLineSel ctermbg=darkred - -syntax match TAB_CHAR /^[ ]*/ -"syntax match TAB_CHAR /\t/ -highlight link TAB_CHAR Error - -"set cursorline -"highlight CursorLine term=reverse cterm=reverse -"au FileType haskell,vhdl,ada,ocaml let b:comment_leader = '-- ' -"au FileType vim let b:comment_leader = '" ' -"au FileType c,cpp,java let b:comment_leader = '// ' -"au FileType sh,make let b:comment_leader = '# ' -"au FileType tex let b:comment_leader = '% ' -"noremap ,c :sil s/^/=escape(b:comment_leader,'\/')/:noh -"noremap ,u :sil s/^\V=escape(b:comment_leader,'\/')//e:noh - -"set background=dark -"highlight PreProc ctermfg=5 cterm=bold "cyan -"highlight Comment ctermfg=9 "bright red -"highlight String ctermfg=7 "dark white -"highlight Normal guibg=Black guifg=White - -" Display settings -"set background=light -set background=dark -"let g:solarized_termcolors=256 -colorscheme desert -set guifont=DejaVu\ Sans\ Mono\ 9 -hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white -hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white - -set guifont=DejaVu\ Sans\ Mono\ 11 - -" NERDTree : Set NERDTree position -let NERDTreeWinPos="left" - -" NERDTree : Use as expected with mouse, (dir => single clic, file => double clic) -let NERDTreeMouseMode=2 - -" NERDTree : Run at startup -autocmd vimenter * NERDTree - -" NERDTree : Force focus to right buffer -autocmd vimenter * wincmd p - -" NERDTree : automatically close if it is the last window remaining -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif - -" NERDTree : map to ,nt -nnoremap nt :NERDTreeToggle -nnoremap nf :NERDTreeFind - -" RainbowParenthesesActivate -" autocmd VimEnter * RainbowParenthesesActivate -au VimEnter * RainbowParenthesesToggle -au Syntax * RainbowParenthesesLoadRound -au Syntax * RainbowParenthesesLoadSquare -au Syntax * RainbowParenthesesLoadBraces - - -" Fugitive : set key mapping -nnoremap gb :Gblame -nnoremap gs :Gstatus -nnoremap gd :Gdiff -nnoremap gw :Gwrite - -" Rails : set key mapping -nnoremap rc :Rcontroller -nnoremap rv :Rview -nnoremap rh :Rhelper -nnoremap rm :Rmodel -nnoremap rs :Emodel - - -" Buffer management : show buffer list & choose -nnoremap :buffers:buffer - -" ## added by OPAM user-setup for vim / base ## 8a3125e39f347f6b9a1b167d8e564281 ## you can edit, but keep this line -let s:opam_share_dir = system("opam config var share") -let s:opam_share_dir = substitute(s:opam_share_dir, '[\r\n]*$', '', '') - -let s:opam_configuration = {} - -function! OpamConfOcpIndent() - let l:file = s:opam_share_dir . "/vim/syntax/ocp-indent.vim" - execute "source " . l:file -endfunction -let s:opam_configuration['ocp-indent'] = function('OpamConfOcpIndent') - -function! OpamConfOcpIndex() - let l:dir = s:opam_share_dir . "/ocp-index/vim" - execute "set rtp+=" . l:dir -endfunction -let s:opam_configuration['ocp-index'] = function('OpamConfOcpIndex') - -function! OpamConfMerlin() - let l:dir = s:opam_share_dir . "/merlin/vim" - execute "set rtp+=" . l:dir -endfunction -let s:opam_configuration['merlin'] = function('OpamConfMerlin') - -let s:opam_packages = ["ocp-indent", "ocp-index", "merlin"] -let s:opam_check_cmdline = ["opam list --installed --short --safe --color=never"] + s:opam_packages -let s:opam_available_tools = split(system(join(s:opam_check_cmdline, ' '))) -for tool in s:opam_available_tools - call s:opam_configuration[tool]() -endfor -" ## end of OPAM user-setup addition for vim / base ## keep this line - -" Ocaml Type Annotation -nnoremap :MerlinTypeOf -nnoremap :MerlinTypeOf -