---
- set_fact:
    plugin_dir: '{{vim_config_dir}}/pack/managed'
    plugins:
      # ====================== Completion & Diagnostics ========================

      # Conqueror of Completion
      - repo: neoclide/coc.nvim
        branch: release
      # Snippet collection
      - repo: honza/vim-snippets
      # Completion for vimscript
      - repo: vim-scripts/vimomni
        mode: opt
      # Version control differences in the sign column
      - repo: mhinz/vim-signify
      # Conflict marker utilities
      - repo: rhysd/conflict-marker.vim
      # Doxygen documentation stubs
      - repo: vim-scripts/DoxygenToolkit.vim
        mode: opt
      # Easy table manipulation
      - repo: dhruvasagar/vim-table-mode

      # =========================== User Interface =============================

      # Sanley numbered tabs in tabline
      - repo: mkitt/tabline.vim
      # Fuzzy finder
      # TODO: Still necessary?
      - repo: junegunn/fzf
      - repo: junegunn/fzf.vim
      # Replay macros with the enter key
      - repo: wincent/replay
      # Improved % matching
      - repo: andymass/vim-matchup
      # Forgot about this...
      - repo: kbenzie/note.vim
      # View term and hex colors
      - repo: guns/xterm-color-table.vim

      # ============================== Text Objects ============================

      # Library for creating text objects
      - repo: kana/vim-textobj-user
      # TODO: Doesn't work with nvim
      - repo: kana/vim-textobj-entire
      # Text object for function parameters
      - repo: sgur/vim-textobj-parameter
      # Text object for URI's
      - repo: jceb/vim-textobj-uri
      # Text object for comment blocks
      - repo: glts/vim-textobj-comment
      # Text object for sentences
      - repo: reedes/vim-textobj-sentence

      # ================================ Tim Pope ==============================

      # Toggle comments
      - repo: tpope/vim-commentary
      # Edit delimiters
      - repo: tpope/vim-surround
      # Better dot command
      - repo: tpope/vim-repeat
      # Git wrapper
      - repo: tpope/vim-fugitive
      # Unix command warppers
      - repo: tpope/vim-eunuch
      # Improved directory browser
      - repo: tpope/vim-vinegar
      # PascalCase to under_score to camelCase
      # TODO: Copy the good bit remove this plugin
      - repo: tpope/vim-abolish
      # Mappings for pairs of tasks
      - repo: tpope/vim-unimpaired
      # Sane date manipulation
      - repo: tpope/vim-speeddating
      # Wisely add end{if,function} fork with cmake support
      - repo: godbyk/vim-endwise
        branch: patch-1
      # Text object & formatting for json
      - repo: tpope/vim-jdaddy
      # Granular project configuration
      - repo: tpope/vim-projectionist

      # ================================ tmux ==================================

      # Seemless vim/tmux pane navigation
      - repo: 'christoomey/vim-tmux-navigator'
        mode: opt
      # Enable focus events when in tmux session
      - repo: 'tmux-plugins/vim-tmux-focus-events'
        mode: opt

      # =============================== Syntax =================================

      - repo: kalekundert/vim-coiled-snake
      - repo: kbenzie/vim-spirv
      - repo: rperier/vim-cmake-syntax
      - repo: tikhomirov/vim-glsl
      - repo: beyondmarc/hlsl.vim
      - repo: frasercrmck/opencl.vim
      - repo: asciidoc/vim-asciidoc
      - repo: mustache/vim-mustache-handlebars
      - repo: joshglendenning/vim-caddyfile
      - repo: kbenzie/vim-khr
      - repo: jrozner/vim-antlr
      - repo: sophacles/vim-bundle-mako

- name: remove minpac directory
  when: ansible_os_family != "Windows"
  file:
    path: '{{vim_config_dir}}/pack/minpac'
    state: absent
- name: remove minpac directory
  when: ansible_os_family == "Windows"
  win_file:
    path: '{{vim_config_dir}}/pack/minpac'
    state: absent