lin.vim is a highly configured VIM/Neovim integrated tons of utilities for development running on most operating systems.
- Running on multiple platforms: UNIX/Linux, Windows and MacOS.
- Code complete, lint and format for most programming languages by coc.nvim.
- Random color schemes and pretty icons.
- File and buffer explorer and better status line.
- Source code and file fuzzy search.
- Useful command line utilities for: git, text search and encoding/decoding, file operation and compression/extraction, datetime calculation, ip calculation, etc.
- Support both VIM and Neovim.
- Use zsh for UNIX/Linux/MacOS with pretty prompt.
- Custom configuration.
|+command Command line utilities(vcmd) implemented in python3.
|+install Installation scripts for all platforms.
|+picture Screenshots for README.
|+setting VimL script settings.
|+template Templates for user-settings.vim, coc-settings.json, vim-plug.vim and .linvimrc.
|`install.sh UNIX/Linux/MacOS bash installation script.
|`install.ps1 Windows PowerShell installation script.
|`LICENSE The license file.
|`lin.vim The .vimrc file.
|`README.md Readme wiki.
$ git clone https://github.com/linrongbin16/lin.vim ~/.vim && cd ~/.vim && ./install.sh
-
Install Visual Studio with options:
- .NET Desktop Development
- Visual C++ Desktop Development
- Common Windows Platform Development
-
Install third party dependencies with recommanded chocolatey as administrator:
$ choco install -y git cmake vim llvm nodejs ag ripgrep universal-ctags
$ choco install -y python --version=3.8.0
-
Add above dependencies in
$env:Path
. Python3 on Windows don't providepython3.exe
, please copypython.exe
aspython3.exe
to explicitly distinguish from python2. You could also manually install these dependencies or through other package manager. Just make sure (Neo)vim's compiled python3 version is compatible withpython3.exe
and they're avaiable in$env:Path
:git.exe
cmake.exe
gvim.exe
clang.exe
,clang++.exe
,clangd.exe
,clang-format.exe
node.exe
,npm.exe
python.exe
,pip.exe
ag.exe
rg.exe
ctags.exe
-
Install following components as administrator:
$ git clone https://github.com/linrongbin16/lin.vim $env:UserProfile\.vim
$ cd $env:UserProfile\.vim
$ .\install.ps1
-
Add
$env:UserProfile\.vim\command
in$env:Path
. -
Install hack nerd fonts windows compatible version downloaded as
$env:UserProfile\.vim\guifonts\Hack.zip
:Hack Regular Nerd Font Complete Mono Windows Compatible.ttf
Hack Italic Nerd Font Complete Mono Windows Compatible.ttf
Hack Bold Italic Nerd Font Complete Mono Windows Compatible.ttf
Hack Bold Nerd Font Complete Mono Windows Compatible.ttf
install.sh will install third party dependencies automatically through package manager, which could conflict with your systems:
- git
- (g)vim (macvim on MacOS)
- curl
- wget
- llvm (clang, clang++, clangd, clang-format)
- autoconf
- automake
- cmake
- the_silver_searcher(ag)
- ripgrep(rg)
- zip, unzip, bzip2, p7zip (7z installed on Windows as an alternative)
- python3, pip packages (python2 is not support)
- node, npm packages
- universal-ctags
- gcc, g++ (only on Linux such as Ubuntu/Fedora/Manjaro)
- neovim (not installed on Windows)
- zsh (not installed on Windows)
- fack nerd font (only download on Windows, need manually installation)
Please notice that installation needs access of websites below, and make sure they're available:
- github.com.
- raw.githubusercontent.com.
- chocolatey on Windows.
Customizing third party dependencies is not supported, but typing the commands in install.sh could achieve manually installation with these prerequisites:
Software Dependency | Version Info |
---|---|
(g)vim | 8.0+ |
neovim | 0.4.0+ |
python3 | 3.6+ |
nodejs | 10.12+ |
Operating System | (Neo)Vim | Python | Nodejs | Test Result |
---|---|---|---|---|
MacOS Catalina 10.15.7 | Macvim 8.2 -lpython3.9 | python 3.9.1 with pip3 20.3.1 | node v15.5.0 with npm 7.3.0 | success |
Windows 10 | Gvim 8.2 -lpython3.8 | python 3.8.0 | node v15.4.0 with npm 7.0.15 | success |
Ubuntu 20.04 LTS | Gvim 8.1 -lpython3.8 | python 3.8.5 with pip3 20.0.2 | node v14.5.3 with npm 6.14.9 | success |
Fedora Workstation 32 | Gvim 8.2 +python3/dyn | python 3.8.6 with pip3 19.3.1 | node v12.19.0 with npm 6.14.8 | success |
Manjaro 20.2 | Gvim 8.2 +python3/dyn | python 3.8.6 with pip3 20.2 | node v15.3.0 with npm 6.14.8 | success |
Ubuntu 16.04 LTS | Gvim 7.4 -lpython3.5 | python 3.5.2 with pip 8.1.1 | node v14.5.3 with npm 6.14.9 | partial failure 1) python formatter black need at least python 3.6 2) coc.nvim need at least vim 8.0+ |
In this section, VIM editing modes are specified with:
- π ½: normal mode
- π : visual mode
- π Έ: insert mode
F1
π ½: open/close nerdtree file explorer, see Code complete for C++.F2
π ½: open/close tagbar tags explorer, see Code complete for C++.F3
π ½: format current file.F4
π ½: switch between C/C++ header and source files.F5
π ½: open terminal window, see Terminal window.F6
π ½: open enhanced yank list.F7
π ½: open markdown preview window in browser, see Markdown preview.F8
π ½: change color theme randomly, see Screenshots.
You could configure these hot keys in user.vim.
Enhanced copy-paste are supported when you want to export/import content from/to an outer file.
<leader>c
π : copy visual-selected text to locale machine cache~/.vim/.lin-vim-enhanced-copy-paste
.<leader>p
π ½: paste text saved from local machine cache~/.vim/.lin-vim-enhanced-copy-paste
.
All copied content in system clipboard will be stored in a text database, press F6
to open enhanced yank list.
You could configure these hot keys in user.vim.
Text search is supported by the_silver_searcher(ag) and ripgrep(rg), see Text search.
:Ag {text}
and:Rg {text}
π ½: search {text}.
File search is supported by LeaderF, see Fuzzy file search.
<c-p>
π ½: search file.
Text Alignment is supported by easy-align.
vipga=
π : align visual-selected paragraph.gaip=
π ½: align inner paragraph.
Cursor Movement is supported by vim-easymotion, see Fast cursor movement.
<leader><leader>f{char}
π ½: go to a single {char}.<leader>s{char}{char}
π ½: go to consequent two {char}{char}.<leader><leader>w
π ½: go to word.<leader><leader>j
π ½: go to a forward line below cursor.<leader><leader>k
π ½: go to a backward line above cursor.<leader><leader>L
π ½: go to a specified line.
10 times faster jkhl movement is binded:
<c-j>
π ½: equal to10j
<c-k>
π ½: euqal to10k
<c-h>
π ½: equal to10h
<c-l>
π ½: equal to10l
You could configure these in user.vim.
Language server is supported by coc.nvim, and completion are supported in insert mode:
<c-n>
tab
<up>
π Έ: select next in candidate list.<c-p>
<s-tab>
<down>
π Έ: select previous in candidate list.<c-k>
π Έ: trigger completion.
Go to operations are supported in normal mode:
gd
π ½: go to definition.gy
π ½: go to type definition.gi
π ½: go to implementation.gr
π ½: go to reference.
You could configure coc extensions in user.vim and coc-settings.json. And refer to coc.nvim#wiki#Language-servers for more programming languages, coc.nvim#wiki#Using-coc-extensions for more coc extensions.
Tags are important suppliement of language server, they're auto generated and updated by vim-gutentags, and viewed by tagbar.
F2
π ½: open/close tagbar tags explorer.<c-]>
π ½: go to definition.<c-o>
π ½: go back to previous position.
Commentary is supported by nerdcomment.
<leader>c<space>
π ½π : toggle one line or selected lines.
File explorer is supported by nerdtree, lightline, vim-buftabline and vim-devicons. They constructs the file explorer on the left(nerdtree), pretty icons integrated with file explorer(vim-devicons), opened buffers on the top(vim-buftabline) and current editing status on the bottom(lightline).
-
ma
π ½ on the left: create new file/directory. -
mc
π ½ on the left: copy file/directory. -
md
π ½ on the left: delete file/directory. -
mm
π ½ on the left: move file/directory. -
<leader>bn
π ½: go to next buffer. -
<leader>bp
π ½: go to previous buffer. -
<leader>bd
π ½: close current buffer.
Other alternatives such as vimfiler/airline/powerline are not chosen because of heavy of features, which will lead to a performance issue. Otherwise, current combination are smooth, not pretty enough though.
Please custom your own settings in user.vim and coc-settings.json.
Hack Nerd Fonts below is installed default(while only downloaded on Windows and need manually install). Please manually install other Nerd Fonts and configure font settings in ~/.vim/user.vim
if you want to customize GUI fonts:
- Hack Nerd Font Complete Mono on UNIX/Linux/MacOS.
- Hack Nerd Font Complete Mono Windows Compatible on Windows.
A bunch of command line utilities are implemented by python3 to speed up your edit and development, named vcmd. vcmd simplifies common operations in most scenarios of developing and editing, include:
vencode
: Encode/decode text strings.vfile
: File operations such as a) delete files with a specified filetype, b) replace content in files with a specified filetype, c) list files with a specified filetype, d) detect and convert file encodings with a specified filetype.vconf
: Configurecompile_commands.json
for C/C++ language server clangd, generate ssh key for host, homebrew/python-pip/ubuntu/fedora/manjaro... mirrors to speed up, etc.vgit
: Git operations without the burden of time consuming remember.vip
: Ip address calculations for both ipv4 and ipv6.vpack
: Easier file/directory compression and extraction.vag
: Fast text search wrapped the_silver_search ag.vtime
: Easier time calculations.
For better understanding and use, help document is supported for all commands, contains command functionality, options and examples.
Here's an example of vencode
:
$ vencode -h
usage: vencode [option] text
Encode and decode text strings with algorithms.
option:
-e/--encode [algorithm] encode text with specified algorithm
-d/--decode [algorithm] decode text with specified algorithm
-h/--help show help message
algorithm:
base64 base64 algorithm
url url algorithm
example:
$ vencode -ebase64 'Hello World'
Hello World => SGVsbG8gV29ybGQ=
Please try these commands with -h
option for more details.
Please open an issue for anything about lin.vim.