Install plugin-specific configuration files.

This commit is contained in:
Glenn Y. Rolland 2015-12-27 19:45:10 +01:00
parent a9e675f245
commit f2c70b222c
12 changed files with 93 additions and 32 deletions

View file

@ -22,7 +22,7 @@
# #
# NERDTREE # NERDTree
# #
- name: Install Nerdtree plugin - name: Install Nerdtree plugin
@ -36,8 +36,8 @@
with_items: vimrc_users with_items: vimrc_users
- template: - template:
src=templates/plugin.nerdtree.j2 src=templates/plugin.nerdtree.vim.j2
dest=~/.vim/ansible/plugin.nerdtree dest=~/.vim/ansible/plugin.nerdtree.vim
owner={{item}} owner={{item}}
group={{item}} group={{item}}
mode=0644 mode=0644
@ -74,8 +74,8 @@
with_items: vimrc_users with_items: vimrc_users
- template: - template:
src=templates/plugin.fugitive.j2 src=templates/plugin.fugitive.vim.j2
dest=~/.vim/ansible/plugin.fugitive dest=~/.vim/ansible/plugin.fugitive.vim
owner={{item}} owner={{item}}
group={{item}} group={{item}}
mode=0644 mode=0644
@ -93,6 +93,9 @@
# become: true # become: true
# become_user: "{{vim_user}}" # become_user: "{{vim_user}}"
#
# Rainbow parentheses:
#
- name: Install rainbow_parentheses plugin - name: Install rainbow_parentheses plugin
git: git:
repo=https://github.com/kien/rainbow_parentheses.vim.git repo=https://github.com/kien/rainbow_parentheses.vim.git
@ -103,6 +106,20 @@
become_user: "{{item}}" become_user: "{{item}}"
with_items: vimrc_users with_items: vimrc_users
- template:
src=templates/plugin.rainbow-parentheses.vim.j2
dest=~/.vim/ansible/plugin.rainbow-parentheses.vim
owner={{item}}
group={{item}}
mode=0644
become: true
become_user: "{{item}}"
with_items: vimrc_users
#
# Syntastic: ...
#
- name: Install syntastic plugin - name: Install syntastic plugin
git: git:
repo=https://github.com/scrooloose/syntastic.git repo=https://github.com/scrooloose/syntastic.git
@ -134,6 +151,10 @@
become_user: "{{item}}" become_user: "{{item}}"
with_items: vimrc_users with_items: vimrc_users
#
# Javascript
#
- name: Install vim-javascript plugin - name: Install vim-javascript plugin
git: git:
repo=https://github.com/pangloss/vim-javascript.git repo=https://github.com/pangloss/vim-javascript.git
@ -154,6 +175,9 @@
become_user: "{{item}}" become_user: "{{item}}"
with_items: vimrc_users with_items: vimrc_users
#
# Rails
#
- name: Install vim-rails plugin - name: Install vim-rails plugin
git: git:
repo=https://github.com/tpope/vim-rails.git repo=https://github.com/tpope/vim-rails.git
@ -164,6 +188,19 @@
become_user: "{{item}}" become_user: "{{item}}"
with_items: vimrc_users with_items: vimrc_users
- template:
src=templates/plugin.rails.vim.j2
dest=~/.vim/ansible/plugin.rails.vim
owner={{item}}
group={{item}}
mode=0644
become: true
become_user: "{{item}}"
with_items: vimrc_users
#
# vim-sensible: a universal set of defaults that (hopefully) everyone can agree on
#
- name: Install vim-sensible plugin - name: Install vim-sensible plugin
git: git:
repo=https://github.com/tpope/vim-sensible.git repo=https://github.com/tpope/vim-sensible.git
@ -174,6 +211,23 @@
become_user: "{{item}}" become_user: "{{item}}"
with_items: vimrc_users with_items: vimrc_users
#
# vim-pencil: rethinking Vim as a tool for writing
#
- name: Install vim-pencil plugin
git:
repo=https://github.com/reedes/vim-pencil.git
dest=~/.vim/bundle/vim-pencil
update=yes
accept_hostkey=yes
become: true
become_user: "{{item}}"
with_items: vimrc_users
#
# YouCompleteMe
#
- name: Uninstall YouCompleteMe plugin - name: Uninstall YouCompleteMe plugin
file: file:
path: ~/.vim/bundle/YouCompleteMe path: ~/.vim/bundle/YouCompleteMe

View file

@ -7,7 +7,7 @@
become_user: "{{item[1]}}" become_user: "{{item[1]}}"
with_nested: with_nested:
- [ '~/.vim/autoload', '~/.vim/bundle' ] - [ '~/.vim/autoload', '~/.vim/bundle' ]
- users - vimrc_users
- name: Install Pathogen - name: Install Pathogen
get_url: > get_url: >

View file

@ -1,19 +0,0 @@
" 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 <Leader>nt :NERDTreeToggle<CR>
nnoremap <Leader>nf :NERDTreeFind<CR>

View file

@ -0,0 +1,26 @@
" NERDTree
" ========
" Open a NERDTree automatically when vim starts up?
autocmd vimenter * NERDTree
" open a NERDTree automatically when vim starts up if no files were specified?
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Set NERDTree position
let NERDTreeWinPos="left"
" Use as expected with mouse, (dir => single clic, file => double clic)
let NERDTreeMouseMode=2
" Force focus to right buffer
autocmd vimenter * wincmd p
" Close vim if the only window left open is a NERDTree?
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Add shortcuts
nnoremap <Leader>nt :NERDTreeToggle<CR>
nnoremap <Leader>nf :NERDTreeFind<CR>

View file

@ -1,9 +1,12 @@
" Vim-Pencil
" ==========
let g:pencil#wrapModeDefault = 'soft' " default is 'hard' let g:pencil#wrapModeDefault = 'soft' " default is 'hard'
augroup pencil augroup pencil
autocmd! autocmd!
autocmd FileType markdown,mkd call pencil#init() autocmd FileType markdown,mkd call pencil#init()
autocmd FileType text call pencil#init() " autocmd FileType text call pencil#init()
augroup END augroup END

View file

@ -169,12 +169,9 @@ hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=whi
nnoremap <F5> :buffers<CR>:buffer<Space> nnoremap <F5> :buffers<CR>:buffer<Space>
" Plugin-specific configuration " Plugin-specific configuration
if filereadable($HOME . '/.vim/ansible/plugin.fugitive') for f in split(glob('~/.vim/ansible/*.vim'), '\n')
source ~/.vim/ansible/plugin.fugitive exe 'source' f
endif endfor
if filereadable($HOME . '/.vim/ansible/plugin.nerdtree')
source ~/.vim/ansible/plugin.nerdtree
endif
" END Ansible glenux.vim " END Ansible glenux.vim