2076 lines
175 KiB
HTML
2076 lines
175 KiB
HTML
<?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>
|
|
<!-- 2022-05-09 lun. 10:03 -->
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<title>Vim Config</title>
|
|
<meta name="author" content="Dehaeze Thomas" />
|
|
<meta name="generator" content="Org Mode" />
|
|
<link rel="stylesheet" type="text/css" href="./dist/style.css"/>
|
|
<script type="text/javascript" src="./dist/script.js"></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" class="content">
|
|
<h1 class="title">Vim Config</h1>
|
|
<div id="table-of-contents" role="doc-toc">
|
|
<h2>Table of Contents</h2>
|
|
<div id="text-table-of-contents" role="doc-toc">
|
|
<ul>
|
|
<li><a href="#org0aab2cd">Plugins Install</a>
|
|
<ul>
|
|
<li><a href="#org069baae">Plug start</a></li>
|
|
<li><a href="#org258c08a">Manage Files</a></li>
|
|
<li><a href="#org7baf221">Text Objects</a></li>
|
|
<li><a href="#orgcfce7af">Git</a></li>
|
|
<li><a href="#orgcbefe8c">Motions, Search</a></li>
|
|
<li><a href="#org99cac2c">Manipulate Things</a></li>
|
|
<li><a href="#orgf10f56e">Utils</a></li>
|
|
<li><a href="#orgb51c55d">Visual</a></li>
|
|
<li><a href="#org570cfbc">Themes</a></li>
|
|
<li><a href="#org4c1d8c7">Language Server Protocol</a></li>
|
|
<li><a href="#org7ef9ce6">Snippnets and autocompletion</a></li>
|
|
<li><a href="#orga26fef4">Syntax Checking and Build Utils</a></li>
|
|
<li><a href="#org385c0db">Auto Completion</a></li>
|
|
<li><a href="#orgeaf81f1">Tmux</a></li>
|
|
<li><a href="#org313351e">Syntax</a></li>
|
|
<li><a href="#orge103e3b">Markdown</a></li>
|
|
<li><a href="#orgaa03469">LaTeX</a></li>
|
|
<li><a href="#org9a8791f">Matlab</a></li>
|
|
<li><a href="#org1215bf7">Python</a></li>
|
|
<li><a href="#org200be10">Org Mode</a></li>
|
|
<li><a href="#orgeb5bbb8">Plug End</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org952fa5f">Basic</a>
|
|
<ul>
|
|
<li><a href="#orgdba5aac">General</a></li>
|
|
<li><a href="#org9f6a906">VIM user interface</a></li>
|
|
<li><a href="#org72fd34a">Foldings</a></li>
|
|
<li><a href="#orgbd5afee">Colors and Fonts</a></li>
|
|
<li><a href="#orgef4b7d1">Files, backups and undo</a></li>
|
|
<li><a href="#org6710add">Text, tab and indent related</a></li>
|
|
<li><a href="#org75f2efc">Moving around, tabs, windows and buffers</a></li>
|
|
<li><a href="#orga66155d">Misc</a></li>
|
|
<li><a href="#orgf72c1a7">Helper functions</a></li>
|
|
<li><a href="#org1ec2713">GUI related</a></li>
|
|
<li><a href="#orgf852425">Turn persistent undo on</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orge01019b">Mappings</a>
|
|
<ul>
|
|
<li><a href="#org8edf7fd">Normal mode related</a></li>
|
|
<li><a href="#org2c556d6">Insert mode related</a></li>
|
|
<li><a href="#orgd201bbf">Visual mode related</a></li>
|
|
<li><a href="#org1e61df9">Add some delimiters</a></li>
|
|
<li><a href="#orgef1c6a8">Command mode related</a></li>
|
|
<li><a href="#org5723884">Terminal mode related</a></li>
|
|
<li><a href="#orgf86cff8">Correct misspelled works</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orgd971ab1">Filetypes</a>
|
|
<ul>
|
|
<li><a href="#org4b1febb">Vim Which Key</a></li>
|
|
<li><a href="#orgd509cbc">Mails</a></li>
|
|
<li><a href="#orge24cc94">MarkDown</a></li>
|
|
<li><a href="#orgbdff106">LaTeX</a></li>
|
|
<li><a href="#org437d41f">Arduino</a></li>
|
|
<li><a href="#org3a44670">Python</a></li>
|
|
<li><a href="#orgf55c1bd">Matlab</a></li>
|
|
<li><a href="#org33049d3">Save Which Key Configuration</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org6050cc8">Plugins Config</a>
|
|
<ul>
|
|
<li><a href="#orgea72c90"><code>junegunn/fzf</code></a></li>
|
|
<li><a href="#org00468be"><code>autozimu/LanguageClient-neovim</code></a></li>
|
|
<li><a href="#orgadd60ee"><code>JamshedVesuna/vim-markdown-preview</code></a></li>
|
|
<li><a href="#orgd1fceae"><code>mhinz/vim-signify</code></a></li>
|
|
<li><a href="#org624a1c2"><code>Deoplete</code></a></li>
|
|
<li><a href="#org79f4123"><code>SirVer/ultisnips</code></a></li>
|
|
<li><a href="#orgce70d4b"><code>honza/vim-snippets</code></a></li>
|
|
<li><a href="#org6d38394"><code>itchyny/lightline.vim</code></a></li>
|
|
<li><a href="#orga74ce6a"><code>Autopairs</code></a></li>
|
|
<li><a href="#org928de7c"><code>Yggdroot/indentLine</code></a></li>
|
|
<li><a href="#org74ee2cf"><code>ryanoasis/vim-devicons</code></a></li>
|
|
<li><a href="#org7539318"><code>junegunn/goyo.vim</code></a></li>
|
|
<li><a href="#orgf0f2692"><code>tpope/vim-surround</code></a></li>
|
|
<li><a href="#orgf65fbff"><code>Vim-Markdown</code></a></li>
|
|
<li><a href="#orgffbc5ba"><code>Neomake</code></a></li>
|
|
<li><a href="#org11bec95"><code>lervag/vimtex</code></a></li>
|
|
<li><a href="#org0828243"><code>jpalardy/vim-slime</code></a></li>
|
|
<li><a href="#orge58a60d"><code>mhinz/vim-grepper</code></a></li>
|
|
<li><a href="#org42102bc">Editor config</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org7274fb0">Bindings</a>
|
|
<ul>
|
|
<li><a href="#orgbd05c0a">Vim Which Key</a></li>
|
|
<li><a href="#orge03c657">Direct ones</a></li>
|
|
<li><a href="#org5cc2a04">Quit</a></li>
|
|
<li><a href="#org81f99aa">Files</a></li>
|
|
<li><a href="#orgcd05e0e">Buffers</a></li>
|
|
<li><a href="#org61fd4af">Tabs</a></li>
|
|
<li><a href="#org116d0da">Terminals</a></li>
|
|
<li><a href="#orgdb45366">Splits / Windows</a></li>
|
|
<li><a href="#org7d89ba7">Check Spell</a></li>
|
|
<li><a href="#org3ba15fb">Make</a></li>
|
|
<li><a href="#orgfc64cba">Search</a></li>
|
|
<li><a href="#orge640718">GIT</a></li>
|
|
<li><a href="#orgd61fb1d">Errors</a></li>
|
|
<li><a href="#orge51b992">Text</a></li>
|
|
<li><a href="#orgc01849a">Config</a></li>
|
|
<li><a href="#org4b5efe9">Insert</a></li>
|
|
<li><a href="#org6eb8289">Save Which Key Configuration</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0aab2cd" class="outline-2">
|
|
<h2 id="org0aab2cd">Plugins Install</h2>
|
|
<div class="outline-text-2" id="text-org0aab2cd">
|
|
</div>
|
|
<div id="outline-container-org069baae" class="outline-3">
|
|
<h3 id="org069baae">Plug start</h3>
|
|
<div class="outline-text-3" id="text-org069baae">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">call</span> plug#<span class="org-function-name">begin</span>(<span class="org-string">'~/.vim/plugged'</span>)
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org258c08a" class="outline-3">
|
|
<h3 id="org258c08a">Manage Files</h3>
|
|
<div class="outline-text-3" id="text-org258c08a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'tpope/vim-vinegar'</span> <span class="org-comment">" Combine with netrw to create a delicious salad dressing</span>
|
|
Plug <span class="org-string">'junegunn/fzf'</span>, { <span class="org-string">'dir'</span>: <span class="org-string">'~/.fzf'</span>, <span class="org-string">'do'</span>: <span class="org-string">'./install --bin'</span> } <span class="org-comment">" A command-line fuzzy finder written in Go</span>
|
|
Plug <span class="org-string">'junegunn/fzf.vim'</span> <span class="org-comment">" Fzf for vim</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7baf221" class="outline-3">
|
|
<h3 id="org7baf221">Text Objects</h3>
|
|
<div class="outline-text-3" id="text-org7baf221">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'kana/vim-textobj-user'</span> <span class="org-comment">" Create your own text objects</span>
|
|
Plug <span class="org-string">'kana/vim-textobj-line'</span> <span class="org-comment">" Text objects for the current line</span>
|
|
Plug <span class="org-string">'kana/vim-textobj-entire'</span> <span class="org-comment">" Text objects for entire buffer</span>
|
|
Plug <span class="org-string">'michaeljsmith/vim-indent-object'</span> <span class="org-comment">" Defines a new text object representing lines of code at the same indent level</span>
|
|
Plug <span class="org-string">'jiangmiao/auto-pairs'</span> <span class="org-comment">" Vim plugin, insert or delete brackets, parens, quotes in pair</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcfce7af" class="outline-3">
|
|
<h3 id="orgcfce7af">Git</h3>
|
|
<div class="outline-text-3" id="text-orgcfce7af">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'jreybert/vimagit'</span>
|
|
Plug <span class="org-string">'tpope/vim-fugitive'</span> <span class="org-comment">" A Git wrapper so awesome, it should be illegal</span>
|
|
Plug <span class="org-string">'junegunn/gv.vim'</span> <span class="org-comment">" A git commit browser</span>
|
|
Plug <span class="org-string">'mhinz/vim-signify'</span> <span class="org-comment">" Show a diff using Vim its sign column</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcbefe8c" class="outline-3">
|
|
<h3 id="orgcbefe8c">Motions, Search</h3>
|
|
<div class="outline-text-3" id="text-orgcbefe8c">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'terryma/vim-expand-region'</span> <span class="org-comment">" Vim plugin that allows you to visually select increasingly larger regions of text using the same key combination</span>
|
|
Plug <span class="org-string">'justinmk/vim-sneak'</span> <span class="org-comment">" The missing motion for Vim</span>
|
|
Plug <span class="org-string">'haya14busa/is.vim'</span> <span class="org-comment">" Improved incremental searching for Vim</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org99cac2c" class="outline-3">
|
|
<h3 id="org99cac2c">Manipulate Things</h3>
|
|
<div class="outline-text-3" id="text-org99cac2c">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'tpope/vim-surround'</span> <span class="org-comment">" Quoting/parenthesizing made simple</span>
|
|
Plug <span class="org-string">'tpope/vim-commentary'</span> <span class="org-comment">" Comment stuff out</span>
|
|
Plug <span class="org-string">'junegunn/vim-easy-align'</span> <span class="org-comment">" A Vim alignment plugin</span>
|
|
Plug <span class="org-string">'Olical/vim-enmasse'</span> <span class="org-comment">" Edit every line in a quickfix list at the same time</span>
|
|
Plug <span class="org-string">'mhinz/vim-grepper'</span>, { <span class="org-string">'on'</span>: [<span class="org-string">'Grepper'</span>, <span class="org-string">'<plug>(GrepperOperator)'</span>] } <span class="org-comment">"</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf10f56e" class="outline-3">
|
|
<h3 id="orgf10f56e">Utils</h3>
|
|
<div class="outline-text-3" id="text-orgf10f56e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'tpope/vim-repeat'</span> <span class="org-comment">" Enable repeating supported plugin maps with '.'</span>
|
|
Plug <span class="org-string">'tpope/vim-obsession'</span> <span class="org-comment">" Continuously updated session files</span>
|
|
Plug <span class="org-string">'tpope/vim-eunuch'</span> <span class="org-comment">" eunuch.vim: helpers for UNIX</span>
|
|
Plug <span class="org-string">'kana/vim-operator-user'</span> <span class="org-comment">" Define your own operator easily</span>
|
|
Plug <span class="org-string">'majutsushi/tagbar'</span> <span class="org-comment">" Vim plugin that displays tags in a window, ordered by scope</span>
|
|
Plug <span class="org-string">'tpope/vim-speeddating'</span> <span class="org-comment">" use CTRL-A/CTRL-X to increment dates, times, and more</span>
|
|
Plug <span class="org-string">'liuchengxu/vim-which-key'</span> <span class="org-comment">" Vim plugin that shows keybindings in popup</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb51c55d" class="outline-3">
|
|
<h3 id="orgb51c55d">Visual</h3>
|
|
<div class="outline-text-3" id="text-orgb51c55d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'itchyny/lightline.vim'</span> <span class="org-comment">" A light and configurable statusline/tabline for Vim</span>
|
|
Plug <span class="org-string">'Yggdroot/indentLine'</span> <span class="org-comment">" A vim plugin to display the indention levels with thin vertical lines</span>
|
|
Plug <span class="org-string">'ryanoasis/vim-devicons'</span> <span class="org-comment">" Adds file type glyphs/icons to many popular Vim plugins such as: NERDTree, vim-airline, unite, vim-startify and many more</span>
|
|
Plug <span class="org-string">'mhinz/vim-startify'</span> <span class="org-comment">" The fancy start screen for Vim</span>
|
|
Plug <span class="org-string">'junegunn/goyo.vim'</span> <span class="org-comment">" Distraction-free writing in Vim</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org570cfbc" class="outline-3">
|
|
<h3 id="org570cfbc">Themes</h3>
|
|
<div class="outline-text-3" id="text-org570cfbc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'morhetz/gruvbox'</span> <span class="org-comment">" Retro groove color scheme for Vim</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Other nice themes are <a href="https://github.com/mhartington/oceanic-next">oceanic-next</a> and <a href="https://github.com/jacoborus/tender.vim">tender</a>.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4c1d8c7" class="outline-3">
|
|
<h3 id="org4c1d8c7">Language Server Protocol</h3>
|
|
<div class="outline-text-3" id="text-org4c1d8c7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'autozimu/LanguageClient-neovim'</span>, {
|
|
\ <span class="org-string">'branch'</span>: <span class="org-string">'next'</span>,
|
|
\ <span class="org-string">'do'</span>: <span class="org-string">'bash install.sh'</span>,
|
|
\ }
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7ef9ce6" class="outline-3">
|
|
<h3 id="org7ef9ce6">Snippnets and autocompletion</h3>
|
|
<div class="outline-text-3" id="text-org7ef9ce6">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'SirVer/ultisnips'</span> <span class="org-comment">" The ultimate snippet solution for Vim</span>
|
|
Plug <span class="org-string">'honza/vim-snippets'</span> <span class="org-comment">" Vim-snipmate default snippets</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga26fef4" class="outline-3">
|
|
<h3 id="orga26fef4">Syntax Checking and Build Utils</h3>
|
|
<div class="outline-text-3" id="text-orga26fef4">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'neomake/neomake'</span> <span class="org-comment">" Asynchronous linting and make framework for Neovim/Vim</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org385c0db" class="outline-3">
|
|
<h3 id="org385c0db">Auto Completion</h3>
|
|
<div class="outline-text-3" id="text-org385c0db">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">if</span> <span class="org-function-name">has</span>(<span class="org-string">'nvim'</span>)
|
|
Plug <span class="org-string">'Shougo/deoplete.nvim'</span>, { <span class="org-string">'do'</span>: <span class="org-string">':UpdateRemotePlugins'</span> }
|
|
Plug <span class="org-string">'Nelyah/deoplete-mu'</span>
|
|
<span class="org-vimrc-command">else</span>
|
|
Plug <span class="org-string">'Shougo/deoplete.nvim'</span>
|
|
Plug <span class="org-string">'roxma/nvim-yarp'</span>
|
|
Plug <span class="org-string">'roxma/vim-hug-neovim-rpc'</span>
|
|
Plug <span class="org-string">'Nelyah/deoplete-mu'</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgeaf81f1" class="outline-3">
|
|
<h3 id="orgeaf81f1">Tmux</h3>
|
|
<div class="outline-text-3" id="text-orgeaf81f1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'christoomey/vim-tmux-navigator'</span> <span class="org-comment">" Seamless navigation between tmux panes and vim splits</span>
|
|
Plug <span class="org-string">'jpalardy/vim-slime'</span> <span class="org-comment">" Used to type text into a REPL</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org313351e" class="outline-3">
|
|
<h3 id="org313351e">Syntax</h3>
|
|
<div class="outline-text-3" id="text-org313351e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'sheerun/vim-polyglot'</span> <span class="org-comment">" A solid language pack for Vim</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge103e3b" class="outline-3">
|
|
<h3 id="orge103e3b">Markdown</h3>
|
|
<div class="outline-text-3" id="text-orge103e3b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'plasticboy/vim-markdown'</span>, { <span class="org-string">'for'</span>: <span class="org-string">'markdown'</span> } <span class="org-comment">" Markdown Vim Mode</span>
|
|
Plug <span class="org-string">'mzlogin/vim-markdown-toc'</span>, { <span class="org-string">'for'</span>: <span class="org-string">'markdown'</span> } <span class="org-comment">" A vim plugin to generate table of contents for Markdown files</span>
|
|
Plug <span class="org-string">'JamshedVesuna/vim-markdown-preview'</span>, { <span class="org-string">'for'</span>: <span class="org-string">'markdown'</span> } <span class="org-comment">" A light Vim plugin for previewing markdown files in a browser</span>
|
|
Plug <span class="org-string">'nelstrom/vim-markdown-folding'</span> <span class="org-comment">" Fold markdown documents by section</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgaa03469" class="outline-3">
|
|
<h3 id="orgaa03469">LaTeX</h3>
|
|
<div class="outline-text-3" id="text-orgaa03469">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'lervag/vimtex'</span>, { <span class="org-string">'for'</span>: <span class="org-string">'tex'</span> } <span class="org-comment">" A modern vim plugin for editing LaTeX files.</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9a8791f" class="outline-3">
|
|
<h3 id="org9a8791f">Matlab</h3>
|
|
<div class="outline-text-3" id="text-org9a8791f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'tdehaeze/matlab-vim'</span>, { <span class="org-string">'for'</span>: <span class="org-string">'matlab'</span> } <span class="org-comment">" Edit Matlab M-files in Vim editor</span>
|
|
Plug <span class="org-string">'djoshea/vim-matlab-fold'</span>, { <span class="org-string">'for'</span>: <span class="org-string">'matlab'</span> } <span class="org-comment">" Vim code folding for Matlab files</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1215bf7" class="outline-3">
|
|
<h3 id="org1215bf7">Python</h3>
|
|
<div class="outline-text-3" id="text-org1215bf7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'pixelneo/vim-python-docstring'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org200be10" class="outline-3">
|
|
<h3 id="org200be10">Org Mode</h3>
|
|
<div class="outline-text-3" id="text-org200be10">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">Plug <span class="org-string">'nvim-orgmode/orgmode'</span>
|
|
|
|
<span class="org-comment">" Plug 'jceb/vim-orgmode' " Text outlining and task management for Vim</span>
|
|
<span class="org-comment">" Plug 'vim-scripts/SyntaxRange' " Define a different filetype syntax on regions of a buffer</span>
|
|
<span class="org-comment">" Plug 'chrisbra/NrrwRgn' " A Narrow Region Plugin for vim</span>
|
|
<span class="org-comment">" Plug 'mattn/calendar-vim' " calendar vimscript</span>
|
|
<span class="org-comment">" Plug 'vim-scripts/utl.vim' " Univeral Text Linking - Execute URLs, footnotes, open emails, organize ideas</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgeb5bbb8" class="outline-3">
|
|
<h3 id="orgeb5bbb8">Plug End</h3>
|
|
<div class="outline-text-3" id="text-orgeb5bbb8">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">call</span> plug#<span class="org-function-name">end</span>()
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org952fa5f" class="outline-2">
|
|
<h2 id="org952fa5f">Basic</h2>
|
|
<div class="outline-text-2" id="text-org952fa5f">
|
|
</div>
|
|
<div id="outline-container-orgdba5aac" class="outline-3">
|
|
<h3 id="orgdba5aac">General</h3>
|
|
<div class="outline-text-3" id="text-orgdba5aac">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">set</span> <span class="org-vimrc-option">runtimepath</span><span class="org-constant">+=</span>~/<span class="org-constant">.</span><span class="org-vimrc-command">vim</span>
|
|
|
|
<span class="org-comment">" Sets how many lines of history VIM has to remember</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">history</span><span class="org-constant">=</span><span class="org-vimrc-number">500</span>
|
|
|
|
<span class="org-comment">" Enable filetype plugins</span>
|
|
<span class="org-vimrc-option">filetype</span> plugin <span class="org-vimrc-command">on</span>
|
|
<span class="org-vimrc-option">filetype</span> indent <span class="org-vimrc-command">on</span>
|
|
|
|
<span class="org-comment">" Set to auto read when a file is changed from the outside</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">autoread</span>
|
|
|
|
<span class="org-comment">" writes the content of the file automatically if you call :make</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">autowrite</span>
|
|
|
|
<span class="org-comment">" Share clipboard with system</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">clipboard</span><span class="org-constant">+=</span>unnamedplus
|
|
|
|
<span class="org-comment">" Define Leader Key as Space key</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">mapleader</span> <span class="org-constant">=</span> <span class="org-comment">"\<Space>"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:mapleader</span> <span class="org-constant">=</span> <span class="org-comment">"\<Space>"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">maplocalleader</span> <span class="org-constant">=</span> <span class="org-comment">","</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9f6a906" class="outline-3">
|
|
<h3 id="org9f6a906">VIM user interface</h3>
|
|
<div class="outline-text-3" id="text-org9f6a906">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Set 7 lines to the cursor - when moving vertically using j/k</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">so</span><span class="org-constant">=</span><span class="org-vimrc-number">7</span>
|
|
|
|
<span class="org-comment">" Avoid garbled characters in Chinese language windows OS</span>
|
|
<span class="org-vimrc-command">let</span> $LANG<span class="org-constant">=</span><span class="org-string">'en'</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">langmenu</span><span class="org-constant">=</span><span class="org-vimrc-command">en</span>
|
|
|
|
<span class="org-comment">" Set Timeout config</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">timeout</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">ttimeout</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">timeoutlen</span><span class="org-constant">=</span><span class="org-vimrc-number">500</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">ttimeoutlen</span><span class="org-constant">=</span><span class="org-vimrc-number">50</span>
|
|
|
|
<span class="org-comment">" Turn on the wild menu</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">wildmenu</span>
|
|
|
|
<span class="org-comment">" Ignore compiled files</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">wildignore</span><span class="org-constant">=</span>*<span class="org-constant">.</span><span class="org-vimrc-command">o</span>,*~,*<span class="org-constant">.</span>pyc
|
|
<span class="org-vimrc-command">if</span> <span class="org-function-name">has</span>(<span class="org-comment">"win16") || has("win32")</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">wildignore</span><span class="org-constant">+=.</span>git\*,<span class="org-constant">.</span>hg\*,<span class="org-constant">.</span>svn\*
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">wildignore</span><span class="org-constant">+=</span>*/<span class="org-constant">.</span>git/*,*/<span class="org-constant">.</span>hg/*,*/<span class="org-constant">.</span>svn/*,*/<span class="org-constant">.</span>DS_Store
|
|
<span class="org-vimrc-command">endif</span>
|
|
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">wildmode</span><span class="org-constant">=</span>full
|
|
|
|
<span class="org-comment">"Always show current position</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">ruler</span>
|
|
|
|
<span class="org-comment">" Height of the command bar</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">cmdheight</span><span class="org-constant">=</span><span class="org-vimrc-number">1</span>
|
|
|
|
<span class="org-comment">" A buffer becomes hidden when it is abandoned</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">hid</span>
|
|
|
|
<span class="org-comment">" Configure backspace so it acts as it should act</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">backspace</span><span class="org-constant">=</span><span class="org-vimrc-option">eol</span>,start,indent
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">whichwrap</span><span class="org-constant">+=<</span>,<span class="org-constant">></span>,h,<span class="org-vimrc-command">l</span>
|
|
|
|
<span class="org-comment">" Ignore case when searching</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">ignorecase</span>
|
|
|
|
<span class="org-comment">" When searching try to be smart about cases</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">smartcase</span>
|
|
|
|
<span class="org-comment">" Option for smarter completions that will be case aware</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">infercase</span>
|
|
|
|
<span class="org-comment">" Highlight search results</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">hlsearch</span>
|
|
|
|
<span class="org-comment">" Makes search act like search in modern browsers</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">incsearch</span>
|
|
|
|
<span class="org-comment">" Don't redraw while executing macros (good performance config)</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">lazyredraw</span>
|
|
|
|
<span class="org-comment">" For regular expressions turn magic on</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">magic</span>
|
|
|
|
<span class="org-comment">" Show matching brackets when text indicator is over them</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">showmatch</span>
|
|
|
|
<span class="org-comment">" Don't show tab line if there is only one tab</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">showtabline</span><span class="org-constant">=</span><span class="org-vimrc-number">1</span>
|
|
|
|
<span class="org-comment">" How tany tenths of a second to blink when matching brackets</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">mat</span><span class="org-constant">=</span><span class="org-vimrc-number">2</span>
|
|
|
|
<span class="org-comment">" No annoying sound on errors</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">noerrorbells</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">novisualbell</span>
|
|
<span class="org-vimrc-command">set</span> t_vb<span class="org-constant">=</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">tm</span><span class="org-constant">=</span><span class="org-vimrc-number">500</span>
|
|
|
|
<span class="org-comment">" Add a bit extra margin to the left</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">foldcolumn</span><span class="org-constant">=</span><span class="org-vimrc-number">0</span>
|
|
|
|
<span class="org-comment">" Improve VIM scrolling</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">ttyfast</span>
|
|
|
|
<span class="org-comment">" Relative Numbers</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">relativenumber</span>
|
|
|
|
<span class="org-comment">" Smarter J and K navigation</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>expr<span class="org-constant">></span> <span class="org-vimrc-command">j</span> <span class="org-variable-name">v:count</span> ? (<span class="org-variable-name">v:count</span> <span class="org-constant">></span> <span class="org-highlight-numbers-number">5</span> ? <span class="org-comment">"m'" . v:count : '') . 'j' : 'gj'</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>expr<span class="org-constant">></span> <span class="org-vimrc-command">k</span> <span class="org-variable-name">v:count</span> ? (<span class="org-variable-name">v:count</span> <span class="org-constant">></span> <span class="org-highlight-numbers-number">5</span> ? <span class="org-comment">"m'" . v:count : '') . 'k' : 'gk'</span>
|
|
|
|
<span class="org-comment">" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">splitbelow</span> splitright
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org72fd34a" class="outline-3">
|
|
<h3 id="org72fd34a">Foldings</h3>
|
|
<div class="outline-text-3" id="text-org72fd34a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">if</span> <span class="org-function-name">has</span>(<span class="org-string">'folding'</span>)
|
|
<span class="org-vimrc-command">if</span> <span class="org-function-name">has</span>(<span class="org-string">'windows'</span>)
|
|
<span class="org-vimrc-command">let</span> &<span class="org-vimrc-option">fillchars</span><span class="org-constant">=</span><span class="org-string">'vert: '</span> <span class="org-comment">" less cluttered vertical window separators</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">foldmethod</span><span class="org-constant">=</span>indent <span class="org-comment">" not as cool as syntax, but faster</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">foldlevelstart</span><span class="org-constant">=</span><span class="org-vimrc-number">99</span> <span class="org-comment">" start unfolded</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbd5afee" class="outline-3">
|
|
<h3 id="orgbd5afee">Colors and Fonts</h3>
|
|
<div class="outline-text-3" id="text-orgbd5afee">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc">syntax enable
|
|
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">background</span><span class="org-constant">=</span>dark
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">base16colorspace</span><span class="org-constant">=</span><span class="org-vimrc-number">256</span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:gruvbox_contrast_dark</span> <span class="org-constant">=</span> <span class="org-string">'soft'</span>
|
|
|
|
<span class="org-vimrc-command">try</span>
|
|
<span class="org-vimrc-command">colorscheme</span> gruvbox
|
|
<span class="org-vimrc-command">catch</span>
|
|
<span class="org-vimrc-command">endtry</span>
|
|
|
|
<span class="org-comment">" set cursor shapes for insert and replace modes</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">guicursor</span><span class="org-constant">=</span><span class="org-vimrc-command">n</span><span class="org-constant">-</span>v<span class="org-constant">-</span><span class="org-vimrc-command">c</span><span class="org-constant">-</span><span class="org-vimrc-option">sm</span>:block,i<span class="org-constant">-</span><span class="org-vimrc-option">ci</span><span class="org-constant">-</span><span class="org-vimrc-option">ve</span>:ver25,<span class="org-vimrc-command">r</span><span class="org-constant">-</span>cr<span class="org-constant">-</span><span class="org-vimrc-command">o</span>:hor20
|
|
|
|
<span class="org-comment">" Set utf8 as standard encoding</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">encoding</span><span class="org-constant">=</span>utf<span class="org-vimrc-number">-8</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">fileencoding</span><span class="org-constant">=</span>utf<span class="org-vimrc-number">-8</span>
|
|
|
|
<span class="org-comment">" Use Unix as the standard file type</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">ffs</span><span class="org-constant">=</span>unix,dos,mac
|
|
|
|
<span class="org-comment">" Do not highlight the cursor line : http://vim.wikia.com/wiki/Highlight_current_line</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">nocursorline</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">nocursorcolumn</span>
|
|
|
|
<span class="org-comment">" Always show the status line</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">laststatus</span><span class="org-constant">=</span><span class="org-vimrc-number">2</span>
|
|
|
|
<span class="org-comment">" Underline for bad spelled words</span>
|
|
<span class="org-vimrc-option">hi</span> clear SpellBad
|
|
<span class="org-vimrc-option">hi</span> SpellBad cterm<span class="org-constant">=</span>underline
|
|
<span class="org-comment">" Set style for gVim</span>
|
|
<span class="org-vimrc-option">hi</span> SpellBad gui<span class="org-constant">=</span>undercurl
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgef4b7d1" class="outline-3">
|
|
<h3 id="orgef4b7d1">Files, backups and undo</h3>
|
|
<div class="outline-text-3" id="text-orgef4b7d1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Turn backup off, since most stuff is in SVN, git et.c anyway...</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">nobackup</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">nowb</span>
|
|
<span class="org-vimrc-command">set</span> noswapfile
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6710add" class="outline-3">
|
|
<h3 id="org6710add">Text, tab and indent related</h3>
|
|
<div class="outline-text-3" id="text-org6710add">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Use spaces instead of tabs</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">expandtab</span>
|
|
|
|
<span class="org-comment">" Be smart when using tabs</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">smarttab</span>
|
|
|
|
<span class="org-comment">" 1 tab == 4 spaces</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">shiftwidth</span><span class="org-constant">=</span><span class="org-vimrc-number">4</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">tabstop</span><span class="org-constant">=</span><span class="org-vimrc-number">4</span>
|
|
|
|
<span class="org-comment">" Enable Line Number</span>
|
|
<span class="org-vimrc-command">set</span> number
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
From <a href="https://stackoverflow.com/questions/36950231/auto-wrap-lines-in-vim-without-inserting-newlines">https://stackoverflow.com/questions/36950231/auto-wrap-lines-in-vim-without-inserting-newlines</a>.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Word wrap without line breaks</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">textwidth</span><span class="org-constant">=</span><span class="org-vimrc-number">0</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">wrapmargin</span><span class="org-constant">=</span><span class="org-vimrc-number">0</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">wrap</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">linebreak</span>
|
|
<span class="org-comment">" set columns=160</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">set</span> <span class="org-vimrc-option">autoindent</span> <span class="org-comment">" Auto Indentation</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">nosmartindent</span> <span class="org-comment">" No Smart Indentation</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org75f2efc" class="outline-3">
|
|
<h3 id="org75f2efc">Moving around, tabs, windows and buffers</h3>
|
|
<div class="outline-text-3" id="text-org75f2efc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Specify the behavior when switching between buffers</span>
|
|
<span class="org-vimrc-command">try</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">switchbuf</span><span class="org-constant">=</span>useopen,usetab
|
|
<span class="org-vimrc-command">catch</span>
|
|
<span class="org-vimrc-command">endtry</span>
|
|
|
|
<span class="org-comment">" Return to last edit position when opening files (You want this!)</span>
|
|
<span class="org-vimrc-command">au</span> BufReadPost * <span class="org-vimrc-command">if</span> <span class="org-function-name">line</span>(<span class="org-comment">"'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif</span>
|
|
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">splitbelow</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">splitright</span>
|
|
|
|
<span class="org-comment">" This enables mouse in all modes</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">mouse</span><span class="org-constant">=</span>a
|
|
|
|
<span class="org-comment">" Automatically equalize splits when Vim is resized</span>
|
|
<span class="org-vimrc-command">autocmd</span> VimResized * <span class="org-vimrc-command">wincmd</span> <span class="org-constant">=</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga66155d" class="outline-3">
|
|
<h3 id="orga66155d">Misc</h3>
|
|
<div class="outline-text-3" id="text-orga66155d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Speed up cursor movments : http://superuser.com/a/625994/587300</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">regexpengine</span><span class="org-constant">=</span><span class="org-vimrc-number">1</span> <span class="org-comment">" https://github.com/xolox/vim-easytags/issues/88</span>
|
|
|
|
<span class="org-comment">" Set the maximum column for syntax highlighting</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">synmaxcol</span><span class="org-constant">=</span><span class="org-vimrc-number">250</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf72c1a7" class="outline-3">
|
|
<h3 id="orgf72c1a7">Helper functions</h3>
|
|
<div class="outline-text-3" id="text-orgf72c1a7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">CmdLine</span>(str)
|
|
<span class="org-vimrc-command">exe</span> <span class="org-comment">"menu Foo.Bar :" . a:str</span>
|
|
<span class="org-vimrc-command">emenu</span> Foo<span class="org-constant">.</span>Bar
|
|
unmenu Foo
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">VisualSelection</span>(direction, extra_filter) range
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">l:saved_reg</span> <span class="org-constant">=</span> @<span class="org-comment">"</span>
|
|
<span class="org-vimrc-command">execute</span> <span class="org-comment">"normal! vgvy"</span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">l:pattern</span> <span class="org-constant">=</span> <span class="org-function-name">escape</span>(@<span class="org-comment">", '\\/.*$^~[]')</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">l:pattern</span> <span class="org-constant">=</span> <span class="org-function-name">substitute</span>(<span class="org-variable-name">l:pattern</span>, <span class="org-comment">"\n$", "", "")</span>
|
|
|
|
<span class="org-vimrc-command">if</span> <span class="org-variable-name">a:direction</span> <span class="org-constant">==</span> <span class="org-string">'gv'</span>
|
|
<span class="org-vimrc-command">call</span> <span class="org-function-name">CmdLine</span>(<span class="org-comment">"Ag \"" . l:pattern . "\" " )</span>
|
|
<span class="org-vimrc-command">elseif</span> <span class="org-variable-name">a:direction</span> <span class="org-constant">==</span> <span class="org-string">'replace'</span>
|
|
<span class="org-vimrc-command">call</span> <span class="org-function-name">CmdLine</span>(<span class="org-comment">"%s" . '/'. l:pattern . '/')</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
|
|
<span class="org-vimrc-command">let</span> @/ <span class="org-constant">=</span> <span class="org-variable-name">l:pattern</span>
|
|
<span class="org-vimrc-command">let</span> @<span class="org-comment">" = l:saved_reg</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-comment">" Don't close window, when deleting a buffer</span>
|
|
<span class="org-vimrc-command">command</span><span class="org-constant">!</span> Bclose <span class="org-vimrc-command">call</span> <span class="org-constant"><</span>SID<span class="org-constant">></span><span class="org-function-name">BufcloseCloseIt</span>()
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-constant"><</span>SID<span class="org-constant">></span><span class="org-function-name">BufcloseCloseIt</span>()
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">l:currentBufNum</span> <span class="org-constant">=</span> <span class="org-function-name">bufnr</span>(<span class="org-comment">"%")</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">l:alternateBufNum</span> <span class="org-constant">=</span> <span class="org-function-name">bufnr</span>(<span class="org-comment">"#")</span>
|
|
|
|
<span class="org-vimrc-command">if</span> <span class="org-function-name">buflisted</span>(<span class="org-variable-name">l:alternateBufNum</span>)
|
|
<span class="org-vimrc-command">buffer</span> #
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">bnext</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
|
|
<span class="org-vimrc-command">if</span> <span class="org-function-name">bufnr</span>(<span class="org-comment">"%") == l:currentBufNum</span>
|
|
<span class="org-vimrc-command">new</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
|
|
<span class="org-vimrc-command">if</span> <span class="org-function-name">buflisted</span>(<span class="org-variable-name">l:currentBufNum</span>)
|
|
<span class="org-function-name">execute</span>(<span class="org-comment">"bdelete! ".l:currentBufNum)</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1ec2713" class="outline-3">
|
|
<h3 id="org1ec2713">GUI related</h3>
|
|
<div class="outline-text-3" id="text-org1ec2713">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">set</span> <span class="org-vimrc-option">guifont</span><span class="org-constant">=</span>Hack\ Nerd\ Font\ Mono:h13
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">gfn</span><span class="org-constant">=</span>Hack\ Nerd\ Font\ Mono:h13
|
|
|
|
<span class="org-comment">" Disable scrollbars</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">guioptions</span><span class="org-constant">-=</span><span class="org-vimrc-command">r</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">guioptions</span><span class="org-constant">-=</span>R
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">guioptions</span><span class="org-constant">-=</span><span class="org-vimrc-command">l</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">guioptions</span><span class="org-constant">-=</span>L
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf852425" class="outline-3">
|
|
<h3 id="orgf852425">Turn persistent undo on</h3>
|
|
<div class="outline-text-3" id="text-orgf852425">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">try</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">undodir</span><span class="org-constant">=~</span>/<span class="org-constant">.</span>vim_runtime/temp_dirs/<span class="org-vimrc-option">undodir</span>
|
|
<span class="org-vimrc-command">set</span> undofile
|
|
<span class="org-vimrc-command">catch</span>
|
|
<span class="org-vimrc-command">endtry</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge01019b" class="outline-2">
|
|
<h2 id="orge01019b">Mappings</h2>
|
|
<div class="outline-text-2" id="text-orge01019b">
|
|
</div>
|
|
<div id="outline-container-org8edf7fd" class="outline-3">
|
|
<h3 id="org8edf7fd">Normal mode related</h3>
|
|
<div class="outline-text-3" id="text-org8edf7fd">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Smart way to move between windows</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">j</span><span class="org-constant">></span> <span class="org-constant"><</span>C<span class="org-constant">-</span>W<span class="org-constant">></span><span class="org-vimrc-command">j</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">k</span><span class="org-constant">></span> <span class="org-constant"><</span>C<span class="org-constant">-</span>W<span class="org-constant">></span><span class="org-vimrc-command">k</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>h<span class="org-constant">></span> <span class="org-constant"><</span>C<span class="org-constant">-</span>W<span class="org-constant">></span>h
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">l</span><span class="org-constant">></span> <span class="org-constant"><</span>C<span class="org-constant">-</span>W<span class="org-constant">></span><span class="org-vimrc-command">l</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2c556d6" class="outline-3">
|
|
<h3 id="org2c556d6">Insert mode related</h3>
|
|
<div class="outline-text-3" id="text-org2c556d6">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Paste while in insert mode</span>
|
|
<span class="org-vimrc-command">inoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>v<span class="org-constant">></span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">r</span><span class="org-constant">></span>*
|
|
|
|
<span class="org-comment">" Go to the end of line</span>
|
|
<span class="org-vimrc-command">inoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">e</span><span class="org-constant">></span> <span class="org-constant"><</span>Esc<span class="org-constant">></span>A
|
|
|
|
<span class="org-comment">" Go to the beginning of line</span>
|
|
<span class="org-vimrc-command">inoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>a<span class="org-constant">></span> <span class="org-constant"><</span>Esc<span class="org-constant">></span>I
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd201bbf" class="outline-3">
|
|
<h3 id="orgd201bbf">Visual mode related</h3>
|
|
<div class="outline-text-3" id="text-orgd201bbf">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Visual mode pressing / or ? searches for the current selection</span>
|
|
<span class="org-vimrc-command">vnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> / :<span class="org-constant"><</span>C<span class="org-constant">-</span>u<span class="org-constant">></span><span class="org-vimrc-command">call</span> <span class="org-function-name">VisualSelection</span>(<span class="org-string">''</span>, <span class="org-string">''</span>)<span class="org-constant"><</span>CR<span class="org-constant">></span>/<span class="org-constant"><</span>C<span class="org-constant">-</span>R<span class="org-constant">>=</span>@/<span class="org-constant"><</span>CR<span class="org-constant">><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">vnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> ? :<span class="org-constant"><</span>C<span class="org-constant">-</span>u<span class="org-constant">></span><span class="org-vimrc-command">call</span> <span class="org-function-name">VisualSelection</span>(<span class="org-string">''</span>, <span class="org-string">''</span>)<span class="org-constant"><</span>CR<span class="org-constant">>?<</span>C<span class="org-constant">-</span>R<span class="org-constant">>=</span>@/<span class="org-constant"><</span>CR<span class="org-constant">><</span>CR<span class="org-constant">></span>
|
|
|
|
<span class="org-comment">" Re-select visual block after indenting</span>
|
|
<span class="org-vimrc-command">vnoremap</span> <span class="org-constant"><</span> <span class="org-constant"><</span>gv
|
|
<span class="org-vimrc-command">vnoremap</span> <span class="org-constant">></span> <span class="org-constant">></span>gv
|
|
|
|
<span class="org-comment">" Move visual block</span>
|
|
<span class="org-vimrc-command">vnoremap</span> J :<span class="org-vimrc-command">m</span> <span class="org-string">'>+1<CR>gv=gv</span>
|
|
<span class="org-string">vnoremap K :m '</span><span class="org-constant"><</span><span class="org-vimrc-number">-2</span><span class="org-constant"><</span>CR<span class="org-constant">></span>gv<span class="org-constant">=</span>gv
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1e61df9" class="outline-3">
|
|
<h3 id="org1e61df9">Add some delimiters</h3>
|
|
<div class="outline-text-3" id="text-org1e61df9">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" use $ as a delimiter</span>
|
|
<span class="org-vimrc-command">xnoremap</span> i$ :<span class="org-constant"><</span>C<span class="org-constant">-</span>u<span class="org-constant">></span>normal<span class="org-constant">!</span> T$vt$<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">xnoremap</span> a$ :<span class="org-constant"><</span>C<span class="org-constant">-</span>u<span class="org-constant">></span>normal<span class="org-constant">!</span> T$hvt$l<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">onoremap</span> i$ :normal vi$<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">onoremap</span> a$ :normal va$<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgef1c6a8" class="outline-3">
|
|
<h3 id="orgef1c6a8">Command mode related</h3>
|
|
<div class="outline-text-3" id="text-orgef1c6a8">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Bash like keys for the command line</span>
|
|
<span class="org-vimrc-command">cnoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>A<span class="org-constant">></span> <span class="org-constant"><</span>Home<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">cnoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>E<span class="org-constant">></span> <span class="org-constant"><</span>End<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">cnoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>K<span class="org-constant">></span> <span class="org-constant"><</span>C<span class="org-constant">-</span>U<span class="org-constant">></span>
|
|
|
|
<span class="org-vimrc-command">cnoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">P</span><span class="org-constant">></span> <span class="org-constant"><</span>Up<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">cnoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">N</span><span class="org-constant">></span> <span class="org-constant"><</span>Down<span class="org-constant">></span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5723884" class="outline-3">
|
|
<h3 id="org5723884">Terminal mode related</h3>
|
|
<div class="outline-text-3" id="text-org5723884">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" tnoremap <Esc> <C-\><C-n></span>
|
|
|
|
tnoremap <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>h <span class="org-constant"><</span>C<span class="org-constant">-</span>\<span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">n</span><span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>h
|
|
tnoremap <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>j <span class="org-constant"><</span>C<span class="org-constant">-</span>\<span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">n</span><span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>j
|
|
tnoremap <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>k <span class="org-constant"><</span>C<span class="org-constant">-</span>\<span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">n</span><span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>k
|
|
tnoremap <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>l <span class="org-constant"><</span>C<span class="org-constant">-</span>\<span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">n</span><span class="org-constant">><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>l
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf86cff8" class="outline-3">
|
|
<h3 id="orgf86cff8">Correct misspelled works</h3>
|
|
<div class="outline-text-3" id="text-orgf86cff8">
|
|
<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"><span class="org-comment">" Go back to last misspelled word and pick first suggestion.</span>
|
|
<span class="org-vimrc-command">inoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>L<span class="org-constant">></span> <span class="org-constant"><</span><span class="org-vimrc-command">c</span><span class="org-constant">-</span>g<span class="org-constant">></span>u<span class="org-constant"><</span>Esc<span class="org-constant">></span>[s1z<span class="org-constant">=</span>`]a<span class="org-constant"><</span><span class="org-vimrc-command">c</span><span class="org-constant">-</span>g<span class="org-constant">></span>u
|
|
|
|
<span class="org-comment">" Select last misspelled word (typing will edit).</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>K<span class="org-constant">></span> <span class="org-constant"><</span>Esc<span class="org-constant">></span>[sve<span class="org-constant"><</span>C<span class="org-constant">-</span>G<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">inoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>K<span class="org-constant">></span> <span class="org-constant"><</span>Esc<span class="org-constant">></span>[sve<span class="org-constant"><</span>C<span class="org-constant">-</span>G<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">snoremap</span> <span class="org-constant"><</span>C<span class="org-constant">-</span>K<span class="org-constant">></span> <span class="org-constant"><</span>Esc<span class="org-constant">></span><span class="org-vimrc-command">b</span>[sviw<span class="org-constant"><</span>C<span class="org-constant">-</span>G<span class="org-constant">></span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd971ab1" class="outline-2">
|
|
<h2 id="orgd971ab1">Filetypes</h2>
|
|
<div class="outline-text-2" id="text-orgd971ab1">
|
|
</div>
|
|
<div id="outline-container-org4b1febb" class="outline-3">
|
|
<h3 id="org4b1febb">Vim Which Key</h3>
|
|
<div class="outline-text-3" id="text-org4b1febb">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> <span class="org-constant"><</span>leader<span class="org-constant">></span> :WhichKey <span class="org-string">'<Space>'</span><span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span> <span class="org-constant">=</span> {}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd509cbc" class="outline-3">
|
|
<h3 id="orgd509cbc">Mails</h3>
|
|
<div class="outline-text-3" id="text-orgd509cbc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">autocmd</span> FileType mail <span class="org-vimrc-command">set</span> <span class="org-vimrc-option">spell</span> <span class="org-vimrc-option">spelllang</span><span class="org-constant">=</span>en_us,fr
|
|
<span class="org-vimrc-command">autocmd</span> FileType mail <span class="org-vimrc-command">set</span> <span class="org-vimrc-option">textwidth</span><span class="org-constant">=</span><span class="org-vimrc-number">0</span>
|
|
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">Mailcomplete</span>(findstart, base)
|
|
<span class="org-vimrc-command">if</span> <span class="org-variable-name">a:findstart</span> <span class="org-constant">==</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">line</span> <span class="org-constant">=</span> <span class="org-function-name">getline</span>(<span class="org-string">'.'</span>)
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">idx</span> <span class="org-constant">=</span> <span class="org-function-name">col</span>(<span class="org-string">'.'</span>)
|
|
<span class="org-vimrc-command">while</span> idx <span class="org-constant">></span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">idx</span> <span class="org-constant">-=</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">c</span> <span class="org-constant">=</span> line[idx]
|
|
<span class="org-vimrc-command">if</span> c <span class="org-constant">==</span> <span class="org-string">':'</span> <span class="org-constant">||</span> <span class="org-vimrc-command">c</span> <span class="org-constant">==</span> <span class="org-string">'>'</span>
|
|
<span class="org-vimrc-command">return</span> idx <span class="org-constant">+</span> <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">continue</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endwhile</span>
|
|
<span class="org-vimrc-command">return</span> idx
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">return</span> <span class="org-function-name">split</span>(<span class="org-function-name">system</span>(<span class="org-string">'~/.local/scripts/find-config.sh '</span> <span class="org-constant">.</span> <span class="org-variable-name">a:base</span>), <span class="org-string">'\n'</span>)
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-vimrc-command">setl</span> <span class="org-vimrc-option">omnifunc</span><span class="org-constant">=</span>Mailcomplete
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-variable-name">search</span>=<span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">@</span></span><span class="org-string">"</span>
|
|
<span class="org-variable-name">contacts</span>=<span class="org-sh-quoted-exec">`mu cfind "$search"`</span>
|
|
<span class="org-variable-name">emails</span>=<span class="org-sh-quoted-exec">`</span><span class="org-type"><span class="org-sh-quoted-exec">echo</span></span><span class="org-sh-quoted-exec"> "$contacts" | awk -F' ' '{print "<" $NF ">"}'`</span>
|
|
<span class="org-variable-name">names</span>=<span class="org-sh-quoted-exec">`</span><span class="org-type"><span class="org-sh-quoted-exec">echo</span></span><span class="org-sh-quoted-exec"> "$contacts" | awk -F' ' '{$NF=""; print $0}'`</span>
|
|
paste -d <span class="org-string">""</span> <<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">printf</span> %s <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">names</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-1">)</span> <<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">printf</span> %s <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">emails</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge24cc94" class="outline-3">
|
|
<h3 id="orge24cc94">MarkDown</h3>
|
|
<div class="outline-text-3" id="text-orge24cc94">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Automatically turn on spell-checking for Markdown files</span>
|
|
<span class="org-vimrc-command">au</span> BufRead,BufNewFile *<span class="org-constant">.</span>md <span class="org-vimrc-command">setlocal</span> <span class="org-vimrc-option">spell</span> <span class="org-vimrc-option">spelllang</span><span class="org-constant">=</span>fr,<span class="org-vimrc-command">en</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbdff106" class="outline-3">
|
|
<h3 id="orgbdff106">LaTeX</h3>
|
|
<div class="outline-text-3" id="text-orgbdff106">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">au</span> BufRead,BufNewFile *<span class="org-constant">.</span>tikz <span class="org-vimrc-command">set</span> <span class="org-vimrc-option">filetype</span><span class="org-constant">=</span>tex
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">tex_no_error</span><span class="org-constant">=</span><span class="org-vimrc-number">1</span> <span class="org-comment">" used to not highlight underscores</span>
|
|
<span class="org-vimrc-command">au</span> BufRead,BufNewFile *<span class="org-constant">.</span>tex <span class="org-vimrc-command">set</span> <span class="org-vimrc-option">filetype</span><span class="org-constant">=</span>tex
|
|
<span class="org-vimrc-command">au</span> BufRead,BufNewFile *<span class="org-constant">.</span>tex <span class="org-vimrc-command">let</span> <span class="org-variable-name">b:AutoPairs</span><span class="org-constant">=</span>{<span class="org-string">'('</span>:<span class="org-string">')'</span>, <span class="org-string">'['</span>:<span class="org-string">']'</span>, <span class="org-string">'{'</span>:<span class="org-string">'}'</span>,<span class="org-comment">"'":"'",'"':'"', '`':'`', '$':'$'}</span>
|
|
|
|
<span class="org-vimrc-command">au</span> BufRead,BufNewFile *<span class="org-constant">.</span>tex <span class="org-vimrc-command">set</span> <span class="org-vimrc-option">iskeyword</span><span class="org-constant">+=-</span>
|
|
|
|
<span class="org-comment">" " clear the current list of matches that cause error-highlighting</span>
|
|
<span class="org-comment">" syn clear texOnlyMath</span>
|
|
<span class="org-comment">" " still mark '^' as an error outside of math mode</span>
|
|
<span class="org-comment">" syn match texOnlyMath /[\^]/</span>
|
|
|
|
<span class="org-comment">" autocmd FileType tex,tikz nnoremap <leader>lt <plug>(vimtex-toc-toggle)</span>
|
|
<span class="org-comment">" autocmd FileType tex,tikz nnoremap <leader>ll <plug>(vimtex-labels-open)</span>
|
|
<span class="org-comment">" autocmd FileType tex,tikz nnoremap <leader>lv <plug>(vimtex-view)</span>
|
|
<span class="org-comment">" autocmd FileType tex,tikz nnoremap <leader>lf <plug>(vimtex-reverse-search)</span>
|
|
|
|
<span class="org-comment">" " Make Tikz</span>
|
|
<span class="org-comment">" nnoremap <leader>mt :Make pdf t=tikz f=%:t:r<cr></span>
|
|
<span class="org-comment">" nnoremap <leader>mto :make open t=tikz f=%:t:r<cr></span>
|
|
|
|
<span class="org-comment">" " Make LaTeX</span>
|
|
<span class="org-comment">" nnoremap <leader>ml :Make pdf f=%:t:r<cr></span>
|
|
<span class="org-comment">" nnoremap <leader>mlo :make open f=%:t:r<cr></span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org437d41f" class="outline-3">
|
|
<h3 id="org437d41f">Arduino</h3>
|
|
<div class="outline-text-3" id="text-org437d41f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">au</span> BufRead,BufNewFile *<span class="org-constant">.</span>pde <span class="org-vimrc-command">set</span> <span class="org-vimrc-option">filetype</span><span class="org-constant">=</span>arduino
|
|
<span class="org-vimrc-command">au</span> BufRead,BufNewFile *<span class="org-constant">.</span><span class="org-vimrc-command">ino</span> set <span class="org-vimrc-option">filetype</span><span class="org-constant">=</span>arduino
|
|
<span class="org-comment">" au FileType arduino map <leader>ac :!platformio run<CR></span>
|
|
<span class="org-comment">" au FileType arduino map <leader>au :!platformio run -s --target=upload<CR></span>
|
|
<span class="org-comment">" au FileType arduino map <leader>am :!platformio serialports monitor --port=/dev/cu</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3a44670" class="outline-3">
|
|
<h3 id="org3a44670">Python</h3>
|
|
<div class="outline-text-3" id="text-org3a44670">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:slime_python_ipython</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-vimrc-command">au</span> FileType <span class="org-vimrc-command">python</span> setlocal <span class="org-vimrc-option">expandtab</span>
|
|
<span class="org-vimrc-command">au</span> FileType <span class="org-vimrc-command">python</span> setlocal <span class="org-vimrc-option">tabstop</span><span class="org-constant">=</span><span class="org-vimrc-number">4</span>
|
|
<span class="org-vimrc-command">au</span> FileType <span class="org-vimrc-command">python</span> setlocal <span class="org-vimrc-option">shiftwidth</span><span class="org-constant">=</span><span class="org-vimrc-number">4</span>
|
|
|
|
<span class="org-comment">" Run Section</span>
|
|
<span class="org-vimrc-command">au</span> FileType <span class="org-vimrc-command">python</span> nmap <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">><</span>localleader<span class="org-constant">></span> <span class="org-constant"><</span>Plug<span class="org-constant">></span>SlimeParagraphSend
|
|
|
|
<span class="org-comment">" Run Selected text</span>
|
|
<span class="org-vimrc-command">au</span> FileType <span class="org-vimrc-command">python</span> vmap <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">><</span>localleader<span class="org-constant">></span> <span class="org-constant"><</span>Plug<span class="org-constant">></span>SlimeRegionSend
|
|
|
|
<span class="org-comment">" CD to directory of current file</span>
|
|
<span class="org-vimrc-command">au</span> FileType <span class="org-vimrc-command">python</span> nmap <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span><span class="org-vimrc-command">c</span> :SlimeSend0(<span class="org-string">'cd '</span><span class="org-constant">.</span><span class="org-function-name">expand</span>(<span class="org-string">'%:p:h'</span>))<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
|
|
<span class="org-comment">" let python_highlight_all = 1</span>
|
|
<span class="org-comment">" au FileType python syn keyword pythonDecorator True None False self</span>
|
|
|
|
<span class="org-comment">" au BufNewFile,BufRead *.jinja set syntax=htmljinja</span>
|
|
<span class="org-comment">" au BufNewFile,BufRead *.mako set ft=mako</span>
|
|
|
|
<span class="org-comment">" au FileType python map <buffer> F :set foldmethod=indent<cr></span>
|
|
|
|
<span class="org-comment">" au FileType python inoremap <buffer> $r return</span>
|
|
<span class="org-comment">" au FileType python inoremap <buffer> $i import</span>
|
|
<span class="org-comment">" au FileType python inoremap <buffer> $p print</span>
|
|
<span class="org-comment">" au FileType python inoremap <buffer> $f #--- <esc>a</span>
|
|
<span class="org-comment">" au FileType python map <buffer> <leader>1 /class</span>
|
|
<span class="org-comment">" au FileType python map <buffer> <leader>2 /def</span>
|
|
<span class="org-comment">" au FileType python map <buffer> <leader>C ?class</span>
|
|
<span class="org-comment">" au FileType python map <buffer> <leader>D ?def</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf55c1bd" class="outline-3">
|
|
<h3 id="orgf55c1bd">Matlab</h3>
|
|
<div class="outline-text-3" id="text-orgf55c1bd">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Run Section (delimited by %%)</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">nmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span><span class="org-vimrc-option">mm</span> <span class="org-constant"><</span>Plug<span class="org-constant">></span>SlimeParagraphSend
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span><span class="org-vimrc-command">m</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+matlab'</span> }
|
|
|
|
<span class="org-comment">" Run either Selected text</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">vmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span><span class="org-vimrc-option">mm</span> <span class="org-constant"><</span>Plug<span class="org-constant">></span>SlimeRegionSend
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span><span class="org-vimrc-option">mm</span> <span class="org-constant">=</span> <span class="org-string">'run-code'</span>
|
|
|
|
func<span class="org-constant">!</span> <span class="org-function-name">GetSelectedText</span>()
|
|
normal gv<span class="org-comment">"xy</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">result</span> <span class="org-constant">=</span> <span class="org-function-name">getreg</span>(<span class="org-comment">"x")</span>
|
|
normal gv
|
|
<span class="org-vimrc-command">return</span> result
|
|
endfunc
|
|
|
|
<span class="org-comment">" Help on the current selection</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">vmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span><span class="org-vimrc-option">mh</span> :<span class="org-constant"><</span>C<span class="org-constant">-</span>U<span class="org-constant">></span>SlimeSend0(<span class="org-string">'help '</span><span class="org-constant">.</span><span class="org-function-name">expand</span>(<span class="org-function-name">GetSelectedText</span>()))<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span><span class="org-vimrc-option">mh</span> <span class="org-constant">=</span> <span class="org-string">'help'</span>
|
|
|
|
<span class="org-comment">" Documentation on the current selection</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">vmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span>mH :<span class="org-constant"><</span>C<span class="org-constant">-</span>U<span class="org-constant">></span>SlimeSend0(<span class="org-string">'doc '</span><span class="org-constant">.</span><span class="org-function-name">expand</span>(<span class="org-function-name">GetSelectedText</span>()))<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span><span class="org-vimrc-option">mh</span> <span class="org-constant">=</span> <span class="org-string">'help'</span>
|
|
|
|
<span class="org-comment">" Open the current file in the Matlab Editor (usefull for debuging)</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">nmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span><span class="org-vimrc-command">me</span> :SlimeSend0(<span class="org-string">'edit '</span><span class="org-constant">.</span><span class="org-function-name">expand</span>(<span class="org-string">'%:p'</span>))<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span><span class="org-vimrc-command">me</span> <span class="org-constant">=</span> <span class="org-string">'edit-gui'</span>
|
|
|
|
<span class="org-comment">" Run all the file</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">nmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span>mr :SlimeSend0(<span class="org-string">'run '</span><span class="org-constant">.</span><span class="org-function-name">expand</span>(<span class="org-string">'%:t'</span>))<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span>mr <span class="org-constant">=</span> <span class="org-string">'run-file'</span>
|
|
|
|
<span class="org-comment">" Send "cd filepath" to matlab</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">nmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span>mc :SlimeSend0(<span class="org-string">'cd '</span><span class="org-constant">.</span><span class="org-function-name">expand</span>(<span class="org-string">'%:p:h'</span>))<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span>mr <span class="org-constant">=</span> <span class="org-string">'cd-file'</span>
|
|
|
|
<span class="org-comment">" Open workspace</span>
|
|
<span class="org-vimrc-command">au</span> FileType matlab <span class="org-vimrc-command">nmap</span> <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-constant"><</span>localleader<span class="org-constant">></span>mw :SlimeSend0(<span class="org-string">'workspace'</span>)<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map_local</span><span class="org-constant">.</span>mr <span class="org-constant">=</span> <span class="org-string">'workspace'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org33049d3" class="outline-3">
|
|
<h3 id="org33049d3">Save Which Key Configuration</h3>
|
|
<div class="outline-text-3" id="text-org33049d3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">call</span> which_key#<span class="org-function-name">register</span>(<span class="org-string">'<Space>'</span>, <span class="org-comment">"g:which_key_map")</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6050cc8" class="outline-2">
|
|
<h2 id="org6050cc8">Plugins Config</h2>
|
|
<div class="outline-text-2" id="text-org6050cc8">
|
|
</div>
|
|
<div id="outline-container-orgea72c90" class="outline-3">
|
|
<h3 id="orgea72c90"><code>junegunn/fzf</code></h3>
|
|
<div class="outline-text-3" id="text-orgea72c90">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" This is the default extra key bindings</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:fzf_action</span> <span class="org-constant">=</span> {
|
|
\ <span class="org-string">'ctrl-t'</span>: <span class="org-string">'tab split'</span>,
|
|
\ <span class="org-string">'ctrl-h'</span>: <span class="org-string">'split'</span>,
|
|
\ <span class="org-string">'ctrl-v'</span>: <span class="org-string">'vsplit'</span> }
|
|
<span class="org-comment">" [[B]Commits] Customize the options used by 'git log':</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:fzf_commits_log_options</span> <span class="org-constant">=</span> <span class="org-string">'--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'</span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:fzf_colors</span> <span class="org-constant">=</span>
|
|
\ { <span class="org-string">'fg'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Normal'</span>],
|
|
\ <span class="org-string">'bg'</span>: [<span class="org-string">'bg'</span>, <span class="org-string">'Normal'</span>],
|
|
\ <span class="org-string">'hl'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Comment'</span>],
|
|
\ <span class="org-string">'fg+'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'CursorLine'</span>, <span class="org-string">'CursorColumn'</span>, <span class="org-string">'Normal'</span>],
|
|
\ <span class="org-string">'bg+'</span>: [<span class="org-string">'bg'</span>, <span class="org-string">'CursorLine'</span>, <span class="org-string">'CursorColumn'</span>],
|
|
\ <span class="org-string">'hl+'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Statement'</span>],
|
|
\ <span class="org-string">'info'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'PreProc'</span>],
|
|
\ <span class="org-string">'prompt'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Conditional'</span>],
|
|
\ <span class="org-string">'pointer'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Exception'</span>],
|
|
\ <span class="org-string">'marker'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Keyword'</span>],
|
|
\ <span class="org-string">'spinner'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Label'</span>],
|
|
\ <span class="org-string">'header'</span>: [<span class="org-string">'fg'</span>, <span class="org-string">'Comment'</span>] }
|
|
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">s:fzf_statusline</span>()
|
|
<span class="org-comment">" Override statusline as you like</span>
|
|
<span class="org-vimrc-option">highlight</span> fzf1 ctermfg<span class="org-constant">=</span><span class="org-vimrc-number">161</span> ctermbg<span class="org-constant">=</span><span class="org-vimrc-number">251</span>
|
|
<span class="org-vimrc-option">highlight</span> fzf2 ctermfg<span class="org-constant">=</span><span class="org-vimrc-number">23</span> ctermbg<span class="org-constant">=</span><span class="org-vimrc-number">251</span>
|
|
<span class="org-vimrc-option">highlight</span> fzf3 ctermfg<span class="org-constant">=</span><span class="org-vimrc-number">237</span> ctermbg<span class="org-constant">=</span><span class="org-vimrc-number">251</span>
|
|
<span class="org-vimrc-command">setlocal</span> <span class="org-vimrc-option">statusline</span><span class="org-constant">=</span>%#fzf1#\ <span class="org-constant">>\</span> %#fzf2#fz%#fzf3#<span class="org-vimrc-command">f</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-vimrc-command">autocmd</span><span class="org-constant">!</span> User FzfStatusLine <span class="org-vimrc-command">call</span> <span class="org-constant"><</span>SID<span class="org-constant">></span>fzf_<span class="org-function-name">statusline</span>()
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org00468be" class="outline-3">
|
|
<h3 id="org00468be"><code>autozimu/LanguageClient-neovim</code></h3>
|
|
<div class="outline-text-3" id="text-org00468be">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:LanguageClient_serverCommands</span> <span class="org-constant">=</span> {
|
|
\ <span class="org-string">'matlab'</span>: [<span class="org-string">'java'</span>, <span class="org-string">' -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'</span>],
|
|
\ }
|
|
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>F5<span class="org-constant">></span> :<span class="org-vimrc-command">call</span> LanguageClient_<span class="org-function-name">contextMenu</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-comment">" Or map each action separately</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> K :<span class="org-vimrc-command">call</span> LanguageClient#textDocument_<span class="org-function-name">hover</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> <span class="org-vimrc-option">gd</span> :<span class="org-vimrc-command">call</span> LanguageClient#textDocument_<span class="org-function-name">definition</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> <span class="org-constant"><</span>F2<span class="org-constant">></span> :<span class="org-vimrc-command">call</span> LanguageClient#textDocument_<span class="org-function-name">rename</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgadd60ee" class="outline-3">
|
|
<h3 id="orgadd60ee"><code>JamshedVesuna/vim-markdown-preview</code></h3>
|
|
<div class="outline-text-3" id="text-orgadd60ee">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">vim_markdown_preview_github</span><span class="org-constant">=</span><span class="org-vimrc-number">1</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">vim_markdown_preview_browser</span><span class="org-constant">=</span><span class="org-string">'Google Chrome'</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">vim_markdown_preview_temp_file</span><span class="org-constant">=</span><span class="org-vimrc-number">1</span>
|
|
<span class="org-comment">" let vim_markdown_preview_pandoc=1</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd1fceae" class="outline-3">
|
|
<h3 id="orgd1fceae"><code>mhinz/vim-signify</code></h3>
|
|
<div class="outline-text-3" id="text-orgd1fceae">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:signify_vcs_list</span> <span class="org-constant">=</span> [<span class="org-string">'git'</span>]
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:signify_disable_by_default</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org624a1c2" class="outline-3">
|
|
<h3 id="org624a1c2"><code>Deoplete</code></h3>
|
|
<div class="outline-text-3" id="text-org624a1c2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:deoplete#enable_at_startup</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-comment">" let g:deoplete#omni#functions = {}</span>
|
|
<span class="org-comment">" set completeopt=longest,menuone,preview</span>
|
|
<span class="org-comment">" let g:deoplete#sources = {}</span>
|
|
<span class="org-comment">" let g:deoplete#enable_smart_case = 1</span>
|
|
<span class="org-comment">" call deoplete#custom#set('ultisnips', 'matchers', ['matcher_fuzzy'])</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org79f4123" class="outline-3">
|
|
<h3 id="org79f4123"><code>SirVer/ultisnips</code></h3>
|
|
<div class="outline-text-3" id="text-org79f4123">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:UltiSnipsSnippetsDir</span> <span class="org-constant">=</span> <span class="org-string">'~/.vim/UltiSnip'</span>
|
|
|
|
<span class="org-comment">" inoremap <silent><expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:UltiSnipsExpandTrigger</span><span class="org-constant">=</span><span class="org-comment">"<C-j>"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:UltiSnipsJumpForwardTrigger</span><span class="org-constant">=</span><span class="org-comment">"<tab>"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:UltiSnipsJumpBackwardTrigger</span><span class="org-constant">=</span><span class="org-comment">"<s-tab>"</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgce70d4b" class="outline-3">
|
|
<h3 id="orgce70d4b"><code>honza/vim-snippets</code></h3>
|
|
<div class="outline-text-3" id="text-orgce70d4b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:snipMate</span> <span class="org-constant">=</span> {}
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:snipMate</span><span class="org-constant">.</span>scope_aliases <span class="org-constant">=</span> {}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6d38394" class="outline-3">
|
|
<h3 id="org6d38394"><code>itchyny/lightline.vim</code></h3>
|
|
<div class="outline-text-3" id="text-org6d38394">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">LightlineObsession</span>()
|
|
<span class="org-vimrc-command">return</span> <span class="org-string">'%{ObsessionStatus("")}'</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-comment">" \ 'colorscheme': 'gruvbox',</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:lightline</span> <span class="org-constant">=</span> {
|
|
\ <span class="org-string">'colorscheme'</span>: <span class="org-string">'solarized'</span>,
|
|
\ <span class="org-string">'active'</span>: {
|
|
\ <span class="org-string">'left'</span>: [ [ <span class="org-string">'mode'</span>, <span class="org-string">'paste'</span> ],
|
|
\ [ <span class="org-string">'filename'</span>, <span class="org-string">'modified'</span>, <span class="org-string">'fugitive'</span>, <span class="org-string">'obsession'</span> ] ]
|
|
\ },
|
|
\ <span class="org-string">'component'</span>: {
|
|
\ <span class="org-string">'fugitive'</span>: <span class="org-string">'%{exists("*fugitive#head")?fugitive#head():""}'</span>
|
|
\ },
|
|
\ <span class="org-string">'component_expand'</span>: {
|
|
\ <span class="org-string">'obsession'</span>: <span class="org-string">'LightlineObsession'</span>
|
|
\ },
|
|
\ <span class="org-string">'component_visible_condition'</span>: {
|
|
\ <span class="org-string">'fugitive'</span>: <span class="org-string">'(exists("*fugitive#head") && ""!=fugitive#head())'</span>
|
|
\ },
|
|
\ <span class="org-string">'separator'</span>: { <span class="org-string">'left'</span>: <span class="org-string">''</span>, <span class="org-string">'right'</span>: <span class="org-string">''</span> },
|
|
\ <span class="org-string">'subseparator'</span>: { <span class="org-string">'left'</span>: <span class="org-comment">"|", 'right': "|" }</span>
|
|
\ }
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga74ce6a" class="outline-3">
|
|
<h3 id="orga74ce6a"><code>Autopairs</code></h3>
|
|
<div class="outline-text-3" id="text-orga74ce6a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Incompatibilité entre auto-pairs et clang-complete</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:AutoPairsMapCR</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">imap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>CR<span class="org-constant">></span> <span class="org-constant"><</span>CR<span class="org-constant">><</span>Plug<span class="org-constant">></span>AutoPairsReturn
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org928de7c" class="outline-3">
|
|
<h3 id="org928de7c"><code>Yggdroot/indentLine</code></h3>
|
|
<div class="outline-text-3" id="text-org928de7c">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" :IndentLinesToggle toggles lines on and off.</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:indentLine_color_term</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">239</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org74ee2cf" class="outline-3">
|
|
<h3 id="org74ee2cf"><code>ryanoasis/vim-devicons</code></h3>
|
|
<div class="outline-text-3" id="text-org74ee2cf">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:webdevicons_enable_ctrlp</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7539318" class="outline-3">
|
|
<h3 id="org7539318"><code>junegunn/goyo.vim</code></h3>
|
|
<div class="outline-text-3" id="text-org7539318">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:goyo_width</span><span class="org-constant">=</span><span class="org-vimrc-number">100</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:goyo_margin_top</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:goyo_margin_bottom</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">2</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
This is for soft line breaks
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">s:goyo_enter</span>()
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">b:quitting</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">b:quitting_bang</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">autocmd</span> QuitPre <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-vimrc-command">let</span> <span class="org-variable-name">b:quitting</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
cabbrev <span class="org-constant"><</span><span class="org-vimrc-command">buffer</span><span class="org-constant">></span> <span class="org-vimrc-command">q</span><span class="org-constant">!</span> <span class="org-vimrc-command">let</span> <span class="org-variable-name">b:quitting_bang</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span> <span class="org-constant"><</span>bar<span class="org-constant">></span> <span class="org-vimrc-command">q</span><span class="org-constant">!</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Quit Vim if this is the only remaining buffer
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">s:goyo_leave</span>()
|
|
<span class="org-vimrc-command">if</span> <span class="org-variable-name">b:quitting</span> <span class="org-constant">&&</span> <span class="org-function-name">len</span>(<span class="org-function-name">filter</span>(<span class="org-function-name">range</span>(<span class="org-highlight-numbers-number">1</span>, <span class="org-function-name">bufnr</span>(<span class="org-string">'$'</span>)), <span class="org-string">'buflisted(v:val)'</span>)) <span class="org-constant">==</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">if</span> <span class="org-variable-name">b:quitting_bang</span>
|
|
<span class="org-vimrc-command">qa</span><span class="org-constant">!</span>
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">qa</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">autocmd</span><span class="org-constant">!</span> User GoyoEnter <span class="org-vimrc-command">call</span> <span class="org-constant"><</span>SID<span class="org-constant">></span>goyo_<span class="org-function-name">enter</span>()
|
|
<span class="org-vimrc-command">autocmd</span><span class="org-constant">!</span> User GoyoLeave <span class="org-vimrc-command">call</span> <span class="org-constant"><</span>SID<span class="org-constant">></span>goyo_<span class="org-function-name">leave</span>()
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf0f2692" class="outline-3">
|
|
<h3 id="orgf0f2692"><code>tpope/vim-surround</code></h3>
|
|
<div class="outline-text-3" id="text-orgf0f2692">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">vmap</span> Si <span class="org-function-name">S</span>(i_<span class="org-constant"><</span>esc<span class="org-constant">></span><span class="org-vimrc-command">f</span>)
|
|
<span class="org-vimrc-command">au</span> FileType mako <span class="org-vimrc-command">vmap</span> Si S<span class="org-comment">"i${ _(<esc>2f"a) }<esc></span>
|
|
<span class="org-comment">" surroung un visual mode : use S, then b to make the text bold in markdown</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:surround</span>_{char2<span class="org-function-name">nr</span>(<span class="org-string">'b'</span>)} <span class="org-constant">=</span> <span class="org-comment">"__\r__"</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf65fbff" class="outline-3">
|
|
<h3 id="orgf65fbff"><code>Vim-Markdown</code></h3>
|
|
<div class="outline-text-3" id="text-orgf65fbff">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:vim_markdown_folding_disabled</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:vim_markdown_conceal</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:vim_markdown_toc_autofit</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:vim_markdown_toml_frontmatter</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:tex_conceal</span> <span class="org-constant">=</span> <span class="org-comment">""</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgffbc5ba" class="outline-3">
|
|
<h3 id="orgffbc5ba"><code>Neomake</code></h3>
|
|
<div class="outline-text-3" id="text-orgffbc5ba">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Latex</span>
|
|
<span class="org-vimrc-command">autocmd</span><span class="org-constant">!</span> BufWritePost *<span class="org-constant">.</span>tex Neomake
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:neomake_tex_chktex_maker</span> <span class="org-constant">=</span> {
|
|
\ <span class="org-string">'exe'</span>: <span class="org-string">'chktex'</span>,
|
|
\ <span class="org-string">'args'</span>: [<span class="org-string">'--inputfiles'</span>],
|
|
\ <span class="org-string">'errorformat'</span>:
|
|
\ <span class="org-string">'%EError %n in %f line %l: %m,'</span> <span class="org-constant">.</span>
|
|
\ <span class="org-string">'%WWarning %n in %f line %l: %m,'</span> <span class="org-constant">.</span>
|
|
\ <span class="org-string">'%WMessage %n in %f line %l: %m,'</span> <span class="org-constant">.</span>
|
|
\ <span class="org-string">'%Z%p^,'</span> <span class="org-constant">.</span>
|
|
\ <span class="org-string">'%-G%.%#'</span>
|
|
\ }
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:neomake_tex_enabled_makers</span> <span class="org-constant">=</span> [<span class="org-string">'chktex'</span>]
|
|
|
|
<span class="org-comment">" Matlab</span>
|
|
<span class="org-vimrc-command">autocmd</span><span class="org-constant">!</span> BufWritePost *<span class="org-constant">.</span><span class="org-vimrc-command">m</span> Neomake
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:neomake_matlab_mlint_maker</span> <span class="org-constant">=</span> {
|
|
\ <span class="org-string">'exe'</span>: <span class="org-string">'mlint'</span>,
|
|
\ <span class="org-string">'mapexpr'</span>: <span class="org-comment">"neomake_bufname.':'.v:val",</span>
|
|
\ <span class="org-string">'errorformat'</span>:
|
|
\ <span class="org-string">'%f:L %l (C %c): %m,'</span> <span class="org-constant">.</span>
|
|
\ <span class="org-string">'%f:L %l (C %c-%*[0-9]): %m,'</span>,
|
|
\ }
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:neomake_matlab_enabled_makers</span> <span class="org-constant">=</span> [<span class="org-string">'mlint'</span>]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org11bec95" class="outline-3">
|
|
<h3 id="org11bec95"><code>lervag/vimtex</code></h3>
|
|
<div class="outline-text-3" id="text-org11bec95">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" let g:tex_conceal=""</span>
|
|
<span class="org-comment">" autocmd FileType tex let b:vimtex_main = 'main.tex'</span>
|
|
<span class="org-comment">" let g:vimtex_mappings_enabled=0</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0828243" class="outline-3">
|
|
<h3 id="org0828243"><code>jpalardy/vim-slime</code></h3>
|
|
<div class="outline-text-3" id="text-org0828243">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">if</span> <span class="org-function-name">exists</span>(<span class="org-string">'$TMUX'</span>)
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:slime_target</span> <span class="org-constant">=</span> <span class="org-comment">"tmux"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:slime_default_config</span> <span class="org-constant">=</span> {<span class="org-comment">"socket_name": split($TMUX, ",")[0], "target_pane": ":.2"}</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:slime_dont_ask_default</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge58a60d" class="outline-3">
|
|
<h3 id="orge58a60d"><code>mhinz/vim-grepper</code></h3>
|
|
<div class="outline-text-3" id="text-orge58a60d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" nnoremap <leader>G :Grepper -tool ag<cr></span>
|
|
<span class="org-comment">" nmap gs <plug>(GrepperOperator)</span>
|
|
<span class="org-comment">" xmap gs <plug>(GrepperOperator)</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org42102bc" class="outline-3">
|
|
<h3 id="org42102bc">Editor config</h3>
|
|
<div class="outline-text-3" id="text-org42102bc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" To ensure that this plugin works well with Tim Pope's fugitive, use the following patterns array:</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:EditorConfig_exclude_patterns</span> <span class="org-constant">=</span> [<span class="org-string">'fugitive://.*'</span>]
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7274fb0" class="outline-2">
|
|
<h2 id="org7274fb0">Bindings</h2>
|
|
<div class="outline-text-2" id="text-org7274fb0">
|
|
</div>
|
|
<div id="outline-container-orgbd05c0a" class="outline-3">
|
|
<h3 id="orgbd05c0a">Vim Which Key</h3>
|
|
<div class="outline-text-3" id="text-orgbd05c0a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> <span class="org-constant"><</span>leader<span class="org-constant">></span> :WhichKey <span class="org-string">'<Space>'</span><span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span> <span class="org-constant">=</span> {}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge03c657" class="outline-3">
|
|
<h3 id="orge03c657">Direct ones</h3>
|
|
<div class="outline-text-3" id="text-orge03c657">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-comment">" Switch with last buffer</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">><</span>Tab<span class="org-constant">></span> :<span class="org-vimrc-command">e</span> #<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-comment">" let g:which_key_map.<Tab> = 'last-buffer'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5cc2a04" class="outline-3">
|
|
<h3 id="org5cc2a04">Quit</h3>
|
|
<div class="outline-text-3" id="text-org5cc2a04">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">q</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+quit'</span> }
|
|
|
|
<span class="org-comment">" Quit</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>qq :<span class="org-vimrc-command">qa</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">q</span><span class="org-constant">.</span>q <span class="org-constant">=</span> <span class="org-string">'quit'</span>
|
|
|
|
<span class="org-comment">" Quit - Force</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>qQ :<span class="org-vimrc-command">qa</span><span class="org-constant">!<</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">q</span><span class="org-constant">.</span>Q <span class="org-constant">=</span> <span class="org-string">'quit-force'</span>
|
|
|
|
<span class="org-comment">" Quit - Save</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>qw :<span class="org-vimrc-command">wq</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">q</span><span class="org-constant">.</span>w <span class="org-constant">=</span> <span class="org-string">'quit-save'</span>
|
|
|
|
<span class="org-comment">" Quit - Save all</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>qW :<span class="org-vimrc-command">wqa</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">q</span><span class="org-constant">.</span>W <span class="org-constant">=</span> <span class="org-string">'quit-save-all'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org81f99aa" class="outline-3">
|
|
<h3 id="org81f99aa">Files</h3>
|
|
<div class="outline-text-3" id="text-org81f99aa">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">f</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+files'</span> }
|
|
|
|
<span class="org-comment">" Fast saving</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">fs</span> :<span class="org-vimrc-command">w</span><span class="org-constant">!<</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">f</span><span class="org-constant">.</span>s <span class="org-constant">=</span> <span class="org-string">'save-file'</span>
|
|
|
|
<span class="org-comment">" Fast saving all</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>fS :<span class="org-vimrc-option">wa</span><span class="org-constant">!<</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">f</span><span class="org-constant">.</span>S <span class="org-constant">=</span> <span class="org-string">'save-all'</span>
|
|
|
|
<span class="org-comment">" Find Files</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">ff</span> :Files<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">f</span><span class="org-constant">.</span>f <span class="org-constant">=</span> <span class="org-string">'find-file'</span>
|
|
|
|
<span class="org-comment">" Find File corresping to Word</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>fw
|
|
\ :<span class="org-vimrc-command">call</span> fzf#<span class="org-vimrc-command">vim</span>#<span class="org-function-name">files</span>(<span class="org-string">'.'</span>, fzf#<span class="org-vimrc-command">vim</span>#with_<span class="org-function-name">preview</span>({<span class="org-string">'options'</span>: [<span class="org-string">'--query'</span>, <span class="org-function-name">expand</span>(<span class="org-string">'<cword>'</span>)]}))<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">f</span><span class="org-constant">.</span>w <span class="org-constant">=</span> <span class="org-string">'find-file-word'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgcd05e0e" class="outline-3">
|
|
<h3 id="orgcd05e0e">Buffers</h3>
|
|
<div class="outline-text-3" id="text-orgcd05e0e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+buffers'</span> }
|
|
|
|
<span class="org-comment">" Buffer Create</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>bc :<span class="org-vimrc-command">enew</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>c <span class="org-constant">=</span> <span class="org-string">'buffer-create'</span>
|
|
|
|
<span class="org-comment">" Buffer Delete</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">bd</span> :Bclose<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>d <span class="org-constant">=</span> <span class="org-string">'buffer-delete'</span>
|
|
|
|
<span class="org-comment">" Buffer Delete all others</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>bD :<span class="org-vimrc-command">bufdo</span> bd<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>D <span class="org-constant">=</span> <span class="org-string">'buffer-delete-others'</span>
|
|
|
|
<span class="org-comment">" Buffer Next</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">bn</span> :<span class="org-vimrc-command">bnext</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>n <span class="org-constant">=</span> <span class="org-string">'buffer-next'</span>
|
|
|
|
<span class="org-comment">" Buffer Previous</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">bp</span> :<span class="org-vimrc-command">bprevious</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>p <span class="org-constant">=</span> <span class="org-string">'buffer-previous'</span>
|
|
|
|
<span class="org-comment">" Find Buffers</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">bf</span> :Buffers<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>f <span class="org-constant">=</span> <span class="org-string">'buffer-find'</span>
|
|
|
|
<span class="org-comment">" Buffer Home (startify)</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">bh</span> :Startify<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>h <span class="org-constant">=</span> <span class="org-string">'buffer-home'</span>
|
|
|
|
<span class="org-comment">" CD to buffer path</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">bw</span> :<span class="org-vimrc-option">cd</span> %:<span class="org-vimrc-command">p</span>:h<span class="org-constant"><</span>CR<span class="org-constant">></span>:<span class="org-vimrc-command">pwd</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">b</span><span class="org-constant">.</span>w <span class="org-constant">=</span> <span class="org-string">'buffer-pwd'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org61fd4af" class="outline-3">
|
|
<h3 id="org61fd4af">Tabs</h3>
|
|
<div class="outline-text-3" id="text-org61fd4af">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+tabs'</span> }
|
|
|
|
<span class="org-comment">" Let 'tt' toggle between this and the last accessed tab</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:lasttab</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">au</span> TabLeave * <span class="org-vimrc-command">let</span> <span class="org-variable-name">g:lasttab</span> <span class="org-constant">=</span> <span class="org-function-name">tabpagenr</span>()
|
|
|
|
<span class="org-comment">" Tab New</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">tc</span> :<span class="org-vimrc-command">tabnew</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>c <span class="org-constant">=</span> <span class="org-string">'tab-create'</span>
|
|
|
|
<span class="org-comment">" Tab Delete</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>td :<span class="org-vimrc-command">tabclose</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>d <span class="org-constant">=</span> <span class="org-string">'tab-delete'</span>
|
|
|
|
<span class="org-comment">" Tab Maximize</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>tD :<span class="org-vimrc-command">tabonly</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>D <span class="org-constant">=</span> <span class="org-string">'tab-delete-others'</span>
|
|
|
|
<span class="org-comment">" Tab Left</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">th</span> gt<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>h <span class="org-constant">=</span> <span class="org-string">'tab-left'</span>
|
|
|
|
<span class="org-comment">" Tab Right</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">tl</span> gT<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>l <span class="org-constant">=</span> <span class="org-string">'tab-right'</span>
|
|
|
|
<span class="org-comment">" Tab Move Left</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>tH :<span class="org-vimrc-command">tabmove</span> <span class="org-vimrc-number">-1</span><span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>H <span class="org-constant">=</span> <span class="org-string">'tab-move-left'</span>
|
|
|
|
<span class="org-comment">" Tab Move Right</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>tL :<span class="org-vimrc-command">tabmove</span> <span class="org-constant">+</span><span class="org-vimrc-number">1</span><span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>L <span class="org-constant">=</span> <span class="org-string">'tab-move-right'</span>
|
|
|
|
<span class="org-comment">" Tab Toggle</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>Leader<span class="org-constant">></span>tt :<span class="org-vimrc-command">exe</span> <span class="org-comment">"tabn ".g:lasttab<CR></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">t</span><span class="org-constant">.</span>t <span class="org-constant">=</span> <span class="org-string">'tab-toggle'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org116d0da" class="outline-3">
|
|
<h3 id="org116d0da">Terminals</h3>
|
|
<div class="outline-text-3" id="text-org116d0da">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>T <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+terminals'</span> }
|
|
|
|
<span class="org-comment">" Quickly create a new terminal in a new tab</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>Leader<span class="org-constant">></span>Tc :<span class="org-vimrc-command">tab</span> new<span class="org-constant"><</span>CR<span class="org-constant">></span>:<span class="org-vimrc-option">term</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>T<span class="org-constant">.</span><span class="org-vimrc-command">c</span> <span class="org-constant">=</span> <span class="org-string">'term-create'</span>
|
|
|
|
<span class="org-comment">" Quickly create a new terminal in a vertical split</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>Leader<span class="org-constant">></span>T/ :<span class="org-vimrc-command">vsplit</span><span class="org-constant"><</span>CR<span class="org-constant">></span>:<span class="org-vimrc-option">term</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-comment">" let g:which_key_map.T./ = 'term-vert'</span>
|
|
|
|
<span class="org-comment">" Quickly create a new terminal in a horizontal split</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>Leader<span class="org-constant">></span>T<span class="org-constant">-</span> :<span class="org-vimrc-command">split</span><span class="org-constant"><</span>CR<span class="org-constant">></span>:<span class="org-vimrc-option">term</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-comment">" let g:which_key_map.T.- = 'term-hor'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgdb45366" class="outline-3">
|
|
<h3 id="orgdb45366">Splits / Windows</h3>
|
|
<div class="outline-text-3" id="text-orgdb45366">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+windows'</span> }
|
|
|
|
<span class="org-comment">" Split Horizontal</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">w</span><span class="org-constant">-</span> :<span class="org-vimrc-command">split</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-comment">" let g:which_key_map.w.- = 'win-hor'</span>
|
|
|
|
<span class="org-comment">" Split Vertical</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">w</span>/ :<span class="org-vimrc-command">vsplit</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-comment">" let g:which_key_map.w./ = 'win-vert'</span>
|
|
|
|
<span class="org-comment">" Split Maximize</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>wD <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>o
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>D <span class="org-constant">=</span> <span class="org-string">'win-delete-others'</span>
|
|
|
|
<span class="org-comment">" Split Delete</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">wd</span> <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>q
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>d <span class="org-constant">=</span> <span class="org-string">'win-delete'</span>
|
|
|
|
<span class="org-comment">" Split Go Left</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">wh</span> :<span class="org-vimrc-command">wincmd</span> h<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>h <span class="org-constant">=</span> <span class="org-string">'win-left'</span>
|
|
|
|
<span class="org-comment">" Split Go Down</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>wj :<span class="org-vimrc-command">wincmd</span> j<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>j <span class="org-constant">=</span> <span class="org-string">'win-down'</span>
|
|
|
|
<span class="org-comment">" Split Go Up</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>wk :<span class="org-vimrc-command">wincmd</span> k<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>k <span class="org-constant">=</span> <span class="org-string">'win-up'</span>
|
|
|
|
<span class="org-comment">" Split Go Right</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>wl :<span class="org-vimrc-command">wincmd</span> l<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>l <span class="org-constant">=</span> <span class="org-string">'win-right'</span>
|
|
|
|
<span class="org-comment">" Split to Tab</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>wt <span class="org-constant"><</span>C<span class="org-constant">-</span><span class="org-vimrc-command">w</span><span class="org-constant">></span>T
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>t <span class="org-constant">=</span> <span class="org-string">'win-make-tab'</span>
|
|
|
|
<span class="org-comment">" Find window</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>wf :Windows<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>f <span class="org-constant">=</span> <span class="org-string">'win-find'</span>
|
|
|
|
<span class="org-comment">" Maximize window</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">wm</span> :<span class="org-vimrc-command">call</span> <span class="org-function-name">MaximizeToggle</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">w</span><span class="org-constant">.</span>m <span class="org-constant">=</span> <span class="org-string">'win-maximize'</span>
|
|
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">MaximizeToggle</span>()
|
|
<span class="org-vimrc-command">if</span> <span class="org-function-name">exists</span>(<span class="org-comment">"s:maximize_session")</span>
|
|
exec <span class="org-comment">"source " . s:maximize_session</span>
|
|
<span class="org-vimrc-command">call</span> <span class="org-function-name">delete</span>(<span class="org-variable-name">s:maximize_session</span>)
|
|
unlet <span class="org-variable-name">s:maximize_session</span>
|
|
<span class="org-vimrc-command">let</span> &<span class="org-vimrc-option">hidden</span><span class="org-constant">=</span><span class="org-variable-name">s:maximize_hidden_save</span>
|
|
unlet <span class="org-variable-name">s:maximize_hidden_save</span>
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:maximize_hidden_save</span> <span class="org-constant">=</span> &<span class="org-vimrc-option">hidden</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:maximize_session</span> <span class="org-constant">=</span> <span class="org-function-name">tempname</span>()
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">hidden</span>
|
|
exec <span class="org-comment">"mksession! " . s:maximize_session</span>
|
|
<span class="org-vimrc-command">only</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7d89ba7" class="outline-3">
|
|
<h3 id="org7d89ba7">Check Spell</h3>
|
|
<div class="outline-text-3" id="text-org7d89ba7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+spell-check'</span> }
|
|
|
|
<span class="org-comment">" CheckSpell Toggle</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>St :<span class="org-vimrc-command">setlocal</span> <span class="org-vimrc-option">spell</span><span class="org-constant">!<</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span><span class="org-vimrc-command">t</span> <span class="org-constant">=</span> <span class="org-string">'spell-toggle'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Correct</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>Sc z<span class="org-constant">=</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span><span class="org-vimrc-command">c</span> <span class="org-constant">=</span> <span class="org-string">'spell-correct'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Do first</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>SC <span class="org-vimrc-number">1</span>z<span class="org-constant">=</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span>C <span class="org-constant">=</span> <span class="org-string">'spell-correct-first'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Language</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>Sl :<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">spelllang</span><span class="org-constant">=</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span><span class="org-vimrc-command">l</span> <span class="org-constant">=</span> <span class="org-string">'spell-language'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Next</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>Sn ]s
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span><span class="org-vimrc-command">n</span> <span class="org-constant">=</span> <span class="org-string">'spell-next'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Next and correct</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>SN ]s1z<span class="org-constant">=</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span><span class="org-vimrc-command">N</span> <span class="org-constant">=</span> <span class="org-string">'spell-next-correct'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Previous</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>Sp [s
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span><span class="org-vimrc-command">p</span> <span class="org-constant">=</span> <span class="org-string">'spell-prev'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Previous and correct</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>SP [s1z<span class="org-constant">=</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span><span class="org-vimrc-command">P</span> <span class="org-constant">=</span> <span class="org-string">'spell-prev-correct'</span>
|
|
|
|
<span class="org-comment">" CheckSpell Add to dictionnary</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>Sa zg
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>S<span class="org-constant">.</span>a <span class="org-constant">=</span> <span class="org-string">'spell-add-dict'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org3ba15fb" class="outline-3">
|
|
<h3 id="org3ba15fb">Make</h3>
|
|
<div class="outline-text-3" id="text-org3ba15fb">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">m</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+make'</span> }
|
|
|
|
<span class="org-comment">" Make Make</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">mm</span> :Make <span class="org-constant">-</span>B<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">m</span><span class="org-constant">.</span>m <span class="org-constant">=</span> <span class="org-string">'make'</span>
|
|
|
|
<span class="org-comment">" Make Clean</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>mc :Make clean<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">m</span><span class="org-constant">.</span>c <span class="org-constant">=</span> <span class="org-string">'make-clean'</span>
|
|
|
|
<span class="org-comment">" Make Force</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>mf :Make<span class="org-constant">!</span> <span class="org-constant">-</span>B<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">m</span><span class="org-constant">.</span>f <span class="org-constant">=</span> <span class="org-string">'make-force'</span>
|
|
|
|
<span class="org-comment">" Make Run</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>mr :Make<span class="org-constant">!</span> run<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">m</span><span class="org-constant">.</span>r <span class="org-constant">=</span> <span class="org-string">'make-run'</span>
|
|
|
|
<span class="org-comment">" Make Open</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>mo :<span class="org-vimrc-command">make</span><span class="org-constant">!</span> <span class="org-vimrc-command">open</span><span class="org-constant"><</span>cr<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">m</span><span class="org-constant">.</span>o <span class="org-constant">=</span> <span class="org-string">'make-open'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgfc64cba" class="outline-3">
|
|
<h3 id="orgfc64cba">Search</h3>
|
|
<div class="outline-text-3" id="text-orgfc64cba">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>s <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+search'</span> }
|
|
|
|
<span class="org-comment">" Search History</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">sh</span> :History<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>s<span class="org-constant">.</span>h <span class="org-constant">=</span> <span class="org-string">'search-history'</span>
|
|
|
|
<span class="org-comment">" Search Tags</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>sT :Tags<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>s<span class="org-constant">.</span>T <span class="org-constant">=</span> <span class="org-string">'search-tags'</span>
|
|
|
|
<span class="org-comment">" Search All</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">sa</span> :Rg<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>s<span class="org-constant">.</span>g <span class="org-constant">=</span> <span class="org-string">'search-all'</span>
|
|
|
|
<span class="org-comment">" Search Word</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">sw</span> :<span class="org-vimrc-command">exe</span> <span class="org-string">':Rg '</span> <span class="org-constant">.</span> <span class="org-function-name">expand</span>(<span class="org-string">'<cword>'</span>)<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>s<span class="org-constant">.</span><span class="org-vimrc-command">w</span> <span class="org-constant">=</span> <span class="org-string">'search-word'</span>
|
|
|
|
<span class="org-comment">" Search todo keyboard</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">st</span> :Grepper <span class="org-constant">-</span>tool rg <span class="org-constant">-</span>query TODO<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>s<span class="org-constant">.</span><span class="org-vimrc-command">t</span> <span class="org-constant">=</span> <span class="org-string">'search-todos'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge640718" class="outline-3">
|
|
<h3 id="orge640718">GIT</h3>
|
|
<div class="outline-text-3" id="text-orge640718">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+git'</span> }
|
|
|
|
<span class="org-comment">" Git Gutter</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>leader<span class="org-constant">></span>gg :SignifyToggle<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span>g <span class="org-constant">=</span> <span class="org-string">'git-'</span>
|
|
|
|
<span class="org-comment">" Git Gutter Highlight</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>leader<span class="org-constant">></span>gG :SignifyToggleHighlight<span class="org-constant"><</span><span class="org-vimrc-command">cr</span><span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span>G <span class="org-constant">=</span> <span class="org-string">'git-'</span>
|
|
|
|
<span class="org-comment">" Git Commit</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>gc :Gcommit<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span><span class="org-vimrc-command">c</span> <span class="org-constant">=</span> <span class="org-string">'git-commit'</span>
|
|
|
|
<span class="org-comment">" Git Status</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>gs :Gstatus<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span>s <span class="org-constant">=</span> <span class="org-string">'git-status'</span>
|
|
|
|
<span class="org-comment">" Git Diff</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">gd</span> :Gdiff<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span><span class="org-vimrc-command">d</span> <span class="org-constant">=</span> <span class="org-string">'git-diff'</span>
|
|
|
|
<span class="org-comment">" Git Blame</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>gb :Gblame<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span><span class="org-vimrc-command">b</span> <span class="org-constant">=</span> <span class="org-string">'git-blame'</span>
|
|
|
|
<span class="org-comment">" Git Visualise</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>gv :GV<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span>v <span class="org-constant">=</span> <span class="org-string">'git-visualize'</span>
|
|
|
|
<span class="org-comment">" Git File (visualise)</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>gF :GV<span class="org-constant">!<</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span>F <span class="org-constant">=</span> <span class="org-string">'git-file'</span>
|
|
|
|
<span class="org-comment">" Git Find Commits</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>gf :Commits<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>g<span class="org-constant">.</span><span class="org-vimrc-command">f</span> <span class="org-constant">=</span> <span class="org-string">'git-find-commit'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd61fb1d" class="outline-3">
|
|
<h3 id="orgd61fb1d">Errors</h3>
|
|
<div class="outline-text-3" id="text-orgd61fb1d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">e</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+errors'</span> }
|
|
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">s:GetBufferList</span>()
|
|
<span class="org-vimrc-command">redir</span> <span class="org-constant">=></span>buflist
|
|
<span class="org-vimrc-command">silent</span><span class="org-constant">!</span> <span class="org-vimrc-option">ls</span>
|
|
<span class="org-vimrc-command">redir</span> END
|
|
<span class="org-vimrc-command">return</span> buflist
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">ToggleLocationList</span>()
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">curbufnr</span> <span class="org-constant">=</span> <span class="org-function-name">winbufnr</span>(<span class="org-highlight-numbers-number">0</span>)
|
|
<span class="org-vimrc-command">for</span> bufnum in <span class="org-function-name">map</span>(<span class="org-function-name">filter</span>(<span class="org-function-name">split</span>(<span class="org-function-name">s:GetBufferList</span>(), <span class="org-string">'\n'</span>), <span class="org-string">'v:val =~ "Location List"'</span>), <span class="org-string">'str2nr(matchstr(v:val, "\\d\\+"))'</span>)
|
|
<span class="org-vimrc-command">if</span> curbufnr <span class="org-constant">==</span> bufnum
|
|
<span class="org-vimrc-command">lclose</span>
|
|
<span class="org-vimrc-command">return</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endfor</span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">winnr</span> <span class="org-constant">=</span> <span class="org-function-name">winnr</span>()
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">prevwinnr</span> <span class="org-constant">=</span> <span class="org-function-name">winnr</span>(<span class="org-comment">"#")</span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">nextbufnr</span> <span class="org-constant">=</span> <span class="org-function-name">winbufnr</span>(winnr <span class="org-constant">+</span> <span class="org-highlight-numbers-number">1</span>)
|
|
<span class="org-vimrc-command">try</span>
|
|
<span class="org-vimrc-command">lopen</span>
|
|
<span class="org-vimrc-command">catch</span> /E776/
|
|
echohl ErrorMsg
|
|
echo <span class="org-comment">"Location List is Empty."</span>
|
|
echohl None
|
|
<span class="org-vimrc-command">return</span>
|
|
<span class="org-vimrc-command">endtry</span>
|
|
<span class="org-vimrc-command">if</span> <span class="org-function-name">winbufnr</span>(<span class="org-highlight-numbers-number">0</span>) <span class="org-constant">==</span> nextbufnr
|
|
<span class="org-vimrc-command">lclose</span>
|
|
<span class="org-vimrc-command">if</span> prevwinnr <span class="org-constant">></span> winnr
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">prevwinnr</span><span class="org-constant">-=</span><span class="org-vimrc-number">1</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">if</span> prevwinnr <span class="org-constant">></span> winnr
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">prevwinnr</span><span class="org-constant">+=</span><span class="org-vimrc-number">1</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-comment">" restore previous window</span>
|
|
exec prevwinnr<span class="org-constant">.</span><span class="org-comment">"wincmd w"</span>
|
|
exec winnr<span class="org-constant">.</span><span class="org-comment">"wincmd w"</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-comment">" Error Toggle</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>leader<span class="org-constant">></span>ee :<span class="org-vimrc-command">call</span> <span class="org-function-name">ToggleLocationList</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">e</span><span class="org-constant">.</span>e <span class="org-constant">=</span> <span class="org-string">'error-toggle'</span>
|
|
|
|
<span class="org-comment">" Error Open</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>leader<span class="org-constant">></span>eo :<span class="org-vimrc-command">lopen</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">e</span><span class="org-constant">.</span>o <span class="org-constant">=</span> <span class="org-string">'error-open'</span>
|
|
|
|
<span class="org-comment">" Error Close</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>leader<span class="org-constant">></span>ec :<span class="org-vimrc-command">lclose</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">e</span><span class="org-constant">.</span>c <span class="org-constant">=</span> <span class="org-string">'error-close'</span>
|
|
|
|
<span class="org-comment">" Error Next</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">en</span> :<span class="org-vimrc-command">lnext</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">e</span><span class="org-constant">.</span>n <span class="org-constant">=</span> <span class="org-string">'error-next'</span>
|
|
|
|
<span class="org-comment">" Error Previous</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">ep</span> :<span class="org-vimrc-command">lprevious</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">e</span><span class="org-constant">.</span>p <span class="org-constant">=</span> <span class="org-string">'error-previous'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge51b992" class="outline-3">
|
|
<h3 id="orge51b992">Text</h3>
|
|
<div class="outline-text-3" id="text-orge51b992">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">x</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+text'</span> }
|
|
|
|
<span class="org-comment">" Start interactive EasyAlign in visual mode (e.g. vipga) and for a motion</span>
|
|
<span class="org-vimrc-command">xmap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">xa</span> <span class="org-constant"><</span>Plug<span class="org-constant">></span>(EasyAlign)
|
|
<span class="org-vimrc-command">nmap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">xa</span> <span class="org-constant"><</span>Plug<span class="org-constant">></span>(EasyAlign)
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">x</span><span class="org-constant">.</span>a <span class="org-constant">=</span> <span class="org-string">'text-align'</span>
|
|
|
|
<span class="org-comment">" Indent all file</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">x</span><span class="org-constant">=</span> mzgg<span class="org-constant">=</span>G`z
|
|
<span class="org-comment">" let g:which_key_map.x.= = 'text-indent-file'</span>
|
|
|
|
<span class="org-comment">" Custom Multiple Cursor</span>
|
|
<span class="org-comment">" http://www.kevinli.co/posts/2017-01-19-multiple-cursors-in-500-bytes-of-vimscript/</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:mc</span> <span class="org-constant">=</span> <span class="org-comment">"y/\\V\<C-r>=escape(@\", '/')\<CR>\<CR>"</span>
|
|
|
|
<span class="org-comment">" Multiple Cursor</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">xm</span> *``cgn
|
|
<span class="org-vimrc-command">vnoremap</span> <span class="org-constant"><</span>expr<span class="org-constant">></span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">xm</span> <span class="org-variable-name">g:mc</span> <span class="org-constant">.</span> <span class="org-comment">"``cgn"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">x</span><span class="org-constant">.</span>m <span class="org-constant">=</span> <span class="org-string">'multiple-cursor'</span>
|
|
|
|
<span class="org-comment">" Multiple Cursor - reserve direction</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>xM *``cgN
|
|
<span class="org-vimrc-command">vnoremap</span> <span class="org-constant"><</span>expr<span class="org-constant">></span> <span class="org-constant"><</span>leader<span class="org-constant">></span>xM <span class="org-variable-name">g:mc</span> <span class="org-constant">.</span> <span class="org-comment">"``cgN"</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">x</span><span class="org-constant">.</span>M <span class="org-constant">=</span> <span class="org-string">'multiple-cursor-reverse'</span>
|
|
|
|
<span class="org-comment">" Delete trainling Whitespaces</span>
|
|
<span class="org-vimrc-command">fun</span><span class="org-constant">!</span> <span class="org-function-name">TrimWhitespace</span>()
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">l:save</span> <span class="org-constant">=</span> <span class="org-function-name">winsaveview</span>()
|
|
keeppatterns %s/\s\<span class="org-constant">+</span>$//<span class="org-vimrc-command">e</span>
|
|
<span class="org-vimrc-command">call</span> <span class="org-function-name">winrestview</span>(<span class="org-variable-name">l:save</span>)
|
|
endfun
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>xt :<span class="org-vimrc-command">call</span> <span class="org-function-name">TrimWhitespace</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">x</span><span class="org-constant">.</span>t <span class="org-constant">=</span> <span class="org-string">'delete-trailing-whitespaces'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc01849a" class="outline-3">
|
|
<h3 id="orgc01849a">Config</h3>
|
|
<div class="outline-text-3" id="text-orgc01849a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">c</span> <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+config'</span> }
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:activatedsh</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">ToggleSyntaxH</span>()
|
|
<span class="org-vimrc-command">if</span> <span class="org-variable-name">s:activatedsh</span> <span class="org-constant">==</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:activatedsh</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">synmaxcol</span><span class="org-constant">=</span><span class="org-vimrc-number">800</span>
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:activatedsh</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">set</span> <span class="org-vimrc-option">synmaxcol</span><span class="org-constant">=</span><span class="org-vimrc-number">100</span>
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-comment">" Toggle Syntax column</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span>cs :<span class="org-vimrc-command">call</span> <span class="org-function-name">ToggleSyntaxH</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">c</span><span class="org-constant">.</span>s <span class="org-constant">=</span> <span class="org-string">'toggle-syntax-col'</span>
|
|
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:activatedh</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">function</span><span class="org-constant">!</span> <span class="org-function-name">ToggleH</span>()
|
|
<span class="org-vimrc-command">if</span> <span class="org-variable-name">s:activatedh</span> <span class="org-constant">==</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:activatedh</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-vimrc-command">match</span> Search <span class="org-string">'\%>80v.\+'</span>
|
|
<span class="org-vimrc-command">else</span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">s:activatedh</span> <span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-vimrc-command">match</span> none
|
|
<span class="org-vimrc-command">endif</span>
|
|
<span class="org-vimrc-command">endfunction</span>
|
|
|
|
<span class="org-comment">" Toggle Highlight</span>
|
|
<span class="org-vimrc-command">nnoremap</span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-option">ch</span> :<span class="org-vimrc-command">call</span> <span class="org-function-name">ToggleH</span>()<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">c</span><span class="org-constant">.</span>h <span class="org-constant">=</span> <span class="org-string">'toggle-highlight'</span>
|
|
|
|
<span class="org-comment">" Reload vim config</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>Leader<span class="org-constant">></span><span class="org-vimrc-command">cr</span> :<span class="org-vimrc-command">source</span> $MYVIMRC<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">c</span><span class="org-constant">.</span>e <span class="org-constant">=</span> <span class="org-string">'reload-config'</span>
|
|
|
|
<span class="org-comment">" Edit vim config</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>Leader<span class="org-constant">></span><span class="org-vimrc-command">ce</span> :<span class="org-vimrc-command">e</span> $MYVIMRC<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">c</span><span class="org-constant">.</span>e <span class="org-constant">=</span> <span class="org-string">'edit-config'</span>
|
|
|
|
<span class="org-comment">" Disable highlight</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> <span class="org-constant"><</span>leader<span class="org-constant">></span><span class="org-vimrc-command">c</span><span class="org-constant"><</span>CR<span class="org-constant">></span> :<span class="org-vimrc-command">noh</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">c</span><span class="org-constant">.</span>enter <span class="org-constant">=</span> <span class="org-string">'disable-highlight'</span>
|
|
|
|
<span class="org-comment">" Theme</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span><span class="org-vimrc-command">silent</span><span class="org-constant">></span> <span class="org-constant"><</span>leader<span class="org-constant">></span>ct :<span class="org-vimrc-command">noh</span><span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span><span class="org-vimrc-command">c</span><span class="org-constant">.</span>t <span class="org-constant">=</span> <span class="org-string">'choose-theme'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4b5efe9" class="outline-3">
|
|
<h3 id="org4b5efe9">Insert</h3>
|
|
<div class="outline-text-3" id="text-org4b5efe9">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>i <span class="org-constant">=</span> { <span class="org-string">'name'</span> : <span class="org-string">'+insert'</span> }
|
|
|
|
<span class="org-comment">" Insert Snippet</span>
|
|
<span class="org-vimrc-option">noremap</span> <span class="org-constant"><</span>Leader<span class="org-constant">></span><span class="org-vimrc-option">is</span> :Snippets<span class="org-constant"><</span>CR<span class="org-constant">></span>
|
|
<span class="org-vimrc-command">let</span> <span class="org-variable-name">g:which_key_map</span><span class="org-constant">.</span>i<span class="org-constant">.</span>s <span class="org-constant">=</span> <span class="org-string">'insert-snippet'</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6eb8289" class="outline-3">
|
|
<h3 id="org6eb8289">Save Which Key Configuration</h3>
|
|
<div class="outline-text-3" id="text-org6eb8289">
|
|
<div class="org-src-container">
|
|
<pre class="src src-vimrc"><span class="org-vimrc-command">call</span> which_key#<span class="org-function-name">register</span>(<span class="org-string">'<Space>'</span>, <span class="org-comment">"g:which_key_map")</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="postamble" class="status">
|
|
<p class="author">Author: Dehaeze Thomas</p>
|
|
<p class="date">Created: 2022-05-09 lun. 10:03</p>
|
|
</div>
|
|
</body>
|
|
</html>
|