Repository: PegasusWang/vim-config
Branch: master
Commit: fc905dcee4e7
Files: 58
Total size: 256.9 KB
Directory structure:
gitextract_ap_uenq3/
├── .gitignore
├── Makefile
├── README.md
├── after/
│ └── ftplugin/
│ ├── go.vim
│ ├── help.vim
│ ├── json.vim
│ ├── man.vim
│ ├── markdown.vim
│ ├── qf.vim
│ └── vim.vim
├── autoload/
│ ├── actionmenu.vim
│ ├── badge.vim
│ └── preview.vim
├── coc-settings.json
├── config/
│ ├── filetype.vim
│ ├── general.vim
│ ├── init.vim
│ ├── local.plugins.yaml
│ ├── local.vim
│ ├── mappings.vim
│ ├── plugins/
│ │ ├── all.vim
│ │ ├── asyncomplete.vim
│ │ ├── coc.vim
│ │ ├── colorizer.lua
│ │ ├── dashboard.lua
│ │ ├── defx.vim
│ │ ├── denite.vim
│ │ ├── gina.vim
│ │ ├── goyo.vim
│ │ ├── iron.lua
│ │ ├── lsp.vim
│ │ └── whichkey.vim
│ ├── plugins.yaml
│ ├── statusline.vim
│ ├── tabline.vim
│ ├── terminal.vim
│ ├── theme.vim
│ └── vimrc
├── filetype.vim
├── init.vim
├── plugin/
│ ├── actionmenu.vim
│ ├── devhelp.vim
│ ├── difftools.vim
│ ├── filesystem.vim
│ ├── jumpfile.vim
│ ├── sessions.vim
│ ├── unixhelp.vim
│ └── whitespace.vim
├── snippets/
│ ├── .gitignore
│ ├── go.snip
│ ├── javascript.snip
│ └── python.snip
├── themes/
│ ├── hybrid.vim
│ ├── rafi-2015.vim
│ ├── rafi-2016.vim
│ └── rafi-2017.vim
├── venv.sh
└── vimrc
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*~
/benchmarks/
/spell/
/.vault.vim
/.local.vimrc
/.stignore
/.stfolder
/.stversions
.vim
================================================
FILE: Makefile
================================================
SHELL = /bin/bash
vim := $(if $(shell which nvim),nvim,$(shell which vim))
vim_version := '${shell $(vim) --version}'
XDG_CACHE_HOME ?= $(HOME)/.cache
default: install
install: create-dirs update-plugins
update: update-repo update-plugins
upgrade: update
create-dirs:
@mkdir -vp "$(XDG_CACHE_HOME)/vim/"{backup,session,swap,tags,undo}
update-repo:
git pull --ff --ff-only
update-plugins:
$(vim) -V1 -es -i NONE -N --noplugin -u config/init.vim \
-c "try | call dein#clear_state() | call dein#update() | finally | messages | qall! | endtry"
uninstall:
rm -rf "$(XDG_CACHE_HOME)/vim"
test:
ifeq ('$(vim)','nvim')
$(info Testing NVIM 0.5+...)
$(if $(shell echo "$(vim_version)" | egrep "NVIM v0\.[5-9]"),\
$(info OK),\
$(error .. You need Neovim 0.5.x or newer))
else
$(info Testing VIM 8.x...)
$(if $(shell echo "$(vim_version)" | egrep "VIM .* 8\."),\
$(info OK),\
$(error .. You need Vim 8.x))
$(info Testing +python3... )
$(if $(findstring +python3,$(vim_version)),\
$(info OK),\
$(error .. MISSING! Install Vim 8.x with "+python3" enabled))
endif
@echo All tests passed, hooray!
.PHONY: install create-dirs update-repo update-plugins uninstall test
================================================
FILE: README.md
================================================
# Rafael Bodill's Neo/vim Config
Lean mean Neo/vim machine, 30-45ms startup time.
Best with [Neovim] 0.5.x or [Vim] 8.x and `python3` enabled.
> I encourage you to fork this repo and create your own experience.
> Learn how to tweak and change Neo/vim to the way YOU like it.
> This is my cultivation of years of tweaking, use it as a git remote
> and stay in-touch with upstream for reference or cherry-picking.
Table of Contents
(🔎 Click to expand/collapse)
* [Features](#features)
* [Screenshot](#screenshot)
* [Prerequisites](#prerequisites)
* [Install](#install)
* [Language-Server Protocol (LSP)](#language-server-protocol-lsp)
* [Upgrade](#upgrade)
* [Recommended Fonts](#recommended-fonts)
* [Recommended Linters](#recommended-linters)
* [Recommended Tools](#recommended-tools)
* [User Custom Config](#user-custom-config)
* [Structure](#structure)
* [Plugin Highlights](#plugin-highlights)
* [Plugins Included](#plugins-included)
* [Non Lazy-Loaded Plugins](#non-lazy-loaded-plugins)
* [Lazy-Loaded Plugins](#lazy-loaded-plugins)
* [Language](#language)
* [Commands](#commands)
* [Interface](#interface)
* [Completion & Code-Analysis](#completion--code-analysis)
* [Denite & Clap](#denite--clap)
* [Operators & Text Objects](#operators--text-objects)
* [Custom Key-mappings](#custom-key-mappings)
* [Navigation](#navigation)
* [File Operations](#file-operations)
* [Edit](#edit)
* [Search & Replace](#search--replace)
* [Clipboard](#clipboard)
* [Command & History](#command--history)
* [Editor UI](#editor-ui)
* [Custom Tools & Plugins](#custom-tools--plugins)
* [Window Management](#window-management)
* [Git Version Control](#git-version-control)
* [Plugin: Denite](#plugin-denite)
* [Plugin: Defx](#plugin-defx)
* [Plugin: Clap](#plugin-clap)
* [Plugin: Asyncomplete and Emmet](#plugin-asyncomplete-and-emmet)
* [Plugin: Any-Jump](#plugin-any-jump)
* [Plugin: Signature](#plugin-signature)
* [Credits & Contribution](#credits--contribution)
## Features
* Fast startup time
* Robust, yet light-weight
* Lazy-load 95% of plugins with [Shougo/dein.vim]
* Custom side-menu (try it out! Space+l)
* Custom context-menu (try it! ;+c)
* Modular configuration (see [structure](#structure))
* Auto-complete [prabirshrestha/asyncomplete.vim] extensive setup
* [Shougo/denite.nvim] centric work-flow (lists)
* Structure view with [liuchengxu/vista.vim]
* Open SCM detailed URL in OS browser
* Light-weight but informative status/tabline
* Easy customizable theme
* Premium color-schemes
* Central location for tags and sessions
## Screenshot

## Prerequisites
* Python 3 (`brew install python`)
* Neovim or Vim (`brew install neovim` and/or `brew install vim`)
*Caveat*: You must have **one** of these tools installed:
[yj](https://github.com/sclevine/yj), [yq](https://github.com/mikefarah/yq),
[yaml2json](https://github.com/bronze1man/yaml2json), Ruby, or Python with
PyYAML in-order for the YAML configuration to be parsed.
## Install
**_1._** Let's clone this repo! Clone to `~/.config/nvim`,
we'll also symlink it for regular Vim:
```bash
mkdir ~/.config
git clone git://github.com/PegasusWang/vim-config.git ~/.config/nvim
cd ~/.config/nvim
ln -s ~/.config/nvim ~/.vim # For "regular" Vim
```
* _**Note**:_ If you set a custom `$XDG_CONFIG_HOME`,
use that instead of `~/.config` in the commands above.
Neovim follows the XDG base-directories convention, Vim doesn't.
**_2._** Install the Python 3 `pynvim` library. This is also needed for Vim 8
if you want to use Denite and Defx.
> Neovim: `./venv.sh` or `pip3 install --user pynvim`
> Vim: `pip3 install --user pynvim`
**_3._** Run `make test` to test your nvim/vim version and capabilities.
**_4._** Run `make` to install all plugins.
**_5._** If you are experiencing problems, run and read `nvim -c checkhealth`
Test Python 3 availability with `:py3 print(sys.version_info)`
Enjoy! :smile:
## Language-Server Protocol (LSP)
To leverage LSP auto-completions and other functionalities, once you open a
file in Neo/vim, run `:LspInstallServer ` to use [mattn/vim-lsp-settings]
installation feature, use Tab to list available servers.
Here are a few useful commands:
* For example, open a `.go` file, and run: `:LspInstallServer gopls`
* In a `go` file, use action `:LspCodeAction source.organizeImports`
* See [config/plugins/lsp.vim] for special code intellisense mappings
## Upgrade
```bash
cd ~/.config/nvim
make update
```
This will run `git pull --ff --ff-only` and update all plugins using
[Shougo/dein.vim] package-manager (`:call dein#update()`).
### Recommended Fonts
* [Pragmata Pro] (€19 – €1,990): My preferred font
* Any of the [Nerd Fonts]
On macOS with Homebrew, choose one of the [Nerd Fonts],
for example, to install the [Hack](https://sourcefoundry.org/hack/) font:
```bash
brew tap homebrew/cask-fonts
brew search nerd-font
brew cask install font-hack-nerd-font
brew cask install font-iosevka-nerd-font-mono
brew cask install font-jetbrains-mono
brew cask install font-fira-code
```
[Pragmata Pro]: https://www.fsd.it/shop/fonts/pragmatapro/
[Nerd Fonts]: https://www.nerdfonts.com
### Recommended Linters
* macOS with Homebrew:
```sh
brew install shellcheck jsonlint yamllint tflint ansible-lint
brew install tidy-html5 proselint write-good
```
* Node.js based linters:
```sh
yarn global add eslint jshint jsxhint stylelint sass-lint
yarn global add markdownlint-cli raml-cop
```
* Python based linters:
```sh
pip3 install --user vim-vint pycodestyle pyflakes flake8
```
### Recommended Tools
* **ag** [ggreer/the_silver_searcher](https://github.com/ggreer/the_silver_searcher)
(macOS: `brew install the_silver_searcher`)
* and/or **ripgrep**: [BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep)
(macOS: `brew install rg`)
* Jump around with **z**: [rupa/z](https://github.com/rupa/z)
(macOS: `brew install z`)
* or **z.lua**: [acme/zlua](https://github.com/skywind3000/z.lua)
* **[Universal ctags](https://ctags.io/)** for syntax tokenization
(macOS: `brew install universal-ctags/universal-ctags/universal-ctags`)
* Fuzzy file finders:
**[fzf](https://github.com/junegunn/fzf)**,
**[fzy](https://github.com/jhawthorn/fzy)**, or
**[peco](https://github.com/peco/peco)**
(macOS: `brew install fzf`)
## User Custom Config
If you want to add your own configuration, create the `config/local.vim` file
and add your personal vimscript there. If you'd like to install plugins by
yourself, create a `config/local.plugins.yaml` file and manage your own plugin
collection.
If you want to disable some of the plugins I use, you can overwrite them, e.g.:
```yaml
- { repo: mattn/vim-lsp-settings, if: 0 }
```
### Disable built-in statusline & tabline
You can use your local `config/local.vim` to disable status and tab lines:
```vim
let g:tabline_plugin_enable = 0
let g:statusline_plugin_enable = 0
```
Now, using `config/local.plugins.yaml` you can install any line plugin you
want, _e.g._:
```yaml
# Use only one!
- repo: itchyny/lightline.vim
- repo: vim-airline/vim-airline
- repo: glepnir/galaxyline.nvim
- repo: glepnir/spaceline.vim
- repo: liuchengxu/eleline.vim
```
## Structure
* [config/](./config) - Configuration
* [plugins/](./config/plugins) - Plugin configurations
* [all.vim](./config/plugins/all.vim) - Plugin mappings
* […](./config/plugins)
* [filetype.vim](./config/filetype.vim) - Language behavior
* [general.vim](./config/general.vim) - General configuration
* **local.plugins.yaml** - Custom user plugins
* **local.vim** - Custom user settings
* [mappings.vim](./config/mappings.vim) - Key-mappings
* [plugins.yaml](./config/plugins.yaml) - My favorite _**Plugins!**_
* [terminal.vim](./config/terminal.vim) - Terminal configuration
* [vimrc](./config/vimrc) - Initialization
* [ftplugin/](./ftplugin) - Language specific custom settings
* [plugin/](./plugin) - Customized small plugins
* [snippets/](./snippets) - Personal code snippets
* [themes/](./themes) - Colorscheme overrides
* [filetype.vim](./filetype.vim) - Custom filetype detection
## Plugin Highlights
* Plugin management with cache and lazy loading for speed
* Auto-completion with Language-Server Protocol (LSP)
* Project-aware tabs and labels
* Defx as file-manager + Git status icons
* Extensive language extensions library
_Note_ that 95% of the plugins are **[lazy-loaded]**.
## Plugins Included
List (🔎 Click to expand/collapse)
### Non Lazy-Loaded Plugins
| Name | Description
| -------------- | ----------------------
| [Shougo/dein.vim] | Dark powered Vim/Neovim plugin manager
| [rafi/awesome-colorschemes] | Awesome color-schemes
| [thinca/vim-localrc] | Enable configuration file of each directory
| [romainl/vim-cool] | Simple plugin that makes hlsearch more useful
| [sgur/vim-editorconfig] | EditorConfig plugin written entirely in Vimscript
| [christoomey/tmux-navigator] | Seamless navigation between tmux panes and vim splits
| [tpope/vim-sleuth] | Heuristically set buffer indent options
| [antoinemadec/FixCursorHold.nvim] | Neovim CursorHold workaround
| [roxma/nvim-yarp] | Vim8 remote plugin framework for Neovim
| [roxma/vim-hug-neovim-rpc] | Vim8 compatibility layer for neovim rpc client
### Lazy-Loaded Plugins
#### Language
| Name | Description
| -------------- | ----------------------
| [hail2u/vim-css3-syntax] | CSS3 syntax support to vim's built-in `syntax/css.vim`
| [othree/csscomplete.vim] | Updated built-in CSS complete with latest standards
| [cakebaker/scss-syntax.vim] | Syntax file for scss (Sassy CSS)
| [groenewege/vim-less] | Syntax for LESS
| [iloginow/vim-stylus] | Syntax, indentation and autocomplete for Stylus
| [mustache/vim-mustache-handlebars] | Mustache and handlebars syntax
| [digitaltoad/vim-pug] | Pug (formerly Jade) syntax and indentation
| [othree/html5.vim] | HTML5 omnicomplete and syntax
| [plasticboy/vim-markdown] | Markdown syntax highlighting
| [pangloss/vim-javascript] | Enhanced Javascript syntax
| [HerringtonDarkholme/yats.vim] | Advanced TypeScript Syntax Highlighting
| [MaxMEllon/vim-jsx-pretty] | React JSX syntax pretty highlighting
| [leafOfTree/vim-svelte-plugin] | Syntax and indent plugin for Svelte
| [heavenshell/vim-jsdoc] | Generate JSDoc to your JavaScript code
| [jparise/vim-graphql] | GraphQL file detection, syntax highlighting, and indentation
| [moll/vim-node] | Superb development with Node.js
| [kchmck/vim-coffee-script] | CoffeeScript support
| [elzr/vim-json] | Better JSON support
| [posva/vim-vue] | Syntax Highlight for Vue.js components
| [vim-python/python-syntax] | Enhanced version of the original Python syntax
| [Vimjas/vim-python-pep8-indent] | A nicer Python indentation style
| [vim-scripts/python_match.vim] | Extend the % motion for Python files
| [raimon49/requirements.txt.vim] | Python requirements file format
| [StanAngeloff/php.vim] | Up-to-date PHP syntax file (5.3 – 7.1 support)
| [tbastos/vim-lua] | Lua 5.3 syntax and indentation improved support
| [vim-ruby/vim-ruby] | Ruby support
| [keith/swift.vim] | Swift support
| [rust-lang/rust.vim] | Rust support
| [vim-jp/syntax-vim-ex] | Improved Vim syntax highlighting
| [chrisbra/csv.vim] | Handling column separated data
| [tpope/vim-git] | Git runtime files
| [ekalinin/Dockerfile.vim] | Syntax and snippets for Dockerfile
| [tmux-plugins/vim-tmux] | Plugin for tmux.conf
| [MTDL9/vim-log-highlighting] | Syntax highlighting for generic log files
| [cespare/vim-toml] | Syntax for TOML
| [mboughaba/i3config.vim] | i3 window manager config syntax
| [dag/vim-fish] | Fish shell edit support
| [jstrater/mpvim] | Macports portfile configuration files
| [robbles/logstash.vim] | Highlights logstash configuration files
| [lifepillar/pgsql.vim] | PostgreSQL syntax and indent
| [chr4/nginx.vim] | Improved nginx syntax and indent
| [towolf/vim-helm] | Syntax for Helm templates (yaml + gotmpl + sprig)
| [udalov/kotlin-vim] | Kotlin syntax and indent
| [reasonml-editor/vim-reason-plus] | Reason syntax and indent
| [pearofducks/ansible-vim] | Improved YAML support for Ansible
| [hashivim/vim-terraform] | Base Terraform integration
#### Commands
| Name | Description
| -------------- | ----------------------
| [Shougo/defx.nvim] | Dark powered file explorer implementation
| [kristijanhusak/defx-git] | Git status implementation for Defx
| [kristijanhusak/defx-icons] | Filetype icons for Defx
| [tyru/caw.vim] | Robust comment plugin with operator support
| [Shougo/context_filetype.vim] | Context filetype detection for nested code
| [lambdalisue/fin.vim] | Filter the buffer content in-place
| [mbbill/undotree] | Ultimate undo history visualizer
| [jreybert/vimagit] | Ease your git work-flow within Vim
| [tweekmonster/helpful.vim] | Display vim version numbers in docs
| [lambdalisue/gina.vim] | Asynchronously control git repositories
| [mhinz/vim-grepper] | Helps you win at grep
| [kana/vim-altr] | Switch to the alternate file without interaction
| [Shougo/vinarise.vim] | Hex editor
| [guns/xterm-color-table.vim] | Display 256 xterm colors with their RGB equivalents
| [cocopon/colorswatch.vim] | Generate a beautiful color swatch for the current buffer
| [dstein64/vim-startuptime] | Visually profile Vim's startup time
| [lambdalisue/suda.vim] | An alternative sudo.vim for Vim and Neovim
| [liuchengxu/vim-which-key] | Shows key-bindings in pop-up
| [brooth/far.vim] | Fast find and replace plugin
| [pechorin/any-jump.vim] | Jump to any definition and references without overhead
| [jaawerth/nrun.vim] | "which" and "exec" functions targeted at local node project bin
| [Vigemus/iron.nvim] | Interactive REPL over Neovim
| [kana/vim-niceblock] | Make blockwise Visual mode more useful
| [t9md/vim-choosewin] | Choose window to use, like tmux's 'display-pane'
| [wfxr/minimap.vim] | Blazing fast minimap for vim, powered by code-minimap
| [mzlogin/vim-markdown-toc] | Generate table of contents for Markdown files
| [reedes/vim-wordy] | Uncover usage problems in your writing
| [liuchengxu/vista.vim] | Viewer & Finder for LSP symbols and tags in Vim
| [junegunn/fzf] | Powerful command-line fuzzy finder
| [junegunn/fzf.vim] | Fzf integration
| [Ron89/thesaurus_query.vim] | Multi-language thesaurus query and replacement
#### Interface
| Name | Description
| -------------- | ----------------------
| [itchyny/vim-gitbranch] | Lightweight git branch detection
| [itchyny/vim-parenmatch] | Efficient alternative to the standard matchparen plugin
| [haya14busa/vim-asterisk] | Improved * motions
| [rhysd/accelerated-jk] | Up/down movement acceleration
| [haya14busa/vim-edgemotion] | Jump to the edge of block
| [t9md/vim-quickhl] | Highlight words quickly
| [rafi/vim-sidemenu] | Small side-menu useful for terminal users
| [machakann/vim-highlightedyank] | Make the yanked region apparent
| [itchyny/cursorword] | Underlines word under cursor
| [airblade/vim-gitgutter] | Show git changes at Vim gutter and un/stages hunks
| [kshenoy/vim-signature] | Display and toggle marks
| [nathanaelkane/vim-indent-guides] | Visually display indent levels in code
| [rhysd/committia.vim] | Pleasant editing on Git commit messages
| [junegunn/goyo] | Distraction-free writing
| [junegunn/limelight] | Hyperfocus-writing
| [itchyny/calendar.vim] | Calendar application
| [deris/vim-shot-f] | Highlight characters to move directly with f/t/F/T
| [vimwiki/vimwiki] | Personal Wiki for Vim
| [norcalli/nvim-colorizer.lua] | The fastest Neovim colorizer
#### Completion & Code-Analysis
| Name | Description
| -------------- | ----------------------
| [prabirshrestha/async.vim] | Normalize async job control API for Vim and Neovim
| [prabirshrestha/asyncomplete.vim] | Async-completion in pure Vimscript for Vim8 and Neovim
| [prabirshrestha/asyncomplete-lsp.vim] | Provide Language Server Protocol autocompletion source
| [prabirshrestha/vim-lsp] | Async Language Server Protocol plugin for Vim and Neovim
| [mattn/vim-lsp-settings] | Auto LSP configurations for vim-lsp
| [Shougo/neco-vim] | Completion source for Vimscript
| [prabirshrestha/asyncomplete-necovim.vim] | Provides syntax autocomplete via neco-vim
| [prabirshrestha/asyncomplete-buffer.vim] | Provides buffer autocomplete
| [prabirshrestha/asyncomplete-tags.vim] | Provides tag autocomplete via vim tagfiles
| [prabirshrestha/asyncomplete-file.vim] | Provides file autocomplete
| [wellle/tmux-complete.vim] | Completion of words in adjacent tmux panes
| [prabirshrestha/asyncomplete-ultisnips.vim] | Provides UltiSnips autocomplete
| [SirVer/ultisnips] | Ultimate snippet solution
| [honza/vim-snippets] | Community-maintained snippets for programming languages
| [mattn/emmet-vim] | Provides support for expanding abbreviations alá emmet
| [ludovicchabant/vim-gutentags] | Manages your tag files
| [Raimondi/delimitMate] | Auto-completion for quotes, parens, brackets
#### Denite & Clap
| Name | Description
| -------------- | ----------------------
| [Shougo/denite.nvim] | Dark powered asynchronous unite all interfaces
| [Shougo/neomru.vim] | Denite plugin for MRU
| [Shougo/neoyank.vim] | Denite plugin for yank history
| [Shougo/junkfile.vim] | Denite plugin for temporary files
| [chemzqm/unite-location] | Denite location & quickfix lists
| [rafi/vim-denite-session] | Browse and open sessions
| [rafi/vim-denite-z] | Filter and browse Z (jump around) data file
| [liuchengxu/vim-clap] | Modern performant generic finder and dispatcher
#### Operators & Text Objects
| Name | Description
| -------------- | ----------------------
| [kana/vim-operator-user] | Define your own custom operators
| [kana/vim-operator-replace] | Operator to replace text with register content
| [machakann/vim-sandwich] | Search, select, and edit sandwich text objects
| [kana/vim-textobj-user] | Create your own text objects
| [terryma/vim-expand-region] | Visually select increasingly larger regions of text
| [AndrewRadev/sideways.vim] | Match function arguments
| [AndrewRadev/splitjoin.vim] | Transition code between multi-line and single-line
| [AndrewRadev/linediff.vim] | Perform diffs on blocks of code
| [AndrewRadev/dsf.vim] | Delete surrounding function call
| [kana/vim-textobj-function] | Text objects for functions
[Shougo/dein.vim]: https://github.com/Shougo/dein.vim
[rafi/awesome-colorschemes]: https://github.com/rafi/awesome-vim-colorschemes
[thinca/vim-localrc]: https://github.com/thinca/vim-localrc
[romainl/vim-cool]: https://github.com/romainl/vim-cool
[sgur/vim-editorconfig]: https://github.com/sgur/vim-editorconfig
[christoomey/tmux-navigator]: https://github.com/christoomey/vim-tmux-navigator
[tpope/vim-sleuth]: https://github.com/tpope/vim-sleuth
[antoinemadec/FixCursorHold.nvim]: https://github.com/antoinemadec/FixCursorHold.nvim
[roxma/nvim-yarp]: https://github.com/roxma/nvim-yarp
[roxma/vim-hug-neovim-rpc]: https://github.com/roxma/vim-hug-neovim-rpc
[hail2u/vim-css3-syntax]: https://github.com/hail2u/vim-css3-syntax
[othree/csscomplete.vim]: https://github.com/othree/csscomplete.vim
[cakebaker/scss-syntax.vim]: https://github.com/cakebaker/scss-syntax.vim
[groenewege/vim-less]: https://github.com/groenewege/vim-less
[iloginow/vim-stylus]: https://github.com/iloginow/vim-stylus
[mustache/vim-mustache-handlebars]: https://github.com/mustache/vim-mustache-handlebars
[digitaltoad/vim-pug]: https://github.com/digitaltoad/vim-pug
[othree/html5.vim]: https://github.com/othree/html5.vim
[plasticboy/vim-markdown]: https://github.com/plasticboy/vim-markdown
[pangloss/vim-javascript]: https://github.com/pangloss/vim-javascript
[HerringtonDarkholme/yats.vim]: https://github.com/HerringtonDarkholme/yats.vim
[MaxMEllon/vim-jsx-pretty]: https://github.com/MaxMEllon/vim-jsx-pretty
[leafOfTree/vim-svelte-plugin]: https://github.com/leafOfTree/vim-svelte-plugin
[heavenshell/vim-jsdoc]: https://github.com/heavenshell/vim-jsdoc
[jparise/vim-graphql]: https://github.com/jparise/vim-graphql
[moll/vim-node]: https://github.com/moll/vim-node
[kchmck/vim-coffee-script]: https://github.com/kchmck/vim-coffee-script
[elzr/vim-json]: https://github.com/elzr/vim-json
[posva/vim-vue]: https://github.com/posva/vim-vue
[vim-python/python-syntax]: https://github.com/vim-python/python-syntax
[Vimjas/vim-python-pep8-indent]: https://github.com/Vimjas/vim-python-pep8-indent
[vim-scripts/python_match.vim]: https://github.com/vim-scripts/python_match.vim
[raimon49/requirements.txt.vim]: https://github.com/raimon49/requirements.txt.vim
[StanAngeloff/php.vim]: https://github.com/StanAngeloff/php.vim
[tbastos/vim-lua]: https://github.com/tbastos/vim-lua
[vim-ruby/vim-ruby]: https://github.com/vim-ruby/vim-ruby
[keith/swift.vim]: https://github.com/keith/swift.vim
[rust-lang/rust.vim]: https://github.com/rust-lang/rust.vim
[vim-jp/syntax-vim-ex]: https://github.com/vim-jp/syntax-vim-ex
[chrisbra/csv.vim]: https://github.com/chrisbra/csv.vim
[tpope/vim-git]: https://github.com/tpope/vim-git
[ekalinin/Dockerfile.vim]: https://github.com/ekalinin/Dockerfile.vim
[tmux-plugins/vim-tmux]: https://github.com/tmux-plugins/vim-tmux
[MTDL9/vim-log-highlighting]: https://github.com/MTDL9/vim-log-highlighting
[cespare/vim-toml]: https://github.com/cespare/vim-toml
[mboughaba/i3config.vim]: https://github.com/mboughaba/i3config.vim
[dag/vim-fish]: https://github.com/dag/vim-fish
[jstrater/mpvim]: https://github.com/jstrater/mpvim
[robbles/logstash.vim]: https://github.com/robbles/logstash.vim
[lifepillar/pgsql.vim]: https://github.com/lifepillar/pgsql.vim
[chr4/nginx.vim]: https://github.com/chr4/nginx.vim
[towolf/vim-helm]: https://github.com/towolf/vim-helm
[udalov/kotlin-vim]: https://github.com/udalov/kotlin-vim
[reasonml-editor/vim-reason-plus]: https://github.com/reasonml-editor/vim-reason-plus
[pearofducks/ansible-vim]: https://github.com/pearofducks/ansible-vim
[hashivim/vim-terraform]: https://github.com/hashivim/vim-terraform
[Shougo/defx.nvim]: https://github.com/Shougo/defx.nvim
[kristijanhusak/defx-git]: https://github.com/kristijanhusak/defx-git
[kristijanhusak/defx-icons]: https://github.com/kristijanhusak/defx-icons
[tyru/caw.vim]: https://github.com/tyru/caw.vim
[Shougo/context_filetype.vim]: https://github.com/Shougo/context_filetype.vim
[lambdalisue/fin.vim]: https://github.com/lambdalisue/fin.vim
[mbbill/undotree]: https://github.com/mbbill/undotree
[jreybert/vimagit]: https://github.com/jreybert/vimagit
[tweekmonster/helpful.vim]: https://github.com/tweekmonster/helpful.vim
[lambdalisue/gina.vim]: https://github.com/lambdalisue/gina.vim
[mhinz/vim-grepper]: https://github.com/mhinz/vim-grepper
[kana/vim-altr]: https://github.com/kana/vim-altr
[Shougo/vinarise.vim]: https://github.com/Shougo/vinarise.vim
[guns/xterm-color-table.vim]: https://github.com/guns/xterm-color-table.vim
[cocopon/colorswatch.vim]: https://github.com/cocopon/colorswatch.vim
[dstein64/vim-startuptime]: https://github.com/dstein64/vim-startuptime
[lambdalisue/suda.vim]: https://github.com/lambdalisue/suda.vim
[liuchengxu/vim-which-key]: https://github.com/liuchengxu/vim-which-key
[brooth/far.vim]: https://github.com/brooth/far.vim
[pechorin/any-jump.vim]: https://github.com/pechorin/any-jump.vim
[jaawerth/nrun.vim]: https://github.com/jaawerth/nrun.vim
[Vigemus/iron.nvim]: https://github.com/Vigemus/iron.nvim
[kana/vim-niceblock]: https://github.com/kana/vim-niceblock
[t9md/vim-choosewin]: https://github.com/t9md/vim-choosewin
[wfxr/minimap.vim]: https://github.com/wfxr/minimap.vim
[mzlogin/vim-markdown-toc]: https://github.com/mzlogin/vim-markdown-toc
[reedes/vim-wordy]: https://github.com/reedes/vim-wordy
[liuchengxu/vista.vim]: https://github.com/liuchengxu/vista.vim
[junegunn/fzf]: https://github.com/junegunn/fzf
[junegunn/fzf.vim]: https://github.com/junegunn/fzf.vim
[Ron89/thesaurus_query.vim]: https://github.com/Ron89/thesaurus_query.vim
[itchyny/vim-gitbranch]: https://github.com/itchyny/vim-gitbranch
[itchyny/vim-parenmatch]: https://github.com/itchyny/vim-parenmatch
[haya14busa/vim-asterisk]: https://github.com/haya14busa/vim-asterisk
[rhysd/accelerated-jk]: https://github.com/rhysd/accelerated-jk
[haya14busa/vim-edgemotion]: https://github.com/haya14busa/vim-edgemotion
[t9md/vim-quickhl]: https://github.com/t9md/vim-quickhl
[rafi/vim-sidemenu]: https://github.com/rafi/vim-sidemenu
[machakann/vim-highlightedyank]: https://github.com/machakann/vim-highlightedyank
[itchyny/cursorword]: https://github.com/itchyny/vim-cursorword
[airblade/vim-gitgutter]: https://github.com/airblade/vim-gitgutter
[kshenoy/vim-signature]: https://github.com/kshenoy/vim-signature
[nathanaelkane/vim-indent-guides]: https://github.com/nathanaelkane/vim-indent-guides
[rhysd/committia.vim]: https://github.com/rhysd/committia.vim
[junegunn/goyo]: https://github.com/junegunn/goyo.vim
[junegunn/limelight]: https://github.com/junegunn/limelight.vim
[itchyny/calendar.vim]: https://github.com/itchyny/calendar.vim
[deris/vim-shot-f]: https://github.com/deris/vim-shot-f
[vimwiki/vimwiki]: https://github.com/vimwiki/vimwiki
[norcalli/nvim-colorizer.lua]: https://github.com/norcalli/nvim-colorizer.lua
[prabirshrestha/async.vim]: https://github.com/prabirshrestha/async.vim
[prabirshrestha/asyncomplete.vim]: https://github.com/prabirshrestha/asyncomplete.vim
[prabirshrestha/asyncomplete-lsp.vim]: https://github.com/prabirshrestha/asyncomplete-lsp.vim
[prabirshrestha/vim-lsp]: https://github.com/prabirshrestha/vim-lsp
[mattn/vim-lsp-settings]: https://github.com/mattn/vim-lsp-settings
[Shougo/neco-vim]: https://github.com/Shougo/neco-vim
[prabirshrestha/asyncomplete-necovim.vim]: https://github.com/prabirshrestha/asyncomplete-necovim.vim
[prabirshrestha/asyncomplete-buffer.vim]: https://github.com/prabirshrestha/asyncomplete-buffer.vim
[prabirshrestha/asyncomplete-tags.vim]: https://github.com/prabirshrestha/asyncomplete-tags.vim
[prabirshrestha/asyncomplete-file.vim]: https://github.com/prabirshrestha/asyncomplete-file.vim
[wellle/tmux-complete.vim]: https://github.com/wellle/tmux-complete.vim
[prabirshrestha/asyncomplete-ultisnips.vim]: https://github.com/prabirshrestha/asyncomplete-ultisnips.vim
[SirVer/ultisnips]: https://github.com/SirVer/ultisnips
[honza/vim-snippets]: https://github.com/honza/vim-snippets
[mattn/emmet-vim]: https://github.com/mattn/emmet-vim
[ludovicchabant/vim-gutentags]: https://github.com/ludovicchabant/vim-gutentags
[Raimondi/delimitMate]: https://github.com/Raimondi/delimitMate
[Shougo/denite.nvim]: https://github.com/Shougo/denite.nvim
[Shougo/neomru.vim]: https://github.com/Shougo/neomru.vim
[Shougo/neoyank.vim]: https://github.com/Shougo/neoyank.vim
[Shougo/junkfile.vim]: https://github.com/Shougo/junkfile.vim
[chemzqm/unite-location]: https://github.com/chemzqm/unite-location
[rafi/vim-denite-session]: https://github.com/rafi/vim-denite-session
[rafi/vim-denite-z]: https://github.com/rafi/vim-denite-z
[liuchengxu/vim-clap]: https://github.com/liuchengxu/vim-clap
[kana/vim-operator-user]: https://github.com/kana/vim-operator-user
[kana/vim-operator-replace]: https://github.com/kana/vim-operator-replace
[machakann/vim-sandwich]: https://github.com/machakann/vim-sandwich
[kana/vim-textobj-user]: https://github.com/kana/vim-textobj-user
[terryma/vim-expand-region]: https://github.com/terryma/vim-expand-region
[AndrewRadev/sideways.vim]: https://github.com/AndrewRadev/sideways.vim
[AndrewRadev/splitjoin.vim]: https://github.com/AndrewRadev/splitjoin.vim
[AndrewRadev/linediff.vim]: https://github.com/AndrewRadev/linediff.vim
[AndrewRadev/dsf.vim]: https://github.com/AndrewRadev/dsf.vim
[kana/vim-textobj-function]: https://github.com/kana/vim-textobj-function
## Custom Key-mappings
Note that,
* **Leader** key set as ,
* **Local-Leader** key set as ; and used for navigation and search
(Denite and Defx)
* Disable ← ↑ → ↓ in normal mode by enabling `g:elite_mode` in `.vault.vim`
Key-mappings
(🔎 Click to expand/collapse)
Modes: 𝐍=normal 𝐕=visual 𝐒=select 𝐈=insert 𝐂=command
### Navigation
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| j / k | 𝐍 𝐕 | Cursor moves through display-lines | `g` `j/k`
| g+j / k | 𝐍 𝐕 𝐒 | Jump to edge upward/downward | [haya14busa/vim-edgemotion]
| gh / gl | 𝐍 𝐕 | Easier line-wise movement | `g` `^/$`
| Space+Space | 𝐍 𝐕 | Toggle visual-line mode | `V` / Escape
| v / V | 𝐕 | Expand/reduce selection | [terryma/vim-expand-region]
| zl / zh | 𝐍 | Scroll horizontally and vertically wider | `z4` `l/h`
| Ctrl+j | 𝐍 | Move to split below | [christoomey/tmux-navigator]
| Ctrl+k | 𝐍 | Move to upper split | [christoomey/tmux-navigator]
| Ctrl+h | 𝐍 | Move to left split | [christoomey/tmux-navigator]
| Ctrl+l | 𝐍 | Move to right split | [christoomey/tmux-navigator]
| Return | 𝐍 | Toggle fold | `za`
| Shift+Return | 𝐍 | Focus the current fold by closing all others | `zMzvzt`
| ]q or ]q | 𝐍 | Next/previous on quickfix list | `:cnext` / `:cprev`
| ]l or ]l | 𝐍 | Next/previous on location-list | `:lnext` / `:lprev`
| ]w or ]w | 𝐍 | Next/previous whitespace error | [plugin/whitespace.vim]
| ]g or ]g | 𝐍 | Next/previous Git hunk | [airblade/vim-gitgutter]
| ]d or ]d | 𝐍 | Next/previous LSP diagnostic | [mattn/vim-lsp-settings]
| Ctrl+f | 𝐂 | Move cursor forwards in command | Right
| Ctrl+b | 𝐂 | Move cursor backwards in command | Left
| Ctrl+h | 𝐂 | Move cursor to the beginning in command | Home
| Ctrl+l | 𝐂 | Move cursor to the end in command | End
### File Operations
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| Space+cd | 𝐍 | Switch to the directory of opened buffer | `:lcd %:p:h`
| gf | 𝐍 𝐕 | Open file under the cursor in a vsplit | `:rightbelow wincmd f`
| Space+w | 𝐍 𝐕 𝐒 | Write buffer to file | `:write`
| Ctrl+s | 𝐍 𝐕 𝐒 𝐂 | Write buffer to file | `:write`
### Edit
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| Ctrl+Return | 𝐈 | Expand emmet abbreviation | [mattn/emmet-vim]
| Q | 𝐍 | Start/stop macro recording | `q`
| gQ | 𝐍 | Play macro 'q' | `@q`
| Shift+Return | 𝐈 | Start new line from any cursor position | `o`
| < | 𝐕 𝐒 | Indent to left and re-select | `> | 𝐕 𝐒 | Indent to right and re-select | `>gv|`
| Tab | 𝐕 𝐒 | Indent to right and re-select | `>gv|`
| Shift+Tab | 𝐕 𝐒 | Indent to left and re-select | `gc | 𝐍 𝐕 𝐒 | Caw (comments plugin) prefix | [tyru/caw.vim]
| gcc | 𝐍 𝐕 𝐒 | Toggle comments | [tyru/caw.vim]
| Space+v | 𝐍 𝐕 𝐒 | Toggle single-line comments | [tyru/caw.vim]
| Space+V | 𝐍 𝐕 𝐒 | Toggle comment block | [tyru/caw.vim]
| Space+j or k | 𝐍 𝐕 | Move lines down/up | `:m` …
| Space+d | 𝐍 𝐕 | Duplicate line or selection |
| Space+cn / cN | 𝐍 𝐕 | Change current word in a repeatable manner |
| Space+cp | 𝐍 | Duplicate paragraph | `yapp`
| Space+cw | 𝐍 | Remove all spaces at EOL | `:%s/\s\+$//e`
| Ctrl+g g | 𝐈 | Jump outside of pair | [Raimondi/delimitMate]
| sj / sk | 𝐍 | Join/split arguments | [AndrewRadev/splitjoin.vim]
| dsf / csf | 𝐍 | Delete/change surrounding function call | [AndrewRadev/dsf.vim]
### Search & Replace
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| Space+f | 𝐍 | Filter lines in-place | [lambdalisue/fin.vim]
| \* / # | 𝐍 𝐕 | Search selection forward/backward | [haya14busa/vim-asterisk]
| g\* / g# | 𝐍 𝐕 | Search whole-word forward/backward | [haya14busa/vim-asterisk]
| Backspace | 𝐍 | Match bracket | `%`
| gp | 𝐍 | Select last paste |
| sg | 𝐕 | Replace within selected area | `:s/⌴/gc`
| Ctrl+r | 𝐕 | Replace selection with step-by-step confirmation | `:%s/\V/⌴/gc`
### Clipboard
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| p | 𝐕 𝐒 | Paste without yank | [kana/vim-operator-replace]
| Y | 𝐍 | Yank to the end of line | `y$`
| Space+y | 𝐍 | Copy relative file-path to clipboard |
| Space+Y | 𝐍 | Copy absolute file-path to clipboard |
### Command & History
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| ! | 𝐍 | Shortcut for shell command | `:!`
| g! | 𝐍 | Read vim command into buffer | `:put=execute('⌴')`
| Ctrl+n / p | 𝐂 | Switch history search pairs | ↓ / ↑
| ↓ / ↑ | 𝐂 | Switch history search pairs | `Ctrl` `n`/`p`
### Editor UI
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| Space+ts | 𝐍 | Toggle spell-checker | `:setlocal spell!`
| Space+tn | 𝐍 | Toggle line numbers | `:setlocal nonumber!`
| Space+tl | 𝐍 | Toggle hidden characters | `:setlocal nolist!`
| Space+th | 𝐍 | Toggle highlighted search | `:set hlsearch!`
| Space+tw | 𝐍 | Toggle wrap | `:setlocal wrap!` …
| Space+ti | 𝐍 | Toggle indentation lines | [nathanaelkane/vim-indent-guides]
| g1 | 𝐍 | Go to first tab | `:tabfirst`
| g9 | 𝐍 | Go to last tab | `:tablast`
| g5 | 𝐍 | Go to previous tab | `:tabprevious`
| Ctrl+Tab | 𝐍 | Go to next tab | `:tabnext`
| Ctrl+ShiftTab | 𝐍 | Go to previous tab | `:tabprevious`
| Alt+j | 𝐍 | Go to next tab | `:tabnext`
| Alt+k | 𝐍 | Go to previous tab | `:tabprevious`
| Alt+{ | 𝐍 | Move tab backward | `:-tabmove`
| Alt+} | 𝐍 | Move tab forward | `:+tabmove`
| Space+h | 𝐍 | Show highlight groups for word |
### Custom Tools & Plugins
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| - | 𝐍 | Choose a window to edit | [t9md/vim-choosewin]
| ;+c | 𝐍 | Open context-menu | [plugin/actionmenu.vim]
| gK | 𝐍 | Open Zeal or Dash on some file-types | [plugin/devhelp.vim]
| gCtrl+o | 𝐍 | Navigate to previous file on jumplist | [plugin/jumpfile.vim]
| gCtrl+i | 𝐍 | Navigate to next file on jumplist | [plugin/jumpfile.vim]
| Space+l | 𝐍 | Open side-menu helper | [rafi/vim-sidemenu]
| Space+b | 𝐍 | Open structure window | [liuchengxu/vista.vim]
| Space+a | 𝐍 | Show nearby tag in structure window | [liuchengxu/vista.vim]
| Space+se | 𝐍 | Save current workspace session | [plugin/sessions.vim]
| Space+sl | 𝐍 | Load workspace session | [plugin/sessions.vim]
| Space+n/N | 𝐍 | Open alternative file | [kana/vim-altr]
| Space+tc | 𝐍 | Enable scroll-context window | [wellle/context.vim]
| Space+tp | 𝐍 | Peek scroll-context window | [wellle/context.vim]
| Space+S | 𝐍 𝐕 | Source selection | `y:execute @@`
| Space+? | 𝐍 | Open the macOS dictionary on current word | `:!open dict://`
| Space+P | 𝐍 | Use Marked 2 for real-time Markdown preview | [Marked 2]
| Space+ml | 𝐍 | Append modeline to end of buffer | [config/mappings.vim]
| Space+mda | 𝐕 | Sequentially mark region for diff | [AndrewRadev/linediff.vim]
| Space+mdf | 𝐕 | Mark region for diff and compare if more than one | [AndrewRadev/linediff.vim]
| Space+mds | 𝐍 | Shows the comparison for all marked regions | [AndrewRadev/linediff.vim]
| Space+mdr | 𝐍 | Removes the signs denoting the diff regions | [AndrewRadev/linediff.vim]
| Space+mg | 𝐍 | Open Magit | [jreybert/vimagit]
| Space+mt | 𝐍 𝐕 | Toggle highlighted word | [t9md/vim-quickhl]
| Space+- | 𝐍 | Switch editing window with selected | [t9md/vim-choosewin]
| Space+G | 𝐍 | Toggle distraction-free writing | [junegunn/goyo]
| Space+gu | 𝐍 | Open undo-tree | [mbbill/undotree]
| Space+K | 𝐍 | Thesaurus | [Ron89/thesaurus_query.vim]
| Space+W | 𝐍 | VimWiki | [vimwiki/vimwiki]
### Window Management
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| q | 𝐍 | Quit window (and Vim, if last window) | `:quit`
| Ctrl+q | 𝐍 | Remap to C-w | Ctrl+w
| Ctrl+x | 𝐍 | Rotate window placement | `C-w` `x`
| sv | 𝐍 | Horizontal split | `:split`
| sg | 𝐍 | Vertical split | `:vsplit`
| st | 𝐍 | Open new tab | `:tabnew`
| so | 𝐍 | Close other windows | `:only`
| sb | 𝐍 | Previous buffer | `:b#`
| sc | 𝐍 | Close current buffer | `:close`
| sx | 𝐍 | Delete buffer, leave blank window | `:enew │ bdelete`
| sz | 𝐍 | Toggle window zoom | `:vertical resize │ resize`
| ssv | 𝐍 | Split with previous buffer | `:split │ wincmd p │ e#`
| ssg | 𝐍 | Vertical split with previous buffer | `:vsplit │ wincmd p │ e#`
| sh | 𝐍 | Toggle colorscheme background=dark/light | `:set background` …
| s- | 𝐍 | Lower solarized8 colorscheme contrast | `:colorscheme ` …
| s= | 𝐍 | Raise solarized8 colorscheme contrast | `:colorscheme ` …
### Git Version Control
| Key | Mode | Action | Plugin or Mapping
| ----- |:----:| ------------------ | ------
| gs | 𝐍 | Preview hunk | [airblade/vim-gitgutter]
| gS | 𝐍 𝐕 𝐒 | Stage hunk | [airblade/vim-gitgutter]
| Space+gr | 𝐍 | Revert hunk | [airblade/vim-gitgutter]
| Space+ga | 𝐍 | Git add current file | [lambdalisue/gina.vim]
| Space+gd | 𝐍 | Git diff | [lambdalisue/gina.vim]
| Space+gc | 𝐍 | Git branches | [lambdalisue/gina.vim]
| Space+gc | 𝐍 | Git commit | [lambdalisue/gina.vim]
| Space+gb | 𝐍 | Git blame | [lambdalisue/gina.vim]
| Space+gs | 𝐍 | Git status -s | [lambdalisue/gina.vim]
| Space+gl | 𝐍 | Git log --all | [lambdalisue/gina.vim]
| Space+gF | 𝐍 | Git fetch | [lambdalisue/gina.vim]
| Space+gp | 𝐍 | Git push | [lambdalisue/gina.vim]
| Space+go | 𝐍 𝐕 | Open SCM detailed URL in browser | [lambdalisue/gina.vim]
### Plugin: Denite
| Key | Mode | Action
| ----- |:----:| ------------------
| ;r | 𝐍 | Resumes last Denite window
| ;f | 𝐍 | File search
| ;g | 𝐍 | Grep search
| ;b | 𝐍 | Buffers
| ;i | 𝐍 | Old files
| ;x | 𝐍 | Most recently used files (MRU)
| ;d | 𝐍 | Directories and MRU
| ;v | 𝐍 𝐕 | Yank history
| ;l | 𝐍 | Location list
| ;q | 𝐍 | Quick fix
| ;m | 𝐍 | Marks
| ;n | 𝐍 | Dein plugin list
| ;j | 𝐍 | Jump points and change stack
| ;u | 𝐍 | Junk files
| ;o | 𝐍 | Outline tags
| ;s | 𝐍 | Sessions
| ;t | 𝐍 | Tag list
| ;p | 𝐍 | Jumps
| ;h | 𝐍 | Help
| ;w | 𝐍 | Memo list
| ;z | 𝐍 | Z (jump around)
| ;; | 𝐍 | Command history
| ;/ | 𝐍 | Buffer lines
| ;\* | 𝐍 | Search word under cursor with lines
| Space+gt | 𝐍 | Find tags matching word under cursor
| Space+gf | 𝐍 | Find files matching word under cursor
| Space+gg | 𝐍 𝐕 | Grep word under cursor
| **Within _Denite_ window** ||
| jj or Escape | 𝐈 | Leave Insert mode
| i or / | 𝐍 | Enter Insert mode (filter input)
| q or Escape | 𝐍 | Exit denite window
| Tab or Shift+Tab | 𝐈 | Next/previous candidate
| Space | 𝐍 | Select candidate entry
| dd | 𝐍 | Delete entry
| p | 𝐍 | Preview entry
| st | 𝐍 | Open in a new tab
| sg | 𝐍 | Open in a vertical split
| sv | 𝐍 | Open in a split
| ' | 𝐍 | Quick-move
| r | 𝐍 | Redraw
| yy | 𝐍 | Yank
| Tab | 𝐍 | List and choose action
### Plugin: Defx
| Key | Mode | Action
| ----- |:----:| ------------------
| ;e | 𝐍 | Open file-explorer (toggle)
| ;a | 𝐍 | Focus current file in file-explorer
| **Within _Defx_ window** ||
| j or k | 𝐍 | Move up and down the tree
| l or Return | 𝐍 | Toggle collapse/expand directory or open file
| h | 𝐍 | Collapse directory tree
| t | 𝐍 | Expand directory tree recursively
| . | 𝐍 | Toggle hidden files
| Space | 𝐍 | Select entry
| \* | 𝐍 | Invert selection (select all)
| & or \ | 𝐍 | Change into current working directory
| ~ | 𝐍 | Change to user home directory
| u or Backspace | 𝐍 | Change into parent directory
| u 2/3/4 | 𝐍 | Change into parent directory count
| st | 𝐍 | Open file in new tab
| sv | 𝐍 | Open file in a horizontal split
| sg | 𝐍 | Open file in a vertical split
| N | 𝐍 | Create new directories and/or files
| K | 𝐍 | Create new directory
| c / m / p | 𝐍 | Copy, move, and paste
| r | 𝐍 | Rename file or directory
| dd | 𝐍 | Trash selected files and directories
| y | 𝐍 | Yank path to clipboard
| w | 𝐍 | Toggle window size
| ]g | 𝐍 | Next dirty git item
| [g | 𝐍 | Previous dirty git item
| x or gx | 𝐍 | Execute associated system application
| gd | 𝐍 | Open git diff on selected file
| gl | 𝐍 | Open terminal file explorer with tmux
| gr | 𝐍 | Grep in current position
| gf | 𝐍 | Find files in current position
### Plugin: Clap
| Key | Mode | Action
| ----- |:----:| ------------------
| **Within _Clap_ window** ||
| jj or Escape | 𝐈 | Leave Insert mode
| i | 𝐍 | Enter Insert mode (filter input)
| q or Escape | 𝐍 | Exit clap window
| Tab or Shift+Tab | 𝐈 | Next/previous candidate
| Space or \' | 𝐍 | Select candidate entry
| st | 𝐍 | Open in a new tab
| sg | 𝐍 | Open in a vertical split
| sv | 𝐍 | Open in a split
### Plugin: Asyncomplete and Emmet
| Key | Mode | Action
| ----- |:----:| ------------------
| Tab / Shift-Tab | 𝐈 | Navigate completion-menu
| Enter | 𝐈 | Select completion or expand snippet
| Ctrl+j/k/d/u | 𝐈 | Movement in completion pop-up
| Ctrl+Return | 𝐈 | Expand Emmet sequence
| Ctrl+Space | 𝐈 | Refresh and show candidates
| Ctrl+y | 𝐈 | Close pop-up
| Ctrl+e | 𝐈 | Cancel selection and close pop-up
| Ctrl+l | 𝐈 | Expand snippet at cursor
| Tab / Shift-Tab | 𝐈 𝐒 | Navigate snippet placeholders
### Plugin: Any-Jump
| Key | Mode | Action
| ----- |:----:| ------------------
| Space+ii | 𝐍 | Jump to definition under cursor
| Space+ii | 𝐕 | Jump to selected text in visual mode
| Space+ib | 𝐍 | Open previous opened file (after jump)
| Space+il | 𝐍 | Open last closed search window again
### Plugin: Signature
| Key | Mode | Action
| ----- |:----:| ------------------
| m/ or m? | 𝐍 | Show list of buffer marks/markers
| mm | 𝐍 | Toggle mark on current line
| m, | 𝐍 | Place next mark
| m a-z | 𝐍 | Place specific mark (Won't work for: mm, mn, mp)
| dm a-z | 𝐍 | Remove specific mark (Won't work for: mm, mn, mp)
| mn | 𝐍 | Jump to next mark
| mp | 𝐍 | Jump to previous mark
| ]= | 𝐍 | Jump to next marker
| [= | 𝐍 | Jump to previous marker
| m- | 𝐍 | Purge all on current line
| m Space | 𝐍 | Purge marks
| m Backspace | 𝐍 | Purge markers
## Credits & Contribution
Big thanks to the dark knight [Shougo](https://github.com/Shougo).
[config/mappings.vim]: ./config/mappings.vim
[plugin/whitespace.vim]: ./plugin/whitespace.vim
[plugin/sessions.vim]: ./plugin/sessions.vim
[plugin/devhelp.vim]: ./plugin/devhelp.vim
[plugin/jumpfile.vim]: ./plugin/jumpfile.vim
[plugin/actionmenu.vim]: ./plugin/actionmenu.vim
[config/plugins/lsp.vim]: ./config/plugins/lsp.vim
[Marked 2]: https://marked2app.com
[Neovim]: https://github.com/neovim/neovim
[Vim]: https://github.com/vim/vim
[lazy-loaded]: ./config/plugins.yaml#L47
### 解决 mac tmux 下 neovim 无法复制到剪贴板的问题
```
# https://github.com/tmux/tmux/issues/543
brew install reattach-to-user-namespace
# then edit your .tmux.conf
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# In .vimrc or ~/.config/nvim/init.vim (I use Neovim):
set clipboard=unnamed
# reload tmux config
tmux source-file ~/.tmux.conf
```
### 解决 vim gutter 使用 emoji 文本渲染问题
See this [Vim text rendering off by one issue](https://www.reddit.com/r/vim/comments/6vkoii/vim_text_rendering_off_by_one_issue/)
如果你使用了 Iterm2 + neovim,并且在 gutter 栏使用了 emoji 表情,比如 vim-gitgutter, vim-ale 等插件的提示是 emoji。
请勾选 Iterm2->Profiles->Text->Use Unicode versoin 9 widths
See this issue https://stackoverflow.com/questions/43107435/emoji-display-issue-in-vim-with-tmux/52142277#52142277
### ag (The Silver Searcher) ignore file 搜索忽略文件
最好在你的根目录或者项目目录加上 ag 搜索需要忽略的文件,防止 denite 搜索占用太大内存,并且加速筛选内容
add `~/.agignore` file:
```
node_modules
.git
.ropeproject
gen-py/
gen-go/
eggs/
.tmp/
vendor/
*.swp
*.pyc
```
### fzf.vim :Ag 搜索结果发送到 quickfix 窗口
使用 fzf.vim 有个 :Ag 命令搜索的时候可以把结果发送到 quickfix 窗口。通常搜索结果可以使用 ctrl+n/p 来选择
使用方式:
- :Ag 搜索需要的单词。`:Ag word`
- alt-a 全选 (注意 MacOS iterm2: Settings -> Profiles -> Keys Left Option choose Esc+)
- alt-d 可以取消选择
- Enter 即可,这时候就可以把搜索结果发送到 quickfix 窗口
ref: https://github.com/junegunn/fzf.vim/issues/586
### [Coc.Nvim](https://github.com/neoclide/coc.nvim)
If you want to use [coc.nvim](https://github.com/neoclide/coc.nvim) for Golang completion,
please see this article [《vim as a go ide》](https://octetz.com/docs/2019/2019-04-24-vim-as-a-go-ide/).
Now you can use `coc` branch for go completion(use gopls). If you use python, type `CocInstall coc-python` install
python coc plugin.
(注意笔者基于开源配置代码修改,笔者的 leader 是 "," 而不是文档中的 Space)
================================================
FILE: after/ftplugin/go.vim
================================================
setlocal tabstop=4
" autocorrect wrong key word spell
iabbrev mian() main()
iabbrev fucn func
iabbrev Pirntln Println
iabbrev errror error
iabbrev itnerface interface
iabbrev cosnt const
iabbrev retunr return
iabbrev imoprt import
iabbrev contineu continue
iabbrev dfer defer
iabbrev defalut default
iabbrev caes case
iabbrev rnage range
================================================
FILE: after/ftplugin/help.vim
================================================
" Snippets from vim-help
" Credits: https://github.com/dahu/vim-help
let s:save_cpo = &cpoptions
set cpoptions&vim
function! s:setup_buffer()
let b:undo_ftplugin .= ' | setlocal spell< list< hidden< iskeyword<'
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap o'"
\ . " | execute 'nunmap O'"
\ . " | execute 'nunmap f'"
\ . " | execute 'nunmap F'"
\ . " | execute 'nunmap t'"
\ . " | execute 'nunmap T'"
\ . " | execute 'nunmap j'"
\ . " | execute 'nunmap k'"
\ . " | execute 'nunmap q'"
setlocal nospell
setlocal nolist
setlocal nohidden
setlocal iskeyword+=:
setlocal iskeyword+=#
setlocal iskeyword+=-
" unsilent echomsg 'help edit' &ft bufname() 'type:' &buftype
if s:count_windows() - 1 > 1
wincmd K
else
wincmd L
endif
" Exit help window with 'q'
nnoremap q :quit
" Jump to links with enter
nmap
" Jump back with backspace
nmap
" Skip to next option link
nmap o /'[a-z]\{2,\}'
" Skip to previous option link
nmap O ?'[a-z]\{2,\}'
" Skip to next subject link
nmap f /\|\S\+\|l
" Skip to previous subject link
nmap F h?\|\S\+\|l
" Skip to next tag (subject anchor)
nmap t /\*\S\+\*l
" Skip to previous tag (subject anchor)
nmap T h?\*\S\+\*l
" Skip to next/prev quickfix list entry (from a helpgrep)
nmap j :cnext
nmap k :cprev
endfunction
" Count tab page windows
function! s:count_windows()
let l:count = 0
let l:tabnr = tabpagenr()
let l:ignore = '^\(hover\|fern\|clap_\|defx\|denite\)'
try
let l:windows = gettabinfo(l:tabnr)[0].windows
for l:win in l:windows
if getwinvar(l:win, '&filetype') !~# l:ignore
let l:count += 1
endif
endfor
catch
" Fallback
let l:count = tabpagewinnr(l:tabnr, '$')
endtry
return l:count
endfunction
" Setup only when viewing help pages
if &buftype ==# 'help'
call s:setup_buffer()
endif
let &cpoptions = s:save_cpo
================================================
FILE: after/ftplugin/json.vim
================================================
setlocal foldmethod=syntax
================================================
FILE: after/ftplugin/man.vim
================================================
let s:save_cpo = &cpoptions
set cpoptions&vim
silent! nunmap q
nnoremap q :quit
nnoremap o :call man#show_toc()
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | '
else
let b:undo_ftplugin = ''
endif
let b:undo_ftplugin .= "execute 'nunmap o'"
let &cpoptions = s:save_cpo
================================================
FILE: after/ftplugin/markdown.vim
================================================
set conceallevel=0
================================================
FILE: after/ftplugin/qf.vim
================================================
" Extend romainl/vim-qf
" ---
" See Also: https://github.com/romainl/vim-qf
let s:save_cpo = &cpoptions
set cpoptions&vim
" Local window settings
setlocal cursorline colorcolumn=
if exists('&signcolumn')
setlocal signcolumn=yes
endif
if ! exists(':Lfilter')
try
packadd cfilter
endtry
endif
if ! exists('b:qf_isLoc')
" Are we in a location list or a quickfix list?
let b:qf_isLoc = ! empty(getloclist(0))
endif
" Is this redundant?
" let &l:statusline="%t%{exists('w:quickfix_title') ? ' '.w:quickfix_title : ''} %=%-15(%l,%L%V%) %P"
silent! nunmap
silent! nunmap p
silent! nunmap q
silent! nunmap s
nnoremap ":pclose!\\" .
\ (b:qf_isLoc == 1 ? ':lclose' : ':cclose') . "\"
nnoremap :pclose!:quit
nnoremap o :pclose!:noautocmd wincmd b
if get(g:, 'enable_universal_quit_mapping', 1)
nnoremap q :pclose!:quit
endif
nnoremap p :call preview_file()
nnoremap K :echo getline(line('.'))
nnoremap dd :Reject
nnoremap :Restore
nnoremap R :Restore
nnoremap O :ListLists
nnoremap :SaveList
nnoremap S :SaveList
nnoremap :LoadList
nnoremap sg :pclose!L=
nnoremap sv :pclose!=
nnoremap st :pclose!T
nmap (qf_newer)
nmap (qf_older)
nmap gj (qf_next_file)
nmap gk (qf_previous_file)
if exists(':Lfilter')
nnoremap i
\ (b:qf_isLoc == 1 ? ':L' : ':C') . "filter\//\"
nnoremap r
\ (b:qf_isLoc == 1 ? ':L' : ':C'). "filter!\//\"
else
nnoremap i :Keep
endif
" let s:ns = nvim_create_namespace('hlgrep')
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | '
else
let b:undo_ftplugin = ''
endif
let b:undo_ftplugin .=
\ 'setl cursorline< colorcolumn< signcolumn<'
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap q'"
\ . " | execute 'nunmap p'"
\ . " | execute 'nunmap K'"
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap R'"
\ . " | execute 'nunmap O'"
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap S'"
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap i'"
\ . " | execute 'nunmap o'"
\ . " | execute 'nunmap sg'"
\ . " | execute 'nunmap sv'"
\ . " | execute 'nunmap st'"
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap '"
\ . " | execute 'nunmap gj'"
\ . " | execute 'nunmap gk'"
function! s:get_entry()
" Find the file, line number and column of current entry
let l:raw = getline(line('.'))
let l:file = fnameescape(substitute(l:raw, '|.*$', '', ''))
let l:pos = substitute(l:raw, '^.\{-}|\(.\{-}|\).*$', '\1', '')
let l:line = 1
let l:column = 1
if l:pos =~# '^\d\+'
let l:line = substitute(l:pos, '^\(\d\+\).*$', '\1', '')
if l:pos =~# ' col \d\+|'
let l:column = substitute(l:pos, '^\d\+ col \(\d\+\).*$', '\1', '')
endif
endif
return [ l:file, l:line, l:column ]
endfunction
function! s:preview_file()
let [ l:file, l:line, l:column ] = s:get_entry()
call preview#open(l:file, l:line, l:column)
endfunction
let &cpoptions = s:save_cpo
================================================
FILE: after/ftplugin/vim.vim
================================================
let s:save_cpo = &cpoptions
set cpoptions&vim
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | '
else
let b:undo_ftplugin = ''
endif
let b:undo_ftplugin .= 'setl modeline< iskeyword< keywordprg< suffixesadd< includeexpr< path<'
setlocal iskeyword+=:
setlocal iskeyword+=#
setlocal keywordprg=:help
" setlocal foldmethod=indent
" setlocal conceallevel=0
" For gf
let &l:path = join(map(split(&runtimepath, ','), 'v:val."/autoload"'), ',')
setlocal suffixesadd=.vim
setlocal includeexpr=fnamemodify(substitute(v:fname,'#','/','g'),':h')
let &cpoptions = s:save_cpo
================================================
FILE: autoload/actionmenu.vim
================================================
" actionmenu
" ---
" Context-aware menu at your cursor
" Forked from: https://github.com/kizza/actionmenu.nvim
" Menu items
let g:actionmenu#items = []
" Current menu selection
let g:actionmenu#selected = 0
" Private variables
let s:buffer = 0
let s:window = 0
function! actionmenu#open(items, callback, ...) abort
" Open the context-menu with a:items and a:callback for selected item action.
if empty(a:items)
return
endif
" Close the old window if opened
call actionmenu#close()
" Create the buffer
if ! s:buffer
let s:buffer = nvim_create_buf(0, 1)
call nvim_buf_set_option(s:buffer, 'syntax', 'OFF')
endif
call nvim_buf_set_option(s:buffer, 'modifiable', v:true)
call nvim_buf_set_option(s:buffer, 'completefunc', 'actionmenu#complete')
" call nvim_buf_set_lines(s:buffer, 0, -1, v:true, [ '' ])
" Persist menu items and callback function
let g:actionmenu#items = a:items
let s:callback = a:callback
" Process user hooks
doautocmd User action_menu_open_pre
" Open the window
let l:opts = {
\ 'relative': 'cursor',
\ 'focusable': v:false,
\ 'width': 1,
\ 'height': 1,
\ 'row': 0,
\ 'col': 0,
\ 'style': 'minimal',
\}
let s:window = nvim_open_win(s:buffer, 1, l:opts)
call nvim_win_set_option(s:window, 'foldenable', v:false)
call nvim_win_set_option(s:window, 'wrap', v:false)
call nvim_win_set_option(s:window, 'statusline', '')
call nvim_win_set_option(s:window, 'sidescrolloff', 0)
call nvim_win_set_option(s:window, 'listchars', '')
if exists('&winblend')
call nvim_win_set_option(s:window, 'winblend', 100)
endif
" Setup the window
call nvim_buf_set_option(s:buffer, 'filetype', 'actionmenu')
" Menu mappings and events
call s:attach_events()
" startinsert TODO: nvim cursor relative is off
call nvim_input("i\\")
endfunction
function! s:attach_events() abort
mapclear
imapclear
inoremap select_item()
" imap
" imap
" Navigate in menu
inoremap
inoremap
inoremap k
inoremap j
inoremap h
inoremap l
inoremap
inoremap
inoremap
inoremap
inoremap
" Scroll pages in menu
inoremap
inoremap
imap
imap