Home

Awesome

lin.vim : Lin Rongbin's (Neo)vim Distribution

Deprecated: Leave vim behind, switch to neovim only for its best performance, editing experience and powerful community. Please use lin.nvim for neovim, it's the next generation of my neovim distribution. This project is no long actively developed, while PR and bug fix is still welcomed.

lin.vim is a highly configured vim/neovim distribution integrated tons of utilities for development, inspired by spf13-vim.

Table of Contents

Introduction

Aim to be out of box, IDE-like editing experience, high performance, light weight and friendly to both vim and neovim users. Focus on and only on editing, no compile/package/debug.

Solve below issues:

Screenshots

<!-- #### Simple but pretty UI --> <!-- ![edit-markdown.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/edit-markdown.png) --> <p align="center"> <img alt="edit-markdown.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/edit-markdown.png" width="100%"> </br> <em style="fontsize:50%">Simple but pretty UI</em> </p> <!-- #### Code complete for Python3 --> <!-- ![python3-complete.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/python-complete.png) --> <p align="center"> <img alt="python3-complete.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/python-complete.png" width="100%"> </br> <em style="fontsize:50%">Code complete for python3</em> </p> <p align="center"> <img alt="outline-terminal.jpg" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/outline-terminal.jpg" width="100%"> </br> <em style="fontsize:50%">Outlines and Terminal</em> </p> <!-- #### Cursor movement --> <!-- ![fast-cursor-movement.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/fast-cursor-movement1.png) --> <p align="center"> <img alt="fast-cursor-movement.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/fast-cursor-movement1.png" width="100%"> </br> <em style="fontsize:50%">Fast cursor movement</em> </p> <!-- #### Search text --> <!-- ![search-text.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/search-text.png) --> <p align="center"> <img alt="search-text.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/search-text.png" width="100%"> </br> <em style="fontsize:50%">Search text</em> </p> <!-- #### Search files --> <!-- ![search-files.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/search-files.png) --> <p align="center"> <img alt="search-files.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/search-files.png" width="100%"> </br> <em style="fontsize:50%">Search files</em> </p> <!-- #### Markdown preview --> <!-- ![markdown-preview.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/markdown-preview1.png) --> <p align="center"> <img alt="markdown-preview.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/markdown-preview1.png" width="100%"> </br> <em style="fontsize:50%">Markdown preview</em> </p>

Feature

Installation

UNIX/Linux/MacOS

    git clone https://github.com/linrongbin16/lin.vim ~/.vim && cd ~/.vim && ./install.sh

Notice:

  1. The install.sh will automatically install below dependencies with system package manager:

  2. For now supported platforms are:

    • Debian/ubuntu based linux: use apt as software installer.
    • Fedora/centos based linux: use dnf as software installer.
    • Archlinux based linux: use pacman as software installer.
    • MacOS: use brew as software installer, please install Xcode and homebrew as pre-requirements.
    • Other *NIX systems such as gentoo, bsd are not supported yet.

Windows

  1. Install Visual Studio with below 2 components:

    • .NET Desktop Development
    • Desktop development with C++
<!-- ![install-windows-visual-studio2.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-visual-studio2.png) --> <p align="center"> <img alt="install-windows-visual-studio2.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-visual-studio2.png" width="100%"> <em style="fontsize:50%">Select .NET and C++ components</em> </p>
  1. Install 64-bit Git for Windows Setup with below 3 options:

    • In the Select Components step, select Associate .sh files to be run with Bash.
    • In the Adjusting your PATH environment step, select Use Git and optional Unix tools from the Command Prompt.
    • In the Configuring the terminal emulator to use with Git Bash step, select Use Windows's default console window. This will add git.exe and linux builtin commands (such as bash.exe, cp.exe, mv.exe, cd.exe, ls.exe, etc) to $env:Path.
