literate-dotfiles/docs/vim.html

2302 lines
71 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-01-11 sam. 22:20 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Vim Config</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="./js/readtheorg.js"></script>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div><div id="content">
<h1 class="title">Vim Config</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orged33009">Plugins Install</a>
<ul>
<li><a href="#orgbc34ff2">Plug start</a></li>
<li><a href="#org02fb17d">Manage Files</a></li>
<li><a href="#org2fcab91">Text Objects</a></li>
<li><a href="#orge56c718">Git</a></li>
<li><a href="#org6dcd9df">Motions, Search</a></li>
<li><a href="#orga9aa13a">Manipulate Things</a></li>
<li><a href="#org8992d56">Utils</a></li>
<li><a href="#orgbf6e9a2">Visual</a></li>
<li><a href="#orge59021e">Themes</a></li>
<li><a href="#org081ce3e">Language Server Protocol</a></li>
<li><a href="#org4b93f38">Snippnets and autocompletion</a></li>
<li><a href="#org1f44829">Syntax Checking and Build Utils</a></li>
<li><a href="#orgf1ad87a">Auto Completion</a></li>
<li><a href="#org74ef746">Tmux</a></li>
<li><a href="#org824d2ab">Syntax</a></li>
<li><a href="#orgf340ea7">Markdown</a></li>
<li><a href="#org78d7d3a">LaTeX</a></li>
<li><a href="#org7eb0377">Matlab</a></li>
<li><a href="#org97199a9">Org Mode</a></li>
<li><a href="#orgdc1ffed">Others / To test</a></li>
<li><a href="#org9dadb1b">Plug End</a></li>
</ul>
</li>
<li><a href="#org0b94b51">Basic</a>
<ul>
<li><a href="#org256b161">General</a></li>
<li><a href="#org6bd8cd7">VIM user interface</a></li>
<li><a href="#orgbb59276">Foldings</a></li>
<li><a href="#org7bccef3">Colors and Fonts</a></li>
<li><a href="#orge9016d2">Files, backups and undo</a></li>
<li><a href="#org4e1de45">Text, tab and indent related</a></li>
<li><a href="#org63d3296">Moving around, tabs, windows and buffers</a></li>
<li><a href="#orgf2561b7">Misc</a></li>
<li><a href="#org0551f06">Helper functions</a></li>
<li><a href="#orgb04dd31">GUI related</a></li>
<li><a href="#orgd629d9a">Turn persistent undo on</a></li>
</ul>
</li>
<li><a href="#orga2ddc8d">Mappings</a>
<ul>
<li><a href="#orgf82145f">Normal mode related</a></li>
<li><a href="#org944f772">Insert mode related</a></li>
<li><a href="#org1a540bc">Visual mode related</a></li>
<li><a href="#org3724a81">Add some delimiters</a></li>
<li><a href="#org6d1a3c1">Command mode related</a></li>
<li><a href="#orgea12030">Terminal mode related</a></li>
<li><a href="#org97c01ca">Correct misspelled works</a></li>
</ul>
</li>
<li><a href="#org9efbaf9">Filetypes</a>
<ul>
<li><a href="#orgaa90e5a">Vim Which Key</a></li>
<li><a href="#org3fe94b3">Mails</a></li>
<li><a href="#org6672ae9">MarkDown</a></li>
<li><a href="#org2855dff">LaTeX</a></li>
<li><a href="#orgdbd486b">Arduino</a></li>
<li><a href="#orgf0c3730">Python</a></li>
<li><a href="#org26daa75">Matlab</a></li>
<li><a href="#org8951ba1">Sage</a></li>
<li><a href="#org1cbea57">Save Which Key Configuration</a></li>
</ul>
</li>
<li><a href="#org48e4b16">Plugins Config</a>
<ul>
<li><a href="#org4cf6f54">junegunn/fzf</a></li>
<li><a href="#org32fa6ff">autozimu/LanguageClient-neovim</a></li>
<li><a href="#org84ce020">JamshedVesuna/vim-markdown-preview</a></li>
<li><a href="#org10c55a5">mhinz/vim-signify</a></li>
<li><a href="#org92ae007">Deoplete</a></li>
<li><a href="#org9049006">SirVer/ultisnips</a></li>
<li><a href="#org1bc629a">honza/vim-snippets</a></li>
<li><a href="#org14b3d73">itchyny/lightline.vim</a></li>
<li><a href="#org09d4b44">Autopairs</a></li>
<li><a href="#orgf99a421">Yggdroot/indentLine</a></li>
<li><a href="#orga9a8a6b">ryanoasis/vim-devicons</a></li>
<li><a href="#org1f543aa">junegunn/goyo.vim</a></li>
<li><a href="#orgd3afff1">tpope/vim-surround</a></li>
<li><a href="#org33b7648">Vim-Markdown</a></li>
<li><a href="#org9d0fb36">Neomake</a></li>
<li><a href="#org3612d41">lervag/vimtex</a></li>
<li><a href="#org39c6e0f">jpalardy/vim-slime</a></li>
<li><a href="#orgc867cde">mhinz/vim-grepper</a></li>
<li><a href="#orgb9f5f6e">Editor config</a></li>
<li><a href="#org87fa133">Polyglot</a></li>
</ul>
</li>
<li><a href="#org75b0074">Bindings</a>
<ul>
<li><a href="#org17185dd">Vim Which Key</a></li>
<li><a href="#orgac7157e">Direct ones</a></li>
<li><a href="#orgb41f651">Quit</a></li>
<li><a href="#org9159c40">Files</a></li>
<li><a href="#org73faea0">Buffers</a></li>
<li><a href="#orgb222501">Tabs</a></li>
<li><a href="#org8c7bf07">Terminals</a></li>
<li><a href="#org04030fd">Splits / Windows</a></li>
<li><a href="#org512741f">Check Spell</a></li>
<li><a href="#orga3f84f4">Make</a></li>
<li><a href="#orgafc2d25">Search</a></li>
<li><a href="#org17121de"><span class="todo TODO">TODO</span> - GIT</a></li>
<li><a href="#orgfb0a00a">Errors</a></li>
<li><a href="#org2e47a1e">Text</a></li>
<li><a href="#org7ee13d9">Config</a></li>
<li><a href="#org480d260">Insert</a></li>
<li><a href="#org63ebf9d">Save Which Key Configuration</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-orged33009" class="outline-2">
<h2 id="orged33009">Plugins Install</h2>
<div class="outline-text-2" id="text-orged33009">
</div>
<div id="outline-container-orgbc34ff2" class="outline-3">
<h3 id="orgbc34ff2">Plug start</h3>
<div class="outline-text-3" id="text-orgbc34ff2">
<div class="org-src-container">
<pre class="src src-vimrc">call plug#begin('~/.vim/plugged')
</pre>
</div>
</div>
</div>
<div id="outline-container-org02fb17d" class="outline-3">
<h3 id="org02fb17d">Manage Files</h3>
<div class="outline-text-3" id="text-org02fb17d">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'tpope/vim-vinegar' " Combine with netrw to create a delicious salad dressing
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } " A command-line fuzzy finder written in Go
Plug 'junegunn/fzf.vim' " Fzf for vim
</pre>
</div>
</div>
</div>
<div id="outline-container-org2fcab91" class="outline-3">
<h3 id="org2fcab91">Text Objects</h3>
<div class="outline-text-3" id="text-org2fcab91">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'kana/vim-textobj-user' " Create your own text objects
Plug 'kana/vim-textobj-line' " Text objects for the current line
Plug 'kana/vim-textobj-entire' " Text objects for entire buffer
Plug 'michaeljsmith/vim-indent-object' " Defines a new text object representing lines of code at the same indent level
Plug 'jiangmiao/auto-pairs' " Vim plugin, insert or delete brackets, parens, quotes in pair
</pre>
</div>
</div>
</div>
<div id="outline-container-orge56c718" class="outline-3">
<h3 id="orge56c718">Git</h3>
<div class="outline-text-3" id="text-orge56c718">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'jreybert/vimagit'
Plug 'tpope/vim-fugitive' " A Git wrapper so awesome, it should be illegal
Plug 'junegunn/gv.vim' " A git commit browser
Plug 'mhinz/vim-signify' " Show a diff using Vim its sign column
</pre>
</div>
</div>
</div>
<div id="outline-container-org6dcd9df" class="outline-3">
<h3 id="org6dcd9df">Motions, Search</h3>
<div class="outline-text-3" id="text-org6dcd9df">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'terryma/vim-expand-region' " Vim plugin that allows you to visually select increasingly larger regions of text using the same key combination
Plug 'justinmk/vim-sneak' " The missing motion for Vim
Plug 'haya14busa/is.vim' " Improved incremental searching for Vim
</pre>
</div>
</div>
</div>
<div id="outline-container-orga9aa13a" class="outline-3">
<h3 id="orga9aa13a">Manipulate Things</h3>
<div class="outline-text-3" id="text-orga9aa13a">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'tpope/vim-surround' " Quoting/parenthesizing made simple
Plug 'tpope/vim-commentary' " Comment stuff out
Plug 'junegunn/vim-easy-align' " A Vim alignment plugin
Plug 'Olical/vim-enmasse' " Edit every line in a quickfix list at the same time
Plug 'mhinz/vim-grepper', { 'on': ['Grepper', '&lt;plug&gt;(GrepperOperator)'] } "
</pre>
</div>
</div>
</div>
<div id="outline-container-org8992d56" class="outline-3">
<h3 id="org8992d56">Utils</h3>
<div class="outline-text-3" id="text-org8992d56">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'tpope/vim-repeat' " Enable repeating supported plugin maps with '.'
Plug 'tpope/vim-obsession' " Continuously updated session files
Plug 'tpope/vim-eunuch' " eunuch.vim: helpers for UNIX
Plug 'kana/vim-operator-user' " Define your own operator easily
Plug 'majutsushi/tagbar' " Vim plugin that displays tags in a window, ordered by scope
Plug 'tpope/vim-speeddating' " use CTRL-A/CTRL-X to increment dates, times, and more
Plug 'liuchengxu/vim-which-key' " Vim plugin that shows keybindings in popup
</pre>
</div>
</div>
</div>
<div id="outline-container-orgbf6e9a2" class="outline-3">
<h3 id="orgbf6e9a2">Visual</h3>
<div class="outline-text-3" id="text-orgbf6e9a2">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'itchyny/lightline.vim' " A light and configurable statusline/tabline for Vim
Plug 'Yggdroot/indentLine' " A vim plugin to display the indention levels with thin vertical lines
Plug 'ryanoasis/vim-devicons' " Adds file type glyphs/icons to many popular Vim plugins such as: NERDTree, vim-airline, unite, vim-startify and many more
Plug 'mhinz/vim-startify' " The fancy start screen for Vim
Plug 'junegunn/goyo.vim' " Distraction-free writing in Vim
</pre>
</div>
</div>
</div>
<div id="outline-container-orge59021e" class="outline-3">
<h3 id="orge59021e">Themes</h3>
<div class="outline-text-3" id="text-orge59021e">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'morhetz/gruvbox' " Retro groove color scheme for Vim
</pre>
</div>
</div>
</div>
<div id="outline-container-org081ce3e" class="outline-3">
<h3 id="org081ce3e">Language Server Protocol</h3>
<div class="outline-text-3" id="text-org081ce3e">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
</pre>
</div>
</div>
</div>
<div id="outline-container-org4b93f38" class="outline-3">
<h3 id="org4b93f38">Snippnets and autocompletion</h3>
<div class="outline-text-3" id="text-org4b93f38">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'SirVer/ultisnips' " The ultimate snippet solution for Vim
" TODO Alternative https://github.com/Shougo/neosnippet.vim
Plug 'honza/vim-snippets' " Vim-snipmate default snippets
</pre>
</div>
</div>
</div>
<div id="outline-container-org1f44829" class="outline-3">
<h3 id="org1f44829">Syntax Checking and Build Utils</h3>
<div class="outline-text-3" id="text-org1f44829">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'neomake/neomake' " Asynchronous linting and make framework for Neovim/Vim
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf1ad87a" class="outline-3">
<h3 id="orgf1ad87a">Auto Completion</h3>
<div class="outline-text-3" id="text-orgf1ad87a">
<div class="org-src-container">
<pre class="src src-vimrc">if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Nelyah/deoplete-mu'
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
Plug 'Nelyah/deoplete-mu'
endif
</pre>
</div>
</div>
</div>
<div id="outline-container-org74ef746" class="outline-3">
<h3 id="org74ef746">Tmux</h3>
<div class="outline-text-3" id="text-org74ef746">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'christoomey/vim-tmux-navigator' " Seamless navigation between tmux panes and vim splits
Plug 'jpalardy/vim-slime' " Used to type text into a REPL
</pre>
</div>
</div>
</div>
<div id="outline-container-org824d2ab" class="outline-3">
<h3 id="org824d2ab">Syntax</h3>
<div class="outline-text-3" id="text-org824d2ab">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'sheerun/vim-polyglot' " A solid language pack for Vim
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf340ea7" class="outline-3">
<h3 id="orgf340ea7">Markdown</h3>
<div class="outline-text-3" id="text-orgf340ea7">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'plasticboy/vim-markdown', { 'for': 'markdown' } " Markdown Vim Mode
Plug 'mzlogin/vim-markdown-toc', { 'for': 'markdown' } " A vim plugin to generate table of contents for Markdown files
Plug 'JamshedVesuna/vim-markdown-preview', { 'for': 'markdown' } " A light Vim plugin for previewing markdown files in a browser
Plug 'nelstrom/vim-markdown-folding' " Fold markdown documents by section
</pre>
</div>
</div>
</div>
<div id="outline-container-org78d7d3a" class="outline-3">
<h3 id="org78d7d3a">LaTeX</h3>
<div class="outline-text-3" id="text-org78d7d3a">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'lervag/vimtex', { 'for': 'tex' } " A modern vim plugin for editing LaTeX files.
</pre>
</div>
</div>
</div>
<div id="outline-container-org7eb0377" class="outline-3">
<h3 id="org7eb0377">Matlab</h3>
<div class="outline-text-3" id="text-org7eb0377">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'tdehaeze/matlab-vim', { 'for': 'matlab' } " Edit Matlab M-files in Vim editor
Plug 'djoshea/vim-matlab-fold', { 'for': 'matlab' } " Vim code folding for Matlab files
</pre>
</div>
</div>
</div>
<div id="outline-container-org97199a9" class="outline-3">
<h3 id="org97199a9">Org Mode</h3>
<div class="outline-text-3" id="text-org97199a9">
<div class="org-src-container">
<pre class="src src-vimrc">Plug 'jceb/vim-orgmode' " Text outlining and task management for Vim
Plug 'vim-scripts/SyntaxRange' " Define a different filetype syntax on regions of a buffer
Plug 'chrisbra/NrrwRgn' " A Narrow Region Plugin for vim
Plug 'mattn/calendar-vim' " calendar vimscript
Plug 'vim-scripts/utl.vim' " Univeral Text Linking - Execute URLs, footnotes, open emails, organize ideas
</pre>
</div>
</div>
</div>
<div id="outline-container-orgdc1ffed" class="outline-3">
<h3 id="orgdc1ffed">Others / To test</h3>
<div class="outline-text-3" id="text-orgdc1ffed">
<div class="org-src-container">
<pre class="src src-vimrc">" Plug 'francoiscabrol/ranger.vim' " Ranger integration in vim and neovim
" Plug 'brooth/far.vim' " Find And Replace Vim plugin
" Plug 'justinmk/vim-gtfo' " Go to Terminal or File manager
" Plug 'sjl/gundo.vim', { 'on': 'GundoToggle' } " Vim plugin to visualize your Vim undo tree
" Plug 'drzel/vim-line-no-indicator' " Simple and expressive line number indicator
</pre>
</div>
</div>
</div>
<div id="outline-container-org9dadb1b" class="outline-3">
<h3 id="org9dadb1b">Plug End</h3>
<div class="outline-text-3" id="text-org9dadb1b">
<div class="org-src-container">
<pre class="src src-vimrc">call plug#end()
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org0b94b51" class="outline-2">
<h2 id="org0b94b51">Basic</h2>
<div class="outline-text-2" id="text-org0b94b51">
</div>
<div id="outline-container-org256b161" class="outline-3">
<h3 id="org256b161">General</h3>
<div class="outline-text-3" id="text-org256b161">
<div class="org-src-container">
<pre class="src src-vimrc">set runtimepath+=~/.vim
" Sets how many lines of history VIM has to remember
set history=500
" Enable filetype plugins
filetype plugin on
filetype indent on
" Set to auto read when a file is changed from the outside
set autoread
" writes the content of the file automatically if you call :make
set autowrite
" Share clipboard with system
set clipboard+=unnamedplus
" Define Leader Key as Space key
let mapleader = "\&lt;Space&gt;"
let g:mapleader = "\&lt;Space&gt;"
let maplocalleader = ","
</pre>
</div>
</div>
</div>
<div id="outline-container-org6bd8cd7" class="outline-3">
<h3 id="org6bd8cd7">VIM user interface</h3>
<div class="outline-text-3" id="text-org6bd8cd7">
<div class="org-src-container">
<pre class="src src-vimrc">" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" Avoid garbled characters in Chinese language windows OS
let $LANG='en'
set langmenu=en
" Set Timeout config
set timeout
set ttimeout
set timeoutlen=500
set ttimeoutlen=50
" Turn on the wild menu
set wildmenu
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
set wildignore+=.git\*,.hg\*,.svn\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
endif
set wildmode=full
"Always show current position
set ruler
" Height of the command bar
set cmdheight=1
" A buffer becomes hidden when it is abandoned
set hid
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=&lt;,&gt;,h,l
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
" Option for smarter completions that will be case aware
set infercase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Don't redraw while executing macros (good performance config)
set lazyredraw
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" Don't show tab line if there is only one tab
set showtabline=1
" How tany tenths of a second to blink when matching brackets
set mat=2
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Add a bit extra margin to the left
set foldcolumn=0
" Improve VIM scrolling
set ttyfast
" Relative Numbers
set relativenumber
" Smarter J and K navigation
nnoremap &lt;expr&gt; j v:count ? (v:count &gt; 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap &lt;expr&gt; k v:count ? (v:count &gt; 5 ? "m'" . v:count : '') . 'k' : 'gk'
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
set splitbelow splitright
</pre>
</div>
</div>
</div>
<div id="outline-container-orgbb59276" class="outline-3">
<h3 id="orgbb59276">Foldings</h3>
<div class="outline-text-3" id="text-orgbb59276">
<div class="org-src-container">
<pre class="src src-vimrc">if has('folding')
if has('windows')
let &amp;fillchars='vert: ' " less cluttered vertical window separators
endif
set foldmethod=indent " not as cool as syntax, but faster
set foldlevelstart=99 " start unfolded
endif
</pre>
</div>
</div>
</div>
<div id="outline-container-org7bccef3" class="outline-3">
<h3 id="org7bccef3">Colors and Fonts</h3>
<div class="outline-text-3" id="text-org7bccef3">
<div class="org-src-container">
<pre class="src src-vimrc">syntax enable
set background=dark
let base16colorspace=256
let g:gruvbox_contrast_dark = 'soft'
try
colorscheme gruvbox
catch
endtry
" set cursor shapes for insert and replace modes
set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20
" Set utf8 as standard encoding
set encoding=utf-8
set fileencoding=utf-8
" Use Unix as the standard file type
set ffs=unix,dos,mac
" Do not highlight the cursor line : http://vim.wikia.com/wiki/Highlight_current_line
set nocursorline
set nocursorcolumn
" Always show the status line
set laststatus=2
" Underline for bad spelled words
hi clear SpellBad
hi SpellBad cterm=underline
" Set style for gVim
hi SpellBad gui=undercurl
</pre>
</div>
</div>
</div>
<div id="outline-container-orge9016d2" class="outline-3">
<h3 id="orge9016d2">Files, backups and undo</h3>
<div class="outline-text-3" id="text-orge9016d2">
<div class="org-src-container">
<pre class="src src-vimrc">" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
</pre>
</div>
</div>
</div>
<div id="outline-container-org4e1de45" class="outline-3">
<h3 id="org4e1de45">Text, tab and indent related</h3>
<div class="outline-text-3" id="text-org4e1de45">
<div class="org-src-container">
<pre class="src src-vimrc">" Use spaces instead of tabs
set expandtab
" Be smart when using tabs
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
" Word wrap without line breaks
set wrap
set linebreak
set nolist " list disables linebreak
set autoindent " Auto Indentation
set nosmartindent " No Smart Indentation
</pre>
</div>
</div>
</div>
<div id="outline-container-org63d3296" class="outline-3">
<h3 id="org63d3296">Moving around, tabs, windows and buffers</h3>
<div class="outline-text-3" id="text-org63d3296">
<div class="org-src-container">
<pre class="src src-vimrc">" Specify the behavior when switching between buffers
try
set switchbuf=useopen,usetab
catch
endtry
" Return to last edit position when opening files (You want this!)
au BufReadPost * if line("'\"") &gt; 1 &amp;&amp; line("'\"") &lt;= line("$") | exe "normal! g'\"" | endif
set splitbelow
set splitright
" This enables mouse in all modes
set mouse=a
" Automatically equalize splits when Vim is resized
autocmd VimResized * wincmd =
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf2561b7" class="outline-3">
<h3 id="orgf2561b7">Misc</h3>
<div class="outline-text-3" id="text-orgf2561b7">
<div class="org-src-container">
<pre class="src src-vimrc">" Enable Line Number
set number
" Speed up cursor movments : http://superuser.com/a/625994/587300
set regexpengine=1 " https://github.com/xolox/vim-easytags/issues/88
" Set the maximum column for syntax highlighting
set synmaxcol=250
</pre>
</div>
</div>
</div>
<div id="outline-container-org0551f06" class="outline-3">
<h3 id="org0551f06">Helper functions</h3>
<div class="outline-text-3" id="text-org0551f06">
<div class="org-src-container">
<pre class="src src-vimrc">function! CmdLine(str)
exe "menu Foo.Bar :" . a:str
emenu Foo.Bar
unmenu Foo
endfunction
function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", '\\/.*$^~[]')
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'gv'
call CmdLine("Ag \"" . l:pattern . "\" " )
elseif a:direction == 'replace'
call CmdLine("%s" . '/'. l:pattern . '/')
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
" Don't close window, when deleting a buffer
command! Bclose call &lt;SID&gt;BufcloseCloseIt()
function! &lt;SID&gt;BufcloseCloseIt()
let l:currentBufNum = bufnr("%")
let l:alternateBufNum = bufnr("#")
if buflisted(l:alternateBufNum)
buffer #
else
bnext
endif
if bufnr("%") == l:currentBufNum
new
endif
if buflisted(l:currentBufNum)
execute("bdelete! ".l:currentBufNum)
endif
endfunction
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb04dd31" class="outline-3">
<h3 id="orgb04dd31">GUI related</h3>
<div class="outline-text-3" id="text-orgb04dd31">
<div class="org-src-container">
<pre class="src src-vimrc">set guifont=Hack\ Nerd\ Font\ Mono:h13
set gfn=Hack\ Nerd\ Font\ Mono:h13
" Disable scrollbars
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd629d9a" class="outline-3">
<h3 id="orgd629d9a">Turn persistent undo on</h3>
<div class="outline-text-3" id="text-orgd629d9a">
<div class="org-src-container">
<pre class="src src-vimrc">try
set undodir=~/.vim_runtime/temp_dirs/undodir
set undofile
catch
endtry
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orga2ddc8d" class="outline-2">
<h2 id="orga2ddc8d">Mappings</h2>
<div class="outline-text-2" id="text-orga2ddc8d">
</div>
<div id="outline-container-orgf82145f" class="outline-3">
<h3 id="orgf82145f">Normal mode related</h3>
<div class="outline-text-3" id="text-orgf82145f">
<div class="org-src-container">
<pre class="src src-vimrc">" Smart way to move between windows
noremap &lt;C-j&gt; &lt;C-W&gt;j
noremap &lt;C-k&gt; &lt;C-W&gt;k
noremap &lt;C-h&gt; &lt;C-W&gt;h
noremap &lt;C-l&gt; &lt;C-W&gt;l
</pre>
</div>
</div>
</div>
<div id="outline-container-org944f772" class="outline-3">
<h3 id="org944f772">Insert mode related</h3>
<div class="outline-text-3" id="text-org944f772">
<div class="org-src-container">
<pre class="src src-vimrc">" Paste while in insert mode
inoremap &lt;C-v&gt; &lt;C-r&gt;*
" Go to the end of line
inoremap &lt;C-e&gt; &lt;Esc&gt;A
" Go to the beginning of line
inoremap &lt;C-a&gt; &lt;Esc&gt;I
</pre>
</div>
</div>
</div>
<div id="outline-container-org1a540bc" class="outline-3">
<h3 id="org1a540bc">Visual mode related</h3>
<div class="outline-text-3" id="text-org1a540bc">
<div class="org-src-container">
<pre class="src src-vimrc">" Visual mode pressing / or ? searches for the current selection
vnoremap &lt;silent&gt; / :&lt;C-u&gt;call VisualSelection('', '')&lt;CR&gt;/&lt;C-R&gt;=@/&lt;CR&gt;&lt;CR&gt;
vnoremap &lt;silent&gt; ? :&lt;C-u&gt;call VisualSelection('', '')&lt;CR&gt;?&lt;C-R&gt;=@/&lt;CR&gt;&lt;CR&gt;
" Re-select visual block after indenting
vnoremap &lt; &lt;gv
vnoremap &gt; &gt;gv
" Move visual block
vnoremap J :m '&gt;+1&lt;CR&gt;gv=gv
vnoremap K :m '&lt;-2&lt;CR&gt;gv=gv
</pre>
</div>
</div>
</div>
<div id="outline-container-org3724a81" class="outline-3">
<h3 id="org3724a81">Add some delimiters</h3>
<div class="outline-text-3" id="text-org3724a81">
<div class="org-src-container">
<pre class="src src-vimrc">" use $ as a delimiter
xnoremap i$ :&lt;C-u&gt;normal! T$vt$&lt;CR&gt;
xnoremap a$ :&lt;C-u&gt;normal! T$hvt$l&lt;CR&gt;
onoremap i$ :normal vi$&lt;CR&gt;
onoremap a$ :normal va$&lt;CR&gt;
</pre>
</div>
</div>
</div>
<div id="outline-container-org6d1a3c1" class="outline-3">
<h3 id="org6d1a3c1">Command mode related</h3>
<div class="outline-text-3" id="text-org6d1a3c1">
<div class="org-src-container">
<pre class="src src-vimrc">" Bash like keys for the command line
cnoremap &lt;C-A&gt; &lt;Home&gt;
cnoremap &lt;C-E&gt; &lt;End&gt;
cnoremap &lt;C-K&gt; &lt;C-U&gt;
cnoremap &lt;C-P&gt; &lt;Up&gt;
cnoremap &lt;C-N&gt; &lt;Down&gt;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgea12030" class="outline-3">
<h3 id="orgea12030">Terminal mode related</h3>
<div class="outline-text-3" id="text-orgea12030">
<div class="org-src-container">
<pre class="src src-vimrc">" tnoremap &lt;Esc&gt; &lt;C-\&gt;&lt;C-n&gt;
tnoremap &lt;C-w&gt;h &lt;C-\&gt;&lt;C-n&gt;&lt;C-w&gt;h
tnoremap &lt;C-w&gt;j &lt;C-\&gt;&lt;C-n&gt;&lt;C-w&gt;j
tnoremap &lt;C-w&gt;k &lt;C-\&gt;&lt;C-n&gt;&lt;C-w&gt;k
tnoremap &lt;C-w&gt;l &lt;C-\&gt;&lt;C-n&gt;&lt;C-w&gt;l
</pre>
</div>
</div>
</div>
<div id="outline-container-org97c01ca" class="outline-3">
<h3 id="org97c01ca">Correct misspelled works</h3>
<div class="outline-text-3" id="text-org97c01ca">
<p>
Taken from: <a href="https://vi.stackexchange.com/questions/68/autocorrect-spelling-mistakes">https://vi.stackexchange.com/questions/68/autocorrect-spelling-mistakes</a>
</p>
<div class="org-src-container">
<pre class="src src-vimrc">" Go back to last misspelled word and pick first suggestion.
inoremap &lt;C-L&gt; &lt;C-G&gt;u&lt;Esc&gt;[s1z=`]a&lt;C-G&gt;u
" Select last misspelled word (typing will edit).
nnoremap &lt;C-K&gt; &lt;Esc&gt;[sve&lt;C-G&gt;
inoremap &lt;C-K&gt; &lt;Esc&gt;[sve&lt;C-G&gt;
snoremap &lt;C-K&gt; &lt;Esc&gt;b[sviw&lt;C-G&gt;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org9efbaf9" class="outline-2">
<h2 id="org9efbaf9">Filetypes</h2>
<div class="outline-text-2" id="text-org9efbaf9">
</div>
<div id="outline-container-orgaa90e5a" class="outline-3">
<h3 id="orgaa90e5a">Vim Which Key</h3>
<div class="outline-text-3" id="text-orgaa90e5a">
<div class="org-src-container">
<pre class="src src-vimrc">nnoremap &lt;silent&gt; &lt;localleader&gt; :&lt;c-u&gt;WhichKey ','&lt;CR&gt;
let g:which_key_map_local = {}
</pre>
</div>
</div>
</div>
<div id="outline-container-org3fe94b3" class="outline-3">
<h3 id="org3fe94b3">Mails</h3>
<div class="outline-text-3" id="text-org3fe94b3">
<div class="org-src-container">
<pre class="src src-vimrc">autocmd FileType mail set spell spelllang=en_us,fr
</pre>
</div>
</div>
</div>
<div id="outline-container-org6672ae9" class="outline-3">
<h3 id="org6672ae9">MarkDown</h3>
<div class="outline-text-3" id="text-org6672ae9">
<div class="org-src-container">
<pre class="src src-vimrc">" Automatically turn on spell-checking for Markdown files
au BufRead,BufNewFile *.md setlocal spell spelllang=fr,en
</pre>
</div>
</div>
</div>
<div id="outline-container-org2855dff" class="outline-3">
<h3 id="org2855dff">LaTeX</h3>
<div class="outline-text-3" id="text-org2855dff">
<div class="org-src-container">
<pre class="src src-vimrc">" TODO : améliorer ça
au BufRead,BufNewFile *.tikz set filetype=tex
let tex_no_error=1 " TODO: used to not highlight underscores
au BufRead,BufNewFile *.tex set filetype=tex
au BufRead,BufNewFile *.tex let b:AutoPairs={'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '$':'$'}
au BufRead,BufNewFile *.tex set iskeyword+=-
" " clear the current list of matches that cause error-highlighting
" syn clear texOnlyMath
" " still mark '^' as an error outside of math mode
" syn match texOnlyMath /[\^]/
" autocmd FileType tex,tikz nnoremap &lt;leader&gt;lt &lt;plug&gt;(vimtex-toc-toggle)
" autocmd FileType tex,tikz nnoremap &lt;leader&gt;ll &lt;plug&gt;(vimtex-labels-open)
" autocmd FileType tex,tikz nnoremap &lt;leader&gt;lv &lt;plug&gt;(vimtex-view)
" autocmd FileType tex,tikz nnoremap &lt;leader&gt;lf &lt;plug&gt;(vimtex-reverse-search)
" " Make Tikz
" nnoremap &lt;leader&gt;mt :Make pdf t=tikz f=%:t:r&lt;cr&gt;
" nnoremap &lt;leader&gt;mto :make open t=tikz f=%:t:r&lt;cr&gt;
" " Make LaTeX
" nnoremap &lt;leader&gt;ml :Make pdf f=%:t:r&lt;cr&gt;
" nnoremap &lt;leader&gt;mlo :make open f=%:t:r&lt;cr&gt;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgdbd486b" class="outline-3">
<h3 id="orgdbd486b">Arduino</h3>
<div class="outline-text-3" id="text-orgdbd486b">
<div class="org-src-container">
<pre class="src src-vimrc">au BufRead,BufNewFile *.pde set filetype=arduino
au BufRead,BufNewFile *.ino set filetype=arduino
" au FileType arduino map &lt;leader&gt;ac :!platformio run&lt;CR&gt;
" au FileType arduino map &lt;leader&gt;au :!platformio run -s --target=upload&lt;CR&gt;
" au FileType arduino map &lt;leader&gt;am :!platformio serialports monitor --port=/dev/cu
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf0c3730" class="outline-3">
<h3 id="orgf0c3730">Python</h3>
<div class="outline-text-3" id="text-orgf0c3730">
<div class="org-src-container">
<pre class="src src-vimrc">let g:slime_python_ipython = 1
au FileType python setlocal expandtab
au FileType python setlocal tabstop=4
au FileType python setlocal shiftwidth=4
" Run Section
au FileType python nmap &lt;buffer&gt; &lt;localleader&gt;&lt;localleader&gt; &lt;Plug&gt;SlimeParagraphSend
" Run Selected text
au FileType python vmap &lt;buffer&gt; &lt;localleader&gt;&lt;localleader&gt; &lt;Plug&gt;SlimeRegionSend
" CD to directory of current file
" TODO - Should enter the command. This just output the command without runing
" it...
au FileType python nmap &lt;buffer&gt; &lt;localleader&gt;c :SlimeSend0('cd '.expand('%:p:h'))&lt;CR&gt;
" let python_highlight_all = 1
" au FileType python syn keyword pythonDecorator True None False self
" au BufNewFile,BufRead *.jinja set syntax=htmljinja
" au BufNewFile,BufRead *.mako set ft=mako
" au FileType python map &lt;buffer&gt; F :set foldmethod=indent&lt;cr&gt;
" au FileType python inoremap &lt;buffer&gt; $r return
" au FileType python inoremap &lt;buffer&gt; $i import
" au FileType python inoremap &lt;buffer&gt; $p print
" au FileType python inoremap &lt;buffer&gt; $f #--- &lt;esc&gt;a
" au FileType python map &lt;buffer&gt; &lt;leader&gt;1 /class
" au FileType python map &lt;buffer&gt; &lt;leader&gt;2 /def
" au FileType python map &lt;buffer&gt; &lt;leader&gt;C ?class
" au FileType python map &lt;buffer&gt; &lt;leader&gt;D ?def
</pre>
</div>
</div>
</div>
<div id="outline-container-org26daa75" class="outline-3">
<h3 id="org26daa75">Matlab</h3>
<div class="outline-text-3" id="text-org26daa75">
<div class="org-src-container">
<pre class="src src-vimrc">" TODO Run Section (delimited by %%)
au FileType matlab nmap &lt;buffer&gt; &lt;localleader&gt;mm &lt;Plug&gt;SlimeParagraphSend
let g:which_key_map_local.m = { 'name' : '+matlab' }
" Run either Selected text
au FileType matlab vmap &lt;buffer&gt; &lt;localleader&gt;mm &lt;Plug&gt;SlimeRegionSend
let g:which_key_map_local.mm = 'run-code'
func! GetSelectedText()
normal gv"xy
let result = getreg("x")
normal gv
return result
endfunc
" Help on the current selection
au FileType matlab vmap &lt;buffer&gt; &lt;localleader&gt;mh :&lt;C-U&gt;SlimeSend0('help '.expand(GetSelectedText()))&lt;CR&gt;
let g:which_key_map_local.mh = 'help'
" Documentation on the current selection
au FileType matlab vmap &lt;buffer&gt; &lt;localleader&gt;mH :&lt;C-U&gt;SlimeSend0('doc '.expand(GetSelectedText()))&lt;CR&gt;
let g:which_key_map_local.mh = 'help'
" Open the current file in the Matlab Editor (usefull for debuging)
au FileType matlab nmap &lt;buffer&gt; &lt;localleader&gt;me :SlimeSend0('edit '.expand('%:p'))&lt;CR&gt;
let g:which_key_map_local.me = 'edit-gui'
" Run all the file
au FileType matlab nmap &lt;buffer&gt; &lt;localleader&gt;mr :SlimeSend0('run '.expand('%:t'))&lt;CR&gt;
let g:which_key_map_local.mr = 'run-file'
" Send "cd filepath" to matlab
au FileType matlab nmap &lt;buffer&gt; &lt;localleader&gt;mc :SlimeSend0('cd '.expand('%:p:h'))&lt;CR&gt;
let g:which_key_map_local.mr = 'cd-file'
" Open workspace
au FileType matlab nmap &lt;buffer&gt; &lt;localleader&gt;mw :SlimeSend0('workspace')&lt;CR&gt;
let g:which_key_map_local.mr = 'workspace'
</pre>
</div>
</div>
</div>
<div id="outline-container-org8951ba1" class="outline-3">
<h3 id="org8951ba1">Sage</h3>
<div class="outline-text-3" id="text-org8951ba1">
<div class="org-src-container">
<pre class="src src-vimrc">" TODO Run Section
au FileType sage.python nmap &lt;buffer&gt; &lt;localleader&gt;&lt;localleader&gt; &lt;Plug&gt;SlimeParagraphSend
" Run Selected text
au FileType sage.python vmap &lt;buffer&gt; &lt;localleader&gt;&lt;localleader&gt; &lt;Plug&gt;SlimeRegionSend
</pre>
</div>
</div>
</div>
<div id="outline-container-org1cbea57" class="outline-3">
<h3 id="org1cbea57">Save Which Key Configuration</h3>
<div class="outline-text-3" id="text-org1cbea57">
<div class="org-src-container">
<pre class="src src-vimrc">call which_key#register(',', "g:which_key_map_local")
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org48e4b16" class="outline-2">
<h2 id="org48e4b16">Plugins Config</h2>
<div class="outline-text-2" id="text-org48e4b16">
</div>
<div id="outline-container-org4cf6f54" class="outline-3">
<h3 id="org4cf6f54">junegunn/fzf</h3>
<div class="outline-text-3" id="text-org4cf6f54">
<div class="org-src-container">
<pre class="src src-vimrc">" This is the default extra key bindings
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-h': 'split',
\ 'ctrl-v': 'vsplit' }
" [[B]Commits] Customize the options used by 'git log':
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
function! s:fzf_statusline()
" Override statusline as you like
highlight fzf1 ctermfg=161 ctermbg=251
highlight fzf2 ctermfg=23 ctermbg=251
highlight fzf3 ctermfg=237 ctermbg=251
setlocal statusline=%#fzf1#\ &gt;\ %#fzf2#fz%#fzf3#f
endfunction
autocmd! User FzfStatusLine call &lt;SID&gt;fzf_statusline()
</pre>
</div>
</div>
</div>
<div id="outline-container-org32fa6ff" class="outline-3">
<h3 id="org32fa6ff">autozimu/LanguageClient-neovim</h3>
<div class="outline-text-3" id="text-org32fa6ff">
<div class="org-src-container">
<pre class="src src-vimrc">let g:LanguageClient_serverCommands = {
\ 'matlab': ['java', ' -Djava.library.path=$MATLABROOT/bin/glnxa64 -cp $MATLABROOT/extern/engines/java/jar/engine.jar:$MATLABROOT/java/jar/jmi.jar:/home/thomas/github/matlab-langserver/build/libs/lsp-matlab-0.1.jar org.tokor.lspmatlab.Application'],
\ }
nnoremap &lt;F5&gt; :call LanguageClient_contextMenu()&lt;CR&gt;
" Or map each action separately
nnoremap &lt;silent&gt; K :call LanguageClient#textDocument_hover()&lt;CR&gt;
nnoremap &lt;silent&gt; gd :call LanguageClient#textDocument_definition()&lt;CR&gt;
nnoremap &lt;silent&gt; &lt;F2&gt; :call LanguageClient#textDocument_rename()&lt;CR&gt;
</pre>
</div>
</div>
</div>
<div id="outline-container-org84ce020" class="outline-3">
<h3 id="org84ce020">JamshedVesuna/vim-markdown-preview</h3>
<div class="outline-text-3" id="text-org84ce020">
<div class="org-src-container">
<pre class="src src-vimrc">let vim_markdown_preview_github=1
let vim_markdown_preview_browser='Google Chrome'
let vim_markdown_preview_temp_file=1
" let vim_markdown_preview_pandoc=1
</pre>
</div>
</div>
</div>
<div id="outline-container-org10c55a5" class="outline-3">
<h3 id="org10c55a5">mhinz/vim-signify</h3>
<div class="outline-text-3" id="text-org10c55a5">
<div class="org-src-container">
<pre class="src src-vimrc">let g:signify_vcs_list = ['git']
let g:signify_disable_by_default = 1
</pre>
</div>
</div>
</div>
<div id="outline-container-org92ae007" class="outline-3">
<h3 id="org92ae007">Deoplete</h3>
<div class="outline-text-3" id="text-org92ae007">
<div class="org-src-container">
<pre class="src src-vimrc">let g:deoplete#enable_at_startup = 1
" let g:deoplete#omni#functions = {}
" set completeopt=longest,menuone,preview
" let g:deoplete#sources = {}
" let g:deoplete#enable_smart_case = 1
" call deoplete#custom#set('ultisnips', 'matchers', ['matcher_fuzzy'])
</pre>
</div>
</div>
</div>
<div id="outline-container-org9049006" class="outline-3">
<h3 id="org9049006">SirVer/ultisnips</h3>
<div class="outline-text-3" id="text-org9049006">
<div class="org-src-container">
<pre class="src src-vimrc">let g:UltiSnipsSnippetsDir = '~/.vim/UltiSnip'
" inoremap &lt;silent&gt;&lt;expr&gt;&lt;TAB&gt; pumvisible() ? "\&lt;C-n&gt;" : "\&lt;TAB&gt;"
let g:UltiSnipsExpandTrigger="&lt;C-j&gt;"
" let g:UltiSnipsJumpForwardTrigger="&lt;tab&gt;"
" let g:UltiSnipsJumpBackwardTrigger="&lt;s-tab&gt;"
</pre>
</div>
</div>
</div>
<div id="outline-container-org1bc629a" class="outline-3">
<h3 id="org1bc629a">honza/vim-snippets</h3>
<div class="outline-text-3" id="text-org1bc629a">
<div class="org-src-container">
<pre class="src src-vimrc">let g:snipMate = {}
let g:snipMate.scope_aliases = {}
</pre>
</div>
</div>
</div>
<div id="outline-container-org14b3d73" class="outline-3">
<h3 id="org14b3d73">itchyny/lightline.vim</h3>
<div class="outline-text-3" id="text-org14b3d73">
<div class="org-src-container">
<pre class="src src-vimrc">function! LightlineObsession()
return '%{ObsessionStatus("")}'
endfunction
" \ 'colorscheme': 'gruvbox',
let g:lightline = {
\ 'colorscheme': 'solarized',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'filename', 'modified', 'fugitive', 'obsession' ] ]
\ },
\ 'component': {
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
\ },
\ 'component_expand': {
\ 'obsession': 'LightlineObsession'
\ },
\ 'component_visible_condition': {
\ 'fugitive': '(exists("*fugitive#head") &amp;&amp; ""!=fugitive#head())'
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': "|", 'right': "|" }
\ }
</pre>
</div>
</div>
</div>
<div id="outline-container-org09d4b44" class="outline-3">
<h3 id="org09d4b44">Autopairs</h3>
<div class="outline-text-3" id="text-org09d4b44">
<div class="org-src-container">
<pre class="src src-vimrc">" Incompatibilité entre auto-pairs et clang-complete
let g:AutoPairsMapCR = 0
imap &lt;silent&gt;&lt;CR&gt; &lt;CR&gt;&lt;Plug&gt;AutoPairsReturn
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf99a421" class="outline-3">
<h3 id="orgf99a421">Yggdroot/indentLine</h3>
<div class="outline-text-3" id="text-orgf99a421">
<div class="org-src-container">
<pre class="src src-vimrc">" :IndentLinesToggle toggles lines on and off.
let g:indentLine_color_term = 239
</pre>
</div>
</div>
</div>
<div id="outline-container-orga9a8a6b" class="outline-3">
<h3 id="orga9a8a6b">ryanoasis/vim-devicons</h3>
<div class="outline-text-3" id="text-orga9a8a6b">
<div class="org-src-container">
<pre class="src src-vimrc">let g:webdevicons_enable_ctrlp = 1
</pre>
</div>
</div>
</div>
<div id="outline-container-org1f543aa" class="outline-3">
<h3 id="org1f543aa">junegunn/goyo.vim</h3>
<div class="outline-text-3" id="text-org1f543aa">
<div class="org-src-container">
<pre class="src src-vimrc">let g:goyo_width=100
let g:goyo_margin_top = 2
let g:goyo_margin_bottom = 2
</pre>
</div>
<p>
This is for soft line breaks
</p>
<div class="org-src-container">
<pre class="src src-vimrc">function! s:goyo_enter()
set wrap linebreak nolist textwidth=0 wrapmargin=0
let b:quitting = 0
let b:quitting_bang = 0
autocmd QuitPre &lt;buffer&gt; let b:quitting = 1
cabbrev &lt;buffer&gt; q! let b:quitting_bang = 1 &lt;bar&gt; q!
endfunction
</pre>
</div>
<p>
Quit Vim if this is the only remaining buffer
</p>
<div class="org-src-container">
<pre class="src src-vimrc">function! s:goyo_leave()
if b:quitting &amp;&amp; len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
if b:quitting_bang
qa!
else
qa
endif
endif
endfunction
</pre>
</div>
<div class="org-src-container">
<pre class="src src-vimrc">autocmd! User GoyoEnter call &lt;SID&gt;goyo_enter()
autocmd! User GoyoLeave call &lt;SID&gt;goyo_leave()
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd3afff1" class="outline-3">
<h3 id="orgd3afff1">tpope/vim-surround</h3>
<div class="outline-text-3" id="text-orgd3afff1">
<div class="org-src-container">
<pre class="src src-vimrc">vmap Si S(i_&lt;esc&gt;f)
au FileType mako vmap Si S"i${ _(&lt;esc&gt;2f"a) }&lt;esc&gt;
" surroung un visual mode : use S, then b to make the text bold in markdown
let g:surround_{char2nr('b')} = "__\r__"
</pre>
</div>
</div>
</div>
<div id="outline-container-org33b7648" class="outline-3">
<h3 id="org33b7648">Vim-Markdown</h3>
<div class="outline-text-3" id="text-org33b7648">
<div class="org-src-container">
<pre class="src src-vimrc">let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_conceal = 0
let g:vim_markdown_toc_autofit = 1
let g:vim_markdown_toml_frontmatter = 1
let g:tex_conceal = ""
</pre>
</div>
</div>
</div>
<div id="outline-container-org9d0fb36" class="outline-3">
<h3 id="org9d0fb36">Neomake</h3>
<div class="outline-text-3" id="text-org9d0fb36">
<div class="org-src-container">
<pre class="src src-vimrc">" Latex
autocmd! BufWritePost *.tex Neomake
let g:neomake_tex_chktex_maker = {
\ 'exe': 'chktex',
\ 'args': ['--inputfiles'],
\ 'errorformat':
\ '%EError %n in %f line %l: %m,' .
\ '%WWarning %n in %f line %l: %m,' .
\ '%WMessage %n in %f line %l: %m,' .
\ '%Z%p^,' .
\ '%-G%.%#'
\ }
let g:neomake_tex_enabled_makers = ['chktex']
" Matlab
autocmd! BufWritePost *.m Neomake
let g:neomake_matlab_mlint_maker = {
\ 'exe': 'mlint',
\ 'mapexpr': "neomake_bufname.':'.v:val",
\ 'errorformat':
\ '%f:L %l (C %c): %m,' .
\ '%f:L %l (C %c-%*[0-9]): %m,',
\ }
let g:neomake_matlab_enabled_makers = ['mlint']
</pre>
</div>
</div>
</div>
<div id="outline-container-org3612d41" class="outline-3">
<h3 id="org3612d41">lervag/vimtex</h3>
<div class="outline-text-3" id="text-org3612d41">
<div class="org-src-container">
<pre class="src src-vimrc">" let g:tex_conceal=""
" autocmd FileType tex let b:vimtex_main = 'main.tex'
" let g:vimtex_mappings_enabled=0
</pre>
</div>
</div>
</div>
<div id="outline-container-org39c6e0f" class="outline-3">
<h3 id="org39c6e0f">jpalardy/vim-slime</h3>
<div class="outline-text-3" id="text-org39c6e0f">
<div class="org-src-container">
<pre class="src src-vimrc">if exists('$TMUX')
let g:slime_target = "tmux"
let g:slime_default_config = {"socket_name": split($TMUX, ",")[0], "target_pane": ":.2"}
let g:slime_dont_ask_default = 1
endif
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc867cde" class="outline-3">
<h3 id="orgc867cde">mhinz/vim-grepper</h3>
<div class="outline-text-3" id="text-orgc867cde">
<div class="org-src-container">
<pre class="src src-vimrc">" nnoremap &lt;leader&gt;G :Grepper -tool ag&lt;cr&gt;
" nmap gs &lt;plug&gt;(GrepperOperator)
" xmap gs &lt;plug&gt;(GrepperOperator)
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb9f5f6e" class="outline-3">
<h3 id="orgb9f5f6e">Editor config</h3>
<div class="outline-text-3" id="text-orgb9f5f6e">
<div class="org-src-container">
<pre class="src src-vimrc">" To ensure that this plugin works well with Tim Pope's fugitive, use the following patterns array:
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
</pre>
</div>
</div>
</div>
<div id="outline-container-org87fa133" class="outline-3">
<h3 id="org87fa133">Polyglot</h3>
<div class="outline-text-3" id="text-org87fa133">
<div class="org-src-container">
<pre class="src src-vimrc">let g:polyglot_disabled = ['latex']
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org75b0074" class="outline-2">
<h2 id="org75b0074">Bindings</h2>
<div class="outline-text-2" id="text-org75b0074">
</div>
<div id="outline-container-org17185dd" class="outline-3">
<h3 id="org17185dd">Vim Which Key</h3>
<div class="outline-text-3" id="text-org17185dd">
<div class="org-src-container">
<pre class="src src-vimrc">nnoremap &lt;silent&gt; &lt;leader&gt; :WhichKey '&lt;Space&gt;'&lt;cr&gt;
let g:which_key_map = {}
</pre>
</div>
</div>
</div>
<div id="outline-container-orgac7157e" class="outline-3">
<h3 id="orgac7157e">Direct ones</h3>
<div class="outline-text-3" id="text-orgac7157e">
<div class="org-src-container">
<pre class="src src-vimrc">" Switch with last buffer
nnoremap &lt;leader&gt;&lt;Tab&gt; :e #&lt;cr&gt;
" let g:which_key_map.&lt;Tab&gt; = 'last-buffer'
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb41f651" class="outline-3">
<h3 id="orgb41f651">Quit</h3>
<div class="outline-text-3" id="text-orgb41f651">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.q = { 'name' : '+quit' }
" Quit
nnoremap &lt;leader&gt;qq :qa&lt;cr&gt;
let g:which_key_map.q.q = 'quit'
" Quit - Force
nnoremap &lt;leader&gt;qQ :qa!&lt;cr&gt;
let g:which_key_map.q.Q = 'quit-force'
" Quit - Save
nnoremap &lt;leader&gt;qw :wq&lt;cr&gt;
let g:which_key_map.q.w = 'quit-save'
" Quit - Save all
nnoremap &lt;leader&gt;qW :wqa&lt;cr&gt;
let g:which_key_map.q.W = 'quit-save-all'
</pre>
</div>
</div>
</div>
<div id="outline-container-org9159c40" class="outline-3">
<h3 id="org9159c40">Files</h3>
<div class="outline-text-3" id="text-org9159c40">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.f = { 'name' : '+files' }
" Fast saving
nnoremap &lt;leader&gt;fs :w!&lt;cr&gt;
let g:which_key_map.f.s = 'save-file'
" Fast saving all
nnoremap &lt;leader&gt;fS :wa!&lt;cr&gt;
let g:which_key_map.f.S = 'save-all'
" Find Files
noremap &lt;leader&gt;ff :Files&lt;CR&gt;
let g:which_key_map.f.f = 'find-file'
" Find File corresping to Word
nnoremap &lt;leader&gt;fw
\ :call fzf#vim#files('.', fzf#vim#with_preview({'options': ['--query', expand('&lt;cword&gt;')]}))&lt;cr&gt;
" TODO - Add visual keymap
" vnoremap &lt;leader&gt;fw
" \ :call fzf#vim#files('.', fzf#vim#with_preview({'options': ['--query', &lt;C-r&gt;0]}))&lt;cr&gt;
let g:which_key_map.f.w = 'find-file-word'
</pre>
</div>
</div>
</div>
<div id="outline-container-org73faea0" class="outline-3">
<h3 id="org73faea0">Buffers</h3>
<div class="outline-text-3" id="text-org73faea0">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.b = { 'name' : '+buffers' }
" Buffer Create
noremap &lt;leader&gt;bc :enew&lt;cr&gt;
let g:which_key_map.b.c = 'buffer-create'
" Buffer Delete
noremap &lt;leader&gt;bd :Bclose&lt;cr&gt;
let g:which_key_map.b.d = 'buffer-delete'
" Buffer Delete all others
noremap &lt;leader&gt;bD :bufdo bd&lt;cr&gt;
let g:which_key_map.b.D = 'buffer-delete-others'
" Buffer Next
noremap &lt;leader&gt;bn :bnext&lt;cr&gt;
let g:which_key_map.b.n = 'buffer-next'
" Buffer Previous
noremap &lt;leader&gt;bp :bprevious&lt;cr&gt;
let g:which_key_map.b.p = 'buffer-previous'
" Find Buffers
noremap &lt;leader&gt;bf :Buffers&lt;CR&gt;
let g:which_key_map.b.f = 'buffer-find'
" Buffer Home (startify)
noremap &lt;leader&gt;bh :Startify&lt;CR&gt;
let g:which_key_map.b.h = 'buffer-home'
" CD to buffer path
noremap &lt;leader&gt;bw :cd %:p:h&lt;CR&gt;:pwd&lt;CR&gt;
let g:which_key_map.b.w = 'buffer-pwd'
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb222501" class="outline-3">
<h3 id="orgb222501">Tabs</h3>
<div class="outline-text-3" id="text-orgb222501">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.t = { 'name' : '+tabs' }
" Let 'tt' toggle between this and the last accessed tab
let g:lasttab = 1
au TabLeave * let g:lasttab = tabpagenr()
" Tab New
nnoremap &lt;leader&gt;tc :tabnew&lt;cr&gt;
let g:which_key_map.t.c = 'tab-create'
" Tab Delete
nnoremap &lt;leader&gt;td :tabclose&lt;cr&gt;
let g:which_key_map.t.d = 'tab-delete'
" Tab Maximize
nnoremap &lt;leader&gt;tD :tabonly&lt;cr&gt;
let g:which_key_map.t.D = 'tab-delete-others'
" Tab Left
nnoremap &lt;leader&gt;th gt&lt;cr&gt;
let g:which_key_map.t.h = 'tab-left'
" Tab Right
nnoremap &lt;leader&gt;tl gT&lt;cr&gt;
let g:which_key_map.t.l = 'tab-right'
" Tab Move Left
nnoremap &lt;leader&gt;tH :tabmove -1&lt;cr&gt;
let g:which_key_map.t.H = 'tab-move-left'
" Tab Move Right
nnoremap &lt;leader&gt;tL :tabmove +1&lt;cr&gt;
let g:which_key_map.t.L = 'tab-move-right'
" Tab Toggle
nnoremap &lt;Leader&gt;tt :exe "tabn ".g:lasttab&lt;CR&gt;
let g:which_key_map.t.t = 'tab-toggle'
</pre>
</div>
</div>
</div>
<div id="outline-container-org8c7bf07" class="outline-3">
<h3 id="org8c7bf07">Terminals</h3>
<div class="outline-text-3" id="text-org8c7bf07">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.T = { 'name' : '+terminals' }
" Quickly create a new terminal in a new tab
nnoremap &lt;Leader&gt;Tc :tab new&lt;CR&gt;:term&lt;CR&gt;
let g:which_key_map.T.c = 'term-create'
" Quickly create a new terminal in a vertical split
nnoremap &lt;Leader&gt;T/ :vsplit&lt;CR&gt;:term&lt;CR&gt;
" let g:which_key_map.T./ = 'term-vert'
" Quickly create a new terminal in a horizontal split
nnoremap &lt;Leader&gt;T- :split&lt;CR&gt;:term&lt;CR&gt;
" let g:which_key_map.T.- = 'term-hor'
</pre>
</div>
</div>
</div>
<div id="outline-container-org04030fd" class="outline-3">
<h3 id="org04030fd">Splits / Windows</h3>
<div class="outline-text-3" id="text-org04030fd">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.w = { 'name' : '+windows' }
" Split Horizontal
nnoremap &lt;leader&gt;w- :split&lt;cr&gt;
" let g:which_key_map.w.- = 'win-hor'
" Split Vertical
nnoremap &lt;leader&gt;w/ :vsplit&lt;cr&gt;
" let g:which_key_map.w./ = 'win-vert'
" Split Maximize
nnoremap &lt;leader&gt;wD &lt;C-w&gt;o
let g:which_key_map.w.D = 'win-delete-others'
" Split Delete
nnoremap &lt;leader&gt;wd &lt;C-w&gt;q
let g:which_key_map.w.d = 'win-delete'
" Split Go Left
nnoremap &lt;leader&gt;wh :wincmd h&lt;CR&gt;
let g:which_key_map.w.h = 'win-left'
" Split Go Down
nnoremap &lt;leader&gt;wj :wincmd j&lt;CR&gt;
let g:which_key_map.w.j = 'win-down'
" Split Go Up
nnoremap &lt;leader&gt;wk :wincmd k&lt;CR&gt;
let g:which_key_map.w.k = 'win-up'
" Split Go Right
nnoremap &lt;leader&gt;wl :wincmd l&lt;CR&gt;
let g:which_key_map.w.l = 'win-right'
" Split to Tab
nnoremap &lt;leader&gt;wt &lt;C-w&gt;T
let g:which_key_map.w.t = 'win-make-tab'
" Find window
nnoremap &lt;leader&gt;wf :Windows&lt;CR&gt;
let g:which_key_map.w.f = 'win-find'
" Maximize window
nnoremap &lt;leader&gt;wm :call MaximizeToggle()&lt;CR&gt;
let g:which_key_map.w.m = 'win-maximize'
function! MaximizeToggle()
if exists("s:maximize_session")
exec "source " . s:maximize_session
call delete(s:maximize_session)
unlet s:maximize_session
let &amp;hidden=s:maximize_hidden_save
unlet s:maximize_hidden_save
else
let s:maximize_hidden_save = &amp;hidden
let s:maximize_session = tempname()
set hidden
exec "mksession! " . s:maximize_session
only
endif
endfunction
</pre>
</div>
</div>
</div>
<div id="outline-container-org512741f" class="outline-3">
<h3 id="org512741f">Check Spell</h3>
<div class="outline-text-3" id="text-org512741f">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.S = { 'name' : '+spell-check' }
" CheckSpell Toggle
noremap &lt;leader&gt;St :setlocal spell!&lt;cr&gt;
let g:which_key_map.S.t = 'spell-toggle'
" CheckSpell Correct
noremap &lt;leader&gt;Sc z=
let g:which_key_map.S.c = 'spell-correct'
" CheckSpell Do first
noremap &lt;leader&gt;SC 1z=
let g:which_key_map.S.C = 'spell-correct-first'
" CheckSpell Language
noremap &lt;leader&gt;Sl :set spelllang=
let g:which_key_map.S.l = 'spell-language'
" CheckSpell Next
noremap &lt;leader&gt;Sn ]s
let g:which_key_map.S.n = 'spell-next'
" CheckSpell Next and correct
noremap &lt;leader&gt;SN ]s1z=
let g:which_key_map.S.N = 'spell-next-correct'
" CheckSpell Previous
noremap &lt;leader&gt;Sp [s
let g:which_key_map.S.p = 'spell-prev'
" CheckSpell Previous and correct
noremap &lt;leader&gt;SP [s1z=
let g:which_key_map.S.P = 'spell-prev-correct'
" CheckSpell Add to dictionnary
noremap &lt;leader&gt;Sa zg
let g:which_key_map.S.a = 'spell-add-dict'
</pre>
</div>
</div>
</div>
<div id="outline-container-orga3f84f4" class="outline-3">
<h3 id="orga3f84f4">Make</h3>
<div class="outline-text-3" id="text-orga3f84f4">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.m = { 'name' : '+make' }
" Make Make
nnoremap &lt;leader&gt;mm :Make -B&lt;CR&gt;
let g:which_key_map.m.m = 'make'
" Make Clean
nnoremap &lt;leader&gt;mc :Make clean&lt;CR&gt;
let g:which_key_map.m.c = 'make-clean'
" Make Force
nnoremap &lt;leader&gt;mf :Make! -B&lt;CR&gt;
let g:which_key_map.m.f = 'make-force'
" Make Run
nnoremap &lt;leader&gt;mr :Make! run&lt;cr&gt;
let g:which_key_map.m.r = 'make-run'
" Make Open
nnoremap &lt;leader&gt;mo :make! open&lt;cr&gt;
let g:which_key_map.m.o = 'make-open'
</pre>
</div>
</div>
</div>
<div id="outline-container-orgafc2d25" class="outline-3">
<h3 id="orgafc2d25">Search</h3>
<div class="outline-text-3" id="text-orgafc2d25">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.s = { 'name' : '+search' }
" Search History
noremap &lt;leader&gt;sh :History&lt;CR&gt;
let g:which_key_map.s.h = 'search-history'
" Search Tags
noremap &lt;leader&gt;sT :Tags&lt;CR&gt;
let g:which_key_map.s.T = 'search-tags'
" Search All
noremap &lt;leader&gt;sa :Rg&lt;CR&gt;
let g:which_key_map.s.g = 'search-all'
" Search Word
noremap &lt;leader&gt;sw :exe ':Rg ' . expand('&lt;cword&gt;')&lt;CR&gt;
let g:which_key_map.s.w = 'search-word'
" Search todo keyboard
" TODO - should not have to press enter
nnoremap &lt;leader&gt;st :Grepper -tool rg -query TODO&lt;CR&gt;
let g:which_key_map.s.t = 'search-todos'
</pre>
</div>
</div>
</div>
<div id="outline-container-org17121de" class="outline-3">
<h3 id="org17121de"><span class="todo TODO">TODO</span> - GIT</h3>
<div class="outline-text-3" id="text-org17121de">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.g = { 'name' : '+git' }
" Git Gutter
nnoremap &lt;silent&gt;&lt;leader&gt;gg :SignifyToggle&lt;cr&gt;
let g:which_key_map.g.g = 'git-'
" Git Gutter Highlight
nnoremap &lt;silent&gt;&lt;leader&gt;gG :SignifyToggleHighlight&lt;cr&gt;
let g:which_key_map.g.G = 'git-'
" Git Commit
nnoremap &lt;leader&gt;gc :Gcommit&lt;CR&gt;
let g:which_key_map.g.c = 'git-commit'
" Git Status
nnoremap &lt;leader&gt;gs :Gstatus&lt;CR&gt;
let g:which_key_map.g.s = 'git-status'
" Git Diff
nnoremap &lt;leader&gt;gd :Gdiff&lt;CR&gt;
let g:which_key_map.g.d = 'git-diff'
" Git Blame
nnoremap &lt;leader&gt;gb :Gblame&lt;CR&gt;
let g:which_key_map.g.b = 'git-blame'
" Git Visualise
nnoremap &lt;leader&gt;gv :GV&lt;CR&gt;
let g:which_key_map.g.v = 'git-visualize'
" Git File (visualise)
nnoremap &lt;leader&gt;gF :GV!&lt;CR&gt;
let g:which_key_map.g.F = 'git-file'
" Git Find Commits
noremap &lt;leader&gt;gf :Commits&lt;CR&gt;
let g:which_key_map.g.f = 'git-find-commit'
</pre>
</div>
</div>
</div>
<div id="outline-container-orgfb0a00a" class="outline-3">
<h3 id="orgfb0a00a">Errors</h3>
<div class="outline-text-3" id="text-orgfb0a00a">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.e = { 'name' : '+errors' }
function! s:GetBufferList()
redir =&gt;buflist
silent! ls
redir END
return buflist
endfunction
function! ToggleLocationList()
let curbufnr = winbufnr(0)
for bufnum in map(filter(split(s:GetBufferList(), '\n'), 'v:val =~ "Location List"'), 'str2nr(matchstr(v:val, "\\d\\+"))')
if curbufnr == bufnum
lclose
return
endif
endfor
let winnr = winnr()
let prevwinnr = winnr("#")
let nextbufnr = winbufnr(winnr + 1)
try
lopen
catch /E776/
echohl ErrorMsg
echo "Location List is Empty."
echohl None
return
endtry
if winbufnr(0) == nextbufnr
lclose
if prevwinnr &gt; winnr
let prevwinnr-=1
endif
else
if prevwinnr &gt; winnr
let prevwinnr+=1
endif
endif
" restore previous window
exec prevwinnr."wincmd w"
exec winnr."wincmd w"
endfunction
" Error Toggle
nnoremap &lt;silent&gt;&lt;leader&gt;ee :call ToggleLocationList()&lt;CR&gt;
let g:which_key_map.e.e = 'error-toggle'
" Error Open
nnoremap &lt;silent&gt;&lt;leader&gt;eo :lopen&lt;CR&gt;
let g:which_key_map.e.o = 'error-open'
" Error Close
nnoremap &lt;silent&gt;&lt;leader&gt;ec :lclose&lt;CR&gt;
let g:which_key_map.e.c = 'error-close'
" Error Next
nnoremap &lt;silent&gt;&lt;leader&gt;en :lnext&lt;CR&gt;
let g:which_key_map.e.n = 'error-next'
" Error Previous
nnoremap &lt;silent&gt;&lt;leader&gt;ep :lprevious&lt;CR&gt;
let g:which_key_map.e.p = 'error-previous'
</pre>
</div>
</div>
</div>
<div id="outline-container-org2e47a1e" class="outline-3">
<h3 id="org2e47a1e">Text</h3>
<div class="outline-text-3" id="text-org2e47a1e">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.x = { 'name' : '+text' }
" Start interactive EasyAlign in visual mode (e.g. vipga) and for a motion
xmap &lt;leader&gt;xa &lt;Plug&gt;(EasyAlign)
nmap &lt;leader&gt;xa &lt;Plug&gt;(EasyAlign)
let g:which_key_map.x.a = 'text-align'
" Indent all file
nnoremap &lt;leader&gt;x= mzgg=G`z
" let g:which_key_map.x.= = 'text-indent-file'
" Custom Multiple Cursor
" http://www.kevinli.co/posts/2017-01-19-multiple-cursors-in-500-bytes-of-vimscript/
let g:mc = "y/\\V\&lt;C-r&gt;=escape(@\", '/')\&lt;CR&gt;\&lt;CR&gt;"
" Multiple Cursor
nnoremap &lt;leader&gt;xm *``cgn
vnoremap &lt;expr&gt; &lt;leader&gt;xm g:mc . "``cgn"
let g:which_key_map.x.m = 'multiple-cursor'
" Multiple Cursor - reserve direction
nnoremap &lt;leader&gt;xM *``cgN
vnoremap &lt;expr&gt; &lt;leader&gt;xM g:mc . "``cgN"
let g:which_key_map.x.M = 'multiple-cursor-reverse'
" Delete trainling Whitespaces
fun! TrimWhitespace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
nnoremap &lt;leader&gt;xt :call TrimWhitespace()&lt;CR&gt;
let g:which_key_map.x.t = 'delete-trailing-whitespaces'
</pre>
</div>
</div>
</div>
<div id="outline-container-org7ee13d9" class="outline-3">
<h3 id="org7ee13d9">Config</h3>
<div class="outline-text-3" id="text-org7ee13d9">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.c = { 'name' : '+config' }
let s:activatedsh = 0
function! ToggleSyntaxH()
if s:activatedsh == 0
let s:activatedsh = 1
set synmaxcol=800
else
let s:activatedsh = 0
set synmaxcol=100
endif
endfunction
" Toggle Syntax column
nnoremap &lt;leader&gt;cs :call ToggleSyntaxH()&lt;CR&gt;
let g:which_key_map.c.s = 'toggle-syntax-col'
let s:activatedh = 0
function! ToggleH()
if s:activatedh == 0
let s:activatedh = 1
match Search '\%&gt;80v.\+'
else
let s:activatedh = 0
match none
endif
endfunction
" Toggle Highlight
nnoremap &lt;leader&gt;ch :call ToggleH()&lt;CR&gt;
let g:which_key_map.c.h = 'toggle-highlight'
" Reload vim config
noremap &lt;Leader&gt;cr :source $MYVIMRC&lt;CR&gt;
let g:which_key_map.c.e = 'reload-config'
" Edit vim config
noremap &lt;Leader&gt;ce :e $MYVIMRC&lt;CR&gt;
let g:which_key_map.c.e = 'edit-config'
" Disable highlight
noremap &lt;silent&gt; &lt;leader&gt;c&lt;CR&gt; :noh&lt;CR&gt;
let g:which_key_map.c.enter = 'disable-highlight'
" Theme
noremap &lt;silent&gt; &lt;leader&gt;ct :noh&lt;CR&gt;
let g:which_key_map.c.t = 'choose-theme'
</pre>
</div>
</div>
</div>
<div id="outline-container-org480d260" class="outline-3">
<h3 id="org480d260">Insert</h3>
<div class="outline-text-3" id="text-org480d260">
<div class="org-src-container">
<pre class="src src-vimrc">let g:which_key_map.i = { 'name' : '+insert' }
" Insert Snippet
noremap &lt;Leader&gt;is :Snippets&lt;CR&gt;
let g:which_key_map.i.s = 'insert-snippet'
</pre>
</div>
</div>
</div>
<div id="outline-container-org63ebf9d" class="outline-3">
<h3 id="org63ebf9d">Save Which Key Configuration</h3>
<div class="outline-text-3" id="text-org63ebf9d">
<div class="org-src-container">
<pre class="src src-vimrc">call which_key#register('&lt;Space&gt;', "g:which_key_map")
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-01-11 sam. 22:20</p>
</div>
</body>
</html>