All Projects → linrongbin16 → lin.vim

linrongbin16 / lin.vim

Licence: GPL-3.0, MIT licenses found Licenses found GPL-3.0 GPL3_LICENSE MIT MIT_LICENSE
Lin Rongbin's (Neo)Vim Distribution

Programming Languages

Vim Script
2826 projects
shell
77523 projects
powershell
5483 projects

Projects that are alternatives of or similar to lin.vim

coc-volar
Volar (Fast Vue Language Support) extension for coc.nvim
Stars: ✭ 143 (+2.88%)
Mutual labels:  coc-nvim
viconf
My (n)Vim config files
Stars: ✭ 18 (-87.05%)
Mutual labels:  vim-plug
vim-tips-wiki
1500+ tips downloaded from Vim Tips Wiki, parsed and formatted to look and work like native Vim help files
Stars: ✭ 56 (-59.71%)
Mutual labels:  vim-plug
coc-webview
Using an external browser to support the webview in coc.nvim.
Stars: ✭ 21 (-84.89%)
Mutual labels:  coc-nvim
dotvim
My Vim setup. Fork at will.
Stars: ✭ 15 (-89.21%)
Mutual labels:  vim-plug
dotfiles
Current dotfiles and scripts
Stars: ✭ 35 (-74.82%)
Mutual labels:  vim-plug
vim-lighthaus
A Lighthaus theme for (n)vim, vim-airline and lightline
Stars: ✭ 33 (-76.26%)
Mutual labels:  vim-plug
coc-toml
Toml extension for coc-nvim, using taplo for lsp engine
Stars: ✭ 52 (-62.59%)
Mutual labels:  coc-nvim
coc-sql
SQL extension for coc.nvim
Stars: ✭ 104 (-25.18%)
Mutual labels:  coc-nvim
VimConfig
Configuration files for Vi-IMproved.
Stars: ✭ 23 (-83.45%)
Mutual labels:  vim-plug
coc-nginx
nginx-language-server extension for coc.nvim
Stars: ✭ 16 (-88.49%)
Mutual labels:  coc-nvim
coc-cmake
coc.nvim extension for cmake language
Stars: ✭ 86 (-38.13%)
Mutual labels:  coc-nvim

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

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

Table of Contents

Introduction

lin.vim is aimed to out of box, IDE-like editing features, high performance, light weight and friendly to most users.

lin.vim is focused on and only on editing, it doesn't compile/package/debug projects, not tutorial for new vim users neither.

lin.vim solved such issues:

  • Solved the difficulty of choosing/grouping/configuring plugins, a set of plugins are embeded and well configured to most needs.
  • Solved the difficulty of duplicate installation on different OS and machines, it's been made easier by one line command (not on Windows for now).
  • Solved the difficulty of balance between performance and features, only carefully chosen plugins are installed, try to be a modern editor just like vscode.
  • Solved the UI-looking issue of original (neo)vim, make you happy working with pretty colorschemes/UI/icons.
  • Document everything so nothing is confused.
  • Customization ability for special needs.

Screenshots

Simple but pretty UI

edit-markdown.png

Code complete for C++

cplusplus-code-complete.png

Fast cursor movement

fast-cursor-movement.png

Search text

search-text.png

Search files

search-files.png

Markdown preview

markdown-preview.png

Feature

  • Automatically installation (not on windows for now).
  • Works on multiple OS platforms:
    • Windows
    • macOS
    • Linux(Ubuntu/Debian/Fedora/Manjaro)
  • Support both Vim and Neovim, neovim 0.6+ is strongly recommended for better performance and experience.
  • Modern editor UI features:
    • File explorer
    • Pretty icons
    • Pretty color schemes (see Color Schemes - Reference) collected and randomly selected on start
    • Status line
    • Tab line and buffer explorer
    • Outline/Tags
  • IDE-like editing features supported by coc.nvim, a set of language servers(see Embeded Language Servers) are embeded by default:
    • Code complete
    • Diagnostic
    • Lint
    • Code format
    • Jump between symbols
    • Code Actions
    • Code Lens
  • Search engine features supported default 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 featuers (see Other Enhancements)
  • Custom configuration.

