_
__ __(_)_ __ ___
\ \ / /| | '_ ` _ \
\ V / | | | | | | |
\_/ |_|_| |_| |_|
vimde is a distribution of vim plugins and resources for Neovim, Vim, Gvim and MacVim.
It is a good starting point for anyone intending to use VIM for development running equally well on Windows, Linux, *nix and Mac.
The distribution is completely customisable using a ~/.vimrc.local
, ~/.vimrc.bundles.local
, and ~/.vimrc.before.local
Vim RC files.
Unlike traditional VIM plugin structure, which similar to UNIX throws all files into common directories, making updating or disabling plugins a real mess, vimde 3 uses the Vundle plugin management system to have a well organized vim directory (Similar to mac's app folders). Vundle also ensures that the latest versions of your plugins are installed and makes it easy to keep them up to date.
Great care has been taken to ensure that each plugin plays nicely with others, and optional configuration has been provided for what we believe is the most efficient use.
Lastly (and perhaps, most importantly) It is completely cross platform. It works well on Windows, Linux and OSX without any modifications or additional configurations. If you are using MacVim or Gvim additional features are enabled. So regardless of your environment just clone and run.
To make all the plugins work, specifically asynchronous plugins like vim-plug, you need Neovim.
The easiest way to install vimde is to use our automatic installer by simply copying and pasting the following line into a terminal. This will install vimde and backup your existing vim configuration.
Requires Git 1.7+ and Vim 7.3+
On Linux:
sudo apt install neovim # install neovim, recommended
sudo apt-get install ripgrep # fast grep
# for Mac OSX with homebrew
brew install neovim/neovim/neovim
pip3 install neovim && pip2 install neovim
curl https://raw.githubusercontent.com/Alexoner/vimde/master/bootstrap.sh -L > vimde.sh && sh vimde.sh
If you have a bash-compatible shell you can run the script directly:
sh <(curl https://raw.githubusercontent.com/Alexoner/vimde/master/bootstrap.sh -L)
On Windows and *nix Git and Curl are required. Also, if you haven't done so already, you'll need to install Vim. The quickest option to install all three dependencies (Git, Curl, Vim and vimde) is via Chocolatey NuGet. After installing Chocolatey, execute the following commands on the command prompt:
C:\> choco install vimde
Note: The vimde package will install Vim also!
If you want to install msysgit, Curl and vimde individually, follow the directions below.
Install Vim
After the installation of Vim you must add a new directory to your environment variables path to make it work with the script installation of vimde.
Open Vim and write the following command, it will show the installed directory:
:echo $VIMRUNTIME
C:\Program Files (X86)\Vim\vim74
Then you need to add it to your environment variable path. After that try execute vim
within command prompt (press Win-R, type cmd
, press Enter) and you’ll see the default vim page.
Install msysgit
After installation try running git --version
within command prompt (press Win-R, type cmd
, press Enter) to make sure all good:
C:\> git --version
git version 1.7.4.msysgit.0
Setup Curl
Instructions blatently copied from vundle readme
Installing Curl on Windows is easy as Curl is bundled with msysgit!
But before it can be used with Vundle it's required make curl
run in command prompt.
The easiest way is to create curl.cmd
with this content
@rem Do not use "echo off" to not affect any child calls.
@setlocal
@rem Get the abolute path to the parent directory, which is assumed to be the
@rem Git installation root.
@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@curl.exe %*
And copy it to C:\Program Files\Git\cmd\curl.cmd
, assuming msysgit was installed to c:\Program Files\Git
to verify all good, run:
C:\> curl --version
curl 7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k zlib/1.2.3
Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: Largefile NTLM SSL SSPI libz
The easiest way is to download and run the vimde-windows-install.cmd file. Remember to run this file in Administrator Mode if you want the symlinks to be created successfully.
The simpliest (and safest) way to update is to run customized vim command ':UpdateSelf'. It will completely and non destructively upgrade to the latest version.
vim +UpdateSelf +qall
Or you can simply rerun the installer.
curl https://raw.githubusercontent.com/Alexoner/vimde/master/bootstrap.sh -L -o - | sh
Alternatively you can manually perform the following steps. If anything has changed with the structure of the configuration you will need to create the appropriate symlinks.
cd $HOME/to/vimde/
git pull
vim +PlugInstall! +PlugClean +q
This distribution started as a fork of spf13-vim. I'm always happy to take pull requests from others. A good number of people are already contributors to vimde. Go ahead to fork and customize.
To display unicode symbols like: ¦.
sudo apt install fonts-noto
- Use [Windows Terminal].
- choose font
DroidSans Mono
- webinstall.dev
The .vimrc file is suited to programming. It is extremely well organized and folds in sections. Each section is labeled and each option is commented.
It fixes many of the inconveniences of vanilla vim including
- A single config can be used across Windows, Mac and linux
- Eliminates swap and backup files from littering directories, preferring to store in a central location.
- Fixes common typos like :W, :Q, etc
- Setup a solid set of settings for Formatting (change to meet your needs)
- Setup the interface to take advantage of vim's features including
- omnicomplete
- line numbers
- syntax highlighting
- A better ruler & status line
- & more
- Configuring included plugins
Create ~/.vimrc.local
and ~/.gvimrc.local
for any local
customizations.
For example, to override the default color schemes:
echo colorscheme ir_black >> ~/.vimrc.local
Create a ~/.vimrc.before.local
file to define any customizations
that get loaded before the vimde .vimrc
.
For example, to prevent autocd into a file directory:
echo let g:vimde_no_autochdir = 1 >> ~/.vimrc.before.local
For a list of available vimde specific customization options, look at the ~/.vimrc.before
file.
There is an additional tier of customization available to those who want to maintain a
fork of vimde specialized for a particular group. These users can create .vimrc.fork
and .vimrc.bundles.fork
files in the root of their fork. The load order for the configuration is:
.vimrc.before
- vimde before configuration.vimrc.before.fork
- fork before configuration.vimrc.before.local
- before user configuration.vimrc.bundles
- vimde bundle configuration.vimrc.bundles.fork
- fork bundle configuration.vimrc.bundles.local
- local user bundle configuration.vimrc
- vimde vim configuration.vimrc.fork
- fork vim configuration.vimrc.local
- local user configuration
See .vimrc.bundles
for specifics on what options can be set to override bundle configuration. See .vimrc.before
for specifics
on what options can be overridden. Most vim configuration options should be set in your .vimrc.fork
file, bundle configuration
needs to be set in your .vimrc.bundles.fork
file.
You can specify the default bundles for your fork using .vimrc.before.fork
file. Here is how to create an example .vimrc.before.fork
file
in a fork repo for the default bundles.
echo let g:vimde_bundle_groups=[\'general\', \'programming\', \'misc\', \'youcompleteme\'] >> .vimrc.before.fork
Once you have this file in your repo, only the bundles you specified will be installed during the first installation of your fork.
You may also want to update your README.markdown
file so that the bootstrap.sh
link points to your repository and your bootstrap.sh
file to pull down your fork.
For an example of a fork of vimde that provides customization in this manner see taxilian's fork.
<Leader>ev
opens a new tab containing the .vimrc configuration files listed above. This makes it easier to get an overview of your
configuration and make customizations.
<Leader>sv
sources the .vimrc file, instantly applying your customizations to the currently running vim instance.
These two mappings can themselves be customized by setting the following in .vimrc.before.local:
let g:vimde_edit_config_mapping='<Leader>ev'
let g:vimde_apply_config_mapping='<Leader>sv'
<leader>
is mapped to ','.
alt+h/l
: previous/next tab
tab/shift+tab
: next/previous buffer
ctrl+p
: fuzzy find git filesctrl+alt+p
: fuzzy find files in current directory
<leader>k
vimde contains a curated set of popular vim plugins, colors, snippets and syntaxes. Great care has been made to ensure that these plugins play well together and have optimal configuration.
Create ~/.vimrc.bundles.local
for any additional bundles.
To add a new bundle, just add one line for each bundle you want to install. The line should start with the word "Plug" followed by a string of either the vim.org project name or the githubusername/githubprojectname. For example, the github project xxx/yyy can be added with the following command
echo Plug \'xxx/yyy\' >> ~/.vimrc.bundles.local
Once new plugins are added, they have to be installed.
vim +PlugInstall! +PlugClean +q
<!--echo UnBundle \'AutoClose\' >> ~/.vimrc.bundles.local-->
<!--echo UnBundle \'scrooloose/syntastic\' >> ~/.vimrc.bundles.local-->
Here are a few of the plugins:
Minimalist Vim Plugin Manager
YouCompleteMe is another amazing completion engine. It is slightly more involved to set up as it contains a binary component that the user needs to compile before it will work. As a result of this however it is very fast.
To enable YouCompleteMe add youcompleteme
to your list of groups by overriding it in your .vimrc.before.local
like so: let g:vimde_bundle_groups=['general', 'programming', 'misc', 'scala', 'youcompleteme']
This is just an example. Remember to choose the other groups you want here.
Once you have done this you will need to get Vundle to grab the latest code from git. You can do this by calling :PlugInstall!
. You should see YouCompleteMe in the list.
You will now have the code in your bundles directory and can proceed to compile the core. Change to the directory it has been downloaded to. If you have a vanilla install then cd ~/.vimde-3/.vim/bundle/YouCompleteMe/
should do the trick. You should see a file in this directory called install.sh. There are a few options to consider before running the installer:
- Do you want clang support (if you don't know what this is then you likely don't need it)?
- Do you want to link against a local libclang or have the installer download the latest for you?
- Do you want support for c# via the omnisharp server?
The plugin is well documented on the site linked above. Be sure to give that a read and make sure you understand the options you require.
For java users wanting to use eclim be sure to add let g:EclimCompletionMethod = 'omnifunc'
to your .vimrc.local.
To generate compilation database file for YouCompleteMe to parse, refer to bear.
For example, using scons
:
bear scons -uj`nproc` .
If you run into linking error, you can skip that submodule by compiling it without bear, then compile incrementally with bear
.
Asynchronous lint engine.
Blazing fast fuzzy finder!
QuickStart Launch using <c-p>
.
NERDTree is a file explorer plugin that provides "project drawer"
functionality to your vim editing. You can learn more about it with
:help NERDTree
.
QuickStart Launch using <Leader>e
.
Customizations:
- Use
<C-E>
to toggle NERDTree - Use
<leader>e
or<leader>nt
to load NERDTreeFind which opens NERDTree where the current file is located. - Hide clutter ('.pyc', '.git', '.hg', '.svn', '.bzr')
- Treat NERDTree more like a panel than a split.
If you undo changes and then make a new change, in most editors the changes you undid are gone forever, as their undo-history is a simple list. Since version 7.0 vim uses an undo-tree instead. If you make a new change after undoing changes, a new branch is created in that tree. Combined with persistent undo, this is nearly as flexible and safe as git ;-)
Undotree makes that feature more accessible by creating a visual representation of said undo-tree.
QuickStart Launch using <Leader>u
.
Want to turn fooBar
into foo_bar
? Press crs
(coerce to
snake_case). MixedCase (crm
), camelCase (crc
), snake_case
(crs
), UPPER_CASE (cru
), dash-case (cr-
), dot.case (cr.
),
space case (cr<space>
), and Title Case (crt
) are all just 3
keystrokes away. These commands support
repeat.vim.
DEPRECATED, in favor of fzf.vim. Ctrlp replaces the Command-T plugin with a 100% viml plugin. It provides an intuitive and fast mechanism to load files from the file system (with regex and fuzzy find), from open buffers, and from recently used files.
QuickStart Launch using <c-p>
.
This plugin is a tool for dealing with pairs of "surroundings." Examples of surroundings include parentheses, quotes, and HTML tags. They are closely related to what Vim refers to as text-objects. Provided are mappings to allow for removing, changing, and adding surroundings.
Details follow on the exact semantics, but first, consider the following examples. An asterisk (*) is used to denote the cursor position.
Old text Command New text ~
"Hello *world!" ds" Hello world!
[123+4*56]/2 cs]) (123+456)/2
"Look ma, I'm *HTML!" cs"<q> <q>Look ma, I'm HTML!</q>
if *x>3 { ysW( if ( x>3 ) {
my $str = *whee!; vllllS' my $str = 'whee!';
For instance, if the cursor was inside "foo bar"
, you could type
cs"'
to convert the text to 'foo bar'
.
There's a lot more, check it out at :help surround
NERDCommenter allows you to wrangle your code comments, regardless of
filetype. View help :NERDCommenter
or checkout my post on NERDCommenter.
QuickStart Toggle comments using <Leader>c<space>
in Visual or Normal mode.
Neocomplete is an amazing autocomplete plugin with additional support for snippets. It can complete simulatiously from the dictionary, buffer, omnicomplete and snippets. This is the one true plugin that brings Vim autocomplete on par with the best editors.
QuickStart Just start typing, it will autocomplete where possible
Customizations:
- Automatically present the autocomplete menu
- Support tab and enter for autocomplete
<C-k>
for completing snippets using Neosnippet.
Deprecated.
Auto-completion engine
Syntastic is a syntax checking plugin that runs buffers through external syntax checkers as they are saved and opened. If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them.
Deprecated, in favor of ale
:Neomake
to run lint code
<leader>r
to run
Automatically insert pairs, such as '', "", (), [], {}
AutoClose does what you expect. It's simple, if you open a bracket, paren, brace, quote, etc, it automatically closes it. It handles curlys correctly and doesn't get in the way of double curlies for things like jinja and twig.
Fugitive adds pervasive git support to git directories in vim. For more
information, use :help fugitive
Use :Gstatus
to view git status
and type -
on any file to stage or
unstage it. Type p
on a file to enter git add -p
and stage specific
hunks in the file.
Use :Gdiff
on an open file to see what changes have been made to that
file
QuickStart <leader>gs
to bring up git status
Customizations:
-
<leader>gs
:Gstatus -
<leader>gd
:Gdiff -
<leader>gc
:Gcommit -
<leader>gb
:Gblame -
<leader>gl
:Glog -
<leader>gp
:Git push -
<leader>gw
:Gwrite -
:Git ___ will pass anything along to git.
Preview markdown instantly.
Ack.vim uses ack to search inside the current directory for a pattern.
You can learn more about it with :help Ack
QuickStart :Ack
Tabularize lets you align statements on their equal signs and other characters
Customizations:
<Leader>a= :Tabularize /=<CR>
<Leader>a: :Tabularize /:<CR>
<Leader>a:: :Tabularize /:\zs<CR>
<Leader>a, :Tabularize /,<CR>
<Leader>a<Bar> :Tabularize /<Bar><CR>
vimde includes the Tagbar plugin. This plugin requires exuberant-ctags and will automatically generate tags for your open files. It also provides a panel to navigate easily via tags
QuickStart CTRL-]
while the cursor is on a keyword (such as a function name) to jump to its definition.
Customizations: vimde binds <Leader>tt
to toggle the tagbar panel
Note: For full language support, run brew install ctags
to install
exuberant-ctags.
Tip: Check out :help ctags
for information about VIM's built-in
ctag support. Tag navigation creates a stack which can traversed via
Ctrl-]
(to find the source of a token) and Ctrl-T
(to jump back up
one level).
EasyMotion provides an interactive way to use motions in Vim.
It quickly maps each possible jump destination to a key allowing very fast and straightforward movement.
QuickStart EasyMotion is triggered using the normal movements, but prefixing them with <leader><leader>
For example this screen shot demonstrates pressing ,,w
Airline provides a lightweight themable statusline with no external dependencies. By default this configuration uses the symbols ‹
and ›
as separators for different statusline sections but can be configured to use the same symbols as Powerline. An example first without and then with powerline symbols is shown here:
To enable powerline symbols first install one of the Powerline Fonts or patch your favorite font using the provided instructions. Configure your terminal, MacVim, or Gvim to use the desired font. Finally add let g:airline_powerline_fonts=1
to your .vimrc.before.local
.
In normal mode, press<F3>
to format.
vimde ships with a few additional syntaxes:
- Markdown (bound to *.markdown, *.md, and *.mk)
- Twig
- Git commits (set your
EDITOR
tomvim -f
)
vimde includes solarized and vimde vim color pack:
- NeoSolarized
- flattened_dark/flattened_light
- gruvbox
- ir_black
- molokai
- peaksea
Use :color molokai
to switch to a color scheme.
Terminal Vim users will benefit from solarizing their terminal emulators and setting solarized support to 16 colors:
let g:solarized_termcolors=16
color NeoSolarized
Terminal emulator colorschemes:
- http://ethanschoonover.com/solarized (iTerm2, Terminal.app)
- https://github.com/phiggins/konsole-colors-solarized (KDE Konsole)
- https://github.com/sigurdga/gnome-terminal-colors-solarized (Gnome Terminal)
The solarized color scheme that works in terminal, without having to change terminal color scheme, really!
It also contains a very complete set of snippets for use with snipmate or neocomplete.
Here's some tips if you've never used VIM before:
- Type
vimtutor
into a shell to go through a brief interactive tutorial inside VIM. - Read the slides at VIM: Walking Without Crutches.
- VIM has two (common) modes:
- insert mode- stuff you type is added to the buffer
- normal mode- keys you hit are interpreted as commands
- To enter insert mode, hit
i
- To exit insert mode, hit
<ESC>
- Use
:q
to exit vim - Certain commands are prefixed with a
<Leader>
key, which by default maps to\
. vimde useslet mapleader = ","
to change this to,
which is in a consistent and convenient location. - Keyboard cheat sheet.
set clipboard=unnamedplus
- (Optional) Configure
tmux
to use system clipboard - Install
xsel
and make sureDISPLAY
variable is set correctly
nvim --startuptime start.txt # or
time vim --startuptime start.log +:q
cat start.log|less
The time stamp indicates when the specific plugin is done loading.
For example if python3.vim
is slow to load, set let g:python3_host_prog='python'
in vimrc
will let the python provider skip detecting usable python to speed up loading.