diff --git a/.gitignore b/.gitignore
index d0299cf..ea1c065 100644
--- a/.gitignore
+++ b/.gitignore
@@ -140,3 +140,5 @@ i3/config
*.sqlite
i3/scripts/dmenu/database.sqlite
albert/*.db
+vim/plugged/
+vim/autoload/plug.vim
diff --git a/.gitmodules b/.gitmodules
index d77862b..35a98cf 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,87 +1,3 @@
-[submodule "vim/plugins/emmet-vim"]
- path = vim/plugins/emmet-vim
- url = https://github.com/mattn/emmet-vim
-[submodule "vim/plugins/neco-vim"]
- path = vim/plugins/neco-vim
- url = https://github.com/Shougo/neco-vim
-[submodule "vim/plugins/nerdcommenter"]
- path = vim/plugins/nerdcommenter
- url = https://github.com/scrooloose/nerdcommenter
-[submodule "vim/plugins/supertab"]
- path = vim/plugins/supertab
- url = https://github.com/ervandew/supertab
-[submodule "vim/plugins/vim-airline"]
- path = vim/plugins/vim-airline
- url = https://github.com/vim-airline/vim-airline.git
-[submodule "vim/plugins/vim-airline-themes"]
- path = vim/plugins/vim-airline-themes
- url = https://github.com/vim-airline/vim-airline-themes.git
-[submodule "vim/plugins/vim-better-whitespace"]
- path = vim/plugins/vim-better-whitespace
- url = git://github.com/ntpeters/vim-better-whitespace.git
-[submodule "vim/plugins/vim-easymotion"]
- path = vim/plugins/vim-easymotion
- url = https://github.com/easymotion/vim-easymotion
-[submodule "vim/plugins/vim-fugitive"]
- path = vim/plugins/vim-fugitive
- url = git://github.com/tpope/vim-fugitive.git
-[submodule "vim/plugins/vim-yankstack"]
- path = vim/plugins/vim-yankstack
- url = https://github.com/maxbrunsfeld/vim-yankstack
-[submodule "vim/plugins/indentline"]
- path = vim/plugins/indentline
- url = https://github.com/yggdroot/indentline
-[submodule "vim/plugins/simpylfold"]
- path = vim/plugins/simpylfold
- url = https://github.com/tmhedberg/simpylfold
-[submodule "vim/plugins/FastFold"]
- path = vim/plugins/FastFold
- url = https://github.com/Konfekt/fastfold.git
-[submodule "vim/plugins/vim-nerdtree-tabs"]
- path = vim/plugins/vim-nerdtree-tabs
- url = https://github.com/jistr/vim-nerdtree-tabs
-[submodule "vim/plugins/ultisnips"]
- path = vim/plugins/ultisnips
- url = https://github.com/SirVer/ultisnips.git
-[submodule "vim/snippets/vim-snippets"]
- path = vim/snippets/vim-snippets
- url = https://github.com/honza/vim-snippets
-[submodule "vim/snippets/bootstrap-snippets"]
- path = vim/snippets/bootstrap-snippets
- url = https://github.com/bonsaiben/bootstrap-snippets.git
-[submodule "vim/snippets/snipmate-snippets-bib"]
- path = vim/snippets/snipmate-snippets-bib
- url = https://github.com/rbonvall/snipmate-snippets-bib.git
-[submodule "vim/plugins/singlecompile"]
- path = vim/plugins/singlecompile
- url = https://github.com/xuhdev/singlecompile
-[submodule "vim/plugins/javacomplete"]
- path = vim/plugins/javacomplete
- url = https://github.com/vim-scripts/javacomplete
-[submodule "vim/plugins/vim-python-pep8-indent"]
- path = vim/plugins/vim-python-pep8-indent
- url = https://github.com/Vimjas/vim-python-pep8-indent
-[submodule "vim/plugins/auto-pairs"]
- path = vim/plugins/auto-pairs
- url = https://github.com/jiangmiao/auto-pairs.git
-[submodule "vim/plugins/kotlin-vim"]
- path = vim/plugins/kotlin-vim
- url = https://github.com/udalov/kotlin-vim.git
-[submodule "vim/plugins/vim-hug-neovim-rpc"]
- path = vim/plugins/vim-hug-neovim-rpc
- url = https://github.com/roxma/vim-hug-neovim-rpc
-[submodule "vim/plugins/deoplete.nvim"]
- path = vim/plugins/deoplete.nvim
- url = https://github.com/Shougo/deoplete.nvim.git
-[submodule "vim/plugins/nvim-yarp"]
- path = vim/plugins/nvim-yarp
- url = https://github.com/roxma/nvim-yarp
-[submodule "vim/plugins/deoplete-jedi"]
- path = vim/plugins/deoplete-jedi
- url = https://github.com/zchee/deoplete-jedi
-[submodule "vim/plugins/vim-latex-live-preview"]
- path = vim/plugins/vim-latex-live-preview
- url = https://github.com/xuhdev/vim-latex-live-preview
[submodule "zsh/modules/history-substring-search/external"]
path = zsh/modules/history-substring-search/external
url = https://github.com/zsh-users/zsh-history-substring-search.git
@@ -127,33 +43,3 @@
[submodule "tmux/plugins/tpm"]
path = tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm.git
-[submodule "vim/plugins/python-mode"]
- path = vim/plugins/python-mode
- url = https://github.com/klen/python-mode.git
-[submodule "vim/plugins/ale"]
- path = vim/plugins/ale
- url = https://github.com/w0rp/ale.git
-[submodule "vim/plugins/pydoc"]
- path = vim/plugins/pydoc
- url = https://github.com/fs111/pydoc.vim
-[submodule "vim/plugins/vim-gitgutter"]
- path = vim/plugins/vim-gitgutter
- url = git://github.com/airblade/vim-gitgutter.git
-[submodule "vim/plugins/fzf"]
- path = vim/plugins/fzf
- url = git://github.com/junegunn/fzf.vim
-[submodule "vim/plugins/vim-markdown"]
- path = vim/plugins/vim-markdown
- url = https://github.com/plasticboy/vim-markdown.git
-[submodule "vim/plugins/ansible-vim"]
- path = vim/plugins/ansible-vim
- url = https://github.com/pearofducks/ansible-vim
-[submodule "vim/plugins/vim-window-resize-easy"]
- path = vim/plugins/vim-window-resize-easy
- url = https://github.com/roxma/vim-window-resize-easy
-[submodule "vim/plugins/traces.vim"]
- path = vim/plugins/traces.vim
- url = https://github.com/markonm/traces.vim
-[submodule "vim/plugins/nerdtree"]
- path = vim/plugins/nerdtree
- url = https://github.com/scrooloose/nerdtree
diff --git a/vim/.vimrc b/vim/.vimrc
index 687e2d1..bbb9cc7 100755
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -1,9 +1,17 @@
" Plugin Manager
-execute pathogen#infect('plugins/{}')
-execute pathogen#infect('snippets/{}')
+source ~/.vim/config/plugins.vim
+
+" Make sure plug.vim is present
+if empty(glob('~/.vim/autoload/plug.vim'))
+ silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
+ \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+ source ~/.vim/autoload/plug.vim
+ autocmd VimEnter * PlugInstall --sync
+endif
+
" Prepare central backup/swap/undo directory
-let &undodir = expand('~/.vim/.undo')
+let &undodir = expand('~/.vim/.undo//')
let &backupdir = expand('~/.vim/.backup//')
let &directory = expand('~/.vim/.swp//')
@@ -39,7 +47,7 @@ colorscheme happy_hacking
" Apply plugin configurations
-source ~/.vim/config/plugin.vim
+source ~/.vim/config/pluginconfig.vim
" Apply custom keybindings
source ~/.vim/config/keybindings.vim
@@ -47,8 +55,5 @@ source ~/.vim/config/keybindings.vim
" Apply settings for custom filetypes
source ~/.vim/config/filetypes.vim
-" Rebuild help files on startup
-autocmd vimenter * Helptags
-
" Transparency
hi Normal guibg=NONE ctermbg=NONE
diff --git a/vim/autoload/pathogen.vim b/vim/autoload/pathogen.vim
deleted file mode 100755
index 2ec30e1..0000000
--- a/vim/autoload/pathogen.vim
+++ /dev/null
@@ -1,266 +0,0 @@
-" pathogen.vim - path option manipulation
-" Maintainer: Tim Pope
-" Version: 2.4
-
-" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
-"
-" For management of individually installed plugins in ~/.vim/bundle (or
-" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
-" .vimrc is the only other setup necessary.
-"
-" The API is documented inline below.
-
-if exists("g:loaded_pathogen") || &cp
- finish
-endif
-let g:loaded_pathogen = 1
-
-" Point of entry for basic default usage. Give a relative path to invoke
-" pathogen#interpose() or an absolute path to invoke pathogen#surround().
-" Curly braces are expanded with pathogen#expand(): "bundle/{}" finds all
-" subdirectories inside "bundle" inside all directories in the runtime path.
-" If no arguments are given, defaults "bundle/{}", and also "pack/{}/start/{}"
-" on versions of Vim without native package support.
-function! pathogen#infect(...) abort
- if a:0
- let paths = filter(reverse(copy(a:000)), 'type(v:val) == type("")')
- else
- let paths = ['bundle/{}', 'pack/{}/start/{}']
- endif
- if has('packages')
- call filter(paths, 'v:val !~# "^pack/[^/]*/start/[^/]*$"')
- endif
- let static = '^\%([$~\\/]\|\w:[\\/]\)[^{}*]*$'
- for path in filter(copy(paths), 'v:val =~# static')
- call pathogen#surround(path)
- endfor
- for path in filter(copy(paths), 'v:val !~# static')
- if path =~# '^\%([$~\\/]\|\w:[\\/]\)'
- call pathogen#surround(path)
- else
- call pathogen#interpose(path)
- endif
- endfor
- call pathogen#cycle_filetype()
- if pathogen#is_disabled($MYVIMRC)
- return 'finish'
- endif
- return ''
-endfunction
-
-" Split a path into a list.
-function! pathogen#split(path) abort
- if type(a:path) == type([]) | return a:path | endif
- if empty(a:path) | return [] | endif
- let split = split(a:path,'\\\@]','\\&','')
- endif
-endfunction
-
-" Like findfile(), but hardcoded to use the runtimepath.
-function! pathogen#runtime_findfile(file,count) abort
- let rtp = pathogen#join(1,pathogen#split(&rtp))
- let file = findfile(a:file,rtp,a:count)
- if file ==# ''
- return ''
- else
- return fnamemodify(file,':p')
- endif
-endfunction
-
-" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':
diff --git a/vim/config/plugin.vim b/vim/config/pluginconfig.vim
similarity index 100%
rename from vim/config/plugin.vim
rename to vim/config/pluginconfig.vim
diff --git a/vim/config/plugins.vim b/vim/config/plugins.vim
new file mode 100644
index 0000000..bbdca3c
--- /dev/null
+++ b/vim/config/plugins.vim
@@ -0,0 +1,42 @@
+call plug#begin('~/.vim/plugged')
+
+Plug 'mattn/emmet-vim'
+Plug 'Shougo/neco-vim'
+Plug 'scrooloose/nerdcommenter'
+Plug 'ervandew/supertab'
+Plug 'vim-airline/vim-airline'
+Plug 'vim-airline/vim-airline-themes'
+Plug 'ntpeters/vim-better-whitespace'
+Plug 'easymotion/vim-easymotion'
+Plug 'tpope/vim-fugitive'
+Plug 'maxbrunsfeld/vim-yankstack'
+Plug 'yggdroot/indentline'
+Plug 'tmhedberg/simpylfold'
+Plug 'Konfekt/fastfold'
+Plug 'jistr/vim-nerdtree-tabs'
+Plug 'SirVer/ultisnips'
+Plug 'honza/vim-snippets'
+Plug 'bonsaiben/bootstrap-snippets'
+Plug 'rbonvall/snipmate-snippets-bib'
+Plug 'xuhdev/singlecompile'
+Plug 'vim-scripts/javacomplete'
+Plug 'Vimjas/vim-python-pep8-indent'
+Plug 'jiangmiao/auto-pairs'
+Plug 'udalov/kotlin-vim'
+Plug 'roxma/vim-hug-neovim-rpc'
+Plug 'Shougo/deoplete.nvim'
+Plug 'roxma/nvim-yarp'
+Plug 'zchee/deoplete-jedi'
+Plug 'xuhdev/vim-latex-live-preview'
+Plug 'klen/python-mode'
+Plug 'w0rp/ale'
+Plug 'fs111/pydoc.vim'
+Plug 'airblade/vim-gitgutter'
+Plug 'junegunn/fzf.vim'
+Plug 'plasticboy/vim-markdown'
+Plug 'pearofducks/ansible-vim'
+Plug 'roxma/vim-window-resize-easy'
+Plug 'markonm/traces.vim'
+Plug 'scrooloose/nerdtree'
+
+call plug#end()
diff --git a/vim/plugins/FastFold/.gitignore b/vim/plugins/FastFold/.gitignore
deleted file mode 100644
index 926ccaa..0000000
--- a/vim/plugins/FastFold/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-doc/tags
diff --git a/vim/plugins/FastFold/README.md b/vim/plugins/FastFold/README.md
deleted file mode 100644
index 1c51fb0..0000000
--- a/vim/plugins/FastFold/README.md
+++ /dev/null
@@ -1,106 +0,0 @@
-# What good will FastFold do?
-
-Automatic folds (that is, folds generated by a fold method different
-from `manual`), bog down VIM noticeably in insert mode. They are also often
-recomputed too early (for example, when inserting an opening fold marker
-whose closing counterpart is yet missing to complete the fold.)
-
-See http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text
-for a discussion.
-
-With this plug-in, the folds in the currently edited buffer are updated by an
-automatic fold method only
-
-- when saving the buffer
-- when closing or opening folds (zo, za, zc, etc...)
-- when moving or operating fold-wise (zj,zk,[z,]z)
-- when typing `zuz` in normal mode
-
-and are kept as is otherwise (by keeping the fold method set to `manual`).
-
-# Example Setup
-
-Each of these triggers for updating folds can be modified or disabled by adding
-the lines
-
-```vim
-nmap zuz (FastFoldUpdate)
-let g:fastfold_savehook = 1
-let g:fastfold_fold_command_suffixes = ['x','X','a','A','o','O','c','C']
-let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk']
-```
-
-to the file `~/.vimrc` (respectively `%USERPROFILE%/_vimrc` on Microsoft Windows).
-
-For example, by adding
-
-```vim
-let g:tex_fold_enabled=1
-let g:vimsyn_folding='af'
-let g:xml_syntax_folding = 1
-let g:php_folding = 1
-let g:perl_fold = 1
-```
-
-to the `.vimrc` file and installing this plug-in, the folds in a TeX, Vim, XML,
-PHP or Perl file are updated by the `syntax` fold method when saving the
-buffer, opening, closing, moving or operating on folds, or typing `zuz` in
-normal mode and are kept as is otherwise.
-
-*Set fold methods for every file type only*! Setting it globally risks that FastFold assumes the wrong, global, fold method instead of that intended by the file type plug-in, for example TagList.
-
-# Configuration
-
-- If you prefer that folds are only updated manually but not when saving the buffer,
- then add `let g:fastfold_savehook = 0` to your `.vimrc`.
-
-- If you prefer that folds are updated whenever you close or open folds by a
- standard keystroke such as `zx`,`zo` or `zc`, then add `let
- g:fastfold_fold_command_suffixes = []` to your `.vimrc`.
-
- The exact list of these standard keystrokes is `zx,zX,za,zA,zo,zO,zc,zC` and
- it can be customized by changing the global variable
- `g:fastfold_mapsuffixes`. If you wanted to intercept all possible fold
- commands (such as zr,zm,...), change this to:
-
- ```vim
- let g:fastfold_fold_command_suffixes =
- ['x','X','a','A','o','O','c','C','r','R','m','M','i','n','N']
- ```
-
-- If you prefer that this plug-in does not add a normal mode mapping that updates
- folds (that defaults to `zuz`), then add
- `nmap (DisableFastFoldUpdate) (FastFoldUpdate) ` to your `.vimrc`.
-
- You can remap `zuz` to your favorite keystroke, say ``, by adding
- `nmap (FastFoldUpdate)` to your `.Vimrc`.
-
- There is also a command `FastFoldUpdate` that updates all folds and its
- variant `FastFoldUpdate!` that updates all folds and echos by which fold
- method the folds were updated.
-
-# Addons
-
-## Vim-Stay
-
-`FastFold` integrates with the plug-in
-[vim-stay](https://github.com/kopischke/vim-stay/issues) that restores the
-folds of a file buffer by `:mkview` and `:loadview`.
-
-## Custom Fold Text
-
-A `CustomFoldText()` function that displays the percentage of the number of buffer lines that the folded text takes up and indents folds according to their nesting level, similar to [that](http://www.gregsexton.org/2011/03/improving-the-text-displayed-in-a-fold/) by Greg Sexton, is available at
-
-http://www.github.com/Konfekt/FoldText
-
-## Fold Text-Object
-
-Create a fold text object, mapped to `iz` and `az`, by adding the lines
-
-```vim
-xnoremap iz :FastFoldUpdate:normal! ]zv[z
-xnoremap az :FastFoldUpdate:normal! ]zV[z
-```
-
-to the file `~/.vimrc` (respectively `%USERPROFILE%/_vimrc` on Microsoft Windows).
-
diff --git a/vim/plugins/FastFold/doc/FastFold.txt b/vim/plugins/FastFold/doc/FastFold.txt
deleted file mode 100644
index 42484ea..0000000
--- a/vim/plugins/FastFold/doc/FastFold.txt
+++ /dev/null
@@ -1,153 +0,0 @@
- FastFold, folding optimization *FastFold* *fastfold*
-
-===========================================================================
-0. Introduction ~
- *FastFold-intro* *fastfold-intro*
-
-Automatic folds - that is, folds generated by a fold method different
-from `manual` - bog down VIM considerably in insert mode. Also, they are often
-re-evaluated prematurely for example, when inserting an opening fold marker
-whose closing counterpart has yet to be added to complete the fold.
-
-See http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text
-for a discussion.
-
-With this plug-in, the folds in the currently edited buffer are updated when
-certain triggers are met:
-
-- when saving the buffer
-- when closing or opening folds (zo, za, zc, etc...)
-- when moving or operating fold-wise (zj,zk,[z,]z)
-- when typing `zuz` in normal mode
-
-===========================================================================
-1. Commands ~
- *FastFold-commands* *fastfold-commands*
- *FastFoldUpdate!*
-
-- `:FastFoldUpdate` updates all folds in the current buffer.
-- `:FastFoldUpdate!` updates all folds & echoes what fold method was used
-
-- The mapping `zuz` that invokes `:FastFoldUpdate!` can be changed to your
- favorite keystroke, say ``, by adding
->
- nmap (FastFoldUpdate)
-<
- to your `.vimrc`. It can be disabled by adding
->
- nmap (DisableFastFoldUpdate) (FastFoldUpdate)
-<
-===========================================================================
-2. Config ~
- *FastFold-config* *fastfold-config*
-
-Each of the above triggers can be enabled or disabled by setting the
-matching global flags in your `.vimrc`. Default values are shown.
->
- let g:fastfold_savehook = 1
- let g:fastfold_fdmhook = 0
- nmap zuz (FastFoldUpdate)
- let g:fastfold_fold_command_suffixes = ['x','X','a','A','o','O','c','C']
- let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk']
-<
-For example, by adding the following to your `.vimrc`
->
- let g:tex_fold_enabled=1
- let g:vimsyn_folding='af'
- let g:xml_syntax_folding = 1
- let g:php_folding = 1
- let g:perl_fold = 1
-<
-You will enable tex, vim, xml, php and perl syntax folding.
-
-Set fold methods for every file type only! Setting it globally risks that
-FastFold assumes the wrong, global, fold method instead of that intended by the
-file type plug-in, for example TagList.
-
------------------------------
-
-- FastFold updates all folds when you open or close folds by the commands
- zx, zX, za, zA, zo, zO, zc, zC. This list of commands is configured by
->
- let g:fastfold_fold_command_suffixes = ['x','X','a','A','o','O','c','C']
-<
- To intercept all possible fold commands (such as zr,zm,...),change this to
->
- let g:fastfold_fold_command_suffixes =
- ['x','X','a','A','o','O','c','C','r','R','m','M','i','n','N']
-<
- To disable all interceptions, change this to
->
- let g:fastfold_fold_command_suffixes = []
-<
-- FastFold updates all fold when you move or operate fold-wise by
- the commands zj,zk,[z or ]z. This list of commands is configured by
->
- let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk']
-<
- It can be disabled by
->
- let g:fastfold_fold_movement_commands = []
-<
-- FastFold updates all folds when you save a buffer. This hook is set by
->
- let g:fastfold_savehook = 1
-<
-- FastFold intercepts every change of the fold method by
->
- let g:fastfold_fdmhook = 1
-<
- This is disabled by default as it could interfere with other plugins such as
- `easymotion`.
-
-- To disable FastFold for a list of file types, such as 'taglist', add
->
-` let g:fastfold_skip_filetypes`= [ 'taglist' ]
-<
- to your 'vimrc'. Default value is [].
-
-- Add a fold text-object, mapped to `iz` and `az`, by adding the lines
-
- xnoremap iz :FastFoldUpdate:normal! ]zv[z
- xnoremap az :FastFoldUpdate:normal! ]zV[z
-
- to your 'vimrc'.
-===========================================================================
-3. Extra Notes ~
-
-3.1 Related Plugins ~
-
-`FastFold` integrates with the plug-in `vim-stay` available at
-
-https://github.com/kopischke/vim-stay
-
-that stores and restores the last folds by `:mkview` and `:loadview`.
-
-------------------------------
-
-A fold-text function `CustomFoldText()` that displays the percentage of the
-number of buffer lines that the folded text takes up and indents folds
-according to their nesting level is available at
-
-http://www.github.com/Konfekt/FoldText
-
-3.2 Warning ~
-
-FastFold overwrites your manual folds when saving the currently edited buffer,
-unless
-
-- FastFold is disabled for this filetype by `g:fastfold_skip_filetypes`, or
-- the `foldmethod=manual` since having entered the buffer.
-
-3.3 API ~
-
-The last used fold method by which FastFold updates the folds in the current
-buffer can be read off from the window local variable `w:lastdfm`.
-
-3.4 Thanks go to... ~
-
-- starcraftman for providing this documentation, and
-- blueyed, kopischke, sabauma, willywampa, and many others for reporting
-issues and suggesting code improvements.
-
-vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl
diff --git a/vim/plugins/FastFold/plugin/fastfold.vim b/vim/plugins/FastFold/plugin/fastfold.vim
deleted file mode 100644
index 19de8f8..0000000
--- a/vim/plugins/FastFold/plugin/fastfold.vim
+++ /dev/null
@@ -1,224 +0,0 @@
-scriptencoding utf-8
-
-" LICENCE PUBLIQUE RIEN À BRANLER
-" Version 1, Mars 2009
-"
-" Copyright (C) 2009 Sam Hocevar
-" 14 rue de Plaisance, 75014 Paris, France
-"
-" La copie et la distribution de copies exactes de cette licence sont
-" autorisées, et toute modification est permise à condition de changer
-" le nom de la licence.
-"
-" CONDITIONS DE COPIE, DISTRIBUTON ET MODIFICATION
-" DE LA LICENCE PUBLIQUE RIEN À BRANLER
-"
-" 0. Faites ce que vous voulez, j’en ai RIEN À BRANLER.
-
-if exists('g:loaded_fastfold') || &cp
- finish
-endif
-let g:loaded_fastfold = 1
-
-let s:keepcpo = &cpo
-set cpo&vim
-" ------------------------------------------------------------------------------
-
-if !exists('g:fastfold_fdmhook') | let g:fastfold_fdmhook = 0 | endif
-if !exists('g:fastfold_savehook') | let g:fastfold_savehook = 1 | endif
-if !exists('g:fastfold_fold_command_suffixes')
- let g:fastfold_fold_command_suffixes = ['x','X','a','A','o','O','c','C']
-endif
-if !exists('g:fastfold_fold_movement_commands')
- let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk']
-endif
-if !exists('g:fastfold_skip_filetypes') | let g:fastfold_skip_filetypes = [] | endif
-
-function! s:EnterWin()
- if exists('w:unchanged')
- unlet w:unchanged
- elseif s:Skip()
- if exists('w:lastfdm')
- unlet w:lastfdm
- endif
- else
- let w:lastfdm = &l:foldmethod
- setlocal foldmethod=manual
- endif
-endfunction
-
-function! s:LeaveWin()
- if exists('w:predifffdm')
- if empty(&l:foldmethod) || &l:foldmethod is# 'manual'
- let &l:foldmethod = w:predifffdm
- unlet w:predifffdm
- return
- elseif &l:foldmethod isnot# 'diff'
- unlet w:predifffdm
- endif
- endif
-
- if exists('w:lastfdm') && &l:foldmethod is# 'diff'
- let w:predifffdm = w:lastfdm
- endif
-
- if exists('w:lastfdm') && &l:foldmethod is# 'manual'
- if !exists('b:last_changedtick') || b:changedtick > b:last_changedtick
- let &l:foldmethod = w:lastfdm
- let b:last_changedtick = b:changedtick
- else
- let w:unchanged = 1
- endif
- endif
-endfunction
-
-" Like windo but restore the current buffer.
-" See http://vim.wikia.com/wiki/Run_a_command_in_multiple_buffers#Restoring_position
-function! s:WinDo( command )
- " avoid errors in CmdWin
- if exists('*getcmdwintype') && !empty(getcmdwintype())
- return
- endif
- " Work around Vim bug.
- " See https://groups.google.com/forum/#!topic/vim_dev/LLTw8JV6wKg
- let curaltwin = winnr('#') ? winnr('#') : 1
- let currwin=winnr()
- if &scrollopt =~# '\'
- set scrollopt-=jump
- let l:restore = 'set scrollopt+=jump'
- endif
- silent! execute 'keepjumps noautocmd windo ' . a:command
- silent! execute 'noautocmd ' . curaltwin . 'wincmd w'
- silent! execute 'noautocmd ' . currwin . 'wincmd w'
- if exists('l:restore')
- exe l:restore
- endif
-endfunction
-
-" WinEnter then TabEnter then BufEnter then BufWinEnter
-function! s:UpdateWin(check)
- " skip if another session still loading
- if a:check && exists('g:SessionLoad') | return | endif
-
- let s:curwin = winnr()
- call s:WinDo('if winnr() is s:curwin | call s:LeaveWin() | endif')
- call s:WinDo('if winnr() is s:curwin | call s:EnterWin() | endif')
-endfunction
-
-function! s:UpdateBuf(feedback)
- let s:curbuf = bufnr('%')
- call s:WinDo("if bufnr('%') is s:curbuf | call s:LeaveWin() | endif")
- call s:WinDo("if bufnr('%') is s:curbuf | call s:EnterWin() | endif")
-
- if !a:feedback | return | endif
-
- if !exists('w:lastfdm')
- echomsg "'" . &l:foldmethod . "' folds already continuously updated"
- else
- echomsg "updated '" . w:lastfdm . "' folds"
- endif
-endfunction
-
-function! s:UpdateTab()
- " skip if another session still loading
- if exists('g:SessionLoad') | return | endif
-
- call s:WinDo('call s:LeaveWin()')
- call s:WinDo('call s:EnterWin()')
-endfunction
-
-function! s:Skip()
- if !s:isReasonable() | return 1 | endif
- if !&l:modifiable | return 1 | endif
- if s:inSkipList() | return 1 | endif
-
- return 0
-endfunction
-
-function! s:isReasonable()
- if &l:foldmethod is# 'syntax' || &l:foldmethod is# 'expr'
- return 1
- else
- return 0
- endif
-endfunction
-
-function! s:inSkipList()
- for ifiles in g:fastfold_skip_filetypes
- if index(g:fastfold_skip_filetypes, &l:filetype) >= 0
- return 1
- endif
- endfor
- return 0
-endfunction
-
-command! -bar -bang FastFoldUpdate call s:UpdateBuf(0)
-
-nnoremap (FastFoldUpdate) :FastFoldUpdate!
-
-if !hasmapto('(FastFoldUpdate)', 'n') && empty(mapcheck('zuz', 'n'))
- nmap zuz (FastFoldUpdate)
-endif
-
-for suffix in g:fastfold_fold_command_suffixes
- execute 'nnoremap z'.suffix.' :call UpdateWin(0)z'.suffix
-endfor
-
-for cmd in g:fastfold_fold_movement_commands
- exe "nnoremap " . cmd. " ':call UpdateWin(0)'.v:count." . "'".cmd."'"
- exe "xnoremap " . cmd. " ':call UpdateWin(0)gv'.v:count." . "'".cmd."'"
- exe "onoremap " . cmd. " ':call UpdateWin(0)' . '\"' . v:register . v:operator . v:count1 . " . "'".cmd."'"
-endfor
-
-augroup FastFold
- autocmd!
- autocmd VimEnter * call s:init()
- autocmd BufEnter,WinEnter *
- \ if !exists('b:last_changedtick') | let b:last_changedtick = b:changedtick | endif
-augroup end
-
-function! s:init()
- call s:UpdateTab()
- augroup FastFoldEnter
- autocmd!
- " Make &l:foldmethod local to Buffer and NOT Window.
- autocmd BufEnter,WinEnter *
- \ if exists('b:lastfdm') | let w:lastfdm = b:lastfdm | call s:LeaveWin() | call s:EnterWin() | endif
- autocmd BufLeave,WinLeave *
- \ call s:LeaveWin() | call s:EnterWin() |
- \ if exists('w:lastfdm') | let b:lastfdm = w:lastfdm |
- \ elseif exists('b:lastfdm') | unlet b:lastfdm | endif
-
- autocmd BufEnter,WinEnter *
- \ if &l:foldmethod isnot# 'diff' && exists('b:predifffdm') | call s:UpdateBuf(0) | endif
- autocmd BufLeave,WinLeave *
- \ if exists('w:predifffdm') | let b:predifffdm = w:predifffdm |
- \ elseif exists('b:predifffdm') | unlet b:predifffdm | endif
-
- " UpdateBuf/Win(1) = skip if another session is still loading.
- autocmd TabEnter * call s:UpdateTab()
-
- " BufWinEnter = to change &l:foldmethod by modelines.
- autocmd BufWinEnter,FileType * call s:UpdateWin(1)
- " So that FastFold functions correctly after :loadview.
- autocmd SessionLoadPost * call s:UpdateWin(0)
-
- " Update folds on reload.
- autocmd BufReadPost *
- \ if !exists('b:already_loaded') | let b:already_loaded = 1 |
- \ else | call s:UpdateBuf(0) | endif
- " Update folds on saving.
- if g:fastfold_savehook
- autocmd BufWritePost * call s:UpdateBuf(0)
- endif
- if g:fastfold_fdmhook
- if exists('##OptionSet')
- autocmd OptionSet foldmethod call s:UpdateBuf(0)
- endif
- endif
- augroup end
-endfunction
-
-" ------------------------------------------------------------------------------
-let &cpo= s:keepcpo
-unlet s:keepcpo
diff --git a/vim/plugins/ale b/vim/plugins/ale
deleted file mode 160000
index 3f0e1cd..0000000
--- a/vim/plugins/ale
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 3f0e1cd05dc526b073946ad96c64f6a5e2f9e4e6
diff --git a/vim/plugins/ansible-vim b/vim/plugins/ansible-vim
deleted file mode 160000
index f1c9be3..0000000
--- a/vim/plugins/ansible-vim
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f1c9be3cdca55c90cc190f8fc38c6c8ac7e8d371
diff --git a/vim/plugins/auto-pairs/.gitignore b/vim/plugins/auto-pairs/.gitignore
deleted file mode 100644
index 926ccaa..0000000
--- a/vim/plugins/auto-pairs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-doc/tags
diff --git a/vim/plugins/auto-pairs/README.md b/vim/plugins/auto-pairs/README.md
deleted file mode 100644
index 7cdcbf9..0000000
--- a/vim/plugins/auto-pairs/README.md
+++ /dev/null
@@ -1,325 +0,0 @@
-Auto Pairs
-==========
-Insert or delete brackets, parens, quotes in pair.
-
-Installation
-------------
-copy plugin/auto-pairs.vim to ~/.vim/plugin
-
-or if you are using `pathogen`:
-
-```git clone git://github.com/jiangmiao/auto-pairs.git ~/.vim/bundle/auto-pairs```
-
-Features
---------
-* Insert in pair
-
- input: [
- output: [|]
-
-* Delete in pair
-
- input: foo[]
- output: foo
-
-* Insert new indented line after Return
-
- input: {|} (press at |)
- output: {
- |
- }
-
-* Insert spaces before closing characters, only for [], (), {}
-
- input: {|} (press at |)
- output: { | }
-
- input: {|} (press foo} at |)
- output: { foo }|
-
- input: '|' (press at |)
- output: ' |'
-
-* Skip ' when inside a word
-
- input: foo| (press ' at |)
- output: foo'
-
-* Skip closed bracket.
-
- input: []
- output: []
-
-* Ignore auto pair when previous character is \
-
- input: "\'
- output: "\'"
-
-* Fast Wrap
-
- input: |'hello' (press ( at |)
- output: ('hello')
-
- wrap string, only support c style string
- input: |'h\\el\'lo' (press ( at |)
- output ('h\\ello\'')
-
- input: |[foo, bar()] (press ( at |)
- output: ([foo, bar()])
-
-* Quick move char to closed pair
-
- input: (|){["foo"]} (press at |)
- output: ({["foo"]}|)
-
- input: |[foo, bar()] (press ( at |)
- output: ([foo, bar()]|)
-
-* Quick jump to closed pair.
-
- input:
- {
- something;|
- }
-
- (press } at |)
-
- output:
- {
-
- }|
-
-* Support ``` ''' and """
-
- input:
- '''
-
- output:
- '''|'''
-
-* Delete Repeated Pairs in one time
-
- input: """|""" (press at |)
- output: |
-
- input: {{|}} (press at |)
- output: |
-
- input: [[[[[[|]]]]]] (press at |)
- output: |
-
-* Fly Mode
-
- input: if(a[3)
- output: if(a[3])| (In Fly Mode)
- output: if(a[3)]) (Without Fly Mode)
-
- input:
- {
- hello();|
- world();
- }
-
- (press } at |)
-
- output:
- {
- hello();
- world();
- }|
-
- (then press at | to do backinsert)
- output:
- {
- hello();}|
- world();
- }
-
- See Fly Mode section for details
-
-Fly Mode
---------
-Fly Mode will always force closed-pair jumping instead of inserting. only for ")", "}", "]"
-
-If jumps in mistake, could use AutoPairsBackInsert(Default Key: ``) to jump back and insert closed pair.
-
-the most situation maybe want to insert single closed pair in the string, eg ")"
-
-Fly Mode is DISABLED by default.
-
-add **let g:AutoPairsFlyMode = 1** .vimrc to turn it on
-
-Default Options:
-
- let g:AutoPairsFlyMode = 0
- let g:AutoPairsShortcutBackInsert = ''
-
-Shortcuts
----------
-
- System Shortcuts:
- : Insert new indented line after return if cursor in blank brackets or quotes.
- : Delete brackets in pair
- : Toggle Autopairs (g:AutoPairsShortcutToggle)
- : Fast Wrap (g:AutoPairsShortcutFastWrap)
- : Jump to next closed pair (g:AutoPairsShortcutJump)
- : BackInsert (g:AutoPairsShortcutBackInsert)
-
- If or conflict with another keys or want to bind to another keys, add
-
- let g:AutoPairsShortcutToggle = ''
-
- to .vimrc, if the key is empty string '', then the shortcut will be disabled.
-
-Options
--------
-* g:AutoPairs
-
- Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}
-
-* b:AutoPairs
-
- Default: g:AutoPairs
-
- Buffer level pairs set.
-
-* g:AutoPairsShortcutToggle
-
- Default: ''
-
- The shortcut to toggle autopairs.
-
-* g:AutoPairsShortcutFastWrap
-
- Default: ''
-
- Fast wrap the word. all pairs will be consider as a block (include <>).
- (|)'hello' after fast wrap at |, the word will be ('hello')
- (|) after fast wrap at |, the word will be ()
-
-* g:AutoPairsShortcutJump
-
- Default: ''
-
- Jump to the next closed pair
-
-* g:AutoPairsMapBS
-
- Default : 1
-
- Map to delete brackets, quotes in pair
- execute 'inoremap =AutoPairsDelete()'
-
-* g:AutoPairsMapCh
-
- Default : 1
-
- Map to delete brackets, quotes in pair
-
-* g:AutoPairsMapCR
-
- Default : 1
-
- Map to insert a new indented line if cursor in (|), {|} [|], '|', "|"
- execute 'inoremap =AutoPairsReturn()'
-
-* g:AutoPairsCenterLine
-
- Default : 1
-
- When g:AutoPairsMapCR is on, center current line after return if the line is at the bottom 1/3 of the window.
-
-* g:AutoPairsMapSpace
-
- Default : 1
-
- Map to insert a space after the opening character and before the closing one.
- execute 'inoremap =AutoPairsSpace()'
-
-* g:AutoPairsFlyMode
-
- Default : 0
-
- set it to 1 to enable FlyMode.
- see FlyMode section for details.
-
-* g:AutoPairsMultilineClose
-
- Default : 1
-
- When you press the key for the closing pair (e.g. `)`) it jumps past it.
- If set to 1, then it'll jump to the next line, if there is only whitespace.
- If set to 0, then it'll only jump to a closing pair on the same line.
-
-* g:AutoPairsShortcutBackInsert
-
- Default :
-
- Work with FlyMode, insert the key at the Fly Mode jumped postion
-
-* g:AutoPairsMoveCharacter
-
- Default: "()[]{}\"'"
-
- Map to
- move character under the cursor to the pair.
-
-Buffer Level Pairs Setting
---------------------------
-
-Set b:AutoPairs before BufEnter
-
-eg:
-
- " When the filetype is FILETYPE then make AutoPairs only match for parenthesis
- au Filetype FILETYPE let b:AutoPairs = {"(": ")"}
-
-TroubleShooting
----------------
- The script will remap keys ([{'"}]) ,
- If auto pairs cannot work, use :imap ( to check if the map is corrected.
- The correct map should be =AutoPairsInsert("\(")
- Or the plugin conflict with some other plugins.
- use command :call AutoPairsInit() to remap the keys.
-
-
-* How to insert parens purely
-
- There are 3 ways
-
- 1. use Ctrl-V ) to insert paren without trigger the plugin.
-
- 2. use Alt-P to turn off the plugin.
-
- 3. use DEL or x to delete the character insert by plugin.
-
-* Swedish Character Conflict
-
- Because AutoPairs uses Meta(Alt) key as shortcut, it is conflict with some Swedish character such as å.
- To fix the issue, you need remap or disable the related shortcut.
-
-Known Issues
------------------------
-Breaks '.' - [issue #3](https://github.com/jiangmiao/auto-pairs/issues/3)
-
- Description: After entering insert mode and inputing `[hello` then leave insert
- mode by ``. press '.' will insert 'hello' instead of '[hello]'.
- Reason: `[` actually equals `[]\` and \ will break '.'.
- After version 7.4.849, Vim implements new keyword U to avoid the break
- Solution: Update Vim to 7.4.849+
-
-Contributors
-------------
-* [camthompson](https://github.com/camthompson)
-
-
-License
--------
-
-Copyright (C) 2011-2013 Miao Jiang
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vim/plugins/auto-pairs/doc/AutoPairs.txt b/vim/plugins/auto-pairs/doc/AutoPairs.txt
deleted file mode 100644
index 49ff549..0000000
--- a/vim/plugins/auto-pairs/doc/AutoPairs.txt
+++ /dev/null
@@ -1,356 +0,0 @@
-*AutoPairs.txt* Insert or delete brackets, parens, quotes in pair
-
-Author: jiangmiao
-License: MIT
-URL: https://github.com/jiangmiao/auto-pairs
-
-==============================================================================
-CONTENTS *autopairs-contents*
-
- 1. Installation ............................. |autopairs-installation|
- 2. Features ..................................... |autopairs-features|
- 3. Fly Mode ..................................... |autopairs-fly-mode|
- 4. Shortcuts ................................... |autopairs-shortcuts|
- 5. Options ....................................... |autopairs-options|
- 6. Troubleshooting ...................... |autopairs-troubleshooting|
-
-==============================================================================
-1. Introduction *autopairs-installation*
-
-Copy `plugin/auto-pairs.vim` to `~/.vim/plugin`.
-
-Or if you are using `pathogen`: >
-
- git clone git://github.com/jiangmiao/auto-pairs.git ~/.vim/bundle/auto-pairs
-
-==============================================================================
-2. Features *autopairs-features*
-
-Insert in pair: >
-
- input: [
- output: [|]
-
-Delete in pair: >
-
- input: foo[]
- output: foo
-
-Insert new indented line after Return: >
-
- input: {|} (press at |)
- output: {
- |
- }
-
-Insert spaces before closing characters, only for [], (), {}: >
-
- input: {|} (press at |)
- output: { | }
-
- input: {|} (press foo} at |)
- output: { foo }|
-
- input: '|' (press at |)
- output: ' |'
-
-Skip ' when inside a word: >
-
- input: foo| (press ' at |)
- output: foo'
-
-Skip closed bracket: >
-
- input: []
- output: []
-
-Ignore auto pair when previous character is '\': >
-
- input: "\'
- output: "\'"
-
-Fast Wrap: >
-
- input: |'hello' (press ( at |)
- output: ('hello')
-
- Wrap string, only support c style string.
- input: |'h\\el\'lo' (press ( at |)
- output ('h\\ello\'')
-
- input: |[foo, bar()] (press ( at |)
- output: ([foo, bar()])
-
-Quick jump to closed pair: >
-
- input:
- {
- something;|
- }
-
- (press } at |)
-
- output:
- {
-
- }|
-
-Support ```, ''' and """: >
-
- input:
- '''
-
- output:
- '''|'''
-
-Delete Repeated Pairs in one time: >
-
- input: """|""" (press at |)
- output: |
-
- input: {{|}} (press at |)
- output: |
-
- input: [[[[[[|]]]]]] (press at |)
- output: |
-
-Fly Mode (|autopairs-flymode|): >
-
- input: if(a[3)
- output: if(a[3])| (In Fly Mode)
- output: if(a[3)]) (Without Fly Mode)
-
- input:
- {
- hello();|
- world();
- }
-
- (press } at |)
-
- output:
- {
- hello();
- world();
- }|
-
- (then press at | to do backinsert)
- output:
- {
- hello();}|
- world();
- }
-
- See |Fly Mode| section for details
-
-==============================================================================
-3. Fly Mode *autopairs-flymode*
-
-Fly Mode will always force closed-pair jumping instead of inserting. Only for
-")", "}", "]". If jumps in mistake, you can use |g:AutoPairsBackInsert| (default
-Key: ) to jump back and insert closed pair.
-
-The most situation maybe you want to insert single closed pair in the string,
-eg: >
-
- ")"
-
-Fly Mode is DISABLED by default. To enable Fly Mode add following to your
-'.vimrc': >
-
- let g:AutoPairsFlyMode = 1
-
-Default Options: >
-
- let g:AutoPairsFlyMode = 0
- let g:AutoPairsShortcutBackInsert = ''
-
-==============================================================================
-4. Shortcuts *autopairs-shortcuts*
-
-System Shortcuts:
- : Insert new indented line after return if cursor in blank brackets
- or quotes.
- : Delete brackets in pair
- : Toggle Autopairs (|g:AutoPairsShortcutToggle|)
- : Fast Wrap (|g:AutoPairsShortcutFastWrap|)
- : Jump to next closed pair (|g:AutoPairsShortcutJump|)
- : BackInsert (|g:AutoPairsShortcutBackInsert|)
-
-
- To rebind keys , or or in case of conflicts conflicts with
- another keys:
-
- let g:AutoPairsShortcutToggle = ''
-
- If the key is empty string '', then the shortcut will be disabled.
-
-==============================================================================
-5. Options *autopairs-options*
-
- *g:AutoPairs*
-|g:AutoPairs| dict
-
-Default: >
- {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}
-
-Specifies which symbols should be automatically paired.
-
-To append new pairs without overwriting defaults, add values in your `.vimrc`.:
-
- let g:AutoPairs['<']='>'
-
-This example will enable matching of `<` with `>`.
-
-
- *b:AutoPairs*
-|b:AutoPairs| dict
-
-Default: |g:AutoPairs|
-
-Buffer level pairs set.
-
-You can set |b:AutoPairs| before |BufEnter|: >
-
- au Filetype FILETYPE let b:AutoPairs = {"(": ")"}
-
-This sets |AutoPairs| to only match for parenthesis for 'FILETYPE'.
-
-
-
- *g:AutoPairsShortcutToggle*
-|g:AutoPairsShortcutToggle| string
-
-Default:
-
-The shortcut to toggle autopairs.
-
-
-
- *g:AutoPairsShortcutFastWrap*
-|g:AutoPairsShortcutFastWrap| string
-
-Default:
-
-Fast wrap the word. All pairs will be considered as a block (including <>).
-
- (|)'hello' after fast wrap at |, the word will be ('hello')
- (|) after fast wrap at |, the word will be ()
-
-
-
- *g:AutoPairsShortcutJump*
-|g:AutoPairsShortcutJump| string
-
-Default:
-
-Jump to the next closed pair.
-
-
- *g:AutoPairsShortcutBackInsert*
-|g:AutoPairsShortcutBackInsert| string
-
-Default:
-
-Work with |autopairs-flymode|, insert the key at the Fly Mode jumped position.
-
-
-
- *g:AutoPairsMapBS*
-|g:AutoPairsMapBS| int
-
-Default: 1
-
-Map to delete brackets and quotes in pair, executes:
-
- inoremap =AutoPairsDelete()
-
-
- *g:AutoPairsMapCh*
-|g:AutoPairsMapCh| int
-
-Default: 1
-
-Map to delete brackets and quotes in pair.
-
-
- *g:AutoPairsMapCR*
-|g:AutoPairsMapCR| int
-
-Default: 1
-
-Map to insert a new indented line if cursor in (|), {|} [|], '|', "|".
-Executes:
-
- inoremap =AutoPairsReturn()
-
-
- *g:AutoPairsCenterLine*
-|g:AutoPairsCenterLine| int
-
-Default: 1
-
-When |g:AutoPairsMapCR| is on, center current line after return if the line
-is at the bottom 1/3 of the window.
-
-
- *g:AutoPairsMapSpace*
-|g:AutoPairsMapSpace| int
-
-Default: 1
-
-Map to insert a space after the opening character and before the
-closing one.
-
-Executes:
-
- inoremap =AutoPairsSpace()
-
-
- *g:AutoPairsFlyMode*
-|g:AutoPairsFlyMode| int
-
-Default: 0
-
-Set it to 1 to enable |autopairs-flymode|.
-
-
- *g:AutoPairsMultilineClose*
-|g:AutoPairsMultilineClose| int
-
-Default: 1
-
-When you press the key for the closing pair (e.g. `)`) it jumps past it.
-If set to 1, then it'll jump to the next line, if there is only 'whitespace'.
-If set to 0, then it'll only jump to a closing pair on the same line.
-
-==============================================================================
-6. Troubleshooting *autopairs-troubleshooting*
-
-This plugin remaps keys `([{'"}]) `
-
-If auto pairs cannot work, use |:imap| to check if the map is corrected.
-
-The correct map should be: >
-
- =AutoPairsInsert("\(")
-
-Or the plugin conflicts with some other plugins. Use command: >
-
- :call AutoPairsInit() to remap the keys.
-
---- How to insert parens purely? ---
-
-There are 3 ways:
-
- 1. Use Ctrl-V ) to insert paren without trigger the plugin.
-
- 2. Use Alt-P to turn off the plugin.
-
- 3. Use DEL or x to delete the character insert by plugin.
-
---- Swedish Character Conflict ---
-
-Because AutoPairs uses Meta(Alt) key as a shortcut, it conflicts with some
-Swedish character such as å. To fix the issue, you need remap or disable the
-related shortcut.
diff --git a/vim/plugins/auto-pairs/plugin/auto-pairs.vim b/vim/plugins/auto-pairs/plugin/auto-pairs.vim
deleted file mode 100644
index b2a9af7..0000000
--- a/vim/plugins/auto-pairs/plugin/auto-pairs.vim
+++ /dev/null
@@ -1,582 +0,0 @@
-" Insert or delete brackets, parens, quotes in pairs.
-" Maintainer: JiangMiao
-" Contributor: camthompson
-" Last Change: 2017-06-17
-" Version: 1.3.3
-" Homepage: http://www.vim.org/scripts/script.php?script_id=3599
-" Repository: https://github.com/jiangmiao/auto-pairs
-" License: MIT
-
-if exists('g:AutoPairsLoaded') || &cp
- finish
-end
-let g:AutoPairsLoaded = 1
-
-if !exists('g:AutoPairs')
- let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}
-end
-
-if !exists('g:AutoPairsParens')
- let g:AutoPairsParens = {'(':')', '[':']', '{':'}'}
-end
-
-if !exists('g:AutoPairsMapBS')
- let g:AutoPairsMapBS = 1
-end
-
-" Map as the same BS
-if !exists('g:AutoPairsMapCh')
- let g:AutoPairsMapCh = 1
-end
-
-if !exists('g:AutoPairsMapCR')
- let g:AutoPairsMapCR = 1
-end
-
-if !exists('g:AutoPairsMapSpace')
- let g:AutoPairsMapSpace = 1
-end
-
-if !exists('g:AutoPairsCenterLine')
- let g:AutoPairsCenterLine = 1
-end
-
-if !exists('g:AutoPairsShortcutToggle')
- let g:AutoPairsShortcutToggle = ''
-end
-
-if !exists('g:AutoPairsShortcutFastWrap')
- let g:AutoPairsShortcutFastWrap = ''
-end
-
-if !exists('g:AutoPairsMoveCharacter')
- let g:AutoPairsMoveCharacter = "()[]{}\"'"
-end
-
-if !exists('g:AutoPairsShortcutJump')
- let g:AutoPairsShortcutJump = ''
-endif
-
-" Fly mode will for closed pair to jump to closed pair instead of insert.
-" also support AutoPairsBackInsert to insert pairs where jumped.
-if !exists('g:AutoPairsFlyMode')
- let g:AutoPairsFlyMode = 0
-endif
-
-" When skipping the closed pair, look at the current and
-" next line as well.
-if !exists('g:AutoPairsMultilineClose')
- let g:AutoPairsMultilineClose = 1
-endif
-
-" Work with Fly Mode, insert pair where jumped
-if !exists('g:AutoPairsShortcutBackInsert')
- let g:AutoPairsShortcutBackInsert = ''
-endif
-
-if !exists('g:AutoPairsSmartQuotes')
- let g:AutoPairsSmartQuotes = 1
-endif
-
-" 7.4.849 support U to avoid breaking '.'
-" Issue talk: https://github.com/jiangmiao/auto-pairs/issues/3
-" Vim note: https://github.com/vim/vim/releases/tag/v7.4.849
-if v:version > 704 || v:version == 704 && has("patch849")
- let s:Go = "\U"
-else
- let s:Go = ""
-endif
-
-let s:Left = s:Go."\"
-let s:Right = s:Go."\"
-
-
-" Will auto generated {']' => '[', ..., '}' => '{'}in initialize.
-let g:AutoPairsClosedPairs = {}
-
-
-function! AutoPairsInsert(key)
- if !b:autopairs_enabled
- return a:key
- end
-
- let line = getline('.')
- let pos = col('.') - 1
- let before = strpart(line, 0, pos)
- let after = strpart(line, pos)
- let next_chars = split(after, '\zs')
- let current_char = get(next_chars, 0, '')
- let next_char = get(next_chars, 1, '')
- let prev_chars = split(before, '\zs')
- let prev_char = get(prev_chars, -1, '')
-
- let eol = 0
- if col('$') - col('.') <= 1
- let eol = 1
- end
-
- " Ignore auto close if prev character is \
- if prev_char == '\'
- return a:key
- end
-
- " The key is difference open-pair, then it means only for ) ] } by default
- if !has_key(b:AutoPairs, a:key)
- let b:autopairs_saved_pair = [a:key, getpos('.')]
-
- " Skip the character if current character is the same as input
- if current_char == a:key
- return s:Right
- end
-
- if !g:AutoPairsFlyMode
- " Skip the character if next character is space
- if current_char == ' ' && next_char == a:key
- return s:Right.s:Right
- end
-
- " Skip the character if closed pair is next character
- if current_char == ''
- if g:AutoPairsMultilineClose
- let next_lineno = line('.')+1
- let next_line = getline(nextnonblank(next_lineno))
- let next_char = matchstr(next_line, '\s*\zs.')
- else
- let next_char = matchstr(line, '\s*\zs.')
- end
- if next_char == a:key
- return "\e^a"
- endif
- endif
- endif
-
- " Fly Mode, and the key is closed-pairs, search closed-pair and jump
- if g:AutoPairsFlyMode && has_key(b:AutoPairsClosedPairs, a:key)
- let n = stridx(after, a:key)
- if n != -1
- return repeat(s:Right, n+1)
- end
- if search(a:key, 'W')
- " force break the '.' when jump to different line
- return "\"
- endif
- endif
-
- " Insert directly if the key is not an open key
- return a:key
- end
-
- let open = a:key
- let close = b:AutoPairs[open]
-
- if current_char == close && open == close
- return s:Right
- end
-
- " Ignore auto close ' if follows a word
- " MUST after closed check. 'hello|'
- if a:key == "'" && prev_char =~ '\v\w'
- return a:key
- end
-
- " support for ''' ``` and """
- if open == close
- " The key must be ' " `
- let pprev_char = line[col('.')-3]
- if pprev_char == open && prev_char == open
- " Double pair found
- return repeat(a:key, 4) . repeat(s:Left, 3)
- end
- end
-
- let quotes_num = 0
- " Ignore comment line for vim file
- if &filetype == 'vim' && a:key == '"'
- if before =~ '^\s*$'
- return a:key
- end
- if before =~ '^\s*"'
- let quotes_num = -1
- end
- end
-
- " Keep quote number is odd.
- " Because quotes should be matched in the same line in most of situation
- if g:AutoPairsSmartQuotes && open == close
- " Remove \\ \" \'
- let cleaned_line = substitute(line, '\v(\\.)', '', 'g')
- let n = quotes_num
- let pos = 0
- while 1
- let pos = stridx(cleaned_line, open, pos)
- if pos == -1
- break
- end
- let n = n + 1
- let pos = pos + 1
- endwhile
- if n % 2 == 1
- return a:key
- endif
- endif
-
- return open.close.s:Left
-endfunction
-
-function! AutoPairsDelete()
- if !b:autopairs_enabled
- return "\"
- end
-
- let line = getline('.')
- let pos = col('.') - 1
- let current_char = get(split(strpart(line, pos), '\zs'), 0, '')
- let prev_chars = split(strpart(line, 0, pos), '\zs')
- let prev_char = get(prev_chars, -1, '')
- let pprev_char = get(prev_chars, -2, '')
-
- if pprev_char == '\'
- return "\"
- end
-
- " Delete last two spaces in parens, work with MapSpace
- if has_key(b:AutoPairs, pprev_char) && prev_char == ' ' && current_char == ' '
- return "\\"
- endif
-
- " Delete Repeated Pair eg: '''|''' [[|]] {{|}}
- if has_key(b:AutoPairs, prev_char)
- let times = 0
- let p = -1
- while get(prev_chars, p, '') == prev_char
- let p = p - 1
- let times = times + 1
- endwhile
-
- let close = b:AutoPairs[prev_char]
- let left = repeat(prev_char, times)
- let right = repeat(close, times)
-
- let before = strpart(line, pos-times, times)
- let after = strpart(line, pos, times)
- if left == before && right == after
- return repeat("\\", times)
- end
- end
-
-
- if has_key(b:AutoPairs, prev_char)
- let close = b:AutoPairs[prev_char]
- if match(line,'^\s*'.close, col('.')-1) != -1
- " Delete (|___)
- let space = matchstr(line, '^\s*', col('.')-1)
- return "\". repeat("\", len(space)+1)
- elseif match(line, '^\s*$', col('.')-1) != -1
- " Delete (|__\n___)
- let nline = getline(line('.')+1)
- if nline =~ '^\s*'.close
- if &filetype == 'vim' && prev_char == '"'
- " Keep next line's comment
- return "\"
- end
-
- let space = matchstr(nline, '^\s*')
- return "\\". repeat("\", len(space)+1)
- end
- end
- end
-
- return "\"
-endfunction
-
-function! AutoPairsJump()
- call search('["\]'')}]','W')
-endfunction
-" string_chunk cannot use standalone
-let s:string_chunk = '\v%(\\\_.|[^\1]|[\r\n]){-}'
-let s:ss_pattern = '\v''' . s:string_chunk . ''''
-let s:ds_pattern = '\v"' . s:string_chunk . '"'
-
-func! s:RegexpQuote(str)
- return substitute(a:str, '\v[\[\{\(\<\>\)\}\]]', '\\&', 'g')
-endf
-
-func! s:RegexpQuoteInSquare(str)
- return substitute(a:str, '\v[\[\]]', '\\&', 'g')
-endf
-
-" Search next open or close pair
-func! s:FormatChunk(open, close)
- let open = s:RegexpQuote(a:open)
- let close = s:RegexpQuote(a:close)
- let open2 = s:RegexpQuoteInSquare(a:open)
- let close2 = s:RegexpQuoteInSquare(a:close)
- if open == close
- return '\v'.open.s:string_chunk.close
- else
- return '\v%(' . s:ss_pattern . '|' . s:ds_pattern . '|' . '[^'.open2.close2.']|[\r\n]' . '){-}(['.open2.close2.'])'
- end
-endf
-
-" Fast wrap the word in brackets
-function! AutoPairsFastWrap()
- let line = getline('.')
- let current_char = line[col('.')-1]
- let next_char = line[col('.')]
- let open_pair_pattern = '\v[({\[''"]'
- let at_end = col('.') >= col('$') - 1
- normal! x
- " Skip blank
- if next_char =~ '\v\s' || at_end
- call search('\v\S', 'W')
- let line = getline('.')
- let next_char = line[col('.')-1]
- end
-
- if has_key(b:AutoPairs, next_char)
- let followed_open_pair = next_char
- let inputed_close_pair = current_char
- let followed_close_pair = b:AutoPairs[next_char]
- if followed_close_pair != followed_open_pair
- " TODO replace system searchpair to skip string and nested pair.
- " eg: (|){"hello}world"} will transform to ({"hello})world"}
- call searchpair('\V'.followed_open_pair, '', '\V'.followed_close_pair, 'W')
- else
- call search(s:FormatChunk(followed_open_pair, followed_close_pair), 'We')
- end
- return s:Right.inputed_close_pair.s:Left
- else
- normal! he
- return s:Right.current_char.s:Left
- end
-endfunction
-
-function! AutoPairsMap(key)
- " | is special key which separate map command from text
- let key = a:key
- if key == '|'
- let key = ''
- end
- let escaped_key = substitute(key, "'", "''", 'g')
- " use expr will cause search() doesn't work
- execute 'inoremap '.key." =AutoPairsInsert('".escaped_key."')"
-
-endfunction
-
-function! AutoPairsToggle()
- if b:autopairs_enabled
- let b:autopairs_enabled = 0
- echo 'AutoPairs Disabled.'
- else
- let b:autopairs_enabled = 1
- echo 'AutoPairs Enabled.'
- end
- return ''
-endfunction
-
-function! AutoPairsMoveCharacter(key)
- let c = getline(".")[col(".")-1]
- let escaped_key = substitute(a:key, "'", "''", 'g')
- return "\\:call search("."'".escaped_key."'".")\a".c."\"
-endfunction
-
-function! AutoPairsReturn()
- if b:autopairs_enabled == 0
- return ''
- end
- let line = getline('.')
- let pline = getline(line('.')-1)
- let prev_char = pline[strlen(pline)-1]
- let cmd = ''
- let cur_char = line[col('.')-1]
- if has_key(b:AutoPairs, prev_char) && b:AutoPairs[prev_char] == cur_char
- if g:AutoPairsCenterLine && winline() * 3 >= winheight(0) * 2
- " Recenter before adding new line to avoid replacing line content
- let cmd = "zz"
- end
-
- " If equalprg has been set, then avoid call =
- " https://github.com/jiangmiao/auto-pairs/issues/24
- if &equalprg != ''
- return "\".cmd."O"
- endif
-
- " conflict with javascript and coffee
- " javascript need indent new line
- " coffeescript forbid indent new line
- if &filetype == 'coffeescript' || &filetype == 'coffee'
- return "\".cmd."k==o"
- else
- return "\".cmd."=ko"
- endif
- end
- return ''
-endfunction
-
-function! AutoPairsSpace()
- let line = getline('.')
- let prev_char = line[col('.')-2]
- let cmd = ''
- let cur_char =line[col('.')-1]
- if has_key(g:AutoPairsParens, prev_char) && g:AutoPairsParens[prev_char] == cur_char
- let cmd = "\".s:Left
- endif
- return "\".cmd
-endfunction
-
-function! AutoPairsBackInsert()
- if exists('b:autopairs_saved_pair')
- let pair = b:autopairs_saved_pair[0]
- let pos = b:autopairs_saved_pair[1]
- call setpos('.', pos)
- return pair
- endif
- return ''
-endfunction
-
-function! AutoPairsInit()
- let b:autopairs_loaded = 1
- if !exists('b:autopairs_enabled')
- let b:autopairs_enabled = 1
- end
- let b:AutoPairsClosedPairs = {}
-
- if !exists('b:AutoPairs')
- let b:AutoPairs = g:AutoPairs
- end
-
- if !exists('b:AutoPairsMoveCharacter')
- let b:AutoPairsMoveCharacter = g:AutoPairsMoveCharacter
- end
-
- " buffer level map pairs keys
- for [open, close] in items(b:AutoPairs)
- call AutoPairsMap(open)
- if open != close
- call AutoPairsMap(close)
- end
- let b:AutoPairsClosedPairs[close] = open
- endfor
-
- for key in split(b:AutoPairsMoveCharacter, '\s*')
- let escaped_key = substitute(key, "'", "''", 'g')
- execute 'inoremap =AutoPairsMoveCharacter('".escaped_key."')"
- endfor
-
- " Still use level mapping for
- if g:AutoPairsMapBS
- " Use instead of for issue #14 sometimes press BS output strange words
- execute 'inoremap =AutoPairsDelete()'
- end
-
- if g:AutoPairsMapCh
- execute 'inoremap =AutoPairsDelete()'
- endif
-
- if g:AutoPairsMapSpace
- " Try to respect abbreviations on a
- let do_abbrev = ""
- if v:version == 703 && has("patch489") || v:version > 703
- let do_abbrev = ""
- endif
- execute 'inoremap '.do_abbrev.'=AutoPairsSpace()'
- end
-
- if g:AutoPairsShortcutFastWrap != ''
- execute 'inoremap '.g:AutoPairsShortcutFastWrap.' =AutoPairsFastWrap()'
- end
-
- if g:AutoPairsShortcutBackInsert != ''
- execute 'inoremap '.g:AutoPairsShortcutBackInsert.' =AutoPairsBackInsert()'
- end
-
- if g:AutoPairsShortcutToggle != ''
- " use