I have worked daily with vim since childhood, and this is my actual vim configuration.
Gitgutter + Linting + Inline warnings and errors
Buffer Explorer:
Ack:
Tagbar and Nerdtree:
Radeon and Control+P:
Before you go, make sure you make a backup of your current vim configuration, go to your home folder and rename both .vim folder and .vimrc file to a different name:
cd ~ && mv .vimrc .vimrc.backup && mv .vim .vim.backup
Let's install:
-
Go to your home folder, clone this repository, and rename it to .vim:
cd ~ && git clone https://github.com/juanmitaboada/vim && mv vim .vim
-
Link .vimrc into your home folder:
ln -s .vim/.vimrc
-
Install dependencies (it will request your sudo password):
~/.vim/vim_install_plugins.sh
-
Let's install all plugins:
cd ~/.vim/bundle/ && ./update.sh
-
You are ready to go
There are plenty of shortcuts but, these are the basic ones:
Shortcut | Description | Provided by |
---|---|---|
* | Search forward word under the cursor | vim |
n | Search next word using the same criteria | vim |
Shift+n | Search the previous word using the same criteria | vim |
# | Search backward word under the cursor | vim |
K | Search for the word inside man | vim |
gd | Go to the first definition of the element under the cursor | vim |
F2 | Start writing and, ultisnips will fill the basic skeleton (check examples) | ultisnips |
F3 | Tagbar panel (on/off) | tagbar |
F4 | NERD Tree (on/off) | nerdtree |
F8 | Save the current session on the current folder | vim |
Ctrl+J | Beautify the buffer using JSON format | vim |
Alt+up | Show all buffers | BufferExplorer |
Alt+down | Close current buffer | vim |
Alt+left | Move to previous buffer | vim |
Alt+right | Move to next buffer | vim |
Ctrl+up | Move current line/block up | vim |
Ctrl+down | Move current line/block down | vim |
Ctrl+right | Indent current line/block one level | vim |
Ctrl+left | Unindent current line/block one level | vim |
Ctrl+P colors | Search for files with the word "colors" in all the project | ctrlp |
Enter | Go to function definition | ctags |
Backspace | Go back from function definition | ctags |
:TagsGenerate! | Will generate one or more tags files | vim-tags |
:7,17Commentary | Comment/Uncomment from line 7 to line 17 both included | Commentary |
:Ack colors | Search everywhere in the project for the word "colors" | Ack |
if:
if condition:
pass
ife:
if condition:
pass
else:
pass
ei:
elif condition:
...
el:
else:
...
for:
for item in iterable:
pass
wl:
while condition:
...
cl:
class ClassName(object):
"""doctstring for ClassName"""
def __init__(self, args):
super(ClassName, self).__init__()
self.arg = arg
def:
def function(arg1):
"""TODO: Docstring for function.
:arg1: TODO
:returns: TODO
"""
Bundle | Description |
---|---|
Ack | Search tool with an enhanced results list |
Airline | Lean & mean status/tabline for Vim that's light as air |
ALE | ALE (Asynchronous Lint Engine) is a plugin providing linting (sytax checking and semantic errors) |
Arduino Snippets | Snippets files for Arduino |
Arduino Syntax | Syntax file and get syntax highlighting for Arduino functions |
Black | Uncompromising Python code formatter |
Bufexplorer | Quickly and easily switches between buffers |
CCLS | Ccls, which originates from cquery, is a C/C++/Objective-C language server |
CCTree | Plugin generates a symbol dependency tree (aka call tree, call graph) in real-time |
Clang | Use of clang to parse and complete C/C++ source files |
Commentary | Comment stuff out |
CtrlP | Full path fuzzy file, buffer, mru, tag, ... finder |
DelimitMate | This plug-in provides automatic closing of quotes, parentheses, brackets, etc. |
Dispatch | Leverage the power of Vim's compiler plugins without being bound by synchronicity |
Gitgutter | Shows a git diff in the sign column |
ISort | Sort python imports |
Javascript | Syntax highlighting and improved indentation for JavaScript |
LSP | Async Language Server Protocol |
Markdown | Syntax highlighting, matching rules and mappings for the original Markdown and extensions |
NerdTree | File system explorer |
Pathogen | Makes it super easy to install plugins and runtime files |
Platform.io | This is a collection of helper commands to ease the use of PlatformIO |
Platform.io Neomake | Easily configure neomake to recognize your PlatformIO project's include path |
Radon | Show the cyclomatic complexity of Python code (we will use a slightly modified version at juanmitaboada/vim-radon) |
Repeat | Remaps . in a way that plugins can tap into it |
Rust | Rust file detection, syntax highlighting, formatting, Syntastic integration, and more |
Signify | Uses the sign column to indicate added, modified and removed lines in a file that is managed by a VCS |
Snippets | Snippets files for various programming languages |
Surround | Is all about "surroundings": parentheses, brackets, quotes, XML tags, and more |
Tagbar | Provides an easy way to browse the tags of the current file and get an overview of its structure |
Tags | The Ctags generator |
Typescript | Syntax file and other settings for TypeScript |
Ultisnips | The ultimate solution for snippets |
YouCompleteMe | A code-completion engine |
Zig | File detection and syntax highlighting for the zig programming language |