Skip to content

Lightweight and well documented Vim/Neovim configuration. Easy to use and configure.

License

Notifications You must be signed in to change notification settings

CharlesGueunet/vimmic

VimMic is well-documented vim configuration along with a set of plugins for the Vim text editor. It stand for Vim Make It Clever and is aimed to keep this editor light and efficient.

CHANGELOG

  • Automatically build/compile_commands.json is found
  • No more .vimmic_config

Key Features

This configuration is not intrusive and should not confict with Vim default use.

By default, leader is defined on coma.

  • Mnemonic shortcuts with gui (press leader three times to see them)
  • Asynchronous completion and Syntax checking
  • Fast travel (file/buffers/tags...) and new operator/scopes
  • Fully customizable
  • Lazy / Conditionally load plugins
  • ...

Install

Note we highly recommend to backup your previous .vimrc if not already done as we are going to erase it through the installation process.

Dependencies

We highly recommend having a Vim build supporting Python. To check if Python is supported, run: vim --version | grep python and see if +python[...] is present.

Dependencies listed here are recommended but not required for all plugins:

  • flake8 is used by the plugin for Python flake8-vim. Install it through pip: pip install --user flake8.
  • yarn is used for the asyncronous completion

Install and update

Quick installation script:

VIMMIC_DIR=".vimmic"
cd ~
git clone https://github.com/CharlesGueunet/vimmic.git "${VIMMIC_DIR}"
ln -sf "${VIMMIC_DIR}"/.vimrc ${HOME}

Notice you can use whatever you want in $VIMMIC_DIR (including inside .config), as long as you do not modify the directory path afterward (as it may break the symbolic link).

To update this distribution, you can simply git pull. To update all plugins, use the command :Update

Windows

For windows, clone this repository wherever you want. As symlink are not managed in a Unix-like way, juste create a _vimrc file in your home containing the following:

let $MYVIMRC='Path to the .vimrc file in vimmic'
source $MYVIMRC

Neovim

For those who would like to try with [neovim][neovim], use the following snippet to link your vim configuration with your neovim configuration, change the $VIMMIC_DIR accordingly:

VIMMIC_DIR="~/.vimmic"
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
ln -s ${VIMMIC_DIR} $XDG_CONFIG_HOME/nvim
# ln -sf ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
# not required in this conf

Note: you may need to run :Update afterward if you have already installed the plugins with Vim.

How to use

  • The default leader is ,.
  • You can see the Vimmic keymap (in a GUI) by pressing leader 3 times.
  • If you want persistant undo (survive vim restart) create a .undodir/ folder in the Vimmic installation folder.
  • If you want to display saved session at Vim startup, save them in .sessions/ folder in the Vimmic installation folder using :mksession.

Please read the Vimmic's help ( :help vimmic ) as it is well documented and provide many tips and tricks!

Enabling / disabling plugins

As described in the vimmic-config help, if you want to add / remove plugins, you can use the ${VIMMIC_DIR}/custom.toml or ${VIMMIC_DIR}/disable.toml files (simple syntax) to manage your list of plugins.

Do not forget to restart your Vim afterward, the editor will ask you to call :Update if needed.

Structure

All plugins are configured in their own files in config/plugins/. Other files do not affect them (the .vimrc load them)

