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 ![Vim screenshot](http://rafi.io/static/img/project/vim-config/features.png) ## 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 " Events augroup actionmenu autocmd! autocmd InsertLeave call on_insert_leave() augroup END endfunction function! s:select_item() abort if pumvisible() if ! empty(v:completed_item) let g:actionmenu#selected = copy(v:completed_item) endif " Close pum and leave insert return "\\" endif " Leave insert mode return "\" endfunction function! s:on_insert_leave() abort call actionmenu#close() let l:index = -1 if type(g:actionmenu#selected) == type({}) let l:index = get(g:actionmenu#selected, 'user_data', -1) endif let l:data = l:index > -1 ? g:actionmenu#items[l:index] : {} let g:actionmenu#items = [] let g:actionmenu#selected = 0 call actionmenu#callback(l:index, l:data) unlet! s:callback doautocmd User action_menu_open_post endfunction " Pum completion function function! actionmenu#complete(findstart, base) abort if a:findstart return 1 else return map(copy(g:actionmenu#items), { \ index, item -> s:pum_parse_item(item, index) }) endif endfunction function! s:pum_parse_item(item, index) abort if type(a:item) == type('') return { 'word': a:item, 'user_data': a:index } else return { 'word': a:item['word'], 'user_data': a:index } endif endfunction function! actionmenu#callback(index, item) abort " doautocmd BufWinEnter if empty(s:callback) return endif if a:index >= 0 && ! empty(a:item) && type(a:item) != type('') call s:callback(a:item) endif endfunction function! actionmenu#close() abort if s:window call nvim_win_close(s:window, v:false) let s:window = 0 let s:buffer = 0 endif endfunction " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: autoload/badge.vim ================================================ " vim-badge - Bite-size badges for tab & status lines " Maintainer: Rafael Bodill "------------------------------------------------- " Configuration " Maximum number of directories in filepath let g:badge_status_filename_max_dirs = \ get(g:, 'badge_status_filename_max_dirs', 3) " Maximum number of characters in each directory let g:badge_status_dir_max_chars = \ get(g:, 'badge_status_dir_max_chars', 5) " Less verbosity on specific filetypes (regexp) let g:badge_filetype_blacklist = \ get(g:, 'badge_filetype_blacklist', \ 'vimfiler\|gundo\|diff\|fugitive\|gitv') let g:badge_loading_charset = \ get(g:, 'badge_loading_charset', \ ['⠃', '⠁', '⠉', '⠈', '⠐', '⠠', '⢠', '⣠', '⠄', '⠂']) let g:badge_nofile = get(g:, 'badge_nofile', 'N/A') let g:badge_project_separator = get(g:, 'badge_project_separator', '') " Private variables let s:caches = [] " Clear cache on save augroup statusline_cache autocmd! autocmd BufWritePre,FileChangedShellPost,TextChanged,InsertLeave * \ unlet! b:badge_cache_trails autocmd BufReadPost,BufFilePost,BufNewFile,BufWritePost * \ for cache_name in s:caches | execute 'unlet! b:' . cache_name | endfor augroup END function! badge#project() abort " Try to guess the project's name let dir = badge#root() return fnamemodify(dir ? dir : getcwd(), ':t') endfunction function! badge#gitstatus(...) abort " Display git status indicators let l:icons = ['₊', '∗', '₋'] " added, modified, removed let l:out = '' " if &filetype ==# 'magit' " let l:map = {} " for l:file in magit#git#get_status() " let l:map[l:file['unstaged']] = get(l:map, l:file['unstaged'], 0) + 1 " endfor " for l:status in l:map " let l:out = values(l:map) " endfor " else if exists('*gitgutter#hunk#summary') let l:summary = gitgutter#hunk#summary(bufnr('%')) for l:idx in range(0, len(l:summary) - 1) if l:summary[l:idx] > 0 let l:out .= ' ' . l:icons[l:idx] . l:summary[l:idx] endif endfor endif " endif return trim(l:out) endfunction function! badge#filename(...) abort " Provides relative path with limited characters in each directory name, and " limits number of total directories. Caches the result for current buffer. " Parameters: " 1: Buffer number, ignored if tab number supplied " 2: Maximum characters displayed in base filename " 3: Maximum characters displayed in each directory " 4: Cache key " Compute buffer id let l:bufnr = '%' if a:0 > 0 let l:bufnr = a:1 endif " Use buffer's cached filepath let l:cache_var_name = a:0 > 3 ? a:4 : 'filename' let l:cache_var_name = 'badge_cache_' . l:cache_var_name let l:fn = getbufvar(l:bufnr, l:cache_var_name, '') if len(l:fn) > 0 return l:fn endif let l:bufname = bufname(l:bufnr) let l:filetype = getbufvar(l:bufnr, '&filetype') if l:filetype =~? g:badge_filetype_blacklist " Empty if owned by certain plugins let l:fn = '' elseif l:filetype ==# 'denite.*\|quickpick-filter' let l:fn = '⌖ ' elseif l:filetype ==# 'qf' let l:fn = '⌗ list' elseif l:filetype ==# 'TelescopePrompt' let l:fn = '⌖ ' elseif l:filetype ==# 'defx' let l:fn = ' ' elseif l:filetype ==# 'magit' let l:fn = magit#git#top_dir() elseif l:filetype ==# 'vimfiler' let l:fn = vimfiler#get_status_string() elseif empty(l:bufname) " Placeholder for empty buffer let l:fn = g:badge_nofile " elseif ! &buflisted " let l:fn = '' else " Shorten dir names let l:max = a:0 > 2 ? a:3 : g:badge_status_dir_max_chars let short = substitute(l:bufname, \ "[^/]\\{" . l:max . "}\\zs[^/]\*\\ze/", '', 'g') " Decrease dir count let l:max = a:0 > 1 ? a:2 : g:badge_status_filename_max_dirs let parts = split(short, '/') if len(parts) > l:max let parts = parts[-l:max-1 : ] endif " Set icon let l:icon = '' if exists('*nerdfont#find') let l:icon = nerdfont#find(l:bufname) elseif exists('*defx_icons#get') let l:icon = get(defx_icons#get().icons.extensions, expand('%:e'), {}) let l:icon = get(l:icon, 'icon', '') endif if ! empty(l:icon) let l:fn .= l:icon . ' ' endif let l:fn .= join(parts, '/') endif " Append fugitive blob type let l:fugitive = getbufvar(l:bufnr, 'fugitive_type') if l:fugitive ==# 'blob' let l:fn .= ' (blob)' endif " Cache and return the final result call setbufvar(l:bufnr, l:cache_var_name, l:fn) if index(s:caches, l:cache_var_name) == -1 call add(s:caches, l:cache_var_name) endif return l:fn endfunction function! badge#root() abort " Find the root directory by searching for the version-control dir let dir = getbufvar('%', 'project_dir') let curr_dir = getcwd() if empty(dir) || getbufvar('%', 'project_dir_last_cwd') != curr_dir let patterns = ['.git', '.git/', '_darcs/', '.hg/', '.bzr/', '.svn/'] for pattern in patterns let is_dir = stridx(pattern, '/') != -1 let match = is_dir ? finddir(pattern, curr_dir . ';') \ : findfile(pattern, curr_dir . ';') if ! empty(match) let dir = fnamemodify(match, is_dir ? ':p:h:h' : ':p:h') call setbufvar('%', 'project_dir', dir) call setbufvar('%', 'project_dir_last_cwd', curr_dir) break endif endfor endif return dir endfunction function! badge#branch() abort " Returns git branch name, using different plugins. if &filetype !~? g:badge_filetype_blacklist if exists('*gitbranch#name') return gitbranch#name() elseif exists('*vcs#info') return vcs#info('%b') elseif exists('fugitive#head') return fugitive#head(8) endif endif return '' endfunction function! badge#syntax() abort " Returns syntax warnings from several plugins " Supports vim-lsp, ALE, Neomake, and Syntastic if &filetype =~? g:badge_filetype_blacklist return '' endif let l:msg = '' let l:errors = 0 let l:warnings = 0 let l:hints = 0 let l:information = 0 if exists('*lsp#get_buffer_diagnostics_counts') \ && get(g:, 'lsp_diagnostics_enabled', 1) let l:counts = lsp#get_buffer_diagnostics_counts() let l:errors = get(l:counts, 'error', '') let l:warnings = get(l:counts, 'warning', '') let l:hints = get(l:counts, 'hint', '') let l:information = get(l:counts, 'information', '') elseif exists('*neomake#Make') let l:counts = neomake#statusline#get_counts(bufnr('%')) let l:errors = get(l:counts, 'E', '') let l:warnings = get(l:counts, 'W', '') elseif exists('g:loaded_ale') let l:counts = ale#statusline#Count(bufnr('%')) let l:errors = l:counts.error + l:counts.style_error let l:warnings = l:counts.total - l:errors elseif exists('*SyntasticStatuslineFlag') let l:msg = SyntasticStatuslineFlag() endif if l:errors > 0 let l:msg .= printf(' %d ', l:errors) endif if l:warnings > 0 let l:msg .= printf(' %d ', l:warnings) endif if l:hints > 0 let l:msg .= printf(' %d ', l:hints) endif if l:information > 0 let l:msg .= printf(' %d ', l:information) endif return substitute(l:msg, '\s*$', '', '') endfunction function! badge#trails(...) abort " Detect trailing whitespace and cache result per buffer " Parameters: " Whitespace warning message, use %s for line number, default: WS:%s if ! exists('b:badge_cache_trails') let b:badge_cache_trails = '' if ! &readonly && &modifiable && line('$') < 9000 let trailing = search('\s$', 'nw') if trailing != 0 let label = a:0 == 1 ? a:1 : 'WS:%s' let b:badge_cache_trails .= printf(label, trailing) endif endif endif return b:badge_cache_trails endfunction function! badge#modified(...) abort " Make sure we ignore &modified when choosewin is active " Parameters: " Modified symbol, default: + let label = a:0 == 1 ? a:1 : '+' let choosewin = exists('g:choosewin_active') && g:choosewin_active return &modified && ! choosewin ? label : '' endfunction function! badge#mode(...) abort " Returns file's mode: read-only and/or zoomed " Parameters: " Read-only symbol, default: R " Zoomed buffer symbol, default: Z let s:modes = '' if &filetype !~? g:badge_filetype_blacklist && &readonly let s:modes .= a:0 > 0 ? a:1 : 'R' endif if exists('t:zoomed') && bufnr('%') == t:zoomed.nr let s:modes .= a:0 > 1 ? a:2 : 'Z' endif return s:modes endfunction function! badge#format() abort " Returns file format return &filetype =~? g:badge_filetype_blacklist ? '' : &fileformat endfunction function! badge#session(...) abort " Returns an indicator for active session " Parameters: " Active session symbol, default: [S] return empty(v:this_session) ? '' : a:0 == 1 ? a:1 : '[S]' endfunction function! badge#indexing() abort let l:out = '' if exists('*lsp#get_progress') let s:lsp_progress = lsp#get_progress() if len(s:lsp_progress) > 0 && has_key(s:lsp_progress[0], 'message') " Show only last progress message let s:lsp_progress = s:lsp_progress[0] let l:percent = get(s:lsp_progress, 'percentage') if s:lsp_progress['message'] != '' && l:percent != 100 let l:out .= s:lsp_progress['server'] . ':' \ . s:lsp_progress['title'] . ' ' \ . s:lsp_progress['message'] \ . l:percent if l:percent >= 0 let l:out .= ' ' . string(l:percent) . '%' endif endif endif endif if exists('*gutentags#statusline') let l:tags = gutentags#statusline('[', ']') if ! empty(l:tags) if exists('*reltime') let s:wait = split(reltimestr(reltime()), '\.')[1] / 100000 else let s:wait = get(s:, 'wait', 9) == 9 ? 0 : s:wait + 1 endif let l:out .= get(g:badge_loading_charset, s:wait, '') . ' ' . l:tags endif endif if exists('*coc#status') let l:out .= coc#status() endif if exists('g:SessionLoad') && g:SessionLoad == 1 let l:out .= '[s]' endif return l:out endfunction function! s:numtr(number, charset) abort let l:result = '' for l:char in split(a:number, '\zs') let l:result .= a:charset[l:char] endfor return l:result endfunction " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: autoload/preview.vim ================================================ " Improved preview for lists " --- function! preview#open(file, line, column) abort " Create or close preview window silent! wincmd P if &previewwindow && expand('%') == a:file let cur_pos = getcurpos() " If the exact same file and numbers are used, close preview window if a:line == cur_pos[1] && (a:column == 0 || a:column == cur_pos[2]) pclose! silent! wincmd p return endif else " Create read-only preview silent doautocmd User preview_open_pre execute 'silent! vertical pedit! +set\ nofoldenable ' . a:file noautocmd wincmd P let b:asyncomplete_enable = 0 let b:sleuth_automatic = 0 let b:cursorword = 0 " local buffer settings setlocal bufhidden=delete " setlocal nomodifiable nobuflisted buftype=nofile " local window settings setlocal statusline= number conceallevel=0 nospell if exists('&signcolumn') setlocal signcolumn=no endif setlocal cursorline cursorcolumn colorcolumn= noautocmd execute 'vertical resize ' . (&columns / 2) silent doautocmd User preview_open_post endif if a:line > 1 || a:column > 1 call cursor(a:line, a:column) " Align match be centered normal! zz if a:column > &sidescrolloff * 2 normal! zs normal! zH endif endif " Move back to previous window, maintaining cursorline silent noautocmd wincmd p endfunction " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: coc-settings.json ================================================ { "languageserver": { "golang": { "command": "gopls", "rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"], "filetypes": ["go"], "initializationOptions": { "usePlaceholders": true } }, "ccls": { "command": "ccls", "args": ["--log-file=/tmp/ccls.log"], "filetypes": ["c", "cpp", "cuda", "objc", "objcpp"], "rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"], "initializationOptions": { "cache": { "directory": ".ccls-cache" }, "clang": { "resourceDir": "$CODE_COMPLETE_CLANG_LIB_PATH" }, "index": { "trackDependency": 1 , "initialBlacklist": ["."] } } } }, "python.pythonPath": "/usr/local/bin/python3", "suggest.noselect": false, "colors.enable": true, "highlight.disableLanguages": ["go"], "inlayHint.enable": false } ================================================ FILE: config/filetype.vim ================================================ " File Types " --- augroup user_plugin_filetype " {{{ autocmd! " Reload vim configuration automatically on-save autocmd BufWritePost $VIM_PATH/{*.vim,*.yaml,vimrc} nested \ source $MYVIMRC | redraw " Highlight current line only on focused window, unless: " 1. Cursor-line is already set to wanted value " 2. Denite or Clap buffers " 3. Preview window " 4. Completion popup menu is visible autocmd WinEnter,BufEnter,InsertLeave * \ if ! &cursorline && &filetype !~# '^\(denite\|clap_\|.*quickpick\)' \ && ! &previewwindow && ! pumvisible() \ | setlocal cursorline \ | endif autocmd WinLeave,BufLeave,InsertEnter * \ if &cursorline && &filetype !~# '^\(denite\|clap_\|.*quickpick\)' \ && ! &previewwindow && ! pumvisible() \ | setlocal nocursorline \ | endif " Automatically set read-only for files being edited elsewhere autocmd SwapExists * nested let v:swapchoice = 'o' " Update diff comparison once leaving insert mode autocmd InsertLeave * if &l:diff | diffupdate | endif " Equalize window dimensions when resizing vim window autocmd VimResized * wincmd = " Force write shada on leaving nvim autocmd VimLeave * if has('nvim') | wshada! | else | wviminfo! | endif " Check if file changed when its window is focus, more eager than 'autoread' autocmd FocusGained * checktime autocmd Syntax * if line('$') > 5000 | syntax sync minlines=200 | endif " Neovim terminal settings if has('nvim-0.5') autocmd TermOpen * setlocal modifiable try autocmd TextYankPost * \ silent! lua vim.highlight.on_yank {higroup="IncSearch", timeout=150} endtry endif " Update filetype on save if empty autocmd BufWritePost * nested \ if &l:filetype ==# '' || exists('b:ftdetect') \ | unlet! b:ftdetect \ | filetype detect \ | endif " Reload Vim script automatically if setlocal autoread autocmd BufWritePost,FileWritePost *.vim nested \ if &l:autoread > 0 | source | \ echo 'source ' . bufname('%') | \ endif " When editing a file, always jump to the last known cursor position. " Credits: https://github.com/farmergreg/vim-lastplace autocmd BufReadPost * \ if index(['gitcommit', 'gitrebase', 'svn', 'hgcommit'], &buftype) == -1 && \ index(['quickfix', 'nofile', 'help'], &buftype) == -1 && \ ! &diff && ! &previewwindow && \ line("'\"") > 0 && line("'\"") <= line("$") \| if line("w$") == line("$") \| execute "normal! g`\"" \| elseif line("$") - line("'\"") > ((line("w$") - line("w0")) / 2) - 1 \| execute "normal! g`\"zz" \| else \| execute "normal! \G'\"\" \| endif \| if foldclosed('.') != -1 \| execute 'normal! zvzz' \| endif \| endif autocmd FileType apache setlocal path+=./;/ autocmd FileType html setlocal path+=./;/ autocmd FileType crontab setlocal nobackup nowritebackup autocmd FileType yaml.docker-compose setlocal expandtab autocmd FileType gitcommit setlocal spell autocmd FileType gitcommit,qfreplace setlocal nofoldenable autocmd FileType php setlocal matchpairs-=<:> iskeyword+=\\ autocmd FileType python \ setlocal expandtab smarttab nosmartindent \ | setlocal tabstop=4 softtabstop=4 shiftwidth=4 textwidth=120 autocmd FileType markdown \ setlocal expandtab nospell conceallevel=0 \ | setlocal autoindent formatoptions=tcroqn2 comments=n:> " https://webpack.github.io/docs/webpack-dev-server.html#working-with-editors-ides-supporting-safe-write autocmd FileType css,javascript,javascriptreact setlocal backupcopy=yes augroup END " }}} " Internal Plugin Settings {{{ " ------------------------ " PHP {{{ let g:PHP_removeCRwhenUnix = 0 " }}} " Python {{{ let g:python_recommended_style = 0 let g:pydoc_executable = 0 let g:python_highlight_all = 1 " let g:python_highlight_builtins = 1 " let g:python_highlight_exceptions = 1 " let g:python_highlight_string_format = 1 " let g:python_highlight_doctests = 1 " let g:python_highlight_class_vars = 1 " let g:python_highlight_operators = 1 " }}} " Vim {{{ let g:vimsyntax_noerror = 1 let g:vim_indent_cont = &shiftwidth " }}} " Bash {{{ let g:is_bash = 1 let g:sh_no_error = 1 " }}} " Java {{{ let g:java_highlight_functions = 'style' let g:java_highlight_all = 1 let g:java_highlight_debug = 1 let g:java_allow_cpp_keywords = 1 let g:java_space_errors = 1 let g:java_highlight_functions = 1 " }}} " JavaScript {{{ let g:SimpleJsIndenter_BriefMode = 1 let g:SimpleJsIndenter_CaseIndentLevel = -1 " }}} " Ruby {{{ let g:ruby_no_expensive = 1 " }}} " Folding {{{ " augroup: a " function: f let g:vimsyn_folding = 'af' let g:tex_fold_enabled = 1 let g:xml_syntax_folding = 1 let g:php_folding = 2 let g:php_phpdoc_folding = 1 let g:perl_fold = 1 " }}} " }}} " vim: set foldmethod=marker ts=2 sw=2 tw=80 noet : ================================================ FILE: config/general.vim ================================================ " Neo/vim Settings " === " General {{{ set mouse=nv " Disable mouse in command-line mode set modeline " automatically setting options from modelines set report=2 " Report on line changes set errorbells " Trigger bell on error set visualbell " Use visual bell instead of beeping set hidden " hide buffers when abandoned instead of unload set fileformats=unix,dos,mac " Use Unix as the standard file type set magic " For regular expressions turn magic on set path+=** " Directories to search when using gf and friends set isfname-== " Remove =, detects filename in var=/foo/bar set virtualedit=block " Position cursor anywhere in visual block set synmaxcol=2500 " Don't syntax highlight long lines set formatoptions+=1 " Don't break lines after a one-letter word set formatoptions-=t " Don't auto-wrap text set formatoptions-=o " Disable comment-continuation (normal 'o'/'O') if has('patch-7.3.541') set formatoptions+=j " Remove comment leader when joining lines endif if has('vim_starting') set encoding=utf-8 scriptencoding utf-8 endif " What to save for views and sessions: set viewoptions=folds,cursor,curdir,slash,unix set sessionoptions=curdir,help,tabpages,winsize if has('mac') && has('vim_starting') let g:clipboard = { \ 'name': 'macOS-clipboard', \ 'copy': { \ '+': 'pbcopy', \ '*': 'pbcopy', \ }, \ 'paste': { \ '+': 'pbpaste', \ '*': 'pbpaste', \ }, \ 'cache_enabled': 0, \ } endif if has('clipboard') && has('vim_starting') " set clipboard& clipboard+=unnamedplus set clipboard& clipboard^=unnamed,unnamedplus endif " }}} " Wildmenu {{{ " -------- if has('wildmenu') if ! has('nvim') set nowildmenu set wildmode=list:longest,full endif set wildignorecase set wildignore+=.git,.hg,.svn,.stversions,*.pyc,*.spl,*.o,*.out,*~,%* set wildignore+=*.jpg,*.jpeg,*.png,*.gif,*.zip,**/tmp/**,*.DS_Store set wildignore+=**/node_modules/**,**/bower_modules/**,*/.sass-cache/* set wildignore+=__pycache__,*.egg-info,.pytest_cache,.mypy_cache/** endif " }}} " Vim Directories {{{ " --------------- set undofile swapfile nobackup set directory=$DATA_PATH/swap//,$DATA_PATH,~/tmp,/var/tmp,/tmp set undodir=$DATA_PATH/undo//,$DATA_PATH,~/tmp,/var/tmp,/tmp set backupdir=$DATA_PATH/backup/,$DATA_PATH,~/tmp,/var/tmp,/tmp set viewdir=$DATA_PATH/view/ set spellfile=$VIM_PATH/spell/en.utf-8.add " History saving set history=2000 if has('nvim') && ! has('win32') && ! has('win64') set shada=!,'100,<20,@100,s10,h,r/tmp,r/private/var else set viminfo='100,<20,@50,h,n$DATA_PATH/viminfo endif augroup user_persistent_undo autocmd! au BufWritePre /tmp/* setlocal noundofile au BufWritePre COMMIT_EDITMSG setlocal noundofile au BufWritePre MERGE_MSG setlocal noundofile au BufWritePre *.tmp setlocal noundofile au BufWritePre *.bak setlocal noundofile augroup END " If sudo, disable vim swap/backup/undo/shada/viminfo writing if $SUDO_USER !=# '' && $USER !=# $SUDO_USER \ && $HOME !=# expand('~'.$USER, 1) \ && $HOME ==# expand('~'.$SUDO_USER, 1) set noswapfile set nobackup set nowritebackup set noundofile if has('nvim') set shada="NONE" else set viminfo="NONE" endif endif " Secure sensitive information, disable backup files in temp directories if exists('&backupskip') set backupskip+=/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*,/private/var/* set backupskip+=.vault.vim endif " Disable swap/undo/viminfo files in temp directories or shm augroup user_secure autocmd! silent! autocmd BufNewFile,BufReadPre \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*,/private/var/*,.vault.vim \ setlocal noswapfile noundofile \ | set nobackup nowritebackup \ | if has('nvim') | set shada= | else | set viminfo= | endif augroup END " }}} " Tabs and Indents {{{ " ---------------- set textwidth=120 " Text width maximum chars before wrapping set noexpandtab " Don't expand tabs to spaces set tabstop=4 " The number of spaces a tab is set shiftwidth=4 " Number of spaces to use in auto(indent) set softtabstop=-1 " Automatically keeps in sync with shiftwidth set smarttab " Tab insert blanks according to 'shiftwidth' set autoindent " Use same indenting on new lines " set smartindent " Smart autoindenting on new lines set shiftround " Round indent to multiple of 'shiftwidth' if exists('&breakindent') set breakindentopt=shift:2,min:20 endif " }}} " Timing {{{ " ------ set timeout ttimeout set timeoutlen=500 " Time out on mappings set ttimeoutlen=10 " Time out on key codes set updatetime=400 " Idle time to write swap and trigger CursorHold set redrawtime=2000 " Time in milliseconds for stopping display redraw " }}} " Searching {{{ " --------- set ignorecase " Search ignoring case set smartcase " Keep case when searching with * set infercase " Adjust case in insert completion mode set incsearch " Incremental search set wrapscan " Searches wrap around the end of the file set complete=.,w,b,k " C-n completion: Scan buffers, windows and dictionary if exists('+inccommand') set inccommand=nosplit endif if executable('rg') set grepformat=%f:%l:%c:%m let &grepprg = \ 'rg --vimgrep --no-heading' . (&smartcase ? ' --smart-case' : '') . ' --' elseif executable('ag') set grepformat=%f:%l:%c:%m let &grepprg = \ 'ag --vimgrep' . (&smartcase ? ' --smart-case' : '') . ' --' endif " }}} " Behavior {{{ " -------- set nowrap " No wrap by default set linebreak " Break long lines at 'breakat' set breakat=\ \ ;:,!? " Long lines break chars set nostartofline " Cursor in same column for few commands set whichwrap+=h,l,<,>,[,],~ " Move to following line on certain keys set splitbelow splitright " Splits open bottom right " set switchbuf=useopen " Look for matching window buffers first set backspace=indent,eol,start " Intuitive backspacing in insert mode set diffopt=filler,iwhite " Diff mode: show fillers, ignore whitespace set completeopt=menuone " Always show menu, even for one item if has('patch-7.4.775') " Do not select a match in the menu. " Do not insert any text for a match until the user selects from menu. set completeopt+=noselect,noinsert endif if has('patch-8.1.0360') || has('nvim-0.5') set diffopt=internal,algorithm:patience " set diffopt=indent-heuristic,algorithm:patience endif " Use the new Neovim :h jumplist-stack if has('nvim-0.5') set jumpoptions=stack endif " }}} " Editor UI {{{ " -------------------- set noshowmode " Don't show mode in cmd window set shortmess=aoOTI " Shorten messages and don't show intro set scrolloff=2 " Keep at least 2 lines above/below set sidescrolloff=5 " Keep at least 5 lines left/right set number " Don't show line numbers set noruler " Disable default status ruler set list " Show hidden characters set showtabline=2 " Always show the tabs line set winwidth=30 " Minimum width for active window set winminwidth=10 " Minimum width for inactive windows " set winheight=4 " Minimum height for active window " set winminheight=4 " Minimum height for inactive window set pumheight=15 " Pop-up menu's line height set helpheight=12 " Minimum help window height set previewheight=12 " Completion preview height set showcmd " Show command in status line set cmdheight=2 " Height of the command line set cmdwinheight=5 " Command-line lines " set noequalalways " Don't resize windows on split or close set laststatus=2 " Always show a status line set colorcolumn=+0 " Column highlight at textwidth's max character-limit set display=lastline if has('folding') && has('vim_starting') set foldenable set foldmethod=indent set foldlevelstart=99 endif if has('nvim-0.4') set signcolumn=auto:1 elseif exists('&signcolumn') set signcolumn=auto endif " UI Symbols " icons: ▏│ ¦ ╎ ┆ ⋮ ⦙ ┊  let &showbreak='↳ ' set listchars=tab:\▏\ ,extends:⟫,precedes:⟪,nbsp:␣,trail:· " set fillchars=foldopen:O,foldclose:x " set fillchars=vert:▉,fold:─ if has('patch-7.4.314') " Do not display completion messages set shortmess+=c endif if has('patch-7.4.1570') " Do not display message when editing files set shortmess+=F endif " if exists('+previewpopup') " set previewpopup=height:10,width:60 " endif " Pseudo-transparency for completion menu and floating windows if has('termguicolors') && &termguicolors if exists('&pumblend') set pumblend=10 endif if exists('&winblend') set winblend=10 endif endif " solve wrong encoding if has("multi_byte") set encoding=utf-8 " set termencoding=utf-8 set formatoptions+=mM set fencs=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1 endif " }}} " vim: set foldmethod=marker ts=2 sw=2 tw=80 noet : ================================================ FILE: config/init.vim ================================================ " Configuration and plugin-manager manager :) " --- " Maintainer: Rafael Bodill " See: github.com/rafi/vim-config " " Plugin-manager agnostic initialization and user configuration parsing " Set custom augroup augroup user_events autocmd! augroup END " Initializes options let s:package_manager = get(g:, 'etc_package_manager', 'dein') if empty(s:package_manager) || s:package_manager ==# 'none' finish endif " Enables 24-bit RGB color in the terminal if has('termguicolors') if empty($COLORTERM) || $COLORTERM =~# 'truecolor\|24bit' set termguicolors endif endif if ! has('nvim') set t_Co=256 " Set Vim-specific sequences for RGB colors " Fixes 'termguicolors' usage in vim+tmux " :h xterm-true-color let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" endif " Disable vim distribution plugins " let g:loaded_gzip = 1 " let g:loaded_tar = 1 " let g:loaded_tarPlugin = 1 " let g:loaded_zip = 1 " let g:loaded_zipPlugin = 1 let g:loaded_getscript = 1 let g:loaded_getscriptPlugin = 1 let g:loaded_vimball = 1 let g:loaded_vimballPlugin = 1 let g:loaded_matchit = 1 let g:loaded_matchparen = 1 let g:loaded_2html_plugin = 1 let g:loaded_logiPat = 1 let g:loaded_rrhelper = 1 let g:no_gitrebase_maps = 1 let g:loaded_netrw = 1 let g:loaded_netrwPlugin = 1 let g:loaded_netrwSettings = 1 let g:loaded_netrwFileHandlers = 1 " Set main configuration directory as parent directory let $VIM_PATH = \ get(g:, 'etc_vim_path', \ exists('*stdpath') ? stdpath('config') : \ ! empty($MYVIMRC) ? fnamemodify(expand($MYVIMRC, 1), ':h') : \ ! empty($VIMCONFIG) ? expand($VIMCONFIG, 1) : \ ! empty($VIM_PATH) ? expand($VIM_PATH, 1) : \ fnamemodify(resolve(expand(':p')), ':h:h') \ ) " Set data/cache directory as $XDG_CACHE_HOME/vim let $DATA_PATH = \ expand(($XDG_CACHE_HOME ? $XDG_CACHE_HOME : '~/.cache') . '/vim', 1) " Collection of user plugin list config file-paths let s:config_paths = get(g:, 'etc_config_paths', [ \ $VIM_PATH . '/config/plugins.yaml', \ $VIM_PATH . '/config/local.plugins.yaml', \ $VIM_PATH . '/usr/vimrc.yaml', \ $VIM_PATH . '/usr/vimrc.json', \ $VIM_PATH . '/vimrc.yaml', \ $VIM_PATH . '/vimrc.json', \ ]) " Filter non-existent config paths call filter(s:config_paths, 'filereadable(v:val)') function! s:main() if has('vim_starting') " When using VIMINIT trick for exotic MYVIMRC locations, add path now. if &runtimepath !~# $VIM_PATH set runtimepath^=$VIM_PATH set runtimepath+=$VIM_PATH/after endif " Ensure data directories for s:path in [ \ $DATA_PATH, \ $DATA_PATH . '/undo', \ $DATA_PATH . '/backup', \ $DATA_PATH . '/session', \ $DATA_PATH . '/swap', \ $VIM_PATH . '/spell' ] if ! isdirectory(s:path) call mkdir(s:path, 'p', 0770) endif endfor " Python interpreter settings if has('nvim') " Try the virtualenv created by venv.sh let l:virtualenv = $DATA_PATH . '/venv/bin/python' if empty(l:virtualenv) || ! filereadable(l:virtualenv) " Fallback to old virtualenv location let l:virtualenv = $DATA_PATH . '/venv/neovim3/bin/python' endif if filereadable(l:virtualenv) let g:python3_host_prog = l:virtualenv endif elseif has('pythonx') if has('python3') set pyxversion=3 elseif has('python') set pyxversion=2 endif endif endif " Initializes chosen package manager call s:use_{s:package_manager}() endfunction " Use dein as a plugin manager function! s:use_dein() let l:cache_path = $DATA_PATH . '/dein' if has('vim_starting') " Use dein as a plugin manager let g:dein#auto_recache = 1 let g:dein#install_max_processes = 12 " Add dein to vim's runtimepath if &runtimepath !~# '/dein.vim' let s:dein_dir = l:cache_path . '/repos/github.com/Shougo/dein.vim' " Clone dein if first-time setup if ! isdirectory(s:dein_dir) execute '!git clone https://github.com/Shougo/dein.vim' s:dein_dir if v:shell_error call s:error('dein installation has failed! is git installed?') finish endif endif execute 'set runtimepath+='.substitute( \ fnamemodify(s:dein_dir, ':p') , '/$', '', '') endif endif " Initialize dein.vim (package manager) if dein#load_state(l:cache_path) let l:rc = s:parse_config_files() if empty(l:rc) call s:error('Empty plugin list') return endif " Start propagating file paths and plugin presets call dein#begin(l:cache_path, extend([expand('')], s:config_paths)) for plugin in l:rc " If vim already started, don't re-add existing ones if has('vim_starting') \ || ! has_key(g:dein#_plugins, fnamemodify(plugin['repo'], ':t')) call dein#add(plugin['repo'], extend(plugin, {}, 'keep')) endif endfor " Add any local ./dev plugins if isdirectory($VIM_PATH . '/dev') call dein#local($VIM_PATH . '/dev', { 'frozen': 1, 'merged': 0 }) endif call dein#end() " Save cached state for faster startups if ! g:dein#_is_sudo call dein#save_state() endif " Update or install plugins if a change detected if dein#check_install() if ! has('nvim') set nomore endif call dein#install() endif endif if has('vim_starting') && ! has('nvim') filetype plugin indent on syntax enable endif endfunction function! s:use_plug() abort " vim-plug package-manager initialization let l:cache_root = $DATA_PATH . '/plug' let l:cache_init = l:cache_root . '/init.vimplug' let l:cache_repos = l:cache_root . '/repos' augroup user_plugin_vimplug autocmd! augroup END if &runtimepath !~# '/init.vimplug' if ! isdirectory(l:cache_init) silent !curl -fLo $DATA_PATH/plug/init.vimplug/autoload/plug.vim \ --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd user_plugin_vimplug VimEnter * PlugInstall --sync | source $MYVIMRC endif execute 'set runtimepath+='.substitute( \ fnamemodify(l:cache_init, ':p') , '/$', '', '') endif let l:rc = s:parse_config_files() if empty(l:rc) call s:error('Empty plugin list') return endif call plug#begin(l:cache_repos) for plugin in l:rc call plug#(plugin['repo'], extend(plugin, {}, 'keep')) endfor call plug#end() endfunction function! s:parse_config_files() let l:merged = [] try " Merge all lists of plugins together for l:cfg_file in s:config_paths let l:merged = extend(l:merged, s:load_config(l:cfg_file)) endfor catch /.*/ call s:error( \ 'Unable to read configuration files at ' . string(s:config_paths)) echoerr v:exception endtry " If there's more than one config file source, " de-duplicate plugins by repo key. if len(s:config_paths) > 1 call s:dedupe_plugins(l:merged) endif return l:merged endfunction function! s:dedupe_plugins(list) let l:list = reverse(a:list) let l:i = 0 let l:seen = {} while i < len(l:list) let l:key = list[i]['repo'] if l:key !=# '' && has_key(l:seen, l:key) call remove(l:list, i) else if l:key !=# '' let l:seen[l:key] = 1 endif let l:i += 1 endif endwhile return reverse(l:list) endfunction " General utilities, mainly for dealing with user configuration parsing " --- function! s:error(msg) for l:mes in s:str2list(a:msg) echohl WarningMsg | echomsg '[config/init] ' . l:mes | echohl None endfor endfunction function! s:debug(msg) for l:mes in s:str2list(a:msg) echohl WarningMsg | echomsg '[config/init] ' . l:mes | echohl None endfor endfunction function! s:load_config(filename) " Parse YAML/JSON config file if a:filename =~# '\.json$' " Parse JSON with built-in json_decode let l:json = readfile(a:filename) return has('nvim') ? json_decode(l:json) : json_decode(join(l:json)) elseif a:filename =~# '\.ya\?ml$' " Parse YAML with common command-line utilities return s:load_yaml(a:filename) endif call s:error('Unknown config file format ' . a:filename) return '' endfunction function! s:str2list(expr) " Convert string to list return type(a:expr) ==# v:t_list ? a:expr : split(a:expr, '\n') endfunction " YAML related " --- let s:convert_tool = '' function! s:load_yaml(filename) if empty(s:convert_tool) let s:convert_tool = s:find_yaml2json_method() endif if s:convert_tool ==# 'ruby' let l:cmd = "ruby -e 'require \"json\"; require \"yaml\"; ". \ "print JSON.generate YAML.load \$stdin.read'" elseif s:convert_tool ==# 'python' let l:cmd = "python -c 'import sys,yaml,json; y=yaml.safe_load(sys.stdin.read()); print(json.dumps(y))'" elseif s:convert_tool ==# 'yq' let l:cmd = 'yq e -j -I 0' else let l:cmd = s:convert_tool endif try let l:raw = readfile(a:filename) return json_decode(system(l:cmd, l:raw)) catch /.*/ call s:error([ \ string(v:exception), \ 'Error loading ' . a:filename, \ 'Caught: ' . string(v:exception), \ ]) endtry endfunction function! s:find_yaml2json_method() if exists('*json_decode') " Try different tools to convert YAML into JSON: if executable('yj') " See https://github.com/sclevine/yj return 'yj' elseif executable('yq') " See https://github.com/mikefarah/yq return 'yq' elseif executable('yaml2json') && s:test_yaml2json() " See https://github.com/bronze1man/yaml2json return 'yaml2json' " Or, try ruby. Which is installed on every macOS by default " and has yaml built-in. elseif executable('ruby') && s:test_ruby_yaml() return 'ruby' " Or, fallback to use python3 and PyYAML elseif executable('python') && s:test_python_yaml() return 'python' endif call s:error([ \ 'Unable to find a proper YAML parsing utility.', \ 'Please run: pip3 install --user PyYAML', \ ]) else call s:error('"json_decode" unsupported. Upgrade to latest Neovim or Vim') endif endfunction function! s:test_yaml2json() " Test yaml2json capabilities try let result = system('yaml2json', "---\na: 1.5") if v:shell_error != 0 return 0 endif let result = json_decode(result) return result.a == 1.5 catch endtry return 0 endfunction function! s:test_ruby_yaml() " Test Ruby YAML capabilities call system("ruby -e 'require \"json\"; require \"yaml\"'") return v:shell_error == 0 endfunction function! s:test_python_yaml() " Test Python YAML capabilities call system("python -c 'import sys,yaml,json'") return v:shell_error == 0 endfunction call s:main() " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/local.plugins.yaml ================================================ - repo: ntpeters/vim-better-whitespace hook_add: | let g:better_whitespace_filetypes_blacklist=['diff', 'git', 'gitcommit', 'unite', 'qf', 'help', 'markdown', 'fugitive', 'defx', 'dashboard'] - repo: terryma/vim-multiple-cursors - repo: tpope/vim-repeat - repo: jszakmeister/vim-togglecursor - repo: mhinz/vim-startify # - repo: glepnir/dashboard-nvim # on_event: VimEnter # hook_source: luafile $VIM_PATH/config/plugins/dashboard.lua # - repo: nvim-tree/nvim-web-devicons - repo: tpope/vim-abolish - repo: tpope/vim-projectionist - repo: vim-scripts/BufOnly.vim - repo: godlygeek/tabular # - repo: kien/rainbow_parentheses.vim - repo: haya14busa/incsearch.vim - repo: haya14busa/incsearch-fuzzy.vim - repo: vim-airline/vim-airline - repo: vim-airline/vim-airline-themes - repo: tpope/vim-surround - repo: junegunn/vim-easy-align - repo: voldikss/vim-translator - repo: APZelos/blamer.nvim - repo: solarnz/thrift.vim - { repo: Valloric/MatchTagAlways, on_ft: [html, xhtml, xml, jinja]} - repo: Yggdroot/indentLine hook_add: | let g:indentLine_bufNameExclude = ['NERD_tree.*', 'defx', 'startify', '__vista__', 'dashboard'] let g:indentLine_fileTypeExclude = ['defx', '__vista__', 'help', 'clap_input', 'tagbar', 'vista_kind'] - repo: neoclide/coc.nvim merge: 0 rev: release hook_add: source $VIM_PATH/config/plugins/coc.vim # pip install https://github.com/Rykka/instant-rst.py/archive/master.zip - { repo: gu-fan/riv.vim, on_ft: rst} - { repo: gu-fan/InstantRst, on_ft: rst} - { repo: PegasusWang/RST-Tables, on_ft: rst} - { repo: iamcco/mathjax-support-for-mkdp, on_ft: markdown} - repo: iamcco/markdown-preview.nvim on_ft: [ markdown, pandoc.markdown, rmd ] build: cd app & npm install hook_source: | let g:mkdp_auto_close = 0 # Python related, NOTE python-mode use submodule # cd ~/.cache/vim/dein/repos/github.com; mkdir python-mode # git clone --recurse-submodules https://github.com/python-mode/python-mode - { repo: python-mode/python-mode, on_ft: python} - repo: easymotion/vim-easymotion on_map: { n: } hook_source: | let g:EasyMotion_do_mapping = 0 let g:EasyMotion_prompt = 'Jump to → ' let g:EasyMotion_keys = 'fjdksweoavn' let g:EasyMotion_smartcase = 1 let g:EasyMotion_use_smartsign_us = 1 # enable ycm if you write cpp # - repo: Valloric/YouCompleteMe # build: ./install.py --clang-completer - repo: dense-analysis/ale on_event: FileType hook_add: | let g:ale_disable_lsp = 0 let g:ale_echo_delay = 100 let g:ale_lint_delay = 1000 let g:ale_echo_msg_format = '%linter%: %code: %%s [%severity%]' let g:ale_history_enabled = 0 let g:ale_sign_error = '✖' let g:ale_sign_warning = 'ⁱ' let g:ale_maximum_file_size = 500000 let g:ale_linters = {'go': ['golangci-lint']} # Golang related # go get -u github.com/cweill/gotests/... - repo: buoto/gotests-vim on_ft: [ go ] - repo: fatih/vim-go if: has('nvim-0.4.0') || has('patch-8.0.1453') on_ft: [ go, gomod, gotexttmpl, gohtmltmpl ] hook_add: |- let g:go_gopls_enabled = 0 let g:go_code_completion_enabled = 0 let g:go_doc_keywordprg_enabled = 0 let g:go_def_mapping_enabled = 0 let g:go_jump_to_error = 0 let g:go_fmt_autosave = 1 let g:go_fmt_fail_silently = 1 let g:go_imports_autosave = 1 let g:go_mod_fmt_autosave = 0 let g:go_snippet_engine = 'ultisnips' let g:go_textobj_enabled = 1 let g:go_list_height = 10 let g:go_list_autoclose = 0 let g:go_fold_enable = [] let g:go_highlight_array_whitespace_error = 0 let g:go_highlight_chan_whitespace_error = 0 let g:go_highlight_space_tab_error = 0 let g:go_highlight_trailing_whitespace_error = 0 let g:go_highlight_extra_types = 1 let g:go_highlight_build_constraints = 1 let g:go_highlight_fields = 1 let g:go_highlight_format_strings = 1 let g:go_highlight_functions = 1 let g:go_highlight_function_calls = 1 let g:go_highlight_function_parameters = 1 let g:go_highlight_types = 1 let g:go_highlight_generate_tags = 1 let g:go_highlight_operators = 1 let g:go_highlight_string_spellcheck = 0 let g:go_highlight_variable_declarations = 0 let g:go_highlight_variable_assignments = 0 let g:go_fmt_command = "goimports" let g:go_def_reuse_buffer = 1 let g:go_auto_type_info = 0 if has('nvim') || exists(':terminal') let g:go_term_enabled = 1 let g:go_term_close_on_exit = 0 endif ================================================ FILE: config/local.vim ================================================ " Update file. :update is equlivalent to :write, but it only saves the file if the buffer has been modified imap w :update " switch buffer nnoremap [b :bprevious nnoremap [n :bnext " shortcuts to vimdiff, http://stackoverflow.com/questions/7309707/why-does-git-mergetool-opens-4-windows-in-vimdiff-id-expect-3 if &diff map 1 :diffget LOCAL map 2 :diffget BASE map 3 :diffget REMOTE endif " change tab nnoremap :tabprevious nnoremap :tabnext " https://stackoverflow.com/questions/15583346/how-can-i-temporarily-make-the-window-im-working-on-to-be-fullscreen-in-vim nnoremap tt :tab split " Sudo to write cnoremap w!! w !sudo tee % >/dev/null " add :FormatJSON command, https://coderwall.com/p/faceag/format-json-in-vim com! FormatJSON %!python3 -c "import json, sys, collections; print(json.dumps(json.load(sys.stdin, object_pairs_hook=collections.OrderedDict), ensure_ascii=False, indent=2))" com! FormatJSONPy3 %!python3 -m json.tool com! FormatJSONPy2 %!python -m json.tool com! FormatJSONPy2Utf8 %!python -c "import json, sys, collections; print json.dumps(json.load(sys.stdin, object_pairs_hook=collections.OrderedDict), ensure_ascii=False, indent=2)" map :%retab! :w " use jj as esc inoremap jj `^ " move to next line (insert mode) inoremap o " move to end (insert mode) inoremap A noremap e :q noremap E :qa! " buffer delete noremap q :bd " jump last last edit position noremap g 2g;a " omni Completion inoremap " disable autochdir set noautochdir set signcolumn=no " fix E363: pattern uses more memory than 'maxmempattern' see: https://github.com/vim/vim/issues/2049 set mmp=5000 " Disable built-in statusline & tabline let g:tabline_plugin_enable = 0 let g:statusline_plugin_enable = 0 autocmd InsertLeave * :silent !/usr/local/bin/im-select com.apple.keylayout.ABC ================================================ FILE: config/mappings.vim ================================================ " Key-mappings " === " Elite-mode {{{ " ---------- if get(g:, 'elite_mode') " Disable arrow movement, resize splits instead. nnoremap :resize +1 nnoremap :resize -1 nnoremap :vertical resize +1 nnoremap :vertical resize -1 endif " }}} " Navigation {{{ " ---------- " Fix keybind name for Ctrl+Space map map! " Double leader key for toggling visual-line mode nmap V vmap " Toggle fold nnoremap za " Focus the current fold by closing all others nnoremap zMzvzt " The plugin rhysd/accelerated-jk moves through display-lines in normal mode, " these mappings will move through display-lines in visual mode too. vnoremap j gj vnoremap k gk " Easier line-wise movement nnoremap gh g^ nnoremap gl g$ " Location/quickfix list movement nmap ]l :lnext nmap [l :lprev nmap ]q :cnext nmap [q :cprev " Whitespace jump (see plugin/whitespace.vim) nnoremap ]w :WhitespaceNext nnoremap [w :WhitespacePrev " Navigation in command line cnoremap cnoremap cnoremap cnoremap " }}} " Scroll {{{ " ------ " Scroll step sideways nnoremap zl z4l nnoremap zh z4h " Resize tab windows after top/bottom window movement nnoremap K K= nnoremap J J= " Improve scroll, credits: https://github.com/Shougo " noremap max([winheight(0) - 2, 1]) " \ ."\".(line('w$') >= line('$') ? "L" : "M") " noremap max([winheight(0) - 2, 1]) " \ ."\".(line('w0') <= 1 ? "H" : "M") " nnoremap zz (winline() == (winheight(0)+1) / 2) ? " \ 'zt' : (winline() == 1) ? 'zb' : 'zz' " noremap (line("w$") >= line('$') ? "j" : "3\") " noremap (line("w0") <= 1 ? "k" : "3\") " }}} " Clipboard {{{ " --------- " Yank from cursor position to end-of-line nnoremap Y y$ " Yank buffer's relative/absolute path to clipboard nnoremap y :let @+=expand("%:~:."):echo 'Yanked relative path' nnoremap Y :let @+=expand("%:p"):echo 'Yanked absolute path' " Cut & paste without pushing to register " xnoremap p "0p " nnoremap x "_x " }}} " Edit {{{ " ---- " Macros if get(g:, 'enable_universal_quit_mapping', 1) nnoremap Q q nnoremap gQ @q endif " Start new line from any cursor position in insert-mode inoremap o " Deletes selection and start insert mode " vnoremap "_xi " Re-select blocks after indenting in visual/select mode xnoremap < >gv| " Use tab for indenting in visual/select mode xnoremap >gv| xnoremap > >>_ nmap << <<_ " Drag current line/s vertically and auto-indent nnoremap k :m-2== nnoremap j :m+== vnoremap k :m'<-2gv=gv vnoremap j :m'>+gv=gv " Duplicate lines nnoremap d m`YP`` vnoremap d YPgv " Change current word in a repeatable manner nnoremap cn *``cgn nnoremap cN *``cgN " Change selected word in a repeatable manner vnoremap cn "y/\\V\=escape(@\", '/')\\" . "``cgn" vnoremap cN "y/\\V\=escape(@\", '/')\\" . "``cgN" " Duplicate paragraph nnoremap cp yapp " Remove spaces at the end of lines nnoremap cw :silent! keeppatterns %substitute/\s\+$//e " }}} " Search & Replace {{{ " ---------------- " Use backspace key for matching parens nmap % xmap % " Repeat latest f, t, F or T nnoremap \ ; " Select last paste nnoremap gp '`['.strpart(getregtype(), 0, 1).'`]' " Quick substitute within selected area xnoremap sg :s//gc " C-r: Easier search and replace visual/select mode xnoremap :call get_selection('/'):%s/\V=@///gc " Returns visually selected text function! s:get_selection(cmdtype) "{{{ let temp = @s normal! gv"sy let @/ = substitute(escape(@s, '\'.a:cmdtype), '\n', '\\n', 'g') let @s = temp endfunction "}}} " }}} " Command & History {{{ " ----------------- " Start an external command with a single bang nnoremap ! :! " Put vim command output into buffer nnoremap g! :put=execute('') " Allow misspellings cnoreabbrev qw wq cnoreabbrev Wq wq cnoreabbrev WQ wq cnoreabbrev Qa qa cnoreabbrev Bd bd cnoreabbrev bD bd " Switch history search pairs, matching my bash shell cnoremap pumvisible() ? "\" : "\" cnoremap pumvisible() ? "\" : "\" cnoremap cnoremap " }}} " File operations {{{ " --------------- " Switch (window) to the directory of the current opened buffer map cd :lcd %:p:h:pwd " Open file under the cursor in a vsplit nnoremap gf :vertical wincmd f " Fast saving from all modes " nnoremap w :write nnoremap w :update xnoremap w :write nnoremap :write xnoremap :write cnoremap write " }}} " Editor UI {{{ " --------- " Toggle editor's visual effects nmap ts :setlocal spell! nmap tn :setlocal nonumber! nmap tl :setlocal nolist! nmap th :nohlsearch " Smart wrap toggle (breakindent and colorcolumn toggle as-well) nmap tw :execute('setlocal wrap! breakindent! colorcolumn=' . \ (&colorcolumn == '' ? &textwidth : '')) " Tabs nnoremap g1 :tabfirst nnoremap g5 :tabprevious nnoremap g9 :tablast nnoremap :tabnext nnoremap :tabprevious nnoremap :tabnext nnoremap :tabprevious nnoremap :-tabmove nnoremap :+tabmove " nnoremap :tabprevious " nnoremap :tabnext " Show vim syntax highlight groups for character under cursor nmap h \ :echo 'hi<'.synIDattr(synID(line('.'), col('.'), 1), 'name') \ . '> trans<'.synIDattr(synID(line('.'), col('.'), 0), 'name') . '> lo<' \ . synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') . '>' " }}} " Custom Tools {{{ " ------------ " Terminal if exists(':tnoremap') if has('nvim') tnoremap jj else tnoremap N tnoremap jj N endif endif " Source line and selection in vim vnoremap S y:execute @@:echo 'Sourced selection.' nnoremap S ^vg_y:execute @@:echo 'Sourced line.' " Context-aware action-menu, neovim only (see plugin/actionmenu.vim) if has('nvim') nmap c :ActionMenu endif " Session management shortcuts (see plugin/sessions.vim) nmap se :SessionSave nmap sl :SessionLoad " Jump entire buffers in jumplist nnoremap g :call JumpBuffer(-1) nnoremap g :call JumpBuffer(1) if has('mac') " Open the macOS dictionary on current word nmap ? :!open dict:// " Use Marked for real-time Markdown preview " if executable('/Applications/Marked 2.app/Contents/MacOS/Marked 2') autocmd user_events FileType markdown \ nmap P :silent !open -a Marked\ 2.app '%:p' endif endif nnoremap ml :call append_modeline() " Append modeline after last line in buffer " See: http://vim.wikia.com/wiki/Modeline_magic function! s:append_modeline() "{{{ let l:modeline = printf(' vim: set ts=%d sw=%d tw=%d %set :', \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no') let l:modeline = substitute(&commentstring, '%s', l:modeline, '') call append(line('$'), l:modeline) endfunction "}}} " }}} " Windows, buffers and tabs {{{ " ------------------------- " Ultimatus Quitos if get(g:, 'enable_universal_quit_mapping', 1) autocmd user_events BufWinEnter,BufNew,BufNewFile * \ if &buftype == '' && ! mapcheck('q', 'n') \ | nnoremap q :quit \ | endif endif nnoremap nnoremap x " Window-control prefix nnoremap [Window] nmap s [Window] nnoremap [Window]v :split nnoremap [Window]g :vsplit nnoremap [Window]t :tabnew nnoremap [Window]o :only nnoremap [Window]b :b# nnoremap [Window]c :close nnoremap [Window]x :call window_empty_buffer() nnoremap [Window]z :call zoom() " Split current buffer, go to previous window and previous buffer nnoremap [Window]sv :split:wincmd p:e# nnoremap [Window]sg :vsplit:wincmd p:e# " Background dark/light toggle and contrasts nmap [Window]h :call toggle_background() nmap [Window]- :call toggle_contrast(-v:count1) nmap [Window]= :call toggle_contrast(+v:count1) function! s:toggle_background() if ! exists('g:colors_name') echomsg 'No colorscheme set' return endif let l:scheme = g:colors_name if l:scheme =~# 'dark' || l:scheme =~# 'light' " Rotate between different theme backgrounds execute 'colorscheme' (l:scheme =~# 'dark' \ ? substitute(l:scheme, 'dark', 'light', '') \ : substitute(l:scheme, 'light', 'dark', '')) else execute 'set background='.(&background ==# 'dark' ? 'light' : 'dark') if ! exists('g:colors_name') execute 'colorscheme' l:scheme echomsg 'The colorscheme `'.l:scheme \ .'` doesn''t have background variants!' else echo 'Set colorscheme to '.&background.' mode' endif endif endfunction function! s:toggle_contrast(delta) let l:scheme = '' if g:colors_name =~# 'solarized8' let l:schemes = map(['_low', '_flat', '', '_high'], \ '"solarized8_".(&background).v:val') let l:contrast = ((a:delta + index(l:schemes, g:colors_name)) % 4 + 4) % 4 let l:scheme = l:schemes[l:contrast] endif if l:scheme !=# '' execute 'colorscheme' l:scheme endif endfunction function! s:window_empty_buffer() let l:current = bufnr('%') if ! getbufvar(l:current, '&modified') enew silent! execute 'bdelete '.l:current endif endfunction " Simple zoom toggle function! s:zoom() if exists('t:zoomed') unlet t:zoomed wincmd = else let t:zoomed = { 'nr': bufnr('%') } vertical resize resize normal! ze endif endfunction " }}} " vim: set foldmethod=marker ts=2 sw=2 tw=80 noet : ================================================ FILE: config/plugins/all.vim ================================================ " Plugin Keyboard-Mappings " --- if dein#tap('denite.nvim') nnoremap r :Denite -resume -refresh -no-start-filter nnoremap f :Denite file/rec nnoremap g :Denite grep -start-filter nnoremap b :Denite buffer -default-action=switch nnoremap i :Denite file/old nnoremap d :Denite directory_rec directory_mru -default-action=cd nnoremap v :Denite neoyank -buffer-name=register xnoremap v :Denite neoyank -buffer-name=register -default-action=replace nnoremap l :Denite location_list -buffer-name=list -no-start-filter nnoremap q :Denite quickfix -buffer-name=list -no-start-filter nnoremap m :Denite mark nnoremap n :Denite dein nnoremap j :Denite jump change file/point -no-start-filter nnoremap u :Denite junkfile:new junkfile -buffer-name=list nnoremap o :Denite outline -no-start-filter nnoremap s :Denite session -buffer-name=list nnoremap t :Denite tag nnoremap p :Denite jump nnoremap h :Denite help nnoremap w :Denite file/rec -buffer-name=memo -path=~/docs/blog nnoremap x :Denite file_mru nnoremap z :Denite z -buffer-name=list nnoremap ; :Denite command_history command nnoremap / wordcount().chars > 10000 ? \ ":\Denite -search line/external\" \ : ":\Denite -search line\" nnoremap * wordcount().chars > 10000 ? \ ":\DeniteCursorWord -no-start-filter -search line/external\" \ : ":\DeniteCursorWord -no-start-filter -search line\" " Open Denite with word under cursor or selection nnoremap gt :DeniteCursorWord tag:include -no-start-filter -immediately nnoremap gf :DeniteCursorWord file/rec -no-start-filter nnoremap gg :DeniteCursorWord grep -no-start-filter vnoremap gg \ :call get_selection('/') \ :execute 'Denite -no-start-filter grep:::'.escape(@/, ' :') function! s:get_selection(cmdtype) let temp = @s normal! gv"sy let @/ = substitute(escape(@s, '\' . a:cmdtype), '\n', '\\n', 'g') let @s = temp endfunction endif if dein#tap('vim-clap') " nnoremap f :Clap! files " nnoremap b :Clap! buffers " nnoremap g :Clap! grep " nnoremap j :Clap! jumps " nnoremap h :Clap! help_tags " nnoremap t :Clap! tags " nnoremap l :Clap! loclist " nnoremap q :Clap! quickfix " nnoremap m :Clap! files ~/docs/books " nnoremap y :Clap! yanks " nnoremap / :Clap! lines " nnoremap * :Clap! lines ++query= " nnoremap ; :Clap! command_history " nnoremap gl :Clap! commits " nnoremap gt :Clap! tags ++query= " xnoremap gt :Clap! tags ++query=@visual " nnoremap gf :Clap! files ++query= " xnoremap gf :Clap! files ++query=@visual " nnoremap gg :Clap! grep ++query= " xnoremap gg :Clap! grep ++query=@visual autocmd user_events FileType clap_input call s:clap_mappings() function! s:clap_mappings() nnoremap :call clap#handler#tab_action() nnoremap ' :call clap#handler#tab_action() inoremap =clap#navigation#linewise('down') inoremap =clap#navigation#linewise('up') nnoremap :call clap#navigation#linewise('down') nnoremap :call clap#navigation#linewise('up') nnoremap :call clap#navigation#linewise('down') nnoremap :call clap#navigation#linewise('up') nnoremap :call clap#navigation#scroll('down') nnoremap :call clap#navigation#scroll('up') nnoremap sg :call clap#handler#try_open('ctrl-v') nnoremap sv :call clap#handler#try_open('ctrl-x') nnoremap st :call clap#handler#try_open('ctrl-t') nnoremap q :call clap#handler#exit() nnoremap :call clap#handler#exit() inoremap =clap#navigation#linewise('down')=clap#navigation#linewise('up') inoremap jj =clap#navigation#linewise('down')=clap#navigation#linewise('up') endfunction endif if dein#tap('vim-lsp') " Close preview window with Escape autocmd User lsp_float_opened \ nmap (lsp-preview-close) autocmd User lsp_float_closed silent! nunmap autocmd user_events FileType markdown.lsp-hover \ nmap q :pclose| doautocmd BufWinEnter endif if dein#tap('defx.nvim') nnoremap e \ :Defx -toggle -buffer-name=explorer`tabpagenr()` nnoremap a \ :Defx \ -search=`escape(expand('%:p'), ' :')` \ -buffer-name=explorer`tabpagenr()` endif if dein#tap('delimitMate') imap delimitMate#JumpAny() endif if dein#tap('vista.vim') nnoremap b :Vista!! nnoremap a :Vista show endif if dein#tap('emmet-vim') autocmd user_events FileType html,css,javascript,javascriptreact,svelte \ EmmetInstall \ | imap (emmet-expand-abbr) endif if dein#tap('vim-gitgutter') nmap ]g (GitGutterNextHunk) nmap [g (GitGutterPrevHunk) nmap gS (GitGutterStageHunk) xmap gS (GitGutterStageHunk) nmap gr (GitGutterUndoHunk) nmap gs (GitGutterPreviewHunk) endif if dein#tap('iron.nvim') nmap rr :IronRepl nmap rq (iron-exit) nmap rl (iron-send-line) vmap rl (iron-visual-send) nmap rp (iron-repeat-cmd) nmap rc (iron-clear) nmap r (iron-cr) nmap r (iron-interrupt) endif if dein#tap('vim-sandwich') nmap sa (operator-sandwich-add) xmap sa (operator-sandwich-add) omap sa (operator-sandwich-g@) nmap sd (operator-sandwich-delete)(operator-sandwich-release-count)(textobj-sandwich-query-a) xmap sd (operator-sandwich-delete) nmap sr (operator-sandwich-replace)(operator-sandwich-release-count)(textobj-sandwich-query-a) xmap sr (operator-sandwich-replace) nmap sdb (operator-sandwich-delete)(operator-sandwich-release-count)(textobj-sandwich-auto-a) nmap srb (operator-sandwich-replace)(operator-sandwich-release-count)(textobj-sandwich-auto-a) omap ir (textobj-sandwich-auto-i) xmap ir (textobj-sandwich-auto-i) omap ab (textobj-sandwich-auto-a) xmap ab (textobj-sandwich-auto-a) omap is (textobj-sandwich-query-i) xmap is (textobj-sandwich-query-i) omap as (textobj-sandwich-query-a) xmap as (textobj-sandwich-query-a) endif if dein#tap('vim-operator-replace') xmap p (operator-replace) endif if dein#tap('vim-niceblock') silent! xmap I (niceblock-I) silent! xmap gI (niceblock-gI) silent! xmap A (niceblock-A) endif if dein#tap('accelerated-jk') nmap j (accelerated_jk_gj) nmap k (accelerated_jk_gk) endif if dein#tap('vim-edgemotion') map gj (edgemotion-j) map gk (edgemotion-k) xmap gj (edgemotion-j) xmap gk (edgemotion-k) endif if dein#tap('vim-quickhl') nmap mt (quickhl-manual-this) nmap mT (quickhl-manual-this-whole-word) xmap mt (quickhl-manual-this) nmap mC (quickhl-manual-reset) endif if dein#tap('vim-sidemenu') nmap l (sidemenu) xmap l (sidemenu-visual) endif if dein#tap('vim-indent-guides') nmap ti :IndentGuidesToggle endif if dein#tap('vim-signature') let g:SignatureIncludeMarks = 'abcdefghijkloqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' let g:SignatureMap = { \ 'Leader': 'm', \ 'ListBufferMarks': 'm/', \ 'ListBufferMarkers': 'm?', \ 'PlaceNextMark': 'm,', \ 'ToggleMarkAtLine': 'mm', \ 'PurgeMarksAtLine': 'm-', \ 'DeleteMark': 'dm', \ 'PurgeMarks': 'm', \ 'PurgeMarkers': 'm', \ 'GotoNextLineAlpha': "']", \ 'GotoPrevLineAlpha': "'[", \ 'GotoNextSpotAlpha': '`]', \ 'GotoPrevSpotAlpha': '`[', \ 'GotoNextLineByPos': "]'", \ 'GotoPrevLineByPos': "['", \ 'GotoNextSpotByPos': 'mn', \ 'GotoPrevSpotByPos': 'mp', \ 'GotoNextMarker': ']-', \ 'GotoPrevMarker': '[-', \ 'GotoNextMarkerAny': ']=', \ 'GotoPrevMarkerAny': '[=', \ } endif if dein#tap('auto-git-diff') autocmd user_events FileType gitrebase \ nmap (auto_git_diff_scroll_manual_update) \| nmap (auto_git_diff_scroll_down_page) \| nmap (auto_git_diff_scroll_up_page) \| nmap (auto_git_diff_scroll_down_half) \| nmap (auto_git_diff_scroll_up_half) endif if dein#tap('committia.vim') let g:committia_hooks = {} function! g:committia_hooks.edit_open(info) setlocal winminheight=1 winheight=10 resize 10 imap (committia-scroll-diff-down-half) imap (committia-scroll-diff-up-half) imap (committia-scroll-diff-down-page) imap (committia-scroll-diff-up-page) imap (committia-scroll-diff-down) imap (committia-scroll-diff-up) endfunction endif if dein#tap('python_match.vim') autocmd user_events FileType python \ nmap {{ [% \ | nmap }} ]% endif if dein#tap('goyo.vim') nnoremap G :Goyo endif if dein#tap('vim-shot-f') nmap f (shot-f-f) nmap F (shot-f-F) nmap t (shot-f-t) nmap T (shot-f-T) xmap f (shot-f-f) xmap F (shot-f-F) xmap t (shot-f-t) xmap T (shot-f-T) omap f (shot-f-f) omap F (shot-f-F) omap t (shot-f-t) omap T (shot-f-T) endif if dein#tap('vimwiki') nnoremap W :VimwikiIndex endif if dein#tap('vim-choosewin') nmap - (choosewin) nmap - :ChooseWinSwapStay endif if dein#tap('vimagit') nnoremap mg :Magit endif if dein#tap('gina.vim') nnoremap ga :Gina add %:p nnoremap gd :Gina compare nnoremap gc :Gina commit nnoremap gb :Gina blame --width=40 nnoremap gs :Gina status -s nnoremap gl :Gina log --graph --all nnoremap gF :Gina! fetch nnoremap gp :Gina! push nnoremap go :,Gina browse : vnoremap go :Gina browse : endif if dein#tap('vim-altr') nmap n (altr-forward) nmap N (altr-back) endif if dein#tap('any-jump.vim') " Normal mode: Jump to definition under cursor nnoremap ii :AnyJump " Visual mode: jump to selected text in visual mode xnoremap ii :AnyJumpVisual " Normal mode: open previous opened file (after jump) nnoremap ib :AnyJumpBack " Normal mode: open last closed search window again nnoremap il :AnyJumpLastResults endif if dein#tap('undotree') nnoremap gu :UndotreeToggle endif if dein#tap('thesaurus_query.vim') nnoremap K :ThesaurusQueryReplaceCurrentWord endif if dein#tap('vim-asterisk') map * (asterisk-g*) map g* (asterisk-*) map # (asterisk-g#) map g# (asterisk-#) map z* (asterisk-z*) map gz* (asterisk-gz*) map z# (asterisk-z#) map gz# (asterisk-gz#) endif if dein#tap('vim-expand-region') xmap v (expand_region_expand) xmap V (expand_region_shrink) endif if dein#tap('sideways.vim') nnoremap <, :SidewaysLeft nnoremap >, :SidewaysRight nnoremap [, :SidewaysJumpLeft nnoremap ], :SidewaysJumpRight omap a, SidewaysArgumentTextobjA xmap a, SidewaysArgumentTextobjA omap i, SidewaysArgumentTextobjI xmap i, SidewaysArgumentTextobjI endif if dein#tap('splitjoin.vim') let g:splitjoin_join_mapping = '' let g:splitjoin_split_mapping = '' nmap sj :SplitjoinJoin nmap sk :SplitjoinSplit endif if dein#tap('linediff.vim') vnoremap mdf :Linediff vnoremap mda :LinediffAdd nnoremap mds :LinediffShow nnoremap mdr :LinediffReset endif if dein#tap('dsf.vim') nmap dsf DsfDelete nmap csf DsfChange endif if dein#tap('caw.vim') function! InitCaw() abort if &l:modifiable && &buftype ==# '' && &filetype != 'gitrebase' xmap V (caw:wrap:toggle) nmap V (caw:wrap:toggle) xmap v (caw:hatpos:toggle) nmap v (caw:hatpos:toggle) nmap gc (caw:prefix) xmap gc (caw:prefix) nmap gcc (caw:hatpos:toggle) xmap gcc (caw:hatpos:toggle) else silent! nunmap V silent! xunmap V silent! nunmap v silent! xunmap v silent! nunmap gc silent! xunmap gc silent! nunmap gcc silent! xunmap gcc endif endfunction autocmd user_events FileType * call InitCaw() call InitCaw() endif if dein#tap('fin.vim') nnoremap f :Fin function! InitFin() abort cmap (fin-line-next) cmap (fin-line-prev) cmap (fin-line-next) cmap (fin-line-prev) endfunction autocmd user_events FileType fin call InitFin() endif if dein#tap('vim-textobj-function') omap af (textobj-function-a) omap if (textobj-function-i) xmap af (textobj-function-a) xmap if (textobj-function-i) endif if dein#tap('vim-easymotion') nmap ss (easymotion-s2) endif if dein#tap('vim-airline') let g:airline_powerline_fonts=1 let g:airline_theme = 'materialbox' let g:airline#extensions#tabline#enabled = 1 endif if dein#tap('incsearch-fuzzy.vim') map z/ (incsearch-fuzzy-/) map z? (incsearch-fuzzy-?) map zg/ (incsearch-fuzzy-stay) endif if dein#tap('python-mode') " 注意如果使用了 rope 一般是项目根目录打开文件,不要切到子目录 " set noautochdir 注意这个自动切换目录会使rope找目录不正确,禁用,坑死我 " 如果你发现找不到你的 package 或者系统的,编辑你的代码根目录下 .ropeproject/config.py 里的文件就可以了 " 比如加上 prefs.add('python_path', '/usr/local/lib/python2.7/site-packages/') 就可以找到系统包了 " when PYTHON_VERSION env variable is set, use python2. default Use python3 " ch: 如果设置了 export PYTHON_VERSION=2 环境变量使用 python2 ,否则默认 python3 if $PYTHON_VERSION == '2' let g:pymode_python = 'python' " Values are `python`, `python3`, `disable`. else let g:pymode_python = 'python3' " Values are `python`, `python3`, `disable`. endif let g:pymode_paths = reverse(split(globpath(getcwd().'/eggs', '*'), '\n')) " support zc.buildout let g:pymode_trim_whitespaces = 1 let g:pymode_quickfix_maxheight = 3 let g:pymode_indent = 1 let g:pymode_folding = 1 let g:pymode_breakpoint = 1 let g:pymode_breakpoint_bind = "" " NOTE: use ctrl+d insert ipdb let g:pymode_breakpoint_cmd = 'import ipdb; ipdb.set_trace() # BREAKPOINT TODO REMOVE; from nose.tools import set_trace; set_trace()' let g:pymode_run = 1 let g:pymode_run_bind = "" let g:pymode_virtualenv = 1 let g:pymode_virtualenv_path = $VIRTUAL_ENV " use coc.nvim, disalbe rope let g:pymode_rope = 0 let g:pymode_rope_autoimport = 0 let g:pymode_rope_complete_on_dot = 0 let g:pymode_rope_lookup_project = 0 let g:pymode_rope_goto_definition_bind = "" let g:pymode_rope_goto_definition_cmd = 'vnew' let g:pymode_rope_regenerate_on_write = 0 let g:pymode_lint = 1 let g:pymode_lint_on_write = 1 let g:pymode_lint_on_fly = 0 let g:pymode_lint_message = 1 let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe', 'pylint'] let g:pymode_lint_ignore = ["C0103, C0111, C0301, C0304, C0325, E0702, E1120, R0201, R0903, R0911, R0912, R0913, R1705, W0105, W0108, W0110, W0201, W0221, W0223, W0235, W0403, W0511, W0622, W0703, W1202"] let g:pymode_lint_options_mccabe = { 'complexity': 15 } let g:pymode_lint_signs = 1 " if you want use emoji you shoud set : Iterm2->Profiles->Text->Use Unicode versoin 9 widths let g:pymode_lint_todo_symbol = '😡' let g:pymode_lint_error_symbol = "\U2717" let g:pymode_lint_comment_symbol = "\u2757" let g:pymode_lint_visual_symbol = "\u0021" " 修改默认的红线为浅色,solorized黑色主题 highlight ColorColumn ctermbg=233 let g:pymode_lint_cwindow = 0 let g:pymode_options_max_line_length = 120 let g:pymode_options_colorcolumn = 1 " 指定UltiSnips python的docstring风格, sphinx, google, numpy let g:ultisnips_python_style = 'sphinx' " use coc doc let g:pymode_doc = 0 endif if dein#tap('vim-go') autocmd user_events FileType go \ nmap (go-def) \ | nmap god (go-describe) \ | nmap goc (go-callees) \ | nmap goC (go-callers) \ | nmap goi (go-info) \ | nmap gom (go-implements) \ | nmap gos (go-callstack) \ | nmap goe (go-referrers) \ | nmap gor (go-run) \ | nmap gov (go-vet) \ | nmap got (go-test) \ | nmap ga (go-alternate-edit) \ | nmap gf (go-test-func) \ | nmap fd (go-def-vertical) \ | nnoremap r :GoRun % endif if dein#tap('fzf.vim') nnoremap ag :Ag nnoremap s :Ag nnoremap f :Buffers nnoremap :Files endif if dein#tap('vim-json') let g:vim_json_syntax_conceal = 0 endif if dein#tap('vim-translator') " Display translation in a window nmap t TranslateW vmap t TranslateWV endif " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/plugins/asyncomplete.vim ================================================ " :h asyncomplete " --- " Problems? https://github.com/prabirshrestha/asyncomplete.vim/issues " Debugging: " let g:asyncomplete_log_file = expand('~/asyncomplete.log', 1) " let g:lsp_log_file = expand('~/vim-lsp.log', 1) " Smart completion-menu selection behavior: " 1) Insert new-line if nothing selected " 2) Otherwise, insert and expand selected snippet (via UltiSnips) " 3) Otherwise, insert selected completion item " 4) If completion-menu is closed, try to expand empty pairs (via DelimitMate) function s:smart_carriage_return() if pumvisible() let l:info = complete_info() " Detect non-selection and insert new-line if get(l:info, 'selected', -1) == -1 return "\\" endif " Detect snippet and expand (via UltiSnips) if exists('g:UltiSnipsEditSplit') let l:menu = get(get(l:info['items'], l:info['selected'], {}), 'menu') if len(l:menu) > 0 && stridx(l:menu, 'Snips: ') == 0 return "\\=UltiSnips#ExpandSnippet()\" endif endif " Otherwise, when pum is visible, insert selected completion return "\" endif " Expand empty pairs (via delimitMate) if get(b:, 'delimitMate_enabled') && delimitMate#WithinEmptyPair() return "\=delimitMate#ExpandReturn()\" endif " Propagate a carriage-return return "\" endfunction " Smart selection inoremap =smart_carriage_return() " Force completion pop-up display imap (asyncomplete_force_refresh) " Navigation inoremap pumvisible() ? "\" : (is_whitespace() ? "\" : asyncomplete#force_refresh()) inoremap pumvisible() ? "\" : (is_whitespace() ? "\" : asyncomplete#force_refresh()) inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" " Menu control inoremap pumvisible() ? asyncomplete#close_popup() : "\" inoremap pumvisible() ? asyncomplete#cancel_popup() : "\" function! s:is_whitespace() let col = col('.') - 1 return ! col || getline('.')[col - 1] =~# '\s' endfunction " Pre-processors " --- " DISABLED: Auto-complete popup doesn't show after dot e.g. "class." " function! s:sort_by_priority_preprocessor(options, matches) abort " let l:items = [] " for [l:source_name, l:matches] in items(a:matches) " for l:item in l:matches['items'] " if stridx(l:item['word'], a:options['base']) == 0 " let l:item['priority'] = " \ get(asyncomplete#get_source_info(l:source_name), 'priority', 1) " call add(l:items, l:item) " endif " endfor " endfor " let l:items = sort(l:items, {a, b -> b['priority'] - a['priority']}) " call asyncomplete#preprocess_complete(a:options, l:items) " endfunction " " let g:asyncomplete_preprocessor = [function('s:sort_by_priority_preprocessor')] " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/plugins/coc.vim ================================================ " May need for vim (not neovim) since coc.nvim calculate byte offset by count " utf-8 byte sequence. set encoding=utf-8 " Some servers have issues with backup files, see #649. set nobackup set nowritebackup " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable " delays and poor user experience. set updatetime=300 " Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved. set signcolumn=yes " Use tab for trigger completion with characters ahead and navigate. " NOTE: There's always complete item selected by default, you may want to enable " no select by `"suggest.noselect": true` in your configuration file. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap \ coc#pum#visible() ? coc#pum#next(1) : \ CheckBackspace() ? "\" : \ coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" " Make to accept selected completion item or notify coc.nvim to format " u breaks current undo, please make your own choice. inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\" function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Use to trigger completion. if has('nvim') inoremap coc#refresh() else inoremap coc#refresh() endif " Use `[g` and `]g` to navigate diagnostics " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap [e (coc-diagnostic-prev) nmap ]e (coc-diagnostic-next) " GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window. nnoremap K :call ShowDocumentation() function! ShowDocumentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else call feedkeys('K', 'in') endif endfunction " Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight') autocmd ColorScheme * highlight CocHighlightText ctermfg=109 ctermbg=60 guifg=#8abeb7 guibg=#5f5f87 " Symbol renaming. nmap rn (coc-rename) nmap rf (coc-refactor) " Formatting selected code. nmap p (coc-format) xmap f (coc-format-selected) nmap f (coc-format-selected) nmap ti :call CocAction('showIncomingCalls') augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end " Applying codeAction to the selected region. " Example: `aap` for current paragraph xmap a (coc-codeaction-selected) nmap a (coc-codeaction-selected) " Remap keys for applying codeAction to the current buffer. nmap ac (coc-codeaction) " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) " Run the Code Lens action on the current line. nmap cl (coc-codelens-action) " Map function and class text objects " NOTE: Requires 'textDocument.documentSymbol' support from the language server. xmap if (coc-funcobj-i) omap if (coc-funcobj-i) xmap af (coc-funcobj-a) omap af (coc-funcobj-a) xmap ic (coc-classobj-i) omap ic (coc-classobj-i) xmap ac (coc-classobj-a) omap ac (coc-classobj-a) " Remap and for scroll float windows/popups. if has('nvim-0.4.0') || has('patch-8.2.0750') nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" endif " Use CTRL-S for selections ranges. " Requires 'textDocument/selectionRange' support of language server. nmap (coc-range-select) xmap (coc-range-select) " Add `:Format` command to format current buffer. command! -nargs=0 Format :call CocActionAsync('format') " Add `:Fold` command to fold current buffer. command! -nargs=? Fold :call CocAction('fold', ) " Add `:OR` command for organize imports of the current buffer. command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport') " Add (Neo)Vim's native statusline support. " NOTE: Please see `:h coc-status` for integrations with external plugins that " provide custom statusline: lightline.vim, vim-airline. set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} " Mappings for CoCList " Show all diagnostics. nnoremap a :CocList diagnostics " Manage extensions. nnoremap e :CocList extensions " Show commands. nnoremap c :CocList commands " Find symbol of current document. nnoremap o :CocList outline " Search workspace symbols. nnoremap s :CocList -I symbols " Do default action for next item. nnoremap j :CocNext " Do default action for previous item. nnoremap k :CocPrev " Resume latest coc list. nnoremap p :CocListResume ================================================ FILE: config/plugins/colorizer.lua ================================================ -- nvim-colorizer -- === -- See https://github.com/norcalli/nvim-colorizer.lua require 'colorizer'.setup { css = { rgb_fn = true; }; scss = { rgb_fn = true; }; sass = { rgb_fn = true; }; stylus = { rgb_fn = true; }; svelte = { rgb_fn = true; }; vim = { names = false; }; tmux = { names = false; }; 'javascript'; 'javascriptreact'; 'typescript'; 'typescriptreact'; html = { mode = 'foreground'; } } ================================================ FILE: config/plugins/dashboard.lua ================================================ require 'dashboard'.setup { theme = 'hyper', config = { week_header = { enable = true, }, shortcut = { { desc = '󰊳 Update', group = '@property', action = 'Lazy update', key = 'u' }, { icon = ' ', icon_hl = '@variable', desc = 'Files', group = 'Label', action = 'Telescope find_files', key = 'f', }, { desc = ' Apps', group = 'DiagnosticHint', action = 'Telescope app', key = 'a', }, { desc = ' dotfiles', group = 'Number', action = 'Telescope dotfiles', key = 'd', }, }, } } ================================================ FILE: config/plugins/defx.vim ================================================ " :h defx " --- " Problems? https://github.com/Shougo/defx.nvim/issues call defx#custom#option('_', { \ 'resume': 1, \ 'winwidth': 25, \ 'split': 'vertical', \ 'direction': 'topleft', \ 'show_ignored_files': 0, \ 'columns': 'indent:git:icons:filename', \ 'root_marker': '', \ 'ignored_files': \ '.mypy_cache,.pytest_cache,.git,.hg,.svn,.stversions' \ . ',__pycache__,.sass-cache,*.egg-info,.DS_Store,*.pyc' \ }) call defx#custom#column('git', { \ 'indicators': { \ 'Modified' : '•', \ 'Staged' : '✚', \ 'Untracked' : 'ᵁ', \ 'Renamed' : '≫', \ 'Unmerged' : '≠', \ 'Ignored' : 'ⁱ', \ 'Deleted' : '✖', \ 'Unknown' : '⁇' \ } \ }) call defx#custom#column('mark', { 'readonly_icon': '', 'selected_icon': '' }) call defx#custom#column('filename', { 'root_marker_highlight': 'Comment' }) " defx-icons plugin let g:defx_icons_column_length = 2 let g:defx_icons_mark_icon = '' " Used in s:toggle_width() let s:original_width = get(get(defx#custom#_get().option, '_'), 'winwidth') " Events " --- augroup user_plugin_defx autocmd! " Define defx window mappings autocmd FileType defx call defx_mappings() " Delete defx if it's the only buffer left in the window autocmd WinEnter * if &filetype == 'defx' && winnr('$') == 1 | bdel | endif " Move focus to the next window if current buffer is defx autocmd TabLeave * if &filetype == 'defx' | wincmd w | endif " autocmd WinEnter * if &filetype ==# 'defx' " \ | silent! highlight! link CursorLine TabLineSel " \ | endif " " autocmd WinLeave * if &filetype ==# 'defx' " \ | silent! highlight! link CursorLine NONE " \ | endif augroup END " Internal functions " --- function! s:jump_dirty(dir) abort " Jump to the next position with defx-git dirty symbols let l:icons = get(g:, 'defx_git_indicators', {}) let l:icons_pattern = join(values(l:icons), '\|') if ! empty(l:icons_pattern) let l:direction = a:dir > 0 ? 'w' : 'bw' return search(printf('\(%s\)', l:icons_pattern), l:direction) endif endfunction function! s:defx_toggle_tree() abort " Open current file, or toggle directory expand/collapse if defx#is_directory() return defx#do_action('open_tree', ['nested', 'toggle']) endif " return defx#do_action('multi', ['drop', 'quit']) return defx#do_action('multi', ['drop']) endfunction function! s:defx_mappings() abort " Defx window keyboard mappings setlocal signcolumn=no expandtab setlocal cursorline nonu nnoremap defx_toggle_tree() nnoremap e defx_toggle_tree() nnoremap l defx_toggle_tree() nnoremap h defx#do_action('close_tree') nnoremap t defx#do_action('open_tree', 'recursive') nnoremap st defx#do_action('multi', [['drop', 'tabnew'], 'quit']) nnoremap sg defx#do_action('multi', [['drop', 'vsplit'], 'quit']) nnoremap sv defx#do_action('multi', [['drop', 'split'], 'quit']) nnoremap P defx#do_action('preview') nnoremap y defx#do_action('yank_path') nnoremap x defx#do_action('execute_system') nnoremap gx defx#do_action('execute_system') nnoremap . defx#do_action('toggle_ignored_files') " Defx's buffer management " nnoremap defx#do_action('quit') nnoremap q defx#do_action('quit') nnoremap se defx#do_action('save_session') nnoremap defx#do_action('redraw') nnoremap defx#do_action('print') " File/dir management nnoremap c defx#do_action('copy') nnoremap m defx#do_action('move') nnoremap p defx#do_action('paste') nnoremap r defx#do_action('rename') nnoremap dd defx#do_action('remove_trash') nnoremap K defx#do_action('new_directory') nnoremap N defx#do_action('new_multiple_files') " Jump nnoremap [g :call jump_dirty(-1) nnoremap ]g :call jump_dirty(1) " Change directory nnoremap \ defx#do_action('cd', getcwd()) nnoremap & defx#do_action('cd', getcwd()) nnoremap defx#async_action('cd', ['..']) nnoremap ~ defx#async_action('cd') nnoremap u defx#do_action('cd', ['..']) nnoremap 2u defx#do_action('cd', ['../..']) nnoremap 3u defx#do_action('cd', ['../../..']) nnoremap 4u defx#do_action('cd', ['../../../..']) " Selection nnoremap * defx#do_action('toggle_select_all') nnoremap \ defx#do_action('toggle_select') . 'j' nnoremap S defx#do_action('toggle_sort', 'Time') nnoremap C \ defx#do_action('toggle_columns', 'indent:mark:filename:type:size:time') " Tools nnoremap w defx#do_action('call', 'toggle_width') nnoremap gd defx#async_action('multi', ['drop', 'quit', ['call', 'git_diff']]) nnoremap gr defx#do_action('call', 'grep') nnoremap gf defx#do_action('call', 'find_files') if exists('$TMUX') nnoremap gl defx#async_action('call', 'explorer') endif endfunction " TOOLS " --- function! s:git_diff(context) abort Gina compare endfunction function! s:find_files(context) abort " Find files in parent directory with Denite let l:target = a:context['targets'][0] let l:parent = fnamemodify(l:target, ':h') silent execute 'wincmd w' silent execute 'Denite file/rec:'.l:parent endfunction function! s:grep(context) abort " Grep in parent directory with Denite let l:target = a:context['targets'][0] let l:parent = fnamemodify(l:target, ':h') silent execute 'wincmd w' silent execute 'Denite grep:'.l:parent endfunction function! s:toggle_width(context) abort " Toggle between defx window width and longest line let l:max = 0 for l:line in range(1, line('$')) let l:len = strdisplaywidth(substitute(getline(l:line), '\s\+$', '', '')) let l:max = max([l:len + 1, l:max]) endfor let l:new = l:max == winwidth(0) ? s:original_width : l:max call defx#call_action('resize', l:new) endfunction function! s:explorer(context) abort " Open file-explorer split with tmux let l:explorer = s:find_file_explorer() if empty('$TMUX') || empty(l:explorer) return endif let l:target = a:context['targets'][0] let l:parent = fnamemodify(l:target, ':h') let l:cmd = 'split-window -p 30 -c ' . l:parent . ' ' . l:explorer silent execute '!tmux ' . l:cmd endfunction function! s:find_file_explorer() abort " Detect terminal file-explorer let s:file_explorer = get(g:, 'terminal_file_explorer', '') if empty(s:file_explorer) for l:explorer in ['lf', 'hunter', 'ranger', 'vifm'] if executable(l:explorer) let s:file_explorer = l:explorer break endif endfor endif return s:file_explorer endfunction " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/plugins/denite.vim ================================================ " :h denite.txt " --- " Problems? https://github.com/Shougo/denite.nvim/issues " Don't reload Denite twice (on vimrc reload) if exists('*denite#start') finish endif " Denite general settings call denite#custom#option('_', { \ 'prompt': '❯', \ 'start_filter': v:true, \ 'smartcase': v:true, \ 'source_names': 'short', \ 'highlight_preview_line': 'CursorColumn', \ 'max_candidate_width': 512, \ 'max_dynamic_update_candidates': 30000, \ }) " Use Neovim's floating window if has('nvim-0.4') highlight! DeniteBackground ctermfg=250 ctermbg=237 guifg=#ACAFAE guibg=#2C3237 call denite#custom#option('_', { \ 'split': 'floating', \ 'filter_split_direction': 'floating', \ 'floating_preview': v:true, \ 'preview_height': &lines / 3, \ 'preview_width': &columns / 2 - 4, \ 'match_highlight': v:false, \ 'highlight_window_background': 'DeniteBackground', \ 'highlight_filter_background': 'NormalFloat', \ 'highlight_matched_char': 'CursorLineNr', \ 'highlight_matched_range': 'Comment', \ }) else call denite#custom#option('_', { \ 'vertical_preview': v:true, \ 'preview_width': &columns / 2, \ }) endif " Interactive grep search call denite#custom#var('grep', 'min_interactive_pattern', 2) call denite#custom#source('grep', 'args', ['', '', '!']) " Allow customizable window positions: top, bottom, centertop, center (default) function! s:denite_resize(position) if a:position ==# 'top' call denite#custom#option('_', { \ 'winwidth': &columns - 1, \ 'winheight': &lines / 3, \ 'wincol': 0, \ 'winrow': 1, \ }) elseif a:position ==# 'bottom' call denite#custom#option('_', { \ 'winwidth': &columns - 1, \ 'winheight': &lines / 3, \ 'wincol': 0, \ 'winrow': (&lines - 2) - (&lines / 3), \ }) elseif a:position ==# 'centertop' call denite#custom#option('_', { \ 'winwidth': &columns / 2, \ 'winheight': &lines / 3, \ 'wincol': &columns / 4, \ 'winrow': (&lines / 12), \ }) else " Use Denite default, which is centered. endif endfunction " Set Denite's window position let g:denite_position = get(g:, 'denite_position', 'centertop') call s:denite_resize(g:denite_position) " MATCHERS " Default is 'matcher/fuzzy' call denite#custom#source('tag', 'matchers', ['matcher/substring']) call denite#custom#source('file/old', 'matchers', [ \ 'matcher/project_files', 'matcher/ignore_globs' ]) " Use vim-clap's rust binary, called maple if dein#tap('vim-clap') let s:clap_path = dein#get('vim-clap')['path'] if executable(s:clap_path . '/target/release/maple') call denite#custom#filter('matcher/clap', 'clap_path', s:clap_path) call denite#custom#source('file/rec,grep,jump,buffer,file_mru,tag', \ 'matchers', [ 'matcher/clap' ]) endif endif " SORTERS " Default is 'sorter/rank' call denite#custom#source('z', 'sorters', ['sorter/z']) if has('nvim') call denite#custom#source('file/old', 'sorters', ['sorter/oldfiles']) endif " CONVERTERS " Default is none call denite#custom#source( \ 'buffer,file_mru,file/old', \ 'converters', ['converter/relative_word']) " FIND and GREP COMMANDS " --- " Ripgrep if executable('rg') call denite#custom#var('file/rec', 'command', \ ['rg', '--hidden', '--files', '--glob', '!.git', '--color', 'never']) call denite#custom#var('grep', { \ 'command': ['rg'], \ 'default_opts': ['--hidden', '-i', '--vimgrep', '--no-heading'], \ 'recursive_opts': [], \ 'pattern_opt': ['--regexp'], \ }) " The Silver Searcher (ag) elseif executable('ag') call denite#custom#var('file/rec', 'command', \ ['ag', '--hidden', '--follow', '--nocolor', '--nogroup', '-g', '']) " Setup ignore patterns in your .agignore file! " https://github.com/ggreer/the_silver_searcher/wiki/Advanced-Usage call denite#custom#var('grep', { \ 'command': ['ag'], \ 'default_opts': ['--vimgrep', '-i', '--hidden'], \ 'recursive_opts': [], \ 'pattern_opt': [], \ }) " Ack command elseif executable('ack') call denite#custom#var('grep', { \ 'command': ['ack'], \ 'default_opts': [ \ '--ackrc', $HOME.'/.config/ackrc', '-H', '-i', \ '--nopager', '--nocolor', '--nogroup', '--column', \ ], \ 'recursive_opts': [], \ 'pattern_opt': ['--match'], \ }) endif " Denite EVENTS augroup user_plugin_denite autocmd! autocmd FileType denite call s:denite_settings() autocmd FileType denite-filter call s:denite_filter_settings() autocmd User denite-preview call s:denite_preview() autocmd VimResized * call s:denite_resize(g:denite_position) augroup END " Denite main window settings function! s:denite_settings() abort " Window options setlocal signcolumn=no cursorline " Use a more vibrant cursorline for Denite highlight! link CursorLine WildMenu autocmd user_plugin_denite BufDelete highlight! link CursorLine NONE " Denite selection window key mappings nmap j nmap k nmap j nmap k nnoremap denite#do_map('do_action') nnoremap i denite#do_map('open_filter_buffer') nnoremap / denite#do_map('open_filter_buffer') nnoremap dd denite#do_map('do_action', 'delete') nnoremap p denite#do_map('do_action', 'preview') nnoremap st denite#do_map('do_action', 'tabopen') nnoremap sg denite#do_map('do_action', 'vsplit') nnoremap sv denite#do_map('do_action', 'split') nnoremap ' denite#do_map('quick_move') nnoremap q denite#do_map('quit') nnoremap r denite#do_map('redraw') nnoremap yy denite#do_map('do_action', 'yank') nnoremap denite#do_map('quit') nnoremap denite#do_map('choose_action') nnoremap denite#do_map('toggle_select').'j' endfunction " Denite-preview window settings function! s:denite_preview() abort " Window options setlocal colorcolumn= signcolumn=no nolist nospell setlocal nocursorline nocursorcolumn number norelativenumber " Clear indents if exists('*indent_guides#clear_matches') call indent_guides#clear_matches() endif endfunction " Denite-filter window settings function! s:denite_filter_settings() abort " Window options setlocal signcolumn=yes nocursorline nonumber norelativenumber " Disable Deoplete auto-completion within Denite filter window if exists('*deoplete#custom#buffer_option') call deoplete#custom#buffer_option('auto_complete', v:false) endif " Denite Filter window key mappings imap jj (denite_filter_update) nmap (denite_filter_update) imap (denite_filter_update) nmap (denite_filter_update) imap (denite_filter_update) imap imap imap (denite_filter_update)ji imap (denite_filter_update)ki endfunction call denite#custom#filter('matcher_ignore_globs', 'ignore_globs', \ [ '.git/', '.ropeproject/', '__pycache__/', 'eggs/', '.tmp', '.cache', \ 'venv/', 'images/', '*.min.*', 'img/', 'fonts/']) " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/plugins/gina.vim ================================================ " :h gina " --- " Problems? https://github.com/lambdalisue/gina.vim/issues call gina#custom#command#alias('status', 'st') call gina#custom#command#option('st', '-s') call gina#custom#command#option('status', '-b') " call gina#custom#command#option('/\v(status|branch|ls|grep|changes)', '--opener', 'botright 10split') " call gina#custom#command#option('/\v(blame|diff|log)', '--opener', 'tabnew') call gina#custom#command#option('commit', '--opener', 'below vnew') call gina#custom#command#option('commit', '--verbose') let s:width_quarter = string(winwidth(0) / 4) let s:width_half = string(winwidth(0) / 2) call gina#custom#command#option('blame', '--width', s:width_quarter) let g:gina#command#blame#formatter#format = '%au: %su%= on %ti %ma%in' " Open in vertical split call gina#custom#command#option( \ '/\%(branch\|changes\|status\|grep\|log\|reflog\)', \ '--opener', 'vsplit' \) " Fixed medium width types call gina#custom#execute( \ '/\%(changes\|status\|ls\)', \ 'vertical resize ' . s:width_half . ' | setlocal winfixwidth' \) " Fixed small width special types call gina#custom#execute( \ '/\%(branch\)', \ 'vertical resize ' . s:width_quarter . ' | setlocal winfixwidth' \) " Alias 'p'/'dp' globally call gina#custom#action#alias('/.*', 'dp', 'diff:preview') call gina#custom#mapping#nmap('/.*', 'dp', ':call gina#action#call(''dp'')', {'noremap': 1, 'silent': 1}) " call gina#custom#action#alias('/\%(blame\|log\)', 'preview', 'botright show:commit:preview') call gina#custom#mapping#nmap('/.*', 'p', \ ':call gina#action#call(''preview'')', \ {'noremap': 1, 'silent': 1, 'nowait': 1}) " Echo chunk info with K call gina#custom#mapping#nmap('blame', 'K', '(gina-blame-echo)') " Blame mappings let g:gina#command#blame#use_default_mappings = 0 call gina#custom#mapping#nmap('blame', '', '(gina-blame-open)') call gina#custom#mapping#nmap('blame', '', '(gina-blame-back)') call gina#custom#mapping#nmap('blame', '', '(gina-blame-C-L)') ================================================ FILE: config/plugins/goyo.vim ================================================ " Goyo " ---- " s:goyo_enter() "{{{ " Disable visual candy in Goyo mode function! s:goyo_enter() if has('gui_running') " Gui fullscreen set fullscreen set background=light set linespace=7 elseif exists('$TMUX') " Hide tmux status silent !tmux set status off endif " Activate Limelight let s:stl = &l:statusline let &l:statusline = '' Limelight endfunction " }}} " s:goyo_leave() "{{{ " Enable visuals when leaving Goyo mode function! s:goyo_leave() if has('gui_running') " Gui exit fullscreen set nofullscreen set background=dark set linespace=0 elseif exists('$TMUX') " Show tmux status silent !tmux set status on endif " De-activate Limelight let &l:statusline = s:stl unlet s:stl Limelight! endfunction " }}} " Goyo Commands {{{ augroup user_plugin_goyo autocmd! autocmd! User GoyoEnter autocmd! User GoyoLeave autocmd User GoyoEnter nested call goyo_enter() autocmd User GoyoLeave nested call goyo_leave() augroup END " }}} " vim: set foldmethod=marker ts=2 sw=2 tw=80 noet : ================================================ FILE: config/plugins/iron.lua ================================================ local iron = require('iron') iron.core.set_config { preferred = { python = 'ipython' } } ================================================ FILE: config/plugins/lsp.vim ================================================ " vim-lsp " --- " Apply settings for languages that registered LSP function! s:on_lsp_buffer_enabled() abort if empty(globpath(&rtp, 'autoload/lsp.vim')) finish endif setlocal omnifunc=lsp#complete if exists('+tagfunc') setlocal tagfunc=lsp#tagfunc endif " Folds are really slow " setlocal foldmethod=expr " \ foldexpr=lsp#ui#vim#folding#foldexpr() " \ foldtext=lsp#ui#vim#folding#foldtext() " Prefer native help with vim files if &filetype != 'vim' nmap K (lsp-hover) endif nmap gr (lsp-references) nmap gi (lsp-peek-implementation) nmap gy (lsp-peek-type-definition) nmap (lsp-definition) nmap g (lsp-peek-definition) nmap gd (lsp-peek-declaration) nmap gY (lsp-type-hierarchy) nmap gA (lsp-code-action) nmap ,s (lsp-signature-help) nmap [d (lsp-previous-diagnostic) nmap ]d (lsp-next-diagnostic) nmap rn (lsp-rename) nmap F (lsp-document-format) vmap F (lsp-document-range-format) endfunction augroup lsp_user_plugin autocmd! autocmd User lsp_buffer_enabled call on_lsp_buffer_enabled() " autocmd CompleteDone * if pumvisible() == 0 | pclose | endif " autocmd VimResized * call fix_preview_max_width() " autocmd FileType markdown.lsp-hover " \ nnoremap K " \| nnoremap q :pclose augroup END ================================================ FILE: config/plugins/whichkey.vim ================================================ " which-key " --- augroup user_events autocmd! FileType which_key autocmd FileType which_key set laststatus=0 noshowmode noruler \| autocmd BufLeave set laststatus=2 showmode ruler augroup END let g:which_key_hspace = 3 call which_key#register('', "g:which_key_map") let g:which_key_map = { \ 'name': 'rafi vim', \ '-': 'swap window select', \ '?': 'open dictionary', \ 'a': 'open structure', \ 'b': 'find in structure', \ 'd': 'duplicate line', \ 'e': 'open diagnostics', \ 'f': 'filter in-place', \ 'G': 'distraction-free', \ 'h': 'show highlight', \ 'j': 'move line down', \ 'k': 'move line up', \ 'K': 'thesaurus', \ 'l': 'open side-menu', \ 'N': 'alternate backwards', \ 'n': 'alternate forwards', \ 'S': 'source vim line', \ 'V': 'comment wrap toggle', \ 'v': 'comment toggle', \ 'W': 'open wiki', \ 'w': 'save', \ 'Y': 'yank relative path', \ 'y': 'yank absolute path', \ } let g:which_key_map['c'] = { \ 'name': '+misc', \ 'd': 'change current window directory', \ 'n': 'change current word in a repeatable manner (forwards)', \ 'N': 'change current word in a repeatable manner (backwards)', \ 'p': 'duplicate paragraph', \ 'w': 'strip trailing whitespace', \ } let g:which_key_map['g'] = { \ 'name': '+find', \ } let g:which_key_map['i'] = { \ 'name': '+jump', \ } let g:which_key_map['m'] = { \ 'name': '+misc2', \ } let g:which_key_map['r'] = { \ 'name': '+iron', \ } let g:which_key_map['s'] = { \ 'name': '+session', \ 'l': ' load project session', \ 'e': ' save project session', \ } let g:which_key_map['t'] = { \ 'name': '+toggle', \ 'h': ' toggle search highlight', \ 'i': ' toggle indent', \ 'l': ' toggle hidden chars', \ 'n': ' toggle line numbers', \ 's': ' toggle spell', \ 'w': ' toggle wrap', \ } " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/plugins.yaml ================================================ --- # PLUGINS # === # See config/plugins/all.vim for plugin mappings and config/plugins/*.vim # Startup # ------- - repo: Shougo/dein.vim - repo: thinca/vim-localrc - repo: Shougo/context_filetype.vim - repo: jaawerth/nrun.vim - { repo: rafi/awesome-vim-colorschemes, merged: 0 } - repo: sgur/vim-editorconfig hook_add: |- let g:editorconfig_verbose = 1 let g:editorconfig_blacklist = { \ 'filetype': [ \ 'git.*', 'fugitive', 'help', 'defx', 'denite.*', 'startify', \ 'vista.*', 'tagbar', 'lsp-.*', 'clap_.*', 'any-jump', 'gina-.*', \ 'lsp-*' \ ], \ 'pattern': ['\.un~$'] \ } # Improve CursorHold performance # See: https://github.com/neovim/neovim/issues/12587 - { repo: antoinemadec/FixCursorHold.nvim, if: "has('nvim')" } - repo: christoomey/vim-tmux-navigator if: "! (has('win32') || has('win64'))" - repo: tpope/vim-sleuth hook_add: let g:sleuth_neighbor_limit = 5 # GUI only: - { repo: equalsraf/neovim-gui-shim, if: has('gui_running') } # Vim8 only: - { repo: roxma/nvim-yarp, if: "! has('nvim')", depends: vim-hug-neovim-rpc } - { repo: roxma/vim-hug-neovim-rpc, if: "! has('nvim')" } # Lazy Loading # ========================================== # Languages # --------- - { repo: hail2u/vim-css3-syntax, on_ft: css } - { repo: othree/csscomplete.vim, on_ft: css } - { repo: cakebaker/scss-syntax.vim, on_ft: [ scss, sass ]} - { repo: groenewege/vim-less, on_ft: less } - { repo: iloginow/vim-stylus, on_ft: stylus } # or wavded/vim-stylus ? - { repo: mustache/vim-mustache-handlebars, on_ft: [html, mustache, handlebars]} - { repo: digitaltoad/vim-pug, on_ft: [ pug, jade ]} - repo: othree/html5.vim on_ft: html hook_add: |- let g:html5_event_handler_attributes_complete = 0 let g:html5_rdfa_attributes_complete = 0 let g:html5_microdata_attributes_complete = 0 let g:html5_aria_attributes_complete = 0 # Markdown related - repo: plasticboy/vim-markdown on_ft: markdown hook_add: |- let g:vim_markdown_frontmatter = 1 let g:vim_markdown_strikethrough = 1 let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_conceal = 0 let g:vim_markdown_conceal_code_blocks = 0 let g:vim_markdown_new_list_item_indent = 0 let g:vim_markdown_toc_autofit = 0 let g:vim_markdown_edit_url_in = 'vsplit' let g:vim_markdown_fenced_languages = [ \ 'c++=cpp', \ 'viml=vim', \ 'bash=sh', \ 'ini=dosini', \ 'js=javascript', \ 'json=javascript', \ 'jsx=javascriptreact', \ 'tsx=typescriptreact', \ 'docker=Dockerfile', \ 'makefile=make', \ 'py=python' \ ] # Javascript related - repo: pangloss/vim-javascript on_ft: [ javascript, javascriptreact ] hook_add: let g:javascript_plugin_jsdoc = 1 - repo: HerringtonDarkholme/yats.vim on_ft: [ typescript, typescriptreact ] - repo: MaxMEllon/vim-jsx-pretty on_ft: [ javascript, javascriptreact, typescriptreact ] depends: vim-javascript hook_add: let g:vim_jsx_pretty_colorful_config = 1 - { repo: leafOfTree/vim-svelte-plugin, depends: yats.vim, on_ft: svelte } - { repo: heavenshell/vim-jsdoc, on_ft: [ javascript, javascriptreact ] } - { repo: jparise/vim-graphql, on_ft: [ javascript, javascriptreact ] } - { repo: moll/vim-node, on_ft: [ javascript, javascriptreact ] } - { repo: kchmck/vim-coffee-script, on_ft: [ coffee, litcoffee ] } - { repo: elzr/vim-json, on_ft: json } - { repo: posva/vim-vue, on_ft: vue } # pangloss/javascript vs. othree/yajs #- { repo: othree/yajs.vim, on_ft: [ javascript, javascriptreact ]} #- { repo: gavocanov/vim-js-indent, on_ft: [ javascript, javascriptreact ]} #- repo: mxw/vim-jsx # on_ft: [ javascript, javascriptreact ] # hook_add: let g:jsx_ext_required = 0 # Python related - { repo: vim-python/python-syntax, on_ft: python } - { repo: Vimjas/vim-python-pep8-indent, on_ft: python } - { repo: vim-scripts/python_match.vim, on_ft: python } # ? - { repo: raimon49/requirements.txt.vim, on_ft: requirements } # Misc - { repo: StanAngeloff/php.vim, on_ft: php } - { repo: tbastos/vim-lua, on_ft: lua } - { repo: vim-ruby/vim-ruby, on_ft: ruby } - { repo: keith/swift.vim, on_ft: swift } - { repo: rust-lang/rust.vim, on_ft: rust } - { repo: vim-jp/syntax-vim-ex, on_ft: vim } - { repo: chrisbra/csv.vim, on_ft: csv } - { repo: tpope/vim-git, on_ft: [ gitcommit, gitrebase, gitconfig ]} - { repo: ekalinin/Dockerfile.vim, on_ft: [ Dockerfile, docker-compose ]} - { repo: tmux-plugins/vim-tmux, on_ft: tmux } - { repo: MTDL9/vim-log-highlighting, on_ft: log } - { repo: cespare/vim-toml, on_ft: toml } - { repo: mboughaba/i3config.vim, on_ft: i3config } - { repo: dag/vim-fish, on_ft: fish } - { repo: jstrater/mpvim, on_ft: portfile } - { repo: robbles/logstash.vim, on_ft: logstash } - { repo: lifepillar/pgsql.vim, on_ft: pgsql } - { repo: chr4/nginx.vim, on_ft: nginx } - { repo: towolf/vim-helm, on_ft: helm } - { repo: udalov/kotlin-vim, on_ft: kotlin } - { repo: reasonml-editor/vim-reason-plus, on_ft: [ reason, merlin ] } - repo: pearofducks/ansible-vim on_ft: [ ansible, ansible_hosts, jinja2 ] hook_add: |- let g:ansible_extra_keywords_highlight = 1 let g:ansible_template_syntaxes = { \ '*.json.j2': 'json', \ '*.(ba)?sh.j2': 'sh', \ '*.ya?ml.j2': 'yaml', \ '*.xml.j2': 'xml', \ '*.conf.j2': 'conf', \ '*.ini.j2': 'ini' \ } - repo: hashivim/vim-terraform on_ft: terraform on_cmd: [ Terraform, TerraformFmt ] # ========================================== # Commands # -------- - repo: Shougo/defx.nvim on_cmd: Defx hook_source: source $VIM_PATH/config/plugins/defx.vim - { repo: kristijanhusak/defx-git, on_source: defx.nvim } - { repo: kristijanhusak/defx-icons, on_source: defx.nvim } - { repo: tyru/caw.vim, on_map: { nx: }} - { repo: lambdalisue/fin.vim, on_cmd: Fin } - { repo: mbbill/undotree, on_cmd: UndotreeToggle } - { repo: jreybert/vimagit, on_cmd: Magit } - { repo: tweekmonster/helpful.vim, on_cmd: HelpfulVersion } - { repo: kana/vim-altr, on_map: { n: }} - { repo: Shougo/vinarise.vim, on_cmd: Vinarise } - { repo: guns/xterm-color-table.vim, on_cmd: XtermColorTable } - { repo: cocopon/colorswatch.vim, rev: main, on_cmd: ColorSwatchGenerate } - { repo: dstein64/vim-startuptime, on_cmd: StartupTime } - { repo: lambdalisue/suda.vim, on_event: BufRead } - repo: liuchengxu/vim-which-key on_cmd: [ WhichKey, WhichKeyVisual ] hook_source: source $VIM_PATH/config/plugins/whichkey.vim - repo: lambdalisue/gina.vim on_cmd: Gina on_ft: [ gitcommit, gitrebase ] hook_source: source $VIM_PATH/config/plugins/gina.vim - repo: mhinz/vim-grepper on_map: { nx: } on_cmd: Grepper hook_add: |- let g:grepper = { \ 'tools': ['rg', 'git', 'fd'], \ 'fd': { \ 'grepprg': 'fd', \ 'grepformat': '%f', \ 'escape': '\+*^$()[]', \ }} - repo: brooth/far.vim on_cmd: [ Far, Farp, F ] hook_source: |- if executable('rg') let g:far#source = 'rg' elseif executable('ag') let g:far#source = 'ag' elseif executable('ack') let g:far#source = 'ack' endif - repo: pechorin/any-jump.vim on_cmd: [ AnyJump, AnyJumpVisual ] hook_add: |- let g:any_jump_disable_default_keybindings = 1 autocmd user_events FileType any-jump setlocal cursorline - repo: Vigemus/iron.nvim if: has('nvim') on_cmd: [ IronRepl, IronReplHere, IronFocus, IronSend, IronWatchCurrentFile ] on_map: { nv: } on_func: IronUnwatchFile hook_add: let g:iron_map_defaults = 0 | let g:iron_map_extended = 0 hook_source: luafile $VIM_PATH/config/plugins/iron.lua - repo: kana/vim-niceblock on_map: { x: } hook_add: let g:niceblock_no_default_key_mappings = 0 - repo: t9md/vim-choosewin on_map: { n: } hook_add: |- let g:choosewin_label = 'ADFGHJKLUIOPQWERT' let g:choosewin_label_padding = 5 - repo: wfxr/minimap.vim on_cmd: [ Minimap, MinimapToggle ] hook_source: |- let g:minimap_block_filetypes = ['fugitive', 'nerdtree', 'defx'] - repo: mzlogin/vim-markdown-toc on_cmd: [ GenTocGFM, GenTocRedcarpet, GenTocGitLab, UpdateToc ] hook_add: let g:vmt_auto_update_on_save = 0 - repo: reedes/vim-wordy on_cmd: [ Wordy, NoWordy, NextWordy ] # hook_add: let g:wordy_spell_dir = $DATA_PATH . '/wordy' - repo: liuchengxu/vista.vim # on_cmd: Vista hook_add: |- let g:vista#renderer#enable_icon = 1 let g:vista_echo_cursor_strategy = 'scroll' let g:vista_vimwiki_executive = 'markdown' let g:vista_executive_for = { \ 'vimwiki': 'markdown', \ 'pandoc': 'markdown', \ 'markdown': 'toc', \ 'go': 'coc', \ } - repo: junegunn/fzf merged: 0 on_cmd: FZF type__depth: 1 hook_source: |- let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'Todo', 'border': 'rounded' } } - repo: junegunn/fzf.vim depends: fzf merged: 0 on_cmd: [ Files, GitFiles, Buffers, Lines, Locate, Colors, Ag, Rg, Tags ] on_func: [ fzf#vim#with_preview, fzf#run, vista#finder#fzf#Run ] - repo: Ron89/thesaurus_query.vim on_cmd: - Thesaurus - ThesaurusQueryReplaceCurrentWord - ThesaurusQueryLookupCurrentWord hook_add: |- let g:tq_map_keys = 0 let g:tq_use_vim_autocomplete = 0 # ========================================== # Interface # --------- - { repo: itchyny/vim-gitbranch, on_event: FileType } - { repo: itchyny/vim-parenmatch, on_event: FileType } - { repo: romainl/vim-cool, on_event: [ CursorMoved, InsertEnter ]} - { repo: haya14busa/vim-asterisk, on_map: { nv: }} - { repo: rhysd/accelerated-jk, on_map: { n: }, if: $SUDO_USER == '' } - { repo: haya14busa/vim-edgemotion, on_map: { nv: }} - { repo: t9md/vim-quickhl, on_map: { nv: }} - { repo: rafi/vim-sidemenu, on_map: { nv: }} - repo: machakann/vim-highlightedyank if: "! has('nvim-0.5')" on_event: TextYankPost hook_source: let g:highlightedyank_highlight_duration = 200 - repo: romainl/vim-qf on_ft: qf on_event: QuickFixCmdPost on_map: { n: } hook_add: |- let g:qf_bufname_or_text = 1 let g:qf_auto_open_quickfix = 0 let g:qf_auto_open_loclist = 0 let g:qf_auto_resize = 0 autocmd User preview_open_pre \ let g:vim_markdown_no_default_key_mappings = 1 \| let g:vim_markdown_emphasis_multiline = 0 autocmd User preview_open_post \ unlet! g:vim_markdown_no_default_key_mappings \| unlet! g:vim_markdown_emphasis_multiline - repo: itchyny/vim-cursorword on_event: FileType hook_add: let g:cursorword = 0 hook_source: |- augroup user_plugin_cursorword autocmd! autocmd FileType json,yaml,markdown,nginx,dosini,conf \ let b:cursorword = 1 autocmd WinEnter * if &diff || &pvw | let b:cursorword = 0 | endif autocmd InsertEnter * if get(b:, 'cursorword', 0) == 1 \| let b:cursorword = 0 \| endif autocmd InsertLeave * if get(b:, 'cursorword', 1) == 0 \| let b:cursorword = 1 \| endif augroup END - repo: airblade/vim-gitgutter on_event: FileType hook_add: |- let g:gitgutter_map_keys = 0 let g:gitgutter_sign_added = '▎' let g:gitgutter_sign_modified = '▎' let g:gitgutter_sign_removed = '▍' let g:gitgutter_sign_removed_first_line = '▘' let g:gitgutter_sign_removed_above_and_below = '_¯' let g:gitgutter_sign_modified_removed = '▍' let g:gitgutter_preview_win_floating = 1 let g:gitgutter_sign_allow_clobber = 0 let g:gitgutter_sign_priority = 0 let g:gitgutter_override_sign_column_highlight = 0 - repo: kshenoy/vim-signature depends: vim-gitgutter on_event: FileType hook_add: |- let g:SignatureForceRemoveGlobal = 0 let g:SignatureUnconditionallyRecycleMarks = 1 let g:SignatureErrorIfNoAvailableMarks = 0 let g:SignaturePurgeConfirmation = 0 let g:SignatureMarkTextHLDynamic = 1 let g:SignatureMarkerTextHLDynamic = 1 let g:SignatureIncludeMarkers = repeat('⚐', 10) autocmd user_events User GitGutter call signature#sign#Refresh() - repo: nathanaelkane/vim-indent-guides if: 0 on_event: FileType hook_source: |- let g:indent_guides_enable_on_vim_startup = 0 let g:indent_guides_default_mapping = 0 let g:indent_guides_tab_guides = 0 let g:indent_guides_color_change_percent = 3 let g:indent_guides_guide_size = 1 let g:indent_guides_exclude_filetypes = [ \ 'help', 'man', 'fern', 'defx', 'denite', 'denite-filter', 'startify', \ 'vista', 'vista_kind', 'tagbar', 'lsp-hover', 'clap_input', 'fzf', \ 'any-jump', 'gina-status', 'gina-commit', 'gina-log', 'minimap', \ 'quickpick-filter', 'lsp-quickpick-filter' \ ] autocmd user_events FileType * ++once IndentGuidesEnable - repo: rhysd/committia.vim on_event: BufReadPost hook_source: let g:committia_min_window_width = 70 - repo: junegunn/goyo.vim depends: limelight.vim on_cmd: Goyo hook_source: source $VIM_PATH/config/plugins/goyo.vim - repo: junegunn/limelight.vim on_cmd: Limelight - repo: itchyny/calendar.vim on_cmd: Calendar hook_source: |- let g:calendar_google_calendar = 1 let g:calendar_google_task = 1 - repo: deris/vim-shot-f on_map: { nxo: } hook_add: let g:shot_f_no_default_key_mappings = 1 - repo: vimwiki/vimwiki on_map: { n: } on_cmd: [ VimwikiIndex, VimwikiUISelect ] hook_add: |- let g:vimwiki_use_calendar = 1 let g:vimwiki_hl_headers = 1 let g:vimwiki_hl_cb_checked = 1 let g:vimwiki_autowriteall = 0 hook_source: |- let g:vimwiki_list = [ \ { 'diary_header': 'Diary', \ 'diary_link_fmt': '%Y-%m/%d', \ 'auto_toc': 1, \ 'path': '~/docs/wiki/', \ 'syntax': 'markdown', \ 'ext': '.md' }, \ { 'path': '~/docs/books/', \ 'syntax': 'markdown', \ 'ext': '.md' } \ ] - repo: norcalli/nvim-colorizer.lua if: has('nvim-0.4') on_event: FileType hook_source: luafile $VIM_PATH/config/plugins/colorizer.lua # ========================================== # Completion and code analysis # ---------- # - repo: prabirshrestha/async.vim # only autoload functions, lazy by nature # # - repo: prabirshrestha/asyncomplete.vim # on_source: asyncomplete-lsp.vim # hook_add: let g:asyncomplete_auto_completeopt = 0 # hook_source: source $VIM_PATH/config/plugins/asyncomplete.vim # # - repo: prabirshrestha/asyncomplete-lsp.vim # on_source: vim-lsp # # - repo: prabirshrestha/vim-lsp # on_source: vim-lsp-settings # hook_source: source $VIM_PATH/config/plugins/lsp.vim # hook_add: |- # let g:lsp_auto_enable = argc() > 0 # let g:lsp_ignorecase = 1 # let g:lsp_signs_enabled = 1 # let g:lsp_async_completion = 1 # let g:lsp_fold_enabled = 0 # let g:lsp_text_edit_enabled = 1 # let g:lsp_peek_alignment = 'top' # let g:lsp_diagnostics_enabled = 1 # let g:lsp_diagnostics_echo_cursor = 1 # let g:lsp_diagnostics_echo_delay = 400 # let g:lsp_diagnostics_virtual_text_enabled = 0 # let g:lsp_diagnostics_highlights_delay = 400 # let g:lsp_diagnostics_signs_error = {'text': '✖'} # let g:lsp_diagnostics_signs_warning = {'text': '⬪'} # let g:lsp_diagnostics_signs_hint = {'text': '▪'} # let g:lsp_diagnostics_signs_information = {'text': '▫'} # # - repo: mattn/vim-lsp-settings # on_event: [ BufReadPre, VimEnter ] # merged: 0 # hook_post_source: |- # if ! g:lsp_auto_enable # call lsp#enable() # endif # hook_add: |- # let g:lsp_settings = { # \ 'yaml-language-server': { # \ 'allowlist': ['yaml', 'yaml.ansible'], # \ } # \ } # # - repo: prabirshrestha/asyncomplete-necovim.vim # on_source: asyncomplete.vim # hook_source: |- # autocmd User asyncomplete_setup call asyncomplete#register_source( # \ asyncomplete#sources#necovim#get_source_options({ # \ 'name': 'necovim', # \ 'allowlist': ['vim'], # \ 'completor': function('asyncomplete#sources#necovim#completor'), # \ })) # # - repo: Shougo/neco-vim # on_source: asyncomplete-necovim.vim # # - repo: prabirshrestha/asyncomplete-buffer.vim # on_source: asyncomplete.vim # hook_source: |- # autocmd User asyncomplete_setup call asyncomplete#register_source( # \ asyncomplete#sources#buffer#get_source_options({ # \ 'name': 'buffer', # \ 'allowlist': ['*'], # \ 'blocklist': ['go', 'denite', 'denite-filter', 'clap_input', # \ 'quickpick-filter', 'lsp-quickpick-filter'], # \ 'completor': function('asyncomplete#sources#buffer#completor'), # \ 'config': { # \ 'max_buffer_size': 4000000, # \ }, # \ })) # # - repo: prabirshrestha/asyncomplete-tags.vim # if: executable('ctags') # on_source: asyncomplete.vim # hook_source: |- # autocmd User asyncomplete_setup call asyncomplete#register_source( # \ asyncomplete#sources#tags#get_source_options({ # \ 'name': 'tags', # \ 'allowlist': ['*'], # \ 'blocklist': ['go', 'python', 'vim', 'denite', 'denite-filter', # \ 'clap_input', 'quickpick-filter', 'lsp-quickpick-filter'], # \ 'completor': function('asyncomplete#sources#tags#completor'), # \ 'config': { 'max_file_size': 5000000 }, # \ })) # # - repo: prabirshrestha/asyncomplete-file.vim # on_source: asyncomplete.vim # hook_source: |- # autocmd User asyncomplete_setup call asyncomplete#register_source( # \ asyncomplete#sources#file#get_source_options({ # \ 'name': 'file', # \ 'priority': 10, # \ 'allowlist': ['*'], # \ 'blocklist': ['denite', 'denite-filter', 'clap_input', # \ 'quickpick-filter', 'lsp-quickpick-filter'], # \ 'completor': function('asyncomplete#sources#file#completor') # \ })) # # - repo: wellle/tmux-complete.vim # if: "! (has('win32') || has('win64'))" # on_source: asyncomplete.vim # hook_add: |- # let g:tmuxcomplete#trigger = '' # let g:tmuxcomplete#asyncomplete_source_options = { # \ 'name': 'tmux', # \ 'priority': 0, # \ 'allowlist': ['*'], # \ 'blocklist': ['denite', 'denite-filter', 'clap_input', # \ 'quickpick-filter', 'lsp-quickpick-filter'], # \ 'config': { # \ 'splitmode': 'words', # \ 'filter_prefix': 1, # \ 'show_incomplete': 1, # \ 'sort_candidates': 0, # \ 'scrollback': 0, # \ 'truncate': 0 # \ } # \ } # # - repo: prabirshrestha/asyncomplete-ultisnips.vim # if: has('python3') # on_source: asyncomplete.vim # hook_source: |- # autocmd User asyncomplete_setup call asyncomplete#register_source( # \ asyncomplete#sources#ultisnips#get_source_options({ # \ 'name': 'snip', # \ 'priority': 0, # \ 'allowlist': ['*'], # \ 'blocklist': ['denite', 'denite-filter', 'clap_input', # \ 'quickpick-filter', 'lsp-quickpick-filter'], # \ 'completor': function('asyncomplete#sources#ultisnips#completor'), # \ })) # # - repo: SirVer/ultisnips # if: has('python3') # on_event: FileType # hook_add: |- # let g:UltiSnipsExpandTrigger = '' # let g:UltiSnipsListSnippets = '' # let g:UltiSnipsJumpForwardTrigger = '' # let g:UltiSnipsJumpBackwardTrigger = '' - repo: honza/vim-snippets # depends: ultisnips on_event: FileType if: has('python3') merged: 0 - repo: mattn/emmet-vim on_event: InsertEnter on_ft: - css - html - vue - svelte - javascript - javascriptreact - typescript - typescriptreact hook_source: |- let g:user_emmet_complete_tag = 0 let g:user_emmet_install_global = 0 let g:user_emmet_install_command = 0 let g:user_emmet_mode = 'i' - repo: ludovicchabant/vim-gutentags if: executable('ctags') on_event: [ BufReadPost, BufWritePost ] hook_add: |- let g:gutentags_cache_dir = $DATA_PATH . '/tags' let g:gutentags_generate_on_write = 0 let g:gutentags_generate_on_missing = 0 let g:gutentags_generate_on_new = 0 let g:gutentags_exclude_project_root = [ '/usr/local' ] let g:gutentags_exclude_filetypes = [ 'defx', 'denite', 'vista', 'magit' ] let g:gutentags_ctags_exclude = [ \ '.idea', '.cache', '.tox', '.bundle', 'build', 'dist' ] - repo: Raimondi/delimitMate on_event: FileType hook_source: |- let g:delimitMate_expand_cr = 1 let g:delimitMate_expand_space = 1 let g:delimitMate_smart_quotes = 1 let g:delimitMate_expand_inside_quotes = 0 let g:delimitMate_excluded_ft = 'mail,txt,denite-filter,clap_input' augroup user_plugin_delimitMate au! au FileType python let b:delimitMate_nesting_quotes = ['"', "'"] au FileType markdown let b:delimitMate_nesting_quotes = ["`"] au FileType tex let b:delimitMate_quotes = "" au FileType tex let b:delimitMate_matchpairs = "(:),[:],{:},`:'" augroup END # ========================================== # Denite # ------ - repo: Shougo/denite.nvim on_cmd: Denite trusted: 1 hook_source: source $VIM_PATH/config/plugins/denite.vim - repo: Shougo/neomru.vim on_source: denite.nvim hook_add: |- let g:neomru#directory_mru_path = $DATA_PATH . '/mru/dir' let g:neomru#file_mru_path = $DATA_PATH . '/mru/file' let g:unite_source_file_mru_limit = 5000 - { repo: Shougo/neoyank.vim, on_source: denite.nvim, on_event: TextYankPost } - { repo: Shougo/junkfile.vim, on_source: denite.nvim } - { repo: chemzqm/unite-location, on_source: denite.nvim } - { repo: rafi/vim-denite-session, on_source: denite.nvim } - repo: rafi/vim-denite-z on_source: denite.nvim hook_source: |- command! -nargs=+ -complete=file Z call denite#start( \ [{'name': 'z', 'args': [], {'immediately': 1}}]) - repo: liuchengxu/vim-clap merged: 0 on_cmd: Clap hook_add: |- let g:clap_cache_directory = $DATA_PATH . '/clap' let g:clap_disable_run_rooter = v:true let g:clap_theme = 'atom_dark' let g:clap_layout = { 'relative': 'editor' } let g:clap_enable_icon = 1 let g:clap_search_box_border_style = 'curve' let g:clap_provider_grep_enable_icon = 1 let g:clap_prompt_format = '%spinner%%forerunner_status% %provider_id%: ' let g:clap_current_selection_sign = { \ 'text': '→', \ 'texthl': 'ClapCurrentSelectionSign', \ 'linehl': 'ClapCurrentSelection' } let g:clap_selected_sign = { \ 'text': '* ', \ 'texthl': 'ClapSelectedSign', \ 'linehl': 'ClapSelected' } highlight! link ClapMatches Function highlight! link ClapNoMatchesFound WarningMsg # ========================================== # Operators # --------- - repo: kana/vim-operator-user # only autoload functions, lazy by nature - { repo: kana/vim-operator-replace, on_map: { vnx: }} - repo: machakann/vim-sandwich on_map: { vonx: (operator-sandwich- } hook_add: |- let g:sandwich_no_default_key_mappings = 1 let g:operator_sandwich_no_default_key_mappings = 1 let g:textobj_sandwich_no_default_key_mappings = 1 # ========================================== # Text objects # ------------ - repo: kana/vim-textobj-user # only autoload functions, lazy by nature - { repo: terryma/vim-expand-region, on_map: { x: }} - { repo: AndrewRadev/sideways.vim, on_map: { onx: Sideways }} - { repo: AndrewRadev/splitjoin.vim, on_map: { n: Splitjoin }} - { repo: AndrewRadev/linediff.vim, on_cmd: Linediff } - repo: AndrewRadev/dsf.vim on_map: { n: Dsf } hook_add: let g:dsf_no_mappings = 1 - repo: kana/vim-textobj-function on_map: { ox: } hook_add: let g:textobj_function_no_default_key_mappings = 1 # vim: set ts=2 sw=2 tw=80 et : ================================================ FILE: config/statusline.vim ================================================ " Statusline " --- let s:stl = " %7*%{&paste ? '=' : ''}%*" " Paste symbol let s:stl .= "%4*%{&readonly ? '' : '#'}%*" " Modified symbol let s:stl .= "%6*%{badge#mode('🔒', '🔎')}" " Read-only symbol let s:stl .= '%*%n' " Buffer number let s:stl .= "%6*%{badge#modified('+')}%0*" " Write symbol let s:stl .= ' %1*%{badge#filename()}%* ' " Filename let s:stl .= '%<' " Start truncating here let s:stl .= '%( %{badge#branch()} %)' " Git branch name let s:stl .= '%4*%(%{badge#syntax()} %)%*' " Syntax lint let s:stl .= "%4*%(%{badge#trails('␣%s')} %)%*" " Whitespace let s:stl .= '%3*%(%{badge#indexing()} %)%*' " Indexing indicator let s:stl .= '%3*%(%{badge#gitstatus()} %)%*' " Git status let s:stl .= '%=' " Align to right let s:stl .= '%{badge#format()} %4*%*' " File format let s:stl .= '%( %{&fenc} %)' " File encoding let s:stl .= '%4*%*%( %{&ft} %)' " File type let s:stl .= '%3*%2* %l/%2c%4p%% ' " Line and column " Non-active Statusline let s:stl_nc = " %{badge#mode('🔒', 'Z')}%n" " Read-only symbol let s:stl_nc .= "%6*%{badge#modified('+')}%*" " Unsaved changes symbol let s:stl_nc .= ' %{badge#filename()}' " Relative supername let s:stl_nc .= '%=' " Align to right let s:stl_nc .= '%{&ft} ' " File type " Status-line blacklist let s:statusline_filetypes_ignore = get(g:, 'statusline_filetypes_ignore', \ 'defx\|denite\|vista\|undotree\|diff\|sidemenu\|qf') let s:statusline_filetypes = get(g:, 'statusline_filetypes', { \ 'defx': ['%{fnamemodify(getcwd(), ":t")}%=%l/%L'], \ 'magit': [ \ '%y %{badge#gitstatus()}%<%=%{fnamemodify(badge#filename(), ":~")}%=%l/%L', \ '%y %{badge#gitstatus()}%= %l/%L'], \ 'minimap': [' '], \ 'denite-filter': ['%#Normal#'], \ }) " s:set_state replaces current statusline function! s:set_state(filetype, index, default) " Skip statusline render during session loading if &previewwindow || exists('g:SessionLoad') "|| empty(a:filetype) return endif if has_key(s:statusline_filetypes, a:filetype) let l:states = s:statusline_filetypes[a:filetype] let l:want = get(l:states, a:index, l:states[0]) if &l:statusline != l:want let &l:statusline = l:want endif elseif a:filetype !~# s:statusline_filetypes_ignore if &l:statusline != a:default let &l:statusline = a:default endif endif endfunction " Bind to Vim events augroup user_statusline autocmd! " Set active/inactive statusline templates autocmd VimEnter,ColorScheme, * let &l:statusline = s:stl autocmd FileType,WinEnter,BufWinEnter * call s:set_state(&filetype, 0, s:stl) autocmd WinLeave * call s:set_state(&filetype, 1, s:stl_nc) " Redraw on Vim events autocmd FileChangedShellPost,BufFilePost,BufNewFile,BufWritePost * redrawstatus " Redraw on Plugins custom events autocmd User ALELintPost,ALEFixPost redrawstatus autocmd User NeomakeJobFinished redrawstatus autocmd User GutentagsUpdating redrawstatus autocmd User CocStatusChange,CocGitStatusChange redrawstatus autocmd User CocDiagnosticChange redrawstatus " autocmd User lsp_diagnostics_updated redrawstatus " if exists('##LspDiagnosticsChanged') " autocmd LspDiagnosticsChanged * redrawstatus " endif augroup END " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/tabline.vim ================================================ " Tabline " --- " Configuration let g:badge_numeric_charset = \ get(g:, 'badge_numeric_charset', \ ['⁰','¹','²','³','⁴','⁵','⁶','⁷','⁸','⁹']) "\ ['₀','₁','₂','₃','₄','₅','₆','₇','₈','₉']) " Limit display of directories in path let g:badge_tab_filename_max_dirs = \ get(g:, 'badge_tab_filename_max_dirs', 1) " Limit display of characters in each directory in path let g:badge_tab_dir_max_chars = \ get(g:, 'badge_tab_dir_max_chars', 5) " Display entire tabline function! Tabline() if exists('g:SessionLoad') " Skip tabline render during session loading return '' endif " Active project name let l:tabline = \ '%#TabLineAlt# %{" " . badge#project()} %#TabLineAltShade#' " Iterate through all tabs and collect labels let l:current = tabpagenr() for i in range(tabpagenr('$')) let l:nr = i + 1 let l:bufnrlist = tabpagebuflist(l:nr) let l:bufnr = l:bufnrlist[tabpagewinnr(l:nr) - 1] " Left-side of single tab if l:nr == l:current let l:tabline .= '%#TabLineFill#%#TabLineSel# ' else let l:tabline .= '%#TabLine# ' endif " Get file-name with custom cutoff settings let l:tabline .= '%' . l:nr . 'T%{badge#filename(' \ . l:bufnr . ', ' . g:badge_tab_filename_max_dirs . ', ' \ . g:badge_tab_dir_max_chars . ', "tabname")}' " Append window count, for tabs let l:win_count = tabpagewinnr(l:nr, '$') for l:bufnr in l:bufnrlist let l:bufname = bufname(l:bufnr) if empty(l:bufname) || l:bufname =~ \ '^\(denite\|defx\|fugitive\|magit\|fern\|hover\|clap_\|Telescope\)' let l:win_count -= 1 endif endfor if l:win_count > 1 let l:tabline .= s:numtr(l:win_count, g:badge_numeric_charset) endif " Add '+' if one of the buffers in the tab page is modified for l:bufnr in l:bufnrlist if getbufvar(l:bufnr, "&modified") let l:tabline .= (l:nr == l:current ? '%#Number#' : '%6*') . '+%*' break endif endfor " Right-side of single tab if l:nr == l:current let l:tabline .= '%#TabLineSel# %#TabLineFill#' else let l:tabline .= '%#TabLine# ' endif endfor " Empty elastic space and session indicator let l:tabline .= \ '%#TabLineFill#%T%=%#TabLine#' . \ '%{badge#session("' . fnamemodify(v:this_session, ':t:r') . '  ")}' return l:tabline endfunction function! s:numtr(number, charset) abort let l:result = '' for l:char in split(a:number, '\zs') let l:result .= a:charset[l:char] endfor return l:result endfunction let &tabline='%!Tabline()' " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/terminal.vim ================================================ " Vim Only Terminal Tweaks: Colors, cursor shape, and tmux " --- " Paste " Credits: https://github.com/Shougo/shougo-s-github " --- " let &t_ti .= "\e[?2004h" " let &t_te .= "\e[?2004l" " let &pastetoggle = "\e[201~" " " function! s:XTermPasteBegin(ret) abort " setlocal paste " return a:ret " endfunction " " noremap [200~ XTermPasteBegin('0i') " inoremap [200~ XTermPasteBegin('') " cnoremap [200~ " cnoremap [201~ " Mouse settings " --- if has('mouse') if has('mouse_sgr') set ttymouse=sgr else set ttymouse=xterm2 endif endif " Disable modifyOtherKeys " See: https://github.com/vim/vim/issues/5200 let &t_TI = "" let &t_TE = "" " Cursor-shape " Credits: https://github.com/wincent/terminus " --- " Detect terminal let s:tmux = exists('$TMUX') let s:iterm = exists('$ITERM_PROFILE') || exists('$ITERM_SESSION_ID') let s:iterm2 = s:iterm && exists('$TERM_PROGRAM_VERSION') && \ match($TERM_PROGRAM_VERSION, '\v^[2-9]\.') == 0 let s:konsole = exists('$KONSOLE_DBUS_SESSION') || \ exists('$KONSOLE_PROFILE_NAME') " 1 or 0 -> blinking block " 2 -> solid block " 3 -> blinking underscore " 4 -> solid underscore " Recent versions of xterm (282 or above) also support " 5 -> blinking vertical bar " 6 -> solid vertical bar let s:normal_shape = 0 let s:insert_shape = 5 let s:replace_shape = 3 if s:iterm2 let s:start_insert = "\]1337;CursorShape=" . s:insert_shape . "\x7" let s:start_replace = "\]1337;CursorShape=" . s:replace_shape . "\x7" let s:end_insert = "\]1337;CursorShape=" . s:normal_shape . "\x7" elseif s:iterm || s:konsole let s:start_insert = "\]50;CursorShape=" . s:insert_shape . "\x7" let s:start_replace = "\]50;CursorShape=" . s:replace_shape . "\x7" let s:end_insert = "\]50;CursorShape=" . s:normal_shape . "\x7" else let s:cursor_shape_to_vte_shape = {1: 6, 2: 4, 0: 2, 5: 6, 3: 4} let s:insert_shape = s:cursor_shape_to_vte_shape[s:insert_shape] let s:replace_shape = s:cursor_shape_to_vte_shape[s:replace_shape] let s:normal_shape = s:cursor_shape_to_vte_shape[s:normal_shape] let s:start_insert = "\[" . s:insert_shape . ' q' let s:start_replace = "\[" . s:replace_shape . ' q' let s:end_insert = "\[" . s:normal_shape . ' q' endif function! s:tmux_wrap(string) if strlen(a:string) == 0 | return '' | end let l:tmux_begin = "\Ptmux;" let l:tmux_end = "\\\" let l:parsed = substitute(a:string, "\", "\\", 'g') return l:tmux_begin.l:parsed.l:tmux_end endfunction if s:tmux let s:start_insert = s:tmux_wrap(s:start_insert) let s:start_replace = s:tmux_wrap(s:start_replace) let s:end_insert = s:tmux_wrap(s:end_insert) endif let &t_SI = s:start_insert if v:version > 704 || v:version == 704 && has('patch687') let &t_SR = s:start_replace end let &t_EI = s:end_insert " Tmux specific settings " --- if s:tmux set ttyfast " Assigns some xterm(1)-style keys to escape sequences passed by tmux " when 'xterm-keys' is set to 'on'. Inspired by an example given by " Chris Johnsen at https://stackoverflow.com/a/15471820 " Credits: Mark Oteiza " Documentation: help:xterm-modifier-keys man:tmux(1) execute "set =\e[1;*A" execute "set =\e[1;*B" execute "set =\e[1;*C" execute "set =\e[1;*D" execute "set =\e[1;*H" execute "set =\e[1;*F" execute "set =\e[2;*~" execute "set =\e[3;*~" execute "set =\e[5;*~" execute "set =\e[6;*~" execute "set =\e[1;*P" execute "set =\e[1;*Q" execute "set =\e[1;*R" execute "set =\e[1;*S" execute "set =\e[15;*~" execute "set =\e[17;*~" execute "set =\e[18;*~" execute "set =\e[19;*~" execute "set =\e[20;*~" execute "set =\e[21;*~" execute "set =\e[23;*~" execute "set =\e[24;*~" endif " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/theme.vim ================================================ " Theme " --- " " Autoloads theme according to user selected colorschemes function! s:theme_init() " Load cached colorscheme or hybrid by default let l:default = 'hybrid' let l:cache = s:theme_cache_file() if ! exists('g:colors_name') set background=dark let l:scheme = filereadable(l:cache) ? readfile(l:cache)[0] : l:default silent! execute 'colorscheme' l:scheme endif endfunction function! s:theme_autoload() if exists('g:colors_name') let theme_path = $VIM_PATH . '/themes/' . g:colors_name . '.vim' if filereadable(theme_path) execute 'source' fnameescape(theme_path) endif " Persist theme call writefile([g:colors_name], s:theme_cache_file()) endif endfunction function! s:theme_cache_file() return $DATA_PATH . '/theme.txt' endfunction function! s:theme_cached_scheme(default) let l:cache_file = s:theme_cache_file() return filereadable(l:cache_file) ? readfile(l:cache_file)[0] : a:default endfunction function! s:theme_cleanup() if ! exists('g:colors_name') return endif highlight clear endfunction augroup user_theme autocmd! autocmd ColorScheme * call s:theme_autoload() if has('patch-8.0.1781') || has('nvim-0.3.2') autocmd ColorSchemePre * call s:theme_cleanup() endif augroup END call s:theme_init() " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: config/vimrc ================================================ " https://github.com/rafi/vim-config " Created By: Rafael Bodill " Runtime and Plugins " === if &compatible " vint: -ProhibitSetNoCompatible set nocompatible " vint: +ProhibitSetNoCompatible endif " Set main configuration directory as parent directory let $VIM_PATH = fnamemodify(resolve(expand(':p')), ':h:h') function! s:source_file(path, ...) " Source user configuration files with set/global sensitivity let use_global = get(a:000, 0, ! has('vim_starting')) let abspath = resolve($VIM_PATH . '/' . a:path) if ! use_global execute 'source' fnameescape(abspath) return endif let tempfile = tempname() let content = map(readfile(abspath), \ "substitute(v:val, '^\\W*\\zsset\\ze\\W', 'setglobal', '')") try call writefile(content, tempfile) execute printf('source %s', fnameescape(tempfile)) finally if filereadable(tempfile) call delete(tempfile) endif endtry endfunction " Initialize startup settings if has('vim_starting') " Use spacebar as leader and ; as secondary-leader " Required before loading plugins! " let g:mapleader="\" let g:mapleader="," let g:maplocalleader=';' " Release keymappings prefixes, evict entirely for use of plug-ins. nnoremap xnoremap nnoremap , xnoremap , nnoremap ; xnoremap ; " Vim only, Linux terminal settings if ! has('nvim') && ! has('gui_running') && ! has('win32') && ! has('win64') call s:source_file('config/terminal.vim') endif endif " Load user scripts with confidential information " or pre-settings like g:elite_mode if filereadable($VIM_PATH . '/.vault.vim') call s:source_file('.vault.vim') endif " Initialize plugin-manager and load main config files call s:source_file('config/init.vim') call s:source_file('config/plugins/all.vim') " Initialize all my configurations call s:source_file('config/general.vim') call s:source_file('config/filetype.vim') call s:source_file('config/mappings.vim') " call s:source_file('config/theme.vim') colorscheme hybrid_reverse " change to your favorite theme " Load user custom local settings if filereadable($VIM_PATH . '/config/local.vim') call s:source_file('config/local.vim') endif if get(g:, 'statusline_plugin_enable', 1) call s:source_file('config/statusline.vim') endif if get(g:, 'tabline_plugin_enable', 1) call s:source_file('config/tabline.vim') endif set secure " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: filetype.vim ================================================ " File-type Detection " === if exists('did_load_filetypes') finish endif augroup filetypedetect "{{{ autocmd BufNewFile,BufRead */.config/git/users/* setfiletype gitconfig autocmd BufNewFile,BufRead */playbooks/*.{yml,yaml} setfiletype yaml.ansible autocmd BufNewFile,BufRead */inventory/* setfiletype ansible_hosts " autocmd BufNewFile,BufRead */templates/*.{yaml,tpl} setfiletype yaml.gotexttmpl autocmd BufNewFile,BufRead *.hcl setfiletype terraform autocmd BufNewFile,BufRead yarn.lock setfiletype yaml autocmd BufNewFile,BufRead */.kube/config setfiletype yaml autocmd BufNewFile,BufRead *.postman_collection setfiletype json autocmd BufNewFile,BufRead .tern-{project,port} setfiletype json autocmd BufNewFile,BufRead *.js.map setfiletype json autocmd BufNewFile,BufRead .jsbeautifyrc setfiletype json autocmd BufNewFile,BufRead .eslintrc setfiletype json autocmd BufNewFile,BufRead .jscsrc setfiletype json autocmd BufNewFile,BufRead .babelrc setfiletype json autocmd BufNewFile,BufRead .watchmanconfig setfiletype json autocmd BufNewFile,BufRead .buckconfig setfiletype toml autocmd BufNewFile,BufRead .flowconfig setfiletype ini autocmd BufNewFile,BufRead Jenkinsfile* setfiletype groovy autocmd BufNewFile,BufRead Tmuxfile,tmux/config setfiletype tmux autocmd BufNewFile,BufRead Brewfile setfiletype ruby autocmd BufNewFile,BufRead *.recipe setfiletype python autocmd BufNewFile,BufRead *.jce setfiletype jce augroup END " }}} " vim: set foldmethod=marker ts=2 sw=2 tw=80 noet : ================================================ FILE: init.vim ================================================ execute 'source' fnamemodify(expand(''), ':h').'/config/vimrc' ================================================ FILE: plugin/actionmenu.vim ================================================ " actionmenu " --- " Context-aware menu at your cursor " Forked from: https://github.com/kizza/actionmenu.nvim if exists('g:loaded_actionmenu') || ! has('nvim') finish endif let g:loaded_actionmenu = 1 command! -nargs=0 ActionMenu call s:actionmenu() function! s:actionmenu() let l:cword = expand('') call actionmenu#open(s:build_menu(l:cword), function('s:apply_action')) endfunction function! s:apply_action(selected) if ! empty(get(a:selected, 'user_data')) execute a:selected['user_data'] endif endfunction function! s:build_menu(cword) let l:items = [] let l:filetype = &filetype if empty(a:cword) " Blank operations let l:items = extend(l:items, [ \ { 'word': 'Select all', 'user_data': 'normal! ggVG' }, \ { 'word': '-------' }, \ ]) else if l:filetype ==# 'python' || l:filetype ==# 'go' let l:items = extend(l:items, [ \ { 'word': 'Declaration', 'user_data': 'LspDeclaration' }, \ { 'word': 'Definition', 'user_data': 'LspDefinition' }, \ { 'word': 'References…', 'user_data': 'LspReferences' }, \ { 'word': 'Implementation', 'user_data': 'LspImplementation' }, \ { 'word': 'TypeDefinition', 'user_data': 'LspTypeDefinition' }, \ { 'word': 'TypeHierarchy', 'user_data': 'LspTypeHierarchy' }, \ { 'word': '--------' }, \ ]) endif " Word operations let l:items = extend(l:items, [ \ { 'word': 'Find symbol…', 'user_data': 'DeniteCursorWord tag:include -no-start-filter' }, \ { 'word': 'Paste from…', 'user_data': 'Denite neoyank -default-action=replace -no-start-filter' }, \ { 'word': 'Grep…', 'user_data': 'DeniteCursorWord grep -no-start-filter' }, \ { 'word': 'Jump…', 'user_data': 'AnyJump' }, \ { 'word': '-------' }, \ ]) endif " File operations let l:items = extend(l:items, [ \ { 'word': 'Diagnostics', 'user_data': 'LspDocumentDiagnostics' }, \ { 'word': 'Bookmark', 'user_data': 'normal mm' }, \ { 'word': 'Git diff', 'user_data': 'Gina compare' }, \ { 'word': 'Unsaved diff', 'user_data': 'DiffOrig' }, \ { 'word': 'Open in browser', 'user_data': 'Gina browse' }, \ ]) return l:items endfunction " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: plugin/devhelp.vim ================================================ " Open Dash or Zeal on words under cursor " --- " " Behaviors: " - Map `gK` for selected filetypes if exists('g:loaded_devhelp') && g:loaded_devhelp finish endif let g:loaded_devhelp = 1 augroup plugin_devhelp autocmd! autocmd FileType yaml.ansible,php,css,less,html,markdown,vim,sql,ruby \ nmap gK :call show_help(expand('')) autocmd FileType javascript,javascriptreact,conf \ nmap gK :call show_help(expand(''), '') augroup END function! s:show_help(word, ...) " Open Dash/Zeal on word " Arguments: word, filetype let l:word = a:word let l:lang = a:0 > 0 && a:1 ? a:1 : &filetype let l:expr = split(l:lang, '\.')[-1] . ':' . l:word if executable('/Applications/Dash.app/Contents/MacOS/Dash') execute '!open -g dash://' . l:expr elseif executable('zeal') execute '!zeal --query "' . l:expr . '"' else echohl ErrorMsg echomsg 'Unable to find Dash or Zeal, install one of these.' echohl None endif redraw! endfunction ================================================ FILE: plugin/difftools.vim ================================================ " Diff Unsaved Changes " --- " " Commands: " - DiffOrig: Show diff of unsaved changes if exists('g:loaded_difftools') finish endif let g:loaded_difftools = 1 augroup plugin_difftools autocmd! autocmd BufWinLeave __diff call s:close_diff() augroup END function! s:open_diff() " Open diff window and start comparison let l:bnr = bufnr('%') call setwinvar(winnr(), 'diff_origin', l:bnr) vertical new __diff let l:diff_bnr = bufnr('%') nnoremap q :quit setlocal buftype=nofile bufhidden=wipe r ++edit # 0d_ diffthis setlocal readonly wincmd p let b:diff_bnr = l:diff_bnr nnoremap q :execute bufwinnr(b:diff_bnr) . 'q' diffthis endfunction function! s:close_diff() " Close diff window, switch to original window and disable diff " Credits: https://github.com/chemzqm/vim-easygit let wnr = +bufwinnr(+expand('')) let val = getwinvar(wnr, 'diff_origin') if ! len(val) | return | endif for i in range(1, winnr('$')) if i == wnr | continue | endif if len(getwinvar(i, 'diff_origin')) return endif endfor let wnr = bufwinnr(val) if wnr > 0 execute wnr . 'wincmd w' diffoff endif endfunction " Display diff of unsaved changes command! -nargs=0 DiffOrig call s:open_diff() " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: plugin/filesystem.vim ================================================ " Helpers for dealing with the filesystem " --- " " Behaviors: " - Before writing file ensure directories exist " " Commands: " - GitOpenDirty: Open all dirty files in repository if exists('g:loaded_filesystemplugin') finish endif let g:loaded_filesystemplugin = 1 augroup plugin_filesystem autocmd! autocmd BufWritePre * call s:mkdir(expand(':p:h'), v:cmdbang) augroup END function! s:mkdir(dir, force) " Credits: https://github.com/Shougo/shougo-s-github if ! isdirectory(a:dir) && empty(&l:buftype) && \ (a:force || input(printf('"%s" does not exist. Create? [y/N]', \ a:dir)) =~? '^y\%[es]$') call mkdir(a:dir, 'p') endif endfunction command! -nargs=0 GitOpenDirty call s:git_open_dirty() " Open a split for each dirty file in git function! s:git_open_dirty() silent only " Close all windows, unless they're modified let status = \ system('git status -s | grep "^ \?\(M\|A\|UU\)" | sed "s/^.\{3\}//"') let filenames = split(status, "\n") if ! empty(filenames) exec 'edit ' . filenames[0] for filename in filenames[1:] exec 'sp ' . filename endfor endif endfunction ================================================ FILE: plugin/jumpfile.vim ================================================ " Jump entire buffers from jumplist " --- " " Commands: " - JumpBuffer: Finds next (1) or previous (-1) file in jumplist if exists('g:loaded_jumpbuffer') finish endif let g:loaded_jumpfiles = 1 " direction - 1=forward, -1=backward " Credits: https://superuser.com/a/1455940/252171 function! JumpBuffer(direction) let [ jumplist, curjump ] = getjumplist() let jumpcmdstr = a:direction > 0 ? '' : '' let jumpcmdchr = a:direction > 0 ? "\" : "\" let searchrange = a:direction > 0 \ ? range(curjump - 1, 0, -1) \ : range(curjump + 1, len(jumplist)) for i in searchrange let l:nr = jumplist[i]['bufnr'] if l:nr != bufnr('%') && bufname(l:nr) !~? "^\a\+://" let n = abs((i - curjump) * a:direction) echo 'Executing' jumpcmdstr n . ' times' execute 'normal! ' . n . jumpcmdchr break endif endfor endfunction ================================================ FILE: plugin/sessions.vim ================================================ " Session Management " --- " " Behaviors: " - Save active session when quitting vim completely " " Commands: " - SessionSave [name]: Create and activate new session " - SessionLoad [name]: Clear buffers and load selected session " - SessionClose: Save session and clear all buffers " - SessionDetach: Stop persisting session, leave buffers open " " If [name] is empty, the current working-directory is used. " " Options: " - g:session_directory defaults to DATA_PATH/session (see config/vimrc) if exists('g:loaded_sessionsplugin') finish endif let g:loaded_sessionsplugin = 1 " Options " --- let g:session_directory = get(g:, 'session_directory', $DATA_PATH . '/session') " Commands " --- " Save and persist session command! -nargs=? -complete=customlist,session_list SessionSave \ call s:session_save() " Load and persist session command! -nargs=? -complete=customlist,session_list SessionLoad \ call s:session_load() " Close session, but leave buffers opened command! SessionDetach call s:session_detach() " Close session and all buffers command! SessionClose call s:session_close() " Save session on quit if one is loaded augroup plugin_sessions autocmd! " If session is loaded, write session file on quit autocmd VimLeavePre * call s:session_save_current() " autocmd SessionLoadPost * ++once unsilent " \ echomsg 'Loaded "' . fnamemodify(v:this_session, ':t:r') . '" session' augroup END " Private functions " --- function! s:session_save(name) if ! isdirectory(g:session_directory) call mkdir(g:session_directory, 'p') endif let file_name = empty(a:name) ? s:project_name() : a:name let file_path = g:session_directory . '/' . file_name . '.vim' execute 'mksession! ' . fnameescape(file_path) let v:this_session = file_path echohl MoreMsg echo 'Session `' . file_name . '` is now persistent' echohl None endfunction function! s:session_load(name) call s:session_save_current() let file_name = empty(a:name) ? s:project_name() : a:name let file_path = g:session_directory . '/' . file_name . '.vim' if filereadable(file_path) call s:buffers_wipeout() execute 'silent source ' . file_path else echohl ErrorMsg echomsg 'The session "' . file_path . '" doesn''t exist' echohl None endif endfunction function! s:session_close() if ! empty(v:this_session) && ! exists('g:SessionLoad') call s:session_save_current() call s:session_detach() call s:buffers_wipeout() endif endfunction function! s:session_save_current() if ! empty(v:this_session) && ! exists('g:SessionLoad') execute 'mksession! ' . fnameescape(v:this_session) endif endfunction function! s:session_detach() if ! empty(v:this_session) && ! exists('g:SessionLoad') let v:this_session = '' redrawtabline redrawstatus endif endfunction function! s:buffers_wipeout() noautocmd silent! %bwipeout! endfunction function! s:session_list(A, C, P) let glob_pattern = g:session_directory . '/' . fnameescape(a:A) . '*.vim' return map(split(glob(glob_pattern), '\n'), "fnamemodify(v:val, ':t:r')") endfunction function! s:project_name() let l:cwd = resolve(getcwd()) let l:cwd = substitute(l:cwd, '^' . $HOME . '/', '', '') let l:cwd = fnamemodify(l:cwd, ':p:gs?/?_?') let l:cwd = substitute(l:cwd, '^\.', '', '') return l:cwd endfunction " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: plugin/unixhelp.vim ================================================ " Unix Help " --- " Open man pages for gitconfig, tmux, and sh files " " Behaviors: " - If one of the supported filetypes is loaded, map K to open help window " " Options: " - g:unixhelp_open_with_tmux enable to use tmux splits for help windows if exists('g:loaded_unixhelp') finish endif let g:loaded_unixhelp = 1 let g:unixhelp_open_with_tmux = get(g:, 'unixhelp_open_with_tmux', 0) augroup plugin_unixhelp autocmd! autocmd FileType gitconfig,tmux nnoremap K \ :call open_man(&filetype, expand('')) augroup END function! s:open_man(ft, search_word) let l:mapping = { \ 'gitconfig': 'git-config', \ } let l:ft = a:ft if has_key(l:mapping, l:ft) let l:ft = l:mapping[l:ft] endif if empty(l:ft) echoerr 'Sorry, no help supported for "' . l:ft . '" filetypes.' return endif let l:cmd = 'man ' . l:ft if g:unixhelp_open_with_tmux && ! empty('$TMUX') call s:man_tmux(l:cmd, a:search_word) else call s:man_preview(l:cmd, a:search_word) endif endfunction " Open file-explorer split with tmux function! s:man_tmux(str, word) if empty('$TMUX') return endif let l:cmd = 'MANPAGER="less --pattern='.shellescape(a:word, 1).'" '.a:str silent execute '!tmux split-window -p 30 '.shellescape(l:cmd, 1) endfunction function! s:man_preview(str, word) silent! wincmd P if ! &previewwindow noautocmd execute 'bo' &previewheight 'new' set previewwindow silent! wincmd P else execute 'resize' &previewheight endif setlocal buftype=nofile bufhidden=delete noswapfile setlocal noreadonly modifiable execute '%delete_' silent execute '%!MANPAGER=cat '.a:str setlocal readonly filetype=man nnoremap q :set nopvw:bdelete! " normal! gg " silent! execute 'normal! /'.a:word."\" " let @/ = a:word " noautocmd wincmd p call feedkeys('/'.a:word."\", 'nt') endfunction ================================================ FILE: plugin/whitespace.vim ================================================ " Whitespace utilities " --- " " Behaviors: " - Display special highlight for trailing whitespace and space preceding tabs " " Commands: " - WhitespaceErase: Strips trailing whitespace from buffer " - WhitespaceNext: Cursor jump to next whitespace issue " - WhitespacePrev: Cursor jump to next whitespace issue " " Options: " - g:whitespace_filetype_blacklist override default whitespace blacklist " - g:whitespace_characters overrides default whitespace chars (default: \s) " - g:whitespace_pattern overrides pattern (default: chars . \+$) " - g:whitespace_pattern_normal overrides normal mode pattern " - g:whitespace_pattern_insert overrides insert mode pattern if exists('g:loaded_pluginwhitespace') finish endif let g:loaded_pluginwhitespace = 1 " Remove end of line white space command! -range=% WhitespaceErase call WhitespaceErase(, ) " Search for trailing white space forwards command! -range=% WhitespaceNext call WhitespaceJump(1, , ) " Search for trailing white space backwards command! -range=% WhitespacePrev call WhitespaceJump(-1, , ) " Whitespace events if v:version >= 702 augroup plugin_whitespace autocmd! autocmd InsertEnter * call ToggleWhitespace('i') autocmd InsertLeave * call ToggleWhitespace('n') augroup END endif let s:ws_chars = get(g:, 'whitespace_characters', '\s') let s:ws_pattern = get(g:, 'whitespace_pattern', s:ws_chars . '\+$') let s:normal_pattern = get(g:, 'whitespace_pattern_normal', \ s:ws_pattern . '\| \+\ze\t') let s:insert_pattern = get(g:, 'whitespace_pattern_insert', \ s:ws_chars . '\+\%#\@ -1 return elseif a:mode ==? '' call matchdelete(w:whitespace_match_id) return else let l:pattern = (a:mode ==# 'i') ? s:insert_pattern : s:normal_pattern if exists('w:whitespace_match_id') call matchdelete(w:whitespace_match_id) call matchadd('ExtraWhitespace', l:pattern, 10, w:whitespace_match_id) else highlight! link ExtraWhitespace SpellBad let w:whitespace_match_id = matchadd('ExtraWhitespace', l:pattern) endif endif endfunction function! s:WhitespaceErase(line1, line2) let l:save_cursor = getpos('.') silent! execute ':' . a:line1 . ',' . a:line2 . 's/' . s:ws_pattern . '//' call setpos('.', l:save_cursor) endfunction " Search for trailing whitespace function! s:WhitespaceJump(direction, from, to) let l:opts = 'wz' let l:until = a:to if a:direction < 1 let l:opts .= 'b' let l:until = a:from endif " Full file, allow wrapping if a:from == 1 && a:to == line('$') let l:until = 0 endif " Go to pattern let l:found = search(s:normal_pattern, l:opts, l:until) endfunction " vim: set ts=2 sw=2 tw=80 noet : ================================================ FILE: snippets/.gitignore ================================================ ================================================ FILE: snippets/go.snip ================================================ snippet todo abbr # todo comment // TODO: <`strftime("%Y-%m-%d")` `$USER`> ${0} ================================================ FILE: snippets/javascript.snip ================================================ snippet cs var cx = React.addons.classSet; snippet cdm componentDidMount: function() { ${1} }, snippet cdup componentDidUpdate: function(prevProps, prevState) { ${1} }, snippet cwm componentWillMount: function() { ${1} }, snippet cwr componentWillReceiveProps: function(nextProps) { ${1} }, snippet cwun componentWillUnmount: function() { ${1} }, snippet cwu componentWillUpdate: function(nextProps, nextState) { ${1} }, snippet cx cx({ ${1}: ${2} }); snippet fup forceUpdate(${1:callback}); snippet gdp getDefaultProps: function() { return { ${1} }; }, snippet gis getInitialState: function() { return { ${1}: ${2} }; }, snippet ism isMounted() snippet jsx /** * @jsx React.DOM */ var React = require('react'); var ${1:ClassName} = React.createClass({ render: function() { return ( ${0:
} ); } }); module.exports = $1; snippet pt propTypes: { ${1}: React.PropTypes.${2:string} }, snippet rcc var ${1:ClassName} = React.createClass({ render: function() { return ( ${0:
} ); } }); snippet ren render: function() { return ( ${1:
} ); } snippet sst setState({ ${1}: ${2} }); snippet scu shouldComponentUpdate: function(nextProps, nextState) { ${1} }, snippet props this.props.${1} snippet state this.state.${1} snippet trp transferPropsTo(${1}); ================================================ FILE: snippets/python.snip ================================================ snippet ip abbr import ipdb import ipdb; ipdb.set_trace() snippet pp abbr import pprint.. import pprint; pprint.pprint(${1}) snippet pprint abbr import pprint.. import pprint; pprint.pprint(${1}) snippet tr abbr import traceback.. import traceback; traceback.print_exc() snippet nose abbr from nose from nose.tools import set_trace; set_trace() snippet todo abbr # todo comment # TODO: <`strftime("%Y-%m-%d")` `$USER`> # ${0} ================================================ FILE: themes/hybrid.vim ================================================ " hybrid custom " === " gVim Appearance {{{ " --- if has('gui_running') set guifont=PragmataPro:h16 set guioptions=Mc " set noantialias endif " }}} " Terminal colors {{{ " --- let g:terminal_color_0 = '#2a2a2a' let g:terminal_color_1 = '#d370a3' let g:terminal_color_2 = '#6d9e3f' let g:terminal_color_3 = '#b58858' let g:terminal_color_4 = '#6095c5' let g:terminal_color_5 = '#ac7bde' let g:terminal_color_6 = '#3ba275' let g:terminal_color_7 = '#ffffff' let g:terminal_color_8 = '#686868' let g:terminal_color_9 = '#ffa7da' let g:terminal_color_10 = '#a3d572' let g:terminal_color_11 = '#efbd8b' let g:terminal_color_12 = '#98cbfe' let g:terminal_color_13 = '#e5b0ff' let g:terminal_color_14 = '#75daa9' let g:terminal_color_15 = '#cfcfcf' " }}} " Tabline {{{ " --- " TabLineFill: Tab pages line, where there are no labels hi TabLineFill ctermfg=234 ctermbg=236 guifg=#1C1C1C guibg=#303030 cterm=NONE gui=NONE " TabLine: Not-active tab page label hi TabLine ctermfg=243 ctermbg=236 guifg=#767676 guibg=#303030 cterm=NONE gui=NONE " TabLineSel: Active tab page label hi TabLineSel ctermfg=241 ctermbg=234 guifg=#626262 guibg=#1C1C1C cterm=NONE gui=NONE " Custom highlight TabLineSelShade ctermfg=235 ctermbg=234 guifg=#262626 guibg=#1C1C1C highlight TabLineAlt ctermfg=252 ctermbg=238 guifg=#D0D0D0 guibg=#444444 highlight TabLineAltShade ctermfg=238 ctermbg=236 guifg=#444444 guibg=#303030 " }}} " Highlights: Statusline {{{ highlight StatusLine ctermfg=236 ctermbg=248 guifg=#30302c guibg=#a8a897 cterm=reverse gui=reverse highlight StatusLineNC ctermfg=236 ctermbg=242 guifg=#30302c guibg=#666656 cterm=reverse gui=reverse " Filepath color highlight User1 guifg=#D7D7BC guibg=#30302c ctermfg=251 ctermbg=236 " Line and column information highlight User2 guifg=#a8a897 guibg=#4e4e43 ctermfg=248 ctermbg=239 " Line and column corner arrow highlight User3 guifg=#4e4e43 guibg=#30302c ctermfg=239 ctermbg=236 " Buffer # symbol and whitespace or syntax errors highlight User4 guifg=#666656 guibg=#30302c ctermfg=242 ctermbg=236 " Write symbol highlight User6 guifg=#cf6a4c guibg=#30302c ctermfg=167 ctermbg=236 " Paste symbol highlight User7 guifg=#99ad6a guibg=#30302c ctermfg=107 ctermbg=236 " Syntax and whitespace highlight User8 guifg=#ffb964 guibg=#30302c ctermfg=215 ctermbg=236 " }}} " Highlights: General GUI {{{ " --- " :h slow-terminal " gui=NONE guifg=NONE highlight NonText cterm=NONE ctermfg=NONE highlight! link jsFutureKeys PreProc highlight! WarningMsg ctermfg=100 guifg=#CCC566 highlight! link QuickFixLine WildMenu highlight! link lspReference Visual " if has('nvim') || has('patch-7.4.2218') " highlight EndOfBuffer gui=NONE guifg=#303030 " endif if has('nvim') highlight TermCursor gui=NONE guibg=#cc22a0 highlight TermCursorNC gui=NONE guibg=#666666 " highlight NormalNC gui=NONE guibg=#2c2c2c guifg=#bfbfbf endif highlight! link vimFunc Function highlight! link vimFunction Function highlight! link vimUserFunc PreProc highlight! link htmlBold String highlight! link htmlItalic Type highlight! link markdownH1 Title highlight! link htmlH1 markdownH1 highlight! link htmlH2 markdownH1 highlight! link htmlH3 markdownH1 highlight! link htmlH4 markdownH1 highlight! link htmlH5 markdownH1 highlight! link htmlH6 markdownH1 highlight! link htmlSpecialChar SpecialChar highlight! link htmlTag Keyword highlight! link htmlTagN Identifier highlight! link htmlEndTag Statement highlight! link VimwikiHeaderChar markdownHeadingDelimiter highlight! link VimwikiHR Keyword highlight! link VimwikiList markdownListMarker hi! link mkdBold htmlBold hi! link mkdItalic htmlItalic " hi! link mkdString Keyword " hi! link mkdCodeStart mkdCode " hi! link mkdCodeEnd mkdCode " hi! link mkdBlockquote Comment " hi! link mkdListItem Keyword " hi! link mkdListItemLine Normal " hi! link mkdFootnotes mkdFootnote " hi! link mkdLink markdownLinkText " hi! link mkdURL markdownUrl " hi! link mkdInlineURL mkdURL " hi! link mkdID Identifier " hi! link mkdLinkDef mkdLink " hi! link mkdLinkDefTarget mkdURL " hi! link mkdLinkTitle mkdInlineURL " hi! link mkdDelimiter Keyword " See: https://github.com/itchyny/vim-parenmatch let g:parenmatch_highlight = 0 highlight! ParenMatch ctermbg=236 guibg=#494D2A cterm=underline gui=underline " See: https://github.com/dominikduda/vim_current_word highlight! CurrentWord ctermbg=236 guibg=#2D3C42 cterm=NONE gui=NONE highlight! CurrentWordTwins ctermbg=235 guibg=#252A3D cterm=NONE gui=NONE " highlight! CurrentWord ctermbg=60 guibg=#2D3C42 cterm=NONE gui=NONE " highlight! CurrentWordTwins ctermbg=237 guibg=#2B2A22 cterm=NONE gui=NONE " highlight! link MatchParen Visual " highlight! MatchParen ctermfg=NONE guifg=NONE ctermbg=236 guibg=#2d3c42 " highlight! ParenMatch ctermfg=NONE guifg=NONE ctermbg=236 guibg=#494d2A " highlight! Error term=NONE cterm=NONE " highlight! link WarningMsg Comment " highlight! link pythonSpaceError NONE " highlight! link pythonIndentError NONE " highlight! link mkdLineBreak NONE " }}} " Plugin: Defx and plugins {{{ " --- highlight def link Defx_filename_directory Directory highlight! Defx_git_Modified ctermfg=1 guifg=#D370A3 highlight! Defx_git_Staged ctermfg=10 guifg=#A3D572 highlight! Defx_git_Deleted ctermfg=167 guifg=#fb4934 highlight def link Defx_git_Renamed Title highlight def link Defx_git_Unmerged Label highlight def link Defx_git_Untracked Comment highlight def link Defx_git_Ignored Comment highlight def link Defx_git_Unknown Comment " }}} " Plugin: Ale {{{ " --- highlight! ALEErrorSign ctermfg=167 guifg=#fb4934 highlight! ALEWarningSign ctermfg=214 guifg=#fabd2f highlight! ALEInfoSign ctermfg=109 guifg=#83a598 " }}} " Plugin: Neomake icons {{{ " --- " let g:neomake_error_sign = {'text': '✘', 'texthl': 'ErrorMsg'} " let g:neomake_warning_sign = {'text': '✚', 'texthl': 'WarningSyntax'} " let g:neomake_message_sign = {'text': '♯', 'texthl': 'NeomakeMessageSign'} " let g:neomake_info_sign = {'text': '⋆', 'texthl': 'NeomakeInfoSign'} " highlight! clear WarningSyntax " highlight! WarningSyntax ctermfg=58 guifg=#7d7629 "}}} " Plugin: vim-gitgutter {{{ " --- highlight! GitGutterAdd ctermfg=22 guifg=#008500 ctermbg=234 guibg=#1c1c1c highlight! GitGutterChange ctermfg=58 guifg=#808200 ctermbg=234 guibg=#1c1c1c highlight! GitGutterDelete ctermfg=52 guifg=#800000 ctermbg=234 guibg=#1c1c1c highlight! GitGutterChangeDelete ctermfg=52 guifg=#800000 ctermbg=234 guibg=#1c1c1c " }}} " Plugin: denite {{{ " --- highlight! clear WildMenu highlight! WildMenu ctermbg=97 guibg=#82395F highlight! link deniteSelectedLine Statement highlight! link deniteMatchedChar Function highlight! link deniteMatchedRange Underlined highlight! link deniteMode Comment highlight! link deniteSource_QuickfixPosition qfLineNr highlight! link deniteSource__LocationListPosition qfLineNr highlight! link deniteSource__LocationListError Constant highlight! link deniteSource__LocationListWarning PreProc " }}} " Plugin: vim-highlightedyank {{{ " --- highlight! link HighlightedyankRegion DiffText " }}} " Plugin: vim-shot-f {{{ " --- highlight! link ShotFGraph Number highlight! link ShotFBlank ErrorMsg " }}} " Plugin: vim-signature {{{ highlight! SignatureMarkText ctermfg=11 guifg=#756207 ctermbg=234 guibg=#1c1c1c highlight! SignatureMarkerText ctermfg=12 guifg=#4EA9D7 ctermbg=234 guibg=#1c1c1c " }}} " Plugin: vim-choosewin {{{ " --- let g:choosewin_color_label = { \ 'cterm': [ 75, 233 ], 'gui': [ '#7f99cd', '#000000' ] } let g:choosewin_color_label_current = { \ 'cterm': [ 228, 233 ], 'gui': [ '#D7D17C', '#000000' ] } let g:choosewin_color_other = { \ 'cterm': [ 235, 235 ], 'gui': [ '#232323', '#000000' ] } " }}} " vim: set foldmethod=marker ts=2 sw=0 tw=80 noet : ================================================ FILE: themes/rafi-2015.vim ================================================ " rafi-2015 - hybrid custom " ========================= " gVim Appearance {{{ " --------------------------------------------------------- if has('gui_running') set guifont=PragmataPro:h17 set noantialias endif " }}} " UI elements {{{ " --------------------------------------------------------- set showbreak=↪ set fillchars=vert:│,fold:─ set listchars=tab:\⋮\ ,extends:⟫,precedes:⟪,nbsp:.,trail:· " }}} " Tabline {{{ " --------------------------------------------------------- hi TabLine ctermfg=236 ctermbg=243 guifg=#303030 guibg=#767676 hi TabLineFill ctermfg=236 guifg=#303030 hi TabLineSel ctermfg=241 ctermbg=234 guifg=#626262 guibg=#1C1C1C gui=NONE hi TabLineSelShade ctermfg=235 ctermbg=234 guifg=#262626 guibg=#1C1C1C hi TabLineAlt ctermfg=234 ctermbg=236 guifg=#1C1C1C guibg=#303030 hi TabLineSel2 ctermfg=252 ctermbg=238 guifg=#D0D0D0 guibg=#444444 hi TabLineSel2Shade ctermfg=238 ctermbg=236 guifg=#444444 guibg=#303030 function! Tabline() abort "{{{ let s:tabline = \ '%#TabLineSel2# %{badge#project()} '. \ '%#TabLineSel2Shade#⮀'. \ '%#TabLine# ' let nr = tabpagenr() for i in range(tabpagenr('$')) if i + 1 == nr let s:tabline .= \ '%#TabLineSelShade#░%#TabLineSel#'. \ '%'.(i+1).'T%{badge#label('.(i+1).', "⮀")} '. \ '%#TabLineAlt#⮀ ' else let s:tabline .= \ '%#TabLine# '. \ '%'.(i+1).'T%{badge#label('.(i+1).', "⮀")} '. \ ' ' endif endfor let s:tabline .= \ '%#TabLineFill#%T%=%#TabLine#%{badge#session("[S]")}' return s:tabline endfunction "}}} let &tabline='%!Tabline()' " }}} " Statusline {{{ " ------------------------------------------=--------------------=------------ " Gibberish | What da heck? | Example " ------------------------------------------+--------------------+------------ let s:stl =" %7*%{&paste?'=':''}%*" "| Paste symbol | = let s:stl.="%4*%{&ro?'':'#'}%*" "| Modifiable symbol | # let s:stl.='%6*%{badge#mode()}' "| Readonly symbol |  let s:stl.='%*%n' "| Buffer number | 3 let s:stl.='%6*%{badge#modified()}%0*' "| Write symbol | + let s:stl.=' %1*%{badge#filename()}%*' "| Relative supername | cor/app.js let s:stl.=' %<' "| Truncate here | let s:stl.='%( %{badge#branch()} %)' "| Git branch name |  master let s:stl.='%4*%(%{badge#trails()} %)' "| Space and indent | trail34 let s:stl.='%(%{badge#syntax()} %)%*' "| syntax error/warn | E:1W:1 let s:stl.='%=' "| Align to right | let s:stl.='%{badge#format()} %4*%*' "| File format | unix  let s:stl.='%( %{&fenc} %)' "| File encoding | utf-8 let s:stl.='%4*%*%( %{&ft} %)' "| File type |  python let s:stl.='%3*%2* %l/%2c%4p%% %*' "| Line and column | 69:77/ 90% " ------------------------------------------'--------------------'------------ " Non-active Statusline {{{ " ------------------------------------------+--------------------+------------ let s:stl_nc = " %{&paste?'=':''}" "| Paste symbol | = let s:stl_nc.= '%{badge#mode()}%n' "| Readonly & buffer | 7 let s:stl_nc.= '%6*%{badge#modified()}%*' "| Write symbol | + let s:stl_nc.= ' %{badge#filename()}' "| Relative supername | src/main.py let s:stl_nc.= '%=' "| Align to right | let s:stl_nc.= '%{&ft} ' "| File type | python " ------------------------------------------'--------------------'---------}}} " Highlights: Statusline {{{ highlight StatusLine ctermfg=236 ctermbg=248 guifg=#30302c guibg=#a8a897 highlight StatusLineNC ctermfg=236 ctermbg=242 guifg=#30302c guibg=#666656 " Filepath color highlight User1 guifg=#D7D7BC guibg=#30302c ctermfg=251 ctermbg=236 " Line and column information highlight User2 guifg=#a8a897 guibg=#4e4e43 ctermfg=248 ctermbg=239 " Line and column corner arrow highlight User3 guifg=#4e4e43 guibg=#30302c ctermfg=239 ctermbg=236 " Buffer # symbol and whitespace or syntax errors highlight User4 guifg=#666656 guibg=#30302c ctermfg=242 ctermbg=236 " Write symbol highlight User6 guifg=#cf6a4c guibg=#30302c ctermfg=167 ctermbg=236 " Paste symbol highlight User7 guifg=#99ad6a guibg=#30302c ctermfg=107 ctermbg=236 " Syntax and whitespace highlight User8 guifg=#ffb964 guibg=#30302c ctermfg=215 ctermbg=236 " }}} " Toggle Statusline {{{ augroup statusline autocmd! autocmd WinEnter,FileType,BufWinEnter,BufReadPost * let &l:statusline = s:stl autocmd WinLeave * let &l:statusline = s:stl_nc augroup END "}}} " }}} " Highlights: General GUI {{{ " --------------------------------------------------------- highlight! Error term=NONE cterm=NONE highlight! link ExtraWhitespace SpellBad highlight! link WarningMsg Comment " }}} " Highlights: Popup menu {{{ " --------------------------------------------------------- "highlight Pmenu ctermfg=245 ctermbg=235 "highlight PmenuSel ctermfg=236 ctermbg=248 "highlight PmenuSbar ctermbg=235 "highlight PmenuThumb ctermbg=238 " }}} " Highlights: Markdown {{{ " --------------------------------------------------------- "highlight link yamlScalar Normal "highlight link htmlH1 Statement "highlight htmlItalic ctermfg=230 cterm=NONE term=NONE " }}} " Plugin: VimFiler icons {{{ " --------------------------------------------------------- let g:vimfiler_tree_indentation = 1 let g:vimfiler_tree_leaf_icon = '┆' let g:vimfiler_tree_opened_icon = '▼' let g:vimfiler_tree_closed_icon = '▷' let g:vimfiler_file_icon = ' ' let g:vimfiler_readonly_file_icon = '⭤' let g:vimfiler_marked_file_icon = '✓' "}}} " Plugin: GitGutter icons {{{ " --------------------------------------------------------- let g:gitgutter_sign_added = '▎' let g:gitgutter_sign_modified = '▎' let g:gitgutter_sign_removed = '▏' let g:gitgutter_sign_removed_first_line = '▔' let g:gitgutter_sign_modified_removed = '▋' "}}} " Plugin: Indent-Guides icons {{{ " --------------------------------------------------------- let g:indent_guides_guide_size = 1 let g:indent_guides_start_level = 1 let g:indent_guides_auto_colors = 0 "}}} " Plugin: vim-gitgutter {{{ " --------------------------------------------------------- highlight GitGutterAdd ctermfg=22 guifg=#006000 ctermbg=NONE highlight GitGutterChange ctermfg=58 guifg=#5F6000 ctermbg=NONE highlight GitGutterDelete ctermfg=52 guifg=#600000 ctermbg=NONE highlight GitGutterChangeDelete ctermfg=52 guifg=#600000 ctermbg=NONE " }}} " Plugin: unite.vim {{{ " --------------------------------------------------------- highlight link uniteInputPrompt Question " Grep "highlight link uniteSource__Grep Normal "highlight link uniteCandidateInputKeyword Function "highlight uniteSource__GrepLineNr ctermfg=240 guifg=#808070 "highlight uniteSource__GrepLine ctermfg=245 guifg=#808070 "highlight uniteSource__GrepFile ctermfg=4 guifg=#8197bf "highlight uniteSource__GrepSeparator ctermfg=5 guifg=#f0a0c0 "highlight uniteSource__GrepPattern ctermfg=1 guifg=#cf6a4c " }}} " Plugin: unite-quickfix {{{ " --------------------------------------------------------- "highlight UniteQuickFixWarning ctermfg=1 "highlight uniteSource__QuickFix ctermfg=8 "highlight uniteSource__QuickFix_Bold ctermfg=249 "highlight link uniteSource__QuickFix_File Directory "highlight link uniteSource__QuickFix_LineNr qfLineNr " }}} " Plugin: vimfiler.vim {{{ " --------------------------------------------------------- highlight vimfilerNonMark ctermfg=132 guifg=#B05E87 highlight vimfilerLeaf ctermfg=238 guifg=#444444 highlight vimfilerClosedFile ctermfg=246 guifg=#949494 highlight link vimfilerOpenedFile Normal highlight link vimfilerNormalFile Comment highlight link vimfilerMarkedFile Type " }}} " Plugin: vim-indent-guides {{{ " --------------------------------------------------------- highlight IndentGuidesOdd guibg=#262626 ctermbg=235 highlight IndentGuidesEven guibg=#303030 ctermbg=236 " }}} " Plugin: vim-operator-flashy {{{ " --------------------------------------------------------- highlight link Flashy Todo " }}} " vim: set foldmethod=marker ts=2 sw=0 tw=80 noet : ================================================ FILE: themes/rafi-2016.vim ================================================ " rafi-2016 - hybrid custom " ========================= " gVim Appearance {{{ " --------------------------------------------------------- if has('gui_running') set guifont=Monaco:h14 " set guifont=PragmataPro:h14 " set noantialias endif " }}} " UI elements {{{ " --------------------------------------------------------- set showbreak=↪ set fillchars=vert:│,fold:─ set listchars=tab:\⋮\ ,extends:⟫,precedes:⟪,nbsp:␣,trail:· " }}} " Tabline {{{ " --------------------------------------------------------- " TabLineFill: Tab pages line, where there are no labels hi TabLineFill ctermfg=234 ctermbg=236 guifg=#1C1C1C guibg=#303030 cterm=NONE gui=NONE " TabLine: Not-active tab page label hi TabLine ctermfg=243 ctermbg=236 guifg=#767676 guibg=#303030 cterm=NONE gui=NONE " TabLineSel: Active tab page label hi TabLineSel ctermfg=241 ctermbg=234 guifg=#626262 guibg=#1C1C1C cterm=NONE gui=NONE " Custom highlight TabLineSelShade ctermfg=235 ctermbg=234 guifg=#262626 guibg=#1C1C1C highlight TabLineAlt ctermfg=252 ctermbg=238 guifg=#D0D0D0 guibg=#444444 highlight TabLineAltShade ctermfg=238 ctermbg=236 guifg=#444444 guibg=#303030 function! Tabline() abort "{{{ " Active project tab let s:tabline = \ '%#TabLineAlt# %{badge#project()} '. \ '%#TabLineAltShade#▛'. \ '%#TabLineFill# ' let nr = tabpagenr() for i in range(tabpagenr('$')) if i + 1 == nr " Active tab let s:tabline .= \ '%#TabLineSelShade#░%#TabLineSel#'. \ '%'.(i+1).'T%{badge#label('.(i+1).', "▛", "N/A")} '. \ '%#TabLineFill#▞ ' else " Normal tab let s:tabline .= \ '%#TabLine# '. \ '%'.(i+1).'T%{badge#label('.(i+1).', "▛", "N/A")} '. \ '▘ ' endif endfor " Empty space and session indicator let s:tabline .= \ '%#TabLineFill#%T%=%#TabLine#%{badge#session("['.fnamemodify(v:this_session, ':t:r').']")}' return s:tabline endfunction "}}} let &tabline='%!Tabline()' " }}} " Statusline {{{ let s:stl = " %7*%{&paste ? '=' : ''}%*" " Paste symbol let s:stl .= "%4*%{&readonly ? '' : '#'}%*" " Modifide symbol let s:stl .= '%6*%{badge#mode()}' " Readonly symbol let s:stl .= '%*%n' " Buffer number let s:stl .= "%6*%{badge#modified('+')}%0*" " Write symbol let s:stl .= ' %1*%{badge#filename()}%*' " Filename let s:stl .= ' %<' " Truncate here let s:stl .= '%( %{badge#branch()} %)' " Git branch name let s:stl .= "%4*%(%{badge#trails('WS:%s')} %)" " Whitespace let s:stl .= '%(%{badge#syntax()} %)%*' " syntax check let s:stl .= '%=' " Align to right let s:stl .= '%{badge#format()} %4*%*' " File format let s:stl .= '%( %{&fenc} %)' " File encoding let s:stl .= '%4*%*%( %{&ft} %)' " File type let s:stl .= '%3*%2* %l/%2c%4p%% ' " Line and column "let s:stl .= "%{gutentags#statusline('[*]')}%*" " Non-active Statusline {{{ let s:stl_nc = " %{badge#mode('⚒', 'Z')}%n" " Readonly & buffer let s:stl_nc .= "%6*%{badge#modified('+')}%*" " Write symbol let s:stl_nc .= ' %{badge#filename()}' " Relative supername let s:stl_nc .= '%=' " Align to right let s:stl_nc .= '%{&ft} ' " File type " }}} " Highlights: Statusline {{{ highlight StatusLine ctermfg=236 ctermbg=248 guifg=#30302c guibg=#a8a897 highlight StatusLineNC ctermfg=236 ctermbg=242 guifg=#30302c guibg=#666656 " Filepath color highlight User1 guifg=#D7D7BC guibg=#30302c ctermfg=251 ctermbg=236 " Line and column information highlight User2 guifg=#a8a897 guibg=#4e4e43 ctermfg=248 ctermbg=239 " Line and column corner arrow highlight User3 guifg=#4e4e43 guibg=#30302c ctermfg=239 ctermbg=236 " Buffer # symbol and whitespace or syntax errors highlight User4 guifg=#666656 guibg=#30302c ctermfg=242 ctermbg=236 " Write symbol highlight User6 guifg=#cf6a4c guibg=#30302c ctermfg=167 ctermbg=236 " Paste symbol highlight User7 guifg=#99ad6a guibg=#30302c ctermfg=107 ctermbg=236 " Syntax and whitespace highlight User8 guifg=#ffb964 guibg=#30302c ctermfg=215 ctermbg=236 " }}} let s:disable_statusline = \ 'denite\|unite\|vimfiler\|tagbar\|nerdtree\|undotree\|gundo\|diff' " Toggle Statusline {{{ augroup statusline autocmd! autocmd FileType,WinEnter,BufWinEnter,BufReadPost * \ if &filetype !~? s:disable_statusline \ | let &l:statusline = s:stl \ | endif autocmd WinLeave * \ if &filetype !~? s:disable_statusline \ | let &l:statusline = s:stl_nc \ | endif augroup END "}}} " }}} " Highlights: General GUI {{{ " --------------------------------------------------------- highlight! Error term=NONE cterm=NONE highlight! link mkdLineBreak NONE highlight! link pythonSpaceError NONE highlight! link pythonIndentError NONE highlight! link WarningMsg Comment highlight! link ExtraWhitespace SpellBad " }}} " Plugin: VimFiler icons {{{ " --------------------------------------------------------- let g:vimfiler_tree_indentation = 1 let g:vimfiler_tree_leaf_icon = '┆' let g:vimfiler_tree_opened_icon = '▼' let g:vimfiler_tree_closed_icon = '▷' let g:vimfiler_file_icon = ' ' let g:vimfiler_readonly_file_icon = '✖' let g:vimfiler_marked_file_icon = '✓' "}}} " Plugin: NERDTree icons and highlights {{{ " --------------------------------------------------------- let g:NERDTreeIndicatorMapCustom = { \ 'Modified': '', \ 'Staged': 'ᴍ', \ 'Untracked': '⁇', \ 'Renamed': '', \ 'Unmerged': '', \ 'Deleted': '', \ 'Dirty': '·', \ 'Clean': '✓', \ 'Unknown': '?' \ } let g:NERDTreeDirArrowExpandable = '▷' let g:NERDTreeDirArrowCollapsible = '▼' highlight! NERDTreeOpenable ctermfg=132 guifg=#B05E87 highlight! def link NERDTreeClosable NERDTreeOpenable highlight! NERDTreeFile ctermfg=246 guifg=#999999 highlight! NERDTreeExecFile ctermfg=246 guifg=#999999 highlight! clear NERDTreeFlags highlight! NERDTreeFlags ctermfg=234 guifg=#1d1f21 highlight! NERDTreeCWD ctermfg=240 guifg=#777777 highlight! NERDTreeGitStatusModified ctermfg=1 guifg=#D370A3 highlight! NERDTreeGitStatusStaged ctermfg=10 guifg=#A3D572 highlight! NERDTreeGitStatusUntracked ctermfg=12 guifg=#98CBFE highlight! def link NERDTreeGitStatusRenamed Title highlight! def link NERDTreeGitStatusUnmerged Label highlight! def link NERDTreeGitStatusDirDirty Constant highlight! def link NERDTreeGitStatusDirClean DiffAdd highlight! def link NERDTreeGitStatusUnknown Comment function! s:NERDTreeHighlight() for l:name in keys(g:NERDTreeIndicatorMapCustom) let l:icon = g:NERDTreeIndicatorMapCustom[l:name] if empty(l:icon) continue endif let l:prefix = index(['Dirty', 'Clean'], l:name) > -1 ? 'Dir' : '' let l:hiname = escape('NERDTreeGitStatus'.l:prefix.l:name, '~') execute 'syntax match '.l:hiname.' #'.l:icon.'# containedin=NERDTreeFlags' endfor syntax match NERDTreeOpenBracket /\[/ \ contained containedin=NERDTreeFlags conceal endfunction augroup AddHighlighting autocmd! autocmd FileType nerdtree call s:NERDTreeHighlight() augroup END "}}} " Plugin: Tagbar icons {{{ " --------------------------------------------------------- let g:tagbar_iconchars = ['▷', '◢'] "}}} " Plugin: Neomake icons {{{ " --------------------------------------------------------- let g:neomake_error_sign = {'text': '⎖', 'texthl': 'ErrorMsg'} let g:neomake_warning_sign = {'text': '⎖', 'texthl': 'WarningMsg'} let g:neomake_message_sign = {'text': 's', 'texthl': 'NeomakeMessageSign'} let g:neomake_info_sign = {'text': 'i', 'texthl': 'NeomakeInfoSign'} "}}} " Plugin: GitGutter icons {{{ " --------------------------------------------------------- let g:gitgutter_sign_added = '▎' let g:gitgutter_sign_modified = '▎' let g:gitgutter_sign_removed = '▏' let g:gitgutter_sign_removed_first_line = '▔' let g:gitgutter_sign_modified_removed = '▋' "}}} " Plugin: Indent-Guides icons {{{ " --------------------------------------------------------- let g:indent_guides_guide_size = 1 let g:indent_guides_start_level = 1 let g:indent_guides_auto_colors = 0 "}}} " Plugin: vim-gitgutter {{{ " --------------------------------------------------------- highlight GitGutterAdd ctermfg=22 guifg=#006000 ctermbg=NONE highlight GitGutterChange ctermfg=58 guifg=#5F6000 ctermbg=NONE highlight GitGutterDelete ctermfg=52 guifg=#600000 ctermbg=NONE highlight GitGutterChangeDelete ctermfg=52 guifg=#600000 ctermbg=NONE " }}} " Plugin: denite {{{ " --------------------------------------------------------- highlight clear WildMenu highlight link WildMenu CursorLine highlight link deniteSelectedLine Type highlight link deniteMatchedChar Function highlight link deniteMatchedRange Underlined highlight link deniteMode Comment " }}} " Plugin: vimfiler.vim {{{ " --------------------------------------------------------- highlight vimfilerNonMark ctermfg=132 guifg=#B05E87 highlight vimfilerLeaf ctermfg=238 guifg=#444444 highlight vimfilerClosedFile ctermfg=246 guifg=#949494 highlight link vimfilerOpenedFile Normal highlight link vimfilerNormalFile Comment highlight link vimfilerMarkedFile Type " }}} " Plugin: vim-indent-guides {{{ " --------------------------------------------------------- highlight IndentGuidesOdd guibg=#262626 ctermbg=235 highlight IndentGuidesEven guibg=#303030 ctermbg=236 " }}} " Plugin: vim-operator-flashy {{{ " --------------------------------------------------------- highlight link Flashy Todo " }}} " }}} " Plugin: vim-bookmarks {{{ let g:bookmark_sign = '⚐' highlight BookmarkSign ctermfg=12 guifg=#4EA9D7 highlight BookmarkAnnotationSign ctermfg=11 guifg=#EACF49 " }}} " Plugin: vim-choosewin {{{ " --------------------------------------------------------- let g:choosewin_label = 'SDFJKLZXCV' let g:choosewin_overlay_enable = 1 let g:choosewin_statusline_replace = 1 let g:choosewin_overlay_clear_multibyte = 0 let g:choosewin_blink_on_land = 0 let g:choosewin_color_label = { \ 'cterm': [ 236, 2 ], 'gui': [ '#555555', '#000000' ] } let g:choosewin_color_label_current = { \ 'cterm': [ 234, 220 ], 'gui': [ '#333333', '#000000' ] } let g:choosewin_color_other = { \ 'cterm': [ 235, 235 ], 'gui': [ '#333333' ] } let g:choosewin_color_overlay = { \ 'cterm': [ 2, 10 ], 'gui': [ '#88A2A4' ] } let g:choosewin_color_overlay_current = { \ 'cterm': [ 72, 64 ], 'gui': [ '#7BB292' ] } " }}} " vim: set foldmethod=marker ts=2 sw=0 tw=80 noet : ================================================ FILE: themes/rafi-2017.vim ================================================ " rafi-2017 - hybrid custom " ========================= " gVim Appearance {{{ " --------------------------------------------------------- if has('gui_running') set guifont=PragmataPro:h16 " set noantialias endif " }}} " UI elements {{{ " --------------------------------------------------------- set showbreak=↪ set fillchars=vert:│,fold:─ set listchars=tab:\▏\ ,extends:⟫,precedes:⟪,nbsp:␣,trail:· " icons: ▏│ ¦ ╎ ┆ ⋮ ⦙ ┊  " }}} " Tabline {{{ " --------------------------------------------------------- " TabLineFill: Tab pages line, where there are no labels hi TabLineFill ctermfg=234 ctermbg=236 guifg=#1C1C1C guibg=#303030 cterm=NONE gui=NONE " TabLine: Not-active tab page label hi TabLine ctermfg=243 ctermbg=236 guifg=#767676 guibg=#303030 cterm=NONE gui=NONE " TabLineSel: Active tab page label hi TabLineSel ctermfg=241 ctermbg=234 guifg=#626262 guibg=#1C1C1C cterm=NONE gui=NONE " Custom highlight TabLineSelShade ctermfg=235 ctermbg=234 guifg=#262626 guibg=#1C1C1C highlight TabLineAlt ctermfg=252 ctermbg=238 guifg=#D0D0D0 guibg=#444444 highlight TabLineAltShade ctermfg=238 ctermbg=236 guifg=#444444 guibg=#303030 function! Tabline() abort "{{{ " Active project tab let s:tabline = \ '%#TabLineAlt# %{badge#project()} '. \ '%#TabLineAltShade#▛'. \ '%#TabLineFill# ' let nr = tabpagenr() for i in range(tabpagenr('$')) if i + 1 == nr " Active tab let s:tabline .= \ '%#TabLineSelShade#░%#TabLineSel#'. \ '%'.(i+1).'T%{badge#label('.(i+1).', "▛", "N/A")} '. \ '%#TabLineFill#▞ ' else " Normal tab let s:tabline .= \ '%#TabLine# '. \ '%'.(i+1).'T%{badge#label('.(i+1).', "▛", "N/A")} '. \ '▘ ' endif endfor " Empty space and session indicator let s:tabline .= \ '%#TabLineFill#%T%=%#TabLine#%{badge#session("['.fnamemodify(v:this_session, ':t:r').']")}' return s:tabline endfunction "}}} let &tabline='%!Tabline()' " }}} " Statusline {{{ let s:stl = " %7*%{&paste ? '=' : ''}%*" " Paste symbol let s:stl .= "%4*%{&readonly ? '' : '#'}%*" " Modifide symbol let s:stl .= "%6*%{badge#mode('⚠ ', 'Z')}" " Read-only symbol let s:stl .= '%*%n' " Buffer number let s:stl .= "%6*%{badge#modified('+')}%0*" " Write symbol let s:stl .= ' %1*%{badge#filename()}%*' " Filename let s:stl .= ' %<' " Truncate here let s:stl .= '%( %{badge#branch()} %)' " Git branch name let s:stl .= "%4*%(%{badge#trails('⤐ %s')} %)" " Whitespace let s:stl .= '%(%{badge#syntax()} %)%*' " syntax check let s:stl .= '%=' " Align to right let s:stl .= '%{badge#format()} %4*%*' " File format let s:stl .= '%( %{&fenc} %)' " File encoding let s:stl .= '%4*%*%( %{&ft} %)' " File type let s:stl .= '%3*%2* %l/%2c%4p%% ' " Line and column let s:stl .= '%{badge#indexing()}%*' " Indexing tags indicator " Non-active Statusline {{{ let s:stl_nc = " %{badge#mode('⚠ ', 'Z')}%n" " Readonly & buffer let s:stl_nc .= "%6*%{badge#modified('+')}%*" " Write symbol let s:stl_nc .= ' %{badge#filename()}' " Relative supername let s:stl_nc .= '%=' " Align to right let s:stl_nc .= '%{&ft} ' " File type " }}} " Highlights: Statusline {{{ highlight StatusLine ctermfg=236 ctermbg=248 guifg=#30302c guibg=#a8a897 highlight StatusLineNC ctermfg=236 ctermbg=242 guifg=#30302c guibg=#666656 " Filepath color highlight User1 guifg=#D7D7BC guibg=#30302c ctermfg=251 ctermbg=236 " Line and column information highlight User2 guifg=#a8a897 guibg=#4e4e43 ctermfg=248 ctermbg=239 " Line and column corner arrow highlight User3 guifg=#4e4e43 guibg=#30302c ctermfg=239 ctermbg=236 " Buffer # symbol and whitespace or syntax errors highlight User4 guifg=#666656 guibg=#30302c ctermfg=242 ctermbg=236 " Write symbol highlight User6 guifg=#cf6a4c guibg=#30302c ctermfg=167 ctermbg=236 " Paste symbol highlight User7 guifg=#99ad6a guibg=#30302c ctermfg=107 ctermbg=236 " Syntax and whitespace highlight User8 guifg=#ffb964 guibg=#30302c ctermfg=215 ctermbg=236 " }}} let s:disable_statusline = \ 'denite\|defx\|tagbar\|nerdtree\|undotree\|diff\|peekaboo\|sidemenu' " Toggle Statusline {{{ augroup statusline autocmd! autocmd FileType,WinEnter,BufWinEnter,BufReadPost * \ if &filetype !~? s:disable_statusline \ | let &l:statusline = s:stl \ | endif autocmd WinLeave * \ if &filetype !~? s:disable_statusline \ | let &l:statusline = s:stl_nc \ | endif augroup END "}}} " }}} " Highlights: General GUI {{{ " --------------------------------------------------------- " highlight! Error term=NONE cterm=NONE " highlight! link WarningMsg Comment highlight! link pythonSpaceError NONE highlight! link pythonIndentError NONE " highlight! link mkdLineBreak NONE highlight! link ExtraWhitespace SpellBad highlight! WarningMsg ctermfg=100 guifg=#CCC566 " }}} highlight ParenMatch ctermbg=236 guibg=#30302c highlight CursorWord0 ctermbg=236 guibg=#30302c highlight CursorWord1 ctermbg=236 guibg=#30302c " Plugin: Defx icons and highlights {{{ " --------------------------------------------------------- let g:defx_git#indicators = { \ 'Modified' : '•', \ 'Staged' : '✚', \ 'Untracked' : 'ᵁ', \ 'Renamed' : '≫', \ 'Unmerged' : '≠', \ 'Ignored' : 'ⁱ', \ 'Deleted' : '✖', \ 'Unknown' : '⁇' \ } highlight Defx_filename_3_Modified ctermfg=1 guifg=#D370A3 highlight Defx_filename_3_Staged ctermfg=10 guifg=#A3D572 highlight Defx_filename_3_Ignored ctermfg=8 guifg=#404660 highlight def link Defx_filename_3_Untracked Comment highlight def link Defx_filename_3_Unknown Comment highlight def link Defx_filename_3_Renamed Title highlight def link Defx_filename_3_Unmerged Label " highlight Defx_git_Deleted ctermfg=13 guifg=#b294bb " Plugin: NERDTree icons and highlights {{{ " --------------------------------------------------------- let g:NERDTreeIndicatorMapCustom = { \ 'Modified': '·', \ 'Staged': '‧', \ 'Untracked': '?', \ 'Renamed': '≫', \ 'Unmerged': '≠', \ 'Deleted': '✃', \ 'Dirty': '⁖', \ 'Clean': '✓', \ 'Unknown': '⁇' \ } let g:NERDTreeDirArrowExpandable = '▷' let g:NERDTreeDirArrowCollapsible = '▼' highlight! NERDTreeOpenable ctermfg=132 guifg=#B05E87 highlight! def link NERDTreeClosable NERDTreeOpenable highlight! NERDTreeFile ctermfg=246 guifg=#999999 highlight! NERDTreeExecFile ctermfg=246 guifg=#999999 highlight! clear NERDTreeFlags highlight! NERDTreeFlags ctermfg=234 guifg=#1d1f21 highlight! NERDTreeCWD ctermfg=240 guifg=#777777 highlight! NERDTreeGitStatusModified ctermfg=1 guifg=#D370A3 highlight! NERDTreeGitStatusStaged ctermfg=10 guifg=#A3D572 highlight! NERDTreeGitStatusUntracked ctermfg=12 guifg=#98CBFE highlight! def link NERDTreeGitStatusRenamed Title highlight! def link NERDTreeGitStatusUnmerged Label highlight! def link NERDTreeGitStatusDirDirty Constant highlight! def link NERDTreeGitStatusDirClean DiffAdd highlight! def link NERDTreeGitStatusUnknown Comment function! s:NERDTreeHighlight() for l:name in keys(g:NERDTreeIndicatorMapCustom) let l:icon = g:NERDTreeIndicatorMapCustom[l:name] if empty(l:icon) continue endif let l:prefix = index(['Dirty', 'Clean'], l:name) > -1 ? 'Dir' : '' let l:hiname = escape('NERDTreeGitStatus'.l:prefix.l:name, '~') execute 'syntax match '.l:hiname.' #'.l:icon.'# containedin=NERDTreeFlags' endfor syntax match hideBracketsInNerdTree "\]" contained conceal containedin=NERDTreeFlags syntax match hideBracketsInNerdTree "\[" contained conceal containedin=NERDTreeFlags " setlocal conceallevel=3 " setlocal concealcursor=nvic endfunction augroup nerdtree-highlights autocmd! autocmd FileType nerdtree call s:NERDTreeHighlight() augroup END "}}} " Plugin: Tagbar icons {{{ " --------------------------------------------------------- let g:tagbar_iconchars = ['▷', '◢'] "}}} " Plugin: Neomake icons {{{ " --------------------------------------------------------- let g:neomake_error_sign = {'text': '⚠', 'texthl': 'ErrorMsg'} let g:neomake_warning_sign = {'text': '⌁', 'texthl': 'WarningSyntax'} let g:neomake_message_sign = {'text': '⌂', 'texthl': 'NeomakeMessageSign'} let g:neomake_info_sign = {'text': '⊹', 'texthl': 'NeomakeInfoSign'} "}}} highlight! WarningSyntax ctermfg=58 guifg=#7d7629 " Plugin: GitGutter icons {{{ " --------------------------------------------------------- let g:gitgutter_sign_added = '▎' let g:gitgutter_sign_modified = '▎' let g:gitgutter_sign_removed = '▏' let g:gitgutter_sign_removed_first_line = '▔' let g:gitgutter_sign_modified_removed = '▋' "}}} " Plugin: vim-gitgutter {{{ " --------------------------------------------------------- highlight! GitGutterAdd ctermfg=22 guifg=#006000 ctermbg=NONE guibg=NONE highlight! GitGutterChange ctermfg=58 guifg=#5F6000 ctermbg=NONE guibg=NONE highlight! GitGutterDelete ctermfg=52 guifg=#600000 ctermbg=NONE guibg=NONE highlight! GitGutterChangeDelete ctermfg=52 guifg=#600000 ctermbg=NONE guibg=NONE " }}} " Plugin: denite {{{ " --------------------------------------------------------- highlight! clear WildMenu highlight! link WildMenu CursorLine highlight! link deniteSelectedLine Type highlight! link deniteMatchedChar Function highlight! link deniteMatchedRange Underlined highlight! link deniteMode Comment highlight! link deniteSource_QuickfixPosition qfLineNr " }}} " Plugin: vim-operator-flashy {{{ " --------------------------------------------------------- highlight! link Flashy DiffText " }}} " Plugin: vim-bookmarks {{{ let g:bookmark_sign = '⚐' highlight! BookmarkSign ctermfg=12 guifg=#4EA9D7 highlight! BookmarkAnnotationSign ctermfg=11 guifg=#EACF49 " }}} " Plugin: vim-choosewin {{{ " --------------------------------------------------------- let g:choosewin_label = 'SDFJKLZXCV' let g:choosewin_overlay_enable = 1 let g:choosewin_statusline_replace = 1 let g:choosewin_overlay_clear_multibyte = 0 let g:choosewin_blink_on_land = 0 let g:choosewin_color_label = { \ 'cterm': [ 236, 2 ], 'gui': [ '#555555', '#000000' ] } let g:choosewin_color_label_current = { \ 'cterm': [ 234, 220 ], 'gui': [ '#333333', '#000000' ] } let g:choosewin_color_other = { \ 'cterm': [ 235, 235 ], 'gui': [ '#333333' ] } let g:choosewin_color_overlay = { \ 'cterm': [ 2, 10 ], 'gui': [ '#88A2A4' ] } let g:choosewin_color_overlay_current = { \ 'cterm': [ 72, 64 ], 'gui': [ '#7BB292' ] } " }}} " vim: set foldmethod=marker ts=2 sw=0 tw=80 noet : ================================================ FILE: venv.sh ================================================ #!/usr/bin/env bash _try_pyenv() { local name='' src='' if hash pyenv 2>/dev/null; then echo '===> pyenv found, searching virtualenvs…' for name in neovim neovim3 nvim; do src="$(pyenv prefix "${name}" 2>/dev/null)" if [ -d "${src}" ]; then echo "===> pyenv virtualenv found '${name}', upgrading..." # Symlink virtualenv for easy access ln -fs "${src}" "${__venv}" return 0 fi done echo "===> skipping pyenv. manual virtualenv isn't found" echo echo "Press Ctrl+C and use pyenv to create one yourself (name it 'neovim')" echo "and run ${0} again. Or press Enter to continue and create a" echo "virtualenv using: python3 -m venv '${__venv}'" read -r else echo '===> pyenv not found, skipping' fi return 1 } _try_python() { if ! hash python3 2>/dev/null; then echo '===> python3 not found, skipping' return 1 fi echo "===> python3 found" [ -d "${__venv}" ] || python3 -m venv "${__venv}" } main() { # Concat a base path for vim cache and virtual environment local __cache="${XDG_CACHE_HOME:-$HOME/.cache}/vim" local __venv="${__cache}/venv" mkdir -p "${__cache}" if [ -d "${__venv}/neovim2" ]; then echo -n '===> ERROR: Python 2 has ended its life, ' echo ' only python3 virtualenv is created now.' echo "Delete '${__venv}' (or backup!) first, and then run ${0} again." elif _try_pyenv || _try_python; then # Install Python 3 requirements "${__venv}/bin/pip" install -U pynvim PyYAML Send2Trash echo '===> success' else echo '===> ERROR: Unable to setup python3 virtualenv.' echo -e '\nConsider using pyenv with its virtualenv plugin:' echo '- https://github.com/pyenv/pyenv' echo '- https://github.com/pyenv/pyenv-virtualenv' fi } main ================================================ FILE: vimrc ================================================ " Note: Skip initialization for vim-tiny or vim-small. if 1 execute 'source' fnamemodify(expand(''), ':h').'/config/vimrc' endif