" vim: set sw=2 ts=2 sts=2 et tw=78 foldmarker={{{,}}} foldlevel=0 foldmethod=marker spell: ft=vim

" Start adding Plugs
silent! if plug#begin('~/.vim/plugged')

" Edition plugins {{{
  " Auto-close feature for parentheses, brackets etc.
  Plug 'jiangmiao/auto-pairs'

  " Trace and highlight the difference, character by character
  Plug 'vim-scripts/diffchar.vim'

  " Improved incremental searching
  Plug 'haya14busa/incsearch.vim'

  " Open a quickfix item in a window you choose
  Plug 'yssl/QFEnter'

  " Perform all your Vim insert mode completions with Tab
  Plug 'ervandew/supertab'

  " Syntax checking hacks for Vim
  "Plug 'scrooloose/syntastic'

  " Display your undo history in a graph
  "Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
  Plug 'sjl/gundo.vim', { 'on': 'GundoToggle' }

  " Provide a completion function for Unicode glyphs
  Plug 'chrisbra/unicode.vim'

  " Alignment plugin
  Plug 'junegunn/vim-easy-align', { 'on': ['<Plug>(EasyAlign)', 'EasyAlign'] }

  " Faster motions in Vim
  Plug 'Lokaltog/vim-easymotion'

  " Highlight the part of a line that doesn't fit into textwidth
  Plug 'whatyouhide/vim-lengthmatters'

  " Build on Vim’s spell/thes/dict completion
  Plug 'reedes/vim-lexical', {
        \ 'do': 'wget -nc http://www.gutenberg.org/files/3202/files.zip -O /tmp/thesaurus.zip &&
              \  sha256sum -c <(printf \"%s  /tmp/thesaurus.zip\n\" \"3a54e61dd3b4153313e00c3113bda1e939af505d1336a350a0fd93a80538a6d8\") &&
              \  mkdir -p ~/.vim/thesaurus &&
              \  unzip -p /tmp/thesaurus.zip files/mthesaur.txt >~/.vim/thesaurus/mthesaur.txt',
        \ 'for': ['tex'] }

  " Uncover usage problems in your writing
  "Plug 'reedes/vim-pencil'

  " True Sublime Text style multiple selections for Vim
  Plug 'terryma/vim-multiple-cursors'

  " Quoting/parenthesizing made simple
  Plug 'tpope/vim-surround'

  " A lightweight implementation of emacs's kill-ring for vim
  Plug 'maxbrunsfeld/vim-yankstack'
" }}}

" Project plugins {{{
  " Vim Workspace Controller
  Plug 'szw/vim-ctrlspace'

  " Change Vim working directory to the project root
  Plug 'airblade/vim-rooter'
" }}}

" Development plugins {{{
  " Incorporates the functionality of CMake into Vim
  "Plug 'jalcine/cmake.vim', { 'on': ['CMakeCreateBuild', 'CMakeBuild'] }

  " DoxygenToolkit: Doxygen support
  Plug 'vim-scripts/DoxygenToolkit.vim'

  " gitk for Vim
  Plug 'gregsexton/gitv', { 'on': 'Gitv' }

  " neo-completion with cache
  Plug 'Shougo/neocomplete.vim'

  " Commenter plugin
  Plug 'scrooloose/nerdcommenter'

  " Display tags in a window, ordered by scope
  Plug 'majutsushi/tagbar'

  " UltiSnips: engine.
  Plug 'sirver/ultisnips'

  " Asynchronous build and test dispatcher
  Plug 'tpope/vim-dispatch'

  " Git wrapper
  Plug 'tpope/vim-fugitive'

  " Vim plugin for previewing markup files (markdown, rdoc, textile, html)
  Plug 'greyblake/vim-preview', { 'on': 'Preview' }

  " Project configuration
  Plug 'tpope/vim-projectionist', { 'for': ['c', 'cpp', 'objc'] }

  " Show a VCS diff using Vim's sign column
  Plug 'mhinz/vim-signify'

  " UltiSnips: snippets.
  Plug 'honza/vim-snippets'

  " C/C++ {{{
    " Formatting with clang-format
    " Requires: vimproc.vim,  vim-operator-user
    Plug 'rhysd/vim-clang-format', { 'for': ['c', 'cpp', 'objc'] }

    " Enhanced syntax highlighting for C++
    Plug 'octol/vim-cpp-enhanced-highlight'
  " }}}
  
  " Haskell {{{
    " A collection of vimscripts for Haskell development.
    Plug 'dag/vim2hs'

    " Happy Haskell programming on Vim, powered by ghc-mod
    Plug 'eagletmt/ghcmod-vim'

    " A completion plugin for Haskell, using ghc-mod
    Plug 'eagletmt/neco-ghc'
  " }}}

  " Python {{{
    " Using the jedi autocompletion library
    Plug 'davidhalter/jedi-vim', { 'for': ['python'] }

    " Enhanced version of the original python.vim for Python programming language. 
    Plug 'python.vim'

    " Extend the % motion and define g%, [%, and ]% motions for Python files
    Plug 'python_match.vim'

    " PyLint, Rope, Pydoc, breakpoints from box.
    Plug 'klen/python-mode', { 'for': ['py'] }
  " }}}
" }}}

" Display plugins {{{
  " Make gvim-only colorschemes work transparently in terminal Vim
  Plug 'godlygeek/csapprox'

  " A light and configurable statusline/tabline for Vim
  Plug 'bchretien/lightline.vim'

  " css/less/sass/html color preview for Vim
  Plug 'gorodinskiy/vim-coloresque', { 'for': ['css', 'html', 'vim'] }

  " Fancy start screen
  Plug 'mhinz/vim-startify'

  " Color schemes {{{
    Plug 'spf13/vim-colors'
    Plug 'flazz/vim-colorschemes'

    " Add solarized color scheme
    Plug 'altercation/vim-colors-solarized'
  " }}}
" }}}

" Unite {{{
  " Unite and create user interfaces
  Plug 'Shougo/unite.vim'

  " Unite plugin providing outline view for a buffer
  Plug 'Shougo/unite-outline'

  " Powerful file explorer with Unite support.
  Plug 'Shougo/vimfiler.vim', { 'on': ['VimFiler', 'VimFilerExplorer'] }

  " Perform replacement in quickfix
  Plug 'thinca/vim-qfreplace'
" }}}

" Web plugins {{{
  " HTML 5 support
  Plug 'othree/html5.vim'

  " Javascript support
  Plug 'pangloss/vim-javascript'

  " Liquid support
  Plug 'tpope/vim-liquid'

  " Interface to Web API
  " Required by: gist-vim
  Plug 'mattn/webapi-vim'
" }}}

" Miscellaneous plugins {{{
  " LaTeX support
  if executable('latexmk')
    Plug 'lervag/vimtex'
  endif

  " Find out where maps are defined
  Plug 'vim-scripts/listmaps.vim', { 'on': 'Listmaps' }

  " Markdown support
  Plug 'tpope/vim-markdown'

  " JSON support
  Plug 'elzr/vim-json'

  " Define your own operator easily
  " Required by: vim
  Plug 'kana/vim-operator-user'

  " Interactive command execution in Vim
  " Required by: vim-clang-format, vim-marching
  Plug 'Shougo/vimproc.vim', { 'do': 'make clean && make'}

  " Run a command and show its result quickly
  Plug 'thinca/vim-quickrun', { 'on': 'QuickRun' }
" }}}

" Wrapper plugins {{{
  " Gist wrapper
  " Requires: webapi-vim
  Plug 'mattn/gist-vim'
" }}}

" Load local plugin file (if it exists)
" This provides a way to have user-specific plugins without needing
" to change this file.
if filereadable(expand("~/.vimrc.plugins.local"))
  source ~/.vimrc.plugins.local
endif

" Stop adding Plugs
call plug#end()
endif