Project Structure

 |+install              Installation scripts for different platforms.
 |+setting              VimL script settings.
 |+template             Templates for ~/.vim/plugin.vim, ~/.vim/coc-settings.json and ~/.vim/setting.vim.
 |`install.sh           UNIX/Linux/MacOS install script.
 |`install.ps1          Windows PowerShell install script.
 |`LICENSE              The license file.
 |`lin.vim              The .vimrc file.
 |`README.md            The readme document.

Installation

Requirements

lin.vim requires below softwares:

  • vim, nvim
  • clang/gcc, make, cmake
  • python3 and pip3 (python 2.x is not supported)
  • node and npm
  • golang
  • rustc and cargo
  • curl, wget
  • universal-ctags
  • unzip
  • hack nerd font

The install script install.sh will automatically install these requirements with system package managers:

  • install/apt.sh for debian/ubuntu based linux
  • install/brew.sh for macOS homebrew, install Xcode and homebrew as pre-requirements
  • install/dnf.sh for fedora/redhat based linuxx
  • install/pacman.sh for archlinux based linuxx

Other Linux/UNIX systems(Gentoo based linux, bsd, etc) are not supported yet.

Access of below websites are required as well, please make sure they're available:

UNIX/Linux/MacOS

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

Windows

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/MYSY2 either use portable GNU shell or ubuntu virtual machine, which is quite slow and heavy.
  • Supporting WSL backend mode (actually remote mode) like vscode is too heavy development work.
  • Git for Windows already contains MYSY2 and provide Unix/Linux builtin commands, lin.vim use it directly.
  1. Install Visual Studio with at least these components:

    • .NET Desktop Development
    • Visual C++ Desktop Development
    • Common Windows Platform Development
  2. Install 64-bit Git for Windows Setup with especially these options:

    • In the 3rd Select Components step, enable Associate .sh files to be run with Bash
    • In the 7th Adjusting your PATH environment step, choose Use Git and optional Unix tools from the Command Prompt
    • In the 11th Configuring the terminal emulator to use with Git Bash step, choose Use Windows's default console window

After git installation, git.exe should be found in $env:Path, Unix/Linux builtin commands such as bash.exe, cp.exe, mv.exe, cd.exe, find.exe, cat.exe should be found as well.

Notice:

  • if you are using WSL, C:\Windows\System32\bash.exe could lead you to WSL instead of the bash.exe provided by Git for Windows. Make sure Git for Windows PATH environment is ahead of C:\Windows\System32 so bash.exe from Git for Windows (wsl.exe could connect to WSL as well) will be first detected on Command Prompt.
  • Don't use old-version vim.exe provided by Git for Windows, use gvim.exe provided by followed steps.
  1. Install other third party dependencies (x64 is preferred):

    • (Optional) make: add make.exe in $env:Path
    • cmake: add cmake.exe in $env:Path
    • gvim: add gvim.exe in $env:Path
    • (Recommended) neovim: add nvim.exe, nvim-qt.exe in $env:Path
    • python3: since python3 installer don't provide python3.exe and pip3.exe, manually copy python.exe as python3.exe, copy pip.exe as pip3.exe, then add them in $env:Path
    • llvm: add clang.exe, clang++.exe, clangd.exe, clang-tidy.exe, clang-format.exe in $env:Path
    • rust: add rustc.exe, cargo.exe in $env:Path
    • golang: add go.exe in $env:Path
    • nodejs: add node.exe, npm.exe in $env:Path
    • ripgrep: add rg.exe in $env:Path
    • fzf: add fzf.exe in $env:Path
    • bat: add bat.exe in $env:Path
    • fd: add fd.exe in $env:Path
    • universal-ctags: add ctags.exe, readtags.exe in $env:Path

Notice:

  • Python3 version must be compatible with gvim/neovim's libpython3.so version, or it will not been loaded. Please use gvim --version to find its libpython3.so version.
  • Install these dependencies with a package manager (such as chocolatey and scoop) is another option, just make sure they're available in $env:Path.
  1. Install Hack Nerd Font Mono Windows Compatible:

    • 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
  2. Install lin.vim as administrator:

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

User Guide

In this section, vim editing mode are specified with:

  • 🄽 - Normal Mode
  • 🅅 - Visual Mode
  • 🄸 - Insert Mode

Hot Key

  • 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.

UI

File Explorer

File explorer is supported by coc-explorer (switched to nvim-tree.lua on neovim 0.7+), you could use key mappings on the file explorer left side:

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 in split.
  • E 🄽 - open file in vsplit.
  • 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 with rm.
  • R 🄽 - reload file explorer.

Resize Width:

  • <A-Right>(<D-Right>)/<A-.>(<D-.>) 🄽 - make explorer bigger.
  • <A-Left>(<D-Left>)/<A-,>(<D-,>) 🄽 - make explorer smaller.

Preview:

  • P 🄽 - preview file content.
  • I 🄽 - preview file info.

Others:

  • H 🄽 - toggle dotfiles hidden.
  • y 🄽 - copy file name string.
  • Y 🄽 - copy absolute file path string.
  • s 🄽 - open file in system file manager(such as Finder in macOS).
  • ? 🄽 - open/close(toggle) help.

You could editing ~/.vim/setting/weirongxu/coc-explorer.vim (or ~/.vim/setting/kyazdani42/nvim-tree.lua.vim) to customize key mappings. Please refer to coc-explorer - Custom mappings example (or nvim-tree.lua - README) for more key mappings.

Buffers/Tabs

Buffers/tabs is supported by vim-buffet(switched to barbar.nvim on neovim 0.5+), you could switch/close them by key mappings:

  • <leader><tab>/<A-Right>(<D-Right>)/<A-.>(<D-.>) 🄽 - go to next buffer on the right.
  • <leader><s-tab>/<A-Left>(<D-Left>)/<A-,>(<D-,>) 🄽 - go to previous buffer on the left(Notice some terminal/GUI could eat Alt+, Alt+. or 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.

Alt-1 ~ Alt-9 are mapped to switch between 1 ~ 9 buffers, Alt-0 are mapped to navigate to the last buffer. For macOS, Command-1 ~ Command-9 and Command-0 are configured for the same thing.

  • <A-1>(<D-1>) 🄽 - go to buffer-1.
  • <A-2>(<D-2>) 🄽 - go to buffer-2.
  • <A-3>(<D-3>) 🄽 - go to buffer-3.
  • <A-4>(<D-4>) 🄽 - go to buffer-4.
  • <A-5>(<D-5>) 🄽 - go to buffer-5.
  • <A-6>(<D-6>) 🄽 - go to buffer-6.
  • <A-7>(<D-7>) 🄽 - go to buffer-7.
  • <A-8>(<D-8>) 🄽 - go to buffer-8.
  • <A-9>(<D-9>) 🄽 - go to buffer-9.
  • <A-0>(<D-0>) 🄽 - go to the last buffer.

For neovim 0.5+ using barbar.nvim, especially you could re-ordering and mouse-clicking on buffers:

  • <A-S-Right>(<D-S-Right>) 🄽 - move current buffer to next position(on the right).
  • <A-S-Left>(<D-S-Left>) 🄽 - move current buffer to previous position(on the left).
  • <LeftMouse> 🄽 - go to selected buffer.
  • <MiddleMouse> 🄽 - close selected buffer.

Font

lin.vim use Hack Nerd Font by default. Please manually install other nerd fonts and configure in ~/.vim/setting.vim for other options.

IDE-like Editing Features

Code Complete

  • <tab>/<c-n>/<down> 🄸 - navigate to next suggestion.
  • <s-tab>/<c-p>/<up> 🄸 - navigate to previous suggestion.
  • <cr> 🄸 - confirm current suggestion or snippet.
  • <esc>/<c-[> 🄸 - close suggestion.
  • <c-k> 🄸 - force trigger suggestion.
  • <c-f> 🄸 - jump to next snippet position.
  • <c-b> 🄸 - jump to previous snippet position.

Jumps

  • [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.

Symbols

  • K 🄽 - show hover(symbol definition).
  • <leader>rs 🄽 - rename symbol.

Code Format

  • <leader>cf 🄽🅅 - format code on current buffer or visual selected code.

Code Actions

  • <leader>ca 🄽🅅 - run code actions on current cursor position or visual selected code.
  • <leader>qf 🄽 - apply quick fix on current line.

Code Lens

  • <leader>cl 🄽 - run code lens on current line.

Git

  • [c 🄽 - go to previous git chunk.
  • ]c 🄽 - go to next git chunk.

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

  • <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:.

File Search

  • <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.

Git Search

  • <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?.

Other Search

  • <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.

Coc.nvim Search

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

  • <space>cs 🄽 - search symbols by :CocFzfList symbols. Notice coc-fzf's symbols only work on neovim, it fallback to :CocList symbols on vim.
  • <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.

Editing Support

Enhanced Copy Paste

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.

Fast Cursor Movement

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+).

Word Movement

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.

Fast Repeat

Enhancement for . operation.

Support by vim-repeat.

Fast Quotes Operation

Enhancement for add/remove quotes operation.

Support by vim-surround

Match Brackets and HTML Tags

Enhancement for brackets(pairs) and html tags.

Support by vim-matchup.

Auto Close Brackets and HTML Tags

Enhancement for auto close brackets(pairs) and html tags.

Support by auto-pairs (switched to nvim-autopairs on neovim 0.5+) and vim-closetag.

Easy Comment

  • gcc 🄽 - toggle(comment/uncomment) current line.
  • gc 🅅 - toggle(comment/uncomment) visual selected blocks.
  • gc{motion} 🄽 - toggle(comment/uncomment) from current line with motion such as jkhl.
  • gc<Count>{motion} 🄽 - toggle(comment/uncomment) from current line with Count motion repeat.

Support by tcomment_vim.

Customization

Please add more settings in ~/.vim/setting.vim and ~/.vim/coc-settings.json.

Embeded Language Servers

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

Reference

Contribute

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

Like lin.vim? Consider

Buy Me A Coffee

Or

wechat-pay.jpeg         alipay.jpeg

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].