Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

SUCH-Vim/SUCH-Vim

Repository files navigation

SUCH-Vim

A Super User's Configuration for Handling Vim

Build Status Open Source Love GPL Licence

Goal

The goal is to have a stable, clean, intuitive configuration of vim. To do that, we try to have the same key binding in each languages for similar features.

You can check all keybindings with SUCH-Help <leader>H or <leader><leader> for current buffer keybinding.

Feature Keybinding
Build <leader>b
Run <leader>R
Completions auto
Rename <leader>r
Go to definition <leader>g
Show documentation <leader>d
Auto formatting on write

We also developed a dependencies control so the user don't have to install manually the npm, pip and cargo packages required by our plugins' selection. Those dependencies are installed automatically in .vim/SUCH-Vim/dependencies/

Installation

You can develop in your cloned Git repository's directory and execute the ./install.sh in order to apply changes to your config. A backup of your last config will be created in the $HOME/.vimrc_old file.

Languages

Markdown

Feature Status
Folding
Preview
Auto formatting
Syntax checking

Python

We use yapf to check the syntax of your python project. It is automatically installed for you but you still have to provide your own ~/.style.yapf file to configure it.

Feature Status
Completions
Rename
Go to definition
Show documentation
Auto formatting
Syntax checking

Javascript

We use eslint to check the syntax of your javascript project. It is automatically installed for you but you still have to provide your own .eslintrc.json file to configure it.

Feature Status
Completions
Rename
Go to definition
Show documentation
Auto formatting
Syntax checking

Html, Css, Json

Language Feature Status
Html Auto formatting
css Auto formatting
json Auto formatting

Go

In order to have all the features, you have to install gocode, godef, goimports, etc. The simplest way to do that is within vim with :GoInstallBinaries.

Feature Status
Completions
Rename
Go to definition
Show documentation
Auto formatting
Syntax checking

C, C++

In order to have formatting features, you have to install astyle and clang-check. You can find them in your distribution packet manager.

Clang-Check uses Compilation database (https://clang.llvm.org/docs/JSONCompilationDatabase.html) in order to figure out specific build options for each file. You can generate those using CMake or Build EAR (bear) (for non-CMake project) that can be find in your distribution packet manager.

Feature Status
Completions
Rename
Go to definition
Show documentation
Auto formatting
Syntax checking

LaTeX

Feature Status
Completions
Rename
Go to definition
Show documentation
Auto formatting
Syntax checking
Build
Run

You can format a paragraph by selecting it and use the <leader>f. Ex: Put your cursor at the begining of the paragraph and do *line number of paragraph*<leader>f

Rust

We use rustfmt to format your project and cargo itself to check the syntax. rustfmt is automatically installed for you but you still have to provide your own rustfmt.toml file at the root of your project to configure it.

Feature Status
Build
Run
Completions
Rename
Go to definition
Show documentation
Auto formatting

Windows

Move to the right window: <Leader>wl <Leader>w<Right>

Move to the left window: <Leader>wh <Leader>w<Left>

Move to the below window: <Leader>wj <Leader>w<Down>

Move to the above window: <Leader>wk <Leader>w<Up>

Buffers

Toggle nerdtree : <Leader>tt

Fuzzy search files : <Leader>ff

View opened buffers and open one of them : <Leader>bb(wait and type a single number)<Enter>

Go to buffer with number : <Leader>bg(enter a number)<Enter>

Delete buffer with number : <Leader>bd(enter a number)d

Create buffer : <Leader>be (write the file name)<Enter>

Next buffer : <Leader>bn

Previous buffer : <Leader>bp

Motions

Cursor

Jump to anywhere you want with minimal keystrokes, with just one key binding.

Search for a character with : <Leader>;{char}{label}.

Search for n characters with : <Leader>ss{char}{char}...{char}<Enter>.

You can also jump to a line with jk : <Leader>j{char} and <Leader>k{char}.

Configuration

You can define your own configuration in the file ~/.suchvimrc.

Here's an example:

" Remap leader
let mapleader = " "

" Define colorscheme and airline theme
autocmd VimEnter * colorscheme solarized
            \| :AirlineTheme solarized

" Add your own set of plugins
call SUCHVim_addPlugins(['altercation/vim-colors-solarized', 'othree/yajs.vim', 'nvie/vim-flake8'])`

" Add your plugins dependencies here if you want them to be installed automatically
autocmd FileType javascript call SUCHVim_check_npm_dependencies(['yajs'])
autocmd FileType python call SUCHVim_check_pip_executable_dependencies(['flake8'])