This is my personalized Vim configuration, specifically tailored for system development with a focus on C programming. However, utilizing coc.nvim
, you can effortlessly customize the development environment for other programming languages.
Furthermore, my configuration is lightweight and modularized, making it straightforward for you to extend and adapt to more complex setups.
- vim 9.0+ (for sms) with python3 support
- ripgrep
- fd
- nodejs >= 12.0
- Universal ctags >= 6.0
- A terminal emulator with true-color support (for the light-pink theme)
You need to clone this repo into your home directory:
git clone https://github.com/forceofsystem/dotvim.git
and then you run vim
in your terminal. Press esc
to skip the warning prompted by the missing plugin, use :PlugInstall
to install the plugin with vim-plug
. After the plugin's installation, LeaderF
will compile something for itself and Coc.nvim
will automitically install coc-json
, coc-clangd
, coc-vimlsp
, respectively.
Then, quit and restart vim
to enjoy my configuration.
Keybinding are in two parts: one for common bindings and the other for plugin's bindings.
The leader key is space.
Command | Default | Description |
---|---|---|
sh | :set nosplitright<CR>:vsplit<CR> | Vertically split the window with the cursor in the left pane. |
sj | :set splitbelow<CR>:split<CR> | Horizontally split the window with the cursor in the bottom pane. |
sk | :set nosplitbelow<CR>:split<CR> | Horizontally split the window with the cursor in the top pane. |
sl | :set splitright<CR>:split<CR> | Vertically split the window with the cursor in the right pane. |
<leader>h | :wincmd h<CR> | Move the cursor to the left pane. |
<leader>j | :wincmd j<CR> | Move the cursor to the bottom pane. |
<leader>k | :wincmd k<CR> | Move the cursor to the top pane. |
<leader>l | :wincmd l<CR> | Move the cursor to the right pane. |
Command | Default | Description |
---|---|---|
<C-u> | :tabe<CR> | move cursor to the left for one |
<C-k> | :-tabnext<CR> | move cursor down for one |
<C-l> | :+tabnext<CR> | move cursor up for one |
The plugin bindings are defined in their respective configuration files located at .vim/after/plugin/{plugin's name}.vim
. To review specific key bindings, you can access the configuration files associated with each plugin, such as coc.vim
.
I use vim-plug to manage the vim plugin.
If you want to install/uninstall plugin, add/remove the specific plugin into/from .vim/plugin/plug.vim
, then run source $MYVIMRC
or restart the vim to run PlugInstall
/PlugClean
.
For more details about to manipulate the plug, please check the vim-plug's document.
Plugin's name | Description |
---|---|
vim-surround | Delete/change/add parentheses/quotes/XML-tags/much more with ease. |
wildfire | Smart selection of the closest text object. |
vim-unimpaired | Pairs of handy bracket mappings. |
auto-pairs | Vim plugin, insert or delete brackets, parens, quotes in pair |
Plugin's name | Description |
---|---|
Coc.nvim | Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers. |
vim-gutentags | A Vim plugin that manages your tag files. |
copilot.vim | Neovim plugin for GitHub Copilot. |
LeaderF | An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim. |
vim-snippets | vim-snipmate default snippets. |
vimtex | VimTeX: A modern Vim and neovim filetype plugin for LaTeX files. |
Plugin's name | Description |
---|---|
fcitx.vim | keep and restore fcitx state when leaving/re-entering insert mode |
vim-wayland-clipboard | Integrate Vim's '+' register with the Wayland system clipboard. |