lin.vim is a highly configured vim/neovim distribution integrated tons of utilities for development, inspired by spf13-vim.
- Introduction
- Installation
- User Guide
- Embeded Language Servers
- Reference
- Contribute
Aim to be out of box, IDE-like editing experience, high performance, light weight and friendly to most users. Focus on and only on editing, no compile/package/debug.
Solve below issues:
- Time-costing study and configure vim scripts - All behaviors configured follow vim community's best practice or most popular modern editors(just like vscode).
- Lack of programming language support or IDE-like features - coc.nvim and a set of plugins are installed, with a bunch of language servers embeded.
- Don't know how to install/choose/configure plugins: All plugins are selected carefully and well cooperated with each other. Provide best performance and user experience, cover most modern editor features(again, just like vscode).
- Time-costing repeat installation on different machines and OS - All done by one-line command (not on Windows for now), all behaviors are the same(the only difference is use cmd-key on macOS instead of alt-key on Windows/Linux).
- Naive UI-looking and lack of icons/colorschemes - Pretty colorschemes, icons, opened tabs, file explorer, file status integrated.
- Special customization - Open and edit
~/.vimrc
~/.vim/plugin.vim
~/.vim/setting.vim
, or add a new language server with coc configuration~/.vim/coc-settings.json
.
- One-line command installation (not on windows for now).
- Work on multiple OS platforms:
- Windows.
- macOS.
- Linux(Ubuntu/Debian/Fedora/Manjaro).
- Support both vim and neovim, neovim 0.7+ is strongly recommended for best performance and experience.
- Modern editor UI features:
- File explorer.
- Icons.
- Color schemes (see Color Schemes - Reference) randomly selected on start.
- Status line.
- Tab line and buffer explorer.
- Outline/Tags.
- IDE-like editing features supported by coc.nvim, a bunch of language servers(see Embeded Language Servers) embeded by default:
- Code complete.
- Diagnostic.
- Lint.
- Code format.
- Jump between symbols.
- Code Actions.
- Code Lens.
- Search engine features supported by fzf.vim:
- Text search on text/lines/tags/search-histories/command-histories/yank-histories.
- File search on files/buffers/history-files.
- Git search on commits/uncommit-changes.
- Coc.nvim integrated search on symbols/outline/diagnostics/yank.
- Other enhancement search on vim-marks/vim-key-mappings/vim-commands/help-tags.
- Other editing enhancements (see Editing Enahncement).
- Custom configuration.
Before installation, please make sure access of below domains are available:
- github.com.
- raw.githubusercontent.com.
- www.rust-lang.org.
- crates.io.
- go.dev.
- storage.googleapis.com.
install.sh
will automatically install below softwares with system package managers:
- git.
- vim and neovim.
- clang(for macOS) or gcc(for linux), make, pkg-config, cmake, linux also need autoconf and automake.
- python3 (python 2.x is not support) and some pip packages.
- node.js and some npm packages.
- golang.
- rust and some modern commands.
- curl and wget.
- universal-ctags.
- hack nerd font.
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.
$ git clone https://github.com/linrongbin16/lin.vim ~/.vim && cd ~/.vim && ./install.sh
The goal of installation on windows is to install native executable file, no WSL nor MYSY2 for below reasons:
- Native executable file has better performance, WSL (actually a virtual machine) is quite slow and heavy.
- Git for Windows already contains MYSY2 and provide Unix/Linux builtin commands, we could leverage that.
-
Install Visual Studio with below 3 components checked:
- .NET Desktop Development
- Visual C++ Desktop Development (Desktop development with C++)
- Common Windows Platform Development (Universal Windows Platform development)
-
Install 64-bit Git for Windows Setup with especially below 3 options checked:
- In the Select Components step, check Associate .sh files to be run with Bash.
- In the Adjusting your PATH environment step, choose Use Git and optional Unix tools from the Command Prompt.
- In the Configuring the terminal emulator to use with Git Bash step, choose Use Windows's default console window.
This will add both git.exe
and linux builtin commands (such as bash.exe
, cp.exe
, mv.exe
, cd.exe
, ls.exe
, etc) in $env:Path
, turn command prompt and powershell to a linux-like shell, thus help (neo)vim plugins running correctly.
-
Install other dependencies (x64 is preferred):
- vim-win32-installer: add
gvim.exe
to$env:Path
- neovim: add
nvim.exe
to$env:Path
- cmake: add
cmake.exe
to$env:Path
- make-for-win32: add
make.exe
to$env:Path
- python3: since python3 installer don't provide
python3.exe
andpip3.exe
, manually copypython.exe
aspython3.exe
, copypip.exe
aspip3.exe
, then add to$env:Path
. - rust: add
rustc.exe
,cargo.exe
to$env:Path
- golang: add
go.exe
to$env:Path
- nodejs: add
node.exe
,npm.exe
to$env:Path
- universal-ctags: add
ctags.exe
,readtags.exe
to$env:Path
- vim-win32-installer: add
Use package manager (such as chocolatey and scoop) could be a better choice, just make sure they're available in $env:Path
.
-
Install Hack NF:
Hack Bold Nerd Font Complete Mono Windows Compatible.ttf
Hack Bold Italic Nerd Font Complete Mono Windows Compatible.ttf
Hack Italic Nerd Font Complete Mono Windows Compatible.ttf
Hack Regular Nerd Font Complete Mono Windows Compatible.ttf
-
Finally run below commands in powershell:
$ git clone https://github.com/linrongbin16/lin.vim $env:UserProfile\.vim
$ cd $env:UserProfile\.vim
$ .\install.ps1
- If you are using WSL,
C:\Windows\System32\bash.exe
could lead you to WSL instead of thebash.exe
provided by Git for Windows. Make sure git environment path is ahead ofC:\Windows\System32
(wsl.exe
could connect to WSL as well, so no need to worry about losingbash.exe
), so git bash will be first detected on$env:Path
.
- Python3 version must be compatible with gvim's libpython3.so version, or it will not been loaded. Latest vim 8.2-9 is compiled with python3.10. Please use
gvim --version
to find its libpython3.so version.
- Don't use old-version
vim.exe
provided by Git for Windows, usegvim.exe
provided by vim-win32-installer. Or you could movegvim.exe
environment path ahead of Git for Windows, this could make surevim.exe
from vim-win32-installer be first detected on$env:Path
.
- Disable Windows App alias
python.exe
orpython3.exe
, this could lead you to the wrong python provide by windows application store. Please see: Manage App Execution Aliases on Windows10 and Default app aliases in windows.
In this section, vim editing mode are specified with:
- ๐ฝ - Normal Mode
- ๐ - Visual Mode
- ๐ธ - Insert Mode
Vim key are specified with:
D
- Meta-Key (Command-Key on macOS, Alt-Key on other os).
F1
๐ฝ - toggle(open/close) file explorer, see Simple but pretty UI.F2
๐ฝ - toggle(open/close) undo tree.F3
๐ฝ - toggle(open/close) vista outline/tags, see Code complete for C++.F4
๐ฝ - switch between C/C++ header and source files.F8
๐ฝ - open markdown preview.F9
๐ฝ - change color theme randomly, see Screenshots.F10
/SHIFT-F10
๐ฝ - open/close(toggle) opened buffers explorer.
You could configure these keys in ~/.vim/setting.vim.
Navigation:
h
๐ฝ - collapse directory.l
๐ฝ - open or expand directory.<CR>
๐ฝ - open file or cd into directory.<BS>
๐ฝ - leave directory and goto upper directory.e
๐ฝ - open file insplit
.E
๐ฝ - open file invsplit
.t
๐ฝ - open file in new tab.
Create/Delete/Copy/Paste/Cut:
a
/A
๐ฝ - create new file/directory.m
/r
๐ฝ - move/rename file/directory.<C-c>
๐ฝ - copy file/directory into internal clipboard just like in Windows.<C-x>
๐ฝ - cut file/directory into internal clipboard just like in Windows.<C-v>
๐ฝ - paste internal clipboard file/directory to current directory just like in Windows.d
๐ฝ - trash file/directory to system trash-bin, only works on Windows/macOS.D
๐ฝ - force delete file/directory, possiblely implemented withrm
.R
๐ฝ - refresh file explorer.
Resize Width:
<D-Right>
/<D-.>
๐ฝ - make explorer bigger.<D-Left>
/<D-,>
๐ฝ - make explorer smaller.
Others:
s
๐ฝ - open file in system file manager(such as Finder in macOS).?
๐ฝ - open/close(toggle) help.
For neovim 0.7+ only:
P
๐ฝ - preview file content.I
๐ฝ - preview file info.H
๐ฝ - toggle dotfiles hidden.y
๐ฝ - copy file name string.Y
๐ฝ - copy absolute file path string.
Support by fern.vim (switched to nvim-tree.lua on neovim 0.7+), you could use key mappings on the file explorer left side:
You could editing ~/.vim/setting/lambdalisue/fern.vim.vim (or ~/.vim/setting/kyazdani42/nvim-tree.lua.vim) to customize key mappings. Please refer to fern.vim - wiki - Mappings (or nvim-tree.lua - README) for more key mappings.
<leader><tab>
/<D-Right>
/<D-.>
๐ฝ - go to next buffer on the right.<leader><s-tab>
/<D-Left>
/<D-,>
๐ฝ - go to previous buffer on the left(Notice some terminal/GUI could eat Alt+, Alt+. and Command+, Command+.).<leader>bd
๐ฝ - close current buffer (and go to a nearest buffer) without closing vim window.F10
/SHIFT-F10
๐ฝ - open/close(toggle) opened buffers explorer.
Meta-1 ~ Meta-9 (on macOS it's Command-Key, on others it's Alt-Key) are mapped to 1~9 buffers, Meta-0 are mapped to navigate to the last buffer.
<D-1>
๐ฝ - go to buffer-1.<D-2>
๐ฝ - go to buffer-2.<D-3>
๐ฝ - go to buffer-3.<D-4>
๐ฝ - go to buffer-4.<D-5>
๐ฝ - go to buffer-5.<D-6>
๐ฝ - go to buffer-6.<D-7>
๐ฝ - go to buffer-7.<D-8>
๐ฝ - go to buffer-8.<D-9>
๐ฝ - go to buffer-9.<D-0>
๐ฝ - go to the last buffer.
For neovim 0.5+ only:
<D-S-Right>
๐ฝ - move current buffer to next position(right side).<D-S-Left>
๐ฝ - move current buffer to previous position(left side).<LeftMouse>
๐ฝ - go to target buffer.<MiddleMouse>
๐ฝ - close target buffer.
Support by vim-buffet(switched to barbar.nvim on neovim 0.5+).
lin.vim use Hack Nerd Font by default. Please manually install other nerd fonts and configure in ~/.vim/setting.vim for other options.
<c-n>
/<down>
๐ธ - navigate to next suggestion.<c-p>
/<up>
๐ธ - navigate to previous suggestion.<tab>
/<cr>
๐ธ - confirm current suggestion or snippet.<esc>
/<c-[>
๐ธ - close suggestion.<c-f>
๐ธ - jump to next snippet position.<c-b>
๐ธ - jump to previous snippet position.<c-k>
๐ธ - force trigger suggestion.
[d
๐ฝ - go to previous diagnostic location.]d
๐ฝ - go to next diagnostic location.gd
๐ฝ - go to definition.gy
๐ฝ - go to type(function) definition.gi
๐ฝ - go to implemention.gr
๐ฝ - go to references.
K
๐ฝ - show hover(symbol definition).<leader>rs
๐ฝ - rename symbol.
<leader>cf
๐ฝ๐ - format code on current buffer or visual-selected code.
<leader>ca
๐ฝ๐ - run code actions on current cursor position or visual-selected code.<leader>qf
๐ฝ - apply quick fix on current line.
<leader>cl
๐ฝ - run code lens on current line.
]c
๐ฝ - go to next git chunk in current buffer.[c
๐ฝ - go to previous git chunk in current buffer.<leader>gs
๐ฝ - show git chunk info on current line.<leader>gc
๐ฝ - show git commit info on current line.
For neovim 0.5+ only:
<leader>gb
๐ฝ - toggle git blame info on current line.
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
.
<space>gr
๐ฝ - search text by:FzfRg
.<space>l
๐ฝ - search lines on opened buffers by:FzfLines
.<space>t
๐ฝ - search tags by:FzfTags
.<space>y
๐ฝ - search yank history by:CocFzfList yank
.<space>sh
๐ฝ - search search history by:FzfHistory/
.<space>ch
๐ฝ - search vim command history by:FzfHistory:
.
<space>f
/<c-p>
๐ฝ - search files by:FzfFiles
.<space>b
๐ฝ - search opened buffers by:FzfBuffers
.<space>hf
๐ฝ - search history files (v:oldfiles) and opened buffers by:FzfHistory
.
<space>gc
๐ฝ - search git commits by:FzfCommits
.<space>gf
๐ฝ - search git files rby:FzfGFile
.<space>gs
๐ฝ - search git status(also diff files by preview) by:FzfGFiles?
.
<space>mk
๐ฝ - search marks by:FzfMarks
.<space>mp
๐ฝ - search normal mode vim key mappings by:FzfMaps
.<space>vc
๐ฝ - search vim commands by:FzfCommands
.<space>ht
๐ฝ - search help tags by:FzfHelptags
.
Key mappings are configured with prefix char c
after <space>
.
<space>cs
๐ฝ - search symbols by:CocFzfList symbols
.<space>cd
๐ฝ - search diagnostics by:CocFzfList diagnostics
.<space>co
๐ฝ - search outline/tags by:CocFzfList outline
.<space>cc
๐ฝ - search commands by:CocFzfList commands
.<space>cl
๐ฝ - search location by:CocFzfList location
.
Please visit fzf.vim and coc-fzf for more information.
when you want copy/paste between different vim instances. Use enhanced copy-paste to stored text content in a file cache:
<leader>y
๐ - copy visual-selected text to~/.vim/.enhanced-copy-paste-cache
.<leader>p
๐ฝ - paste text saved from~/.vim/.enhanced-copy-paste-cache
.
You could configure these key mappings in ~/.vim/setting/linrongbin16/enhanced-copy-paste.vim.
See Fast cursor movement.
<leader>f{char}
๐ฝ - move to a single {char}.<leader>s{char}{char}
๐ฝ - move to consequent two {char}{char}.<leader>w
๐ฝ - move to word.<leader>l
๐ฝ - move to line.
Support by vim-easymotion(switched to hop.nvim on neovim 0.5+).
Better word movement enhancement.
W
๐ฝ - move forward to a single word.B
๐ฝ - move backward to a single word.E
๐ฝ - move forward to the end of a single word.gE
๐ฝ - move backward to the end of a single word.
Support by vim-wordmotion.
Enhancement for .
operation.
Support by vim-repeat.
Enhancement for add/remove quotes operation.
Support by vim-surround
Enhancement for brackets(pairs) and html tags.
Support by vim-matchup.
Enhancement for auto close brackets(pairs) and html tags.
Support by auto-pairs (switched to nvim-autopairs on neovim 0.5+) and vim-closetag.
Normal mode:
gcc
๐ฝ - toggle current line using linewise comment.gc{motion}
๐ฝ - toggle from current line with motion (jkhl) using linewise comment.gc<Count>{motion}
๐ฝ - toggle from current line with motion repeat times using linewise comment.
Virual Mode:
gc
๐ - toggle visual-selected code using linewise comment.
Support by tcomment_vim (switched to Comment.nvim on neovim).
Please add plugins in ~/.vim/plugin.vim
, add settings in ~/.vim/setting.vim
and ~/.vim/coc-settings.json
.
These language servers are installed by default:
- c/c++
- python3 (python2 is not supported)
- rust
- go
- html/xml/markdown
- css/sass/scss/less
- json
- javascript/typescript/jsx/tsx
- Nerd font cheat sheet: https://www.nerdfonts.com/cheat-sheet.
- IDE-like defaults for neovim: LunarVim.
- Color Schemes:
Please open issue/PR for anything about lin.vim.
Like lin.vim? Consider
Or