# vim
- name: ctags link
  become: true
  file:
    src: /usr/bin/ctags
    path: /usr/local/bin/ctags
    state: link
- name: vimrc
  copy:
    src: .vimrc
    dest: '{{ansible_user_dir}}/.vimrc'
- name: vim bundles
  synchronize:
    src: .vim/
    dest: '{{ansible_user_dir}}/.vim'
    delete: yes
    copy_links: yes
    verify_host: no
    recursive: yes
    checksum: yes
    archive: no
    perms: yes
- name: vimrc for root
  become: true
  copy:
    src: .vimrc
    dest: '/root/.vimrc'
  when: ansible_user_id != 'root'
- name: vim bundles
  become: true
  synchronize:
    src: .vim/
    dest: '/root/.vim'
    delete: yes
    copy_links: yes
    verify_host: no
    recursive: yes
    checksum: yes
    archive: no
    perms: yes
  when: ansible_user_id != 'root'
#- name: vim-editorconfig
#  git:
#    repo: https://github.com/editorconfig/editorconfig-vim.git
#    dest: '~/.vim/pack/editorconfig/start/editorconfig'
#    depth: 1
#- name: vim-xterm-bracketed-paste-directory
#  file: 
#    path: '~/.vim/pack/xterm-bracketed-paste/start/xterm-bracketed-paste/plugin'
#    state: directory
#- name: vim-xterm-bracketed-paste
#  copy:
#    content: |
#      " bracketed paste mode support for tmux
#      if &term =~ '^screen\|^tmux' && exists('&t_BE')
#        let &t_BE = "\033[?2004h"
#        let &t_BD = "\033[?2004l"
#        " t_PS and t_PE are key code options and they are special
#        exec "set t_PS=" . "\033[200~"
#        exec "set t_PE=" . "\033[201~"
#      endif
#    dest: '~/.vim/pack/xterm-bracketed-paste/start/xterm-bracketed-paste/plugin/xterm-bracketed-paste.vim'
#- name: vim-modeline-directory
#  file: 
#    path: '~/.vim/pack/modeline/start/modeline/plugin'
#    state: directory
#- name: vim-modeline
#  copy:
#    content: set modeline
#    dest: '~/.vim/pack/modeline/start/modeline/plugin/modeline.vim'
#- name: vim-nginx
#  subversion:
#    repo: https://github.com/nginx/nginx/trunk/contrib/vim
#    dest: '~/.vim/pack/nginx/start/nginx'