<!-- ![install-windows-git1.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git1.png) --> <!-- ![install-windows-git2.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git2.png) --> <!-- ![install-windows-git3.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git3.png) --> <p align="center"> <img alt="install-windows-git1.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git1.png" width="65%"> </br> <em style="fontsize:50%">Treat .sh files as bash script</em> </p> <p align="center"> <img alt="install-windows-git2.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git2.png" width="65%"> </br> <em style="fontsize:50%">Enable both git and linux builtin commands</em> </p> <p align="center"> <img alt="install-windows-git3.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git3.png" width="65%"> </br> <em style="fontsize:50%">Add git and linux commands to environment path</em> </p>
  1. Install other 64-bit dependencies:

    • vim-win32-installer (gvim_{x.y.z}_x64.exe): add gvim.exe to $env:Path
    • neovim (nvim-win64.msi): add nvim.exe to $env:Path
    • cmake (cmake-{x.y.z}-windows-x86_64.msi): add cmake.exe to $env:Path
    • make-for-win32 (make-{x.y}-bin.zip): add make.exeto$env:Path
    • python3 (python-{x.y.z}-amd64.exe): manually copy python.exe to python3.exe, then add python3.exe to $env:Path (Since windows python3 installer only provide python.exe).
    • rust (rustup-init.exe (64-bit)): add rustc.exe, cargo.exe to $env:Path
    • golang (go{x.y.z}.windows-amd64.msi): add go.exe to $env:Path
    • nodejs (node-v{x.y.z}-x64.msi): add node.exe, npm.exe to $env:Path
    • universal-ctags (ctags-p{x.y.d.z}-x64.zip): add ctags.exe, readtags.exe to $env:Path
  2. Install Hack NFM.

  3. Run powershell commands as administrator:

    git clone https://github.com/linrongbin16/lin.vim $env:UserProfile\.vim && cd $env:UserProfile\.vim && .\install.ps1

Notice:

  1. If you are using WSL, C:\Windows\System32\bash.exe could lead you to WSL instead of the bash.exe from Git for Windows. Make sure git path is ahead of C:\Windows\System32, so git bash will be first detected (wsl.exe could connect to WSL as well so no need to worry about losing C:\Windows\System32\bash.exe).
<!-- ![install-windows-git-path.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git-path.png) --> <p align="center"> <img alt="install-windows-git-path.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-git-path.png" width="65%"> </br> <em style="fontsize:50%">Move git path ahead of C:\Windows\System32</em> </p>
  1. Git for Windows provide an old-version vim.exe, make sure gvim.exe (from vim-win32-installer) path is ahead of git, so vim.exe from vim-win32-installer will be first detected. You could also only use gvim.exe to avoid the old-version vim.
<!-- ![install-windows-gvim-path.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-gvim-path.png) --> <p align="center"> <img alt="install-windows-gvim-path.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-gvim-path.png" width="65%"> </br> <em style="fontsize:50%">Move gvim path ahead of git</em> </p>
  1. Python3 version must be compatible with gvim's libpython3.lib, or python3 will not be loaded correctly. Please use gvim --version to find its libpython3.lib version.
<!-- ![install-windows-gvim-libpython3.png](https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-gvim-libpython3.png) --> <p align="center"> <img alt="install-windows-gvim-libpython3.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-gvim-libpython3.png" width="65%"> </br> <em style="fontsize:50%">Find libpython3.lib version at bottom</em> </p>
  1. Disable Windows App alias python.exe or python3.exe, this could lead you to the wrong python from windows store.
<p align="center"> <img alt="install-windows-app-alias.png" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/install-windows-app-alias.png" width="65%"> </br> <em style="fontsize:50%">Disable python.exe and python3.exe</em> </p>

More Options

The install.sh (and install.ps1) provide 3 installation modes:

And more options:

Notice:

The install.ps1 especially provide two more options for Windows:

Use a package manager (such as chocolatey and scoop) could be a better choice, just make sure they're available in $env:Path.

Upgrade

For distribution, please re-install by:

    cd ~/.vim
    git pull origin master
    ./install.sh

For vim plugins, please open (neo)vim and update by:

    :PlugUpdate!

User Guide

In this section, vim editing mode are specified with:

Meta-key (M), alt-key (A) on Windows/Linux, and command-key (D) on macOS are collectively refered as:

Global Key Mappings

Hot Keys

Control/Command+? Keys

Control+? keys are configured following most editors' behaviour under windows:

Additionally for macOS, command+? keys are configured following the same behaviour (control+? keys are also enabled):

Copy/paste across different vim instances through remote ssh could be difficult, so introduce two shortcuts using local cache:

You could configure all global key mappings in ~/.vim/settings.vim.

UI

File Explorer

File explorer is support by fern.vim (switched to nvim-tree.lua on neovim 0.7+).

Navigation:

Create/rename/delete:

Copy/paste/cut:

Adjust explorer width:

Other:

For neovim 0.7+ only:

You could editing ~/.vim/repository/lambdalisue/fern.vim.vim (or ~/.vim/repository/kyazdani42/nvim-tree.lua.vim) to customize key mappings. Please refer to fern.vim - wiki - Mappings (or :help nvim-tree-mappings) for more information.

Tabline

Notice that on different platforms,terminals and GUI clients, some ctrl/meta+keys could been overwritten. So introduced several ways of mappings to make sure for the availibility.

Navigation:

For neovim 0.7+ only:

Support by vim-buffet (switched to barbar.nvim on neovim 0.5+).

Font

By default Hack Nerd Font Mono is enabled. Please install other nerd fonts and edit ~/.vim/settings.vim to customize fonts.

IDE-like Editing

Code Complete

Jumps

Symbols

Code Format

Code Actions

CodeLens

Git

Search

Search engine use fzf.vim and integrated with coc.nvim with coc-fzf. All fzf commands are configured with prefix Fzf, for example :Files are renamed to :FzfFiles, :Rg are renamed to :FzfRg.

Text Search

File Search

Git Search

Other Search

Coc.nvim Search

Key mappings are configured with prefix char c after <Space>.

Please visit fzf.vim and coc-fzf for more information.

Editing Enhancement

Easy Comment

Linewise comment:

Blockwise comment (for neovim only):

Support by tcomment_vim (switched to Comment.nvim on neovim).

Cursor Motion

See Fast cursor movement.

Support by vim-easymotion (switched to hop.nvim on neovim 0.5+).

Word Movement

(Neo)vim word movement cannot recognize real literal word, such as camel case, mixed digits, characters, punctuations, etc. So introduce better word motions:

Support by vim-wordmotion.

Better Repeat

Better repeat(.) operation, support by vim-repeat.

Better Surrounding(Quotes) Editing

Better surrounding(quotes) editing, support by vim-surround.

Better Matching

Better matching include HTML tags, if-endif, and other things, support by vim-matchup.

Auto Pair and Close HTML Tag

Auto pair and close html tags, support by auto-pairs (switched to nvim-autopairs on neovim 0.5+) and vim-closetag.

Customization

Please check vim entry ~/.vimrc (~/_vimrc on windows), and neovim entry ~/.config/nvim/init.vim (~/AppData/Local/nvim/init.vim on windows). They load below vim files:

For basic install mode, there's only standalone vim settings, see More Options.

Appendix

Embeded Language Servers

Color Schemes

Contribute

Please open issue/PR for anything about lin.vim.

Like lin.vim? Consider

<a href="https://www.buymeacoffee.com/linrongbin16" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

Or

<p align="center"> <img alt="wechat-pay.jpeg" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/wechat-pay.jpeg" width="45%"> &nbsp; &nbsp; &nbsp; &nbsp; <img alt="alipay.jpeg" src="https://raw.githubusercontent.com/linrongbin16/lin.vim.github.io/main/screen-snapshots/alipay.jpeg" width="45%"> </p>