${VIMMIC_DIR}/         # Vimmic install directory
  .vimrc               # Loads Vimmic environment, configuration and plugins
  plugins.toml         # Default plugins list
  plugins_ft.toml      # Plugins loaded only on specific file types
  config/
    editor.vim         # Behaviour config (files, buffers, search...)
    shortcuts.vim      # Defines some shortcuts on the original vim functionalities
    functions.vim      # Some cool functions to update all plugins, fold, debug...
    plugins/*          # per-plugin related configuration. Files should use the following sections:
                       #   Settings: Plugin related settings and variable
                       #   Shortcuts: Mapping for this plugin
                       #   Theme: Colors configuration for this plugin

For personnal configuration, you can ceate two files:

  • ${VIMMIC_DIR}/.vimrc.preconf: tweak vimmic by changing the leader key, colors, disabling part of the configuration...
  • ${VIMMIC_DIR}/.vimrc.postconf: override plugins configuration / themes, add your own features...

Examples of those files in the extra/ folder and the help vimmic-config gives some details.

Gallery

Vimmic default config Default configuration on a low color terminal. On the left we see the NerdTree pane to navigate in the project. The Install word is highlighted by the search.

Vimmic quantum The configuration using true-colors colorscheme as explained in the sample .vimrc.preconf and .vimrc.postconf of the extra/ folder. Here, we see on the left the Nerd Tree with the project files, the Undo Tree with the historic of the current file modifications and on the right the Tag bar with the current function highlighted. Moreover, Git information are shown on the left of the text.

Vimmic Visual Shortcuts To learn Vimmic, the help pages are your firends, but you can also use the Visual Shortcut panel. (Summon by pressin three times {leader})

Vimmic code For code development, the left window shows an error (v is not printable) reported on the editor line 15. The right window shows the clever completion (Ctrl-x x or Ctrl-space).

Inspiration

This configuration have started by a look at spf13, another vim distribution. spf13 is great but heavy so I decided to make my own configuration much lighter.

Another great distribution is SpaceVim, but here again this configuration is really complexe and most of the configuration should be made using their own defined functions.

For the navigation and some highlight, we used this post

Lots of idea where taken from the jetbrains ide which is among the best ones.

For those who want to use space as the leader key, this website can be usefull.

For later, build tools and shortcut might come from this conf.

Another great website about vim plugins is vimawesome.

Some tricks about buffer and viml evaluation come from this dotfile.

Plugins

Plugins and configurations included by default (lots of them are lazily/conditionally loaded):

'glts/vim-textobj-comment'
'kana/vim-textobj-entire'
'kana/vim-textobj-indent'
'sgur/vim-textobj-parameter'
'w0rp/ale'
'AndrewRadev/switch.vim'
'ctrlpvim/ctrlp.vim'
'markonm/traces.vim'
'mbbill/undotree'
'scrooloose/nerdtree'
'CharlesGueunet/quickmenu.vim'
'Lokaltog/vim-easymotion'
'Raimondi/delimitMate'
'Shougo/dein.vim'
'SirVer/ultisnips'
'airblade/vim-gitgutter'
'andymass/vim-matchup'
'andymass/vim-tradewinds'
'eugen0329/vim-esearch'
'google/vim-searchindex'
'honza/vim-snippets'
'inkarkat/vim-ingo-library'
'inkarkat/vim-mark'
'joereynolds/place.vim'
'junegunn/vim-peekaboo'
'kana/vim-textobj-user'
'kshenoy/vim-signature'
'liuchengxu/vista.vim'
'luochen1990/rainbow'
'machakann/vim-highlightedyank'
'mhinz/vim-startify'
'myusuf3/numbers.vim'
'neoclide/coc.nvim'
'rhysd/committia.vim'
'simeji/winresizer'
't9md/vim-choosewin'
'tommcdo/vim-exchange'
'tommcdo/vim-lion'
'tpope/vim-commentary'
'tpope/vim-dispatch'
'tpope/vim-fugitive'
'tpope/vim-repeat'
'tpope/vim-surround'
'vim-scripts/YankRing.vim'
'zivyangll/git-blame.vim'
'ilyachur/cmake4vim'
'lervag/vimtex'
'nickhutchinson/vim-cmake-syntax'
'octol/vim-cpp-enhanced-highlight'
'plasticboy/vim-markdown'
'prettier/vim-prettier'
'richq/vim-cmake-completion'
'sukima/xmledit'
'cespare/vim-toml'

Copyright

This git is maintained by Charles Gueunet <[email protected]>

Copyright (C) 2016 Charles Gueunet All rights reserved.

Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by Charles Gueunet. The name of Charles Gueunet may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ''AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.