Skip to content

timsu92/vimrc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

vimrc: my vim settings

Note! This is a config file on Ubuntu 22.04 on WSL2. If you use another system, you may need some changes to it.

Although contents in here still valid, many of the plugins I use now aren't updated to this list😒 I'll try to find a time to do it.

Plugins

Plugins installed using vim-plug

[βœ“] coc: Code linting, code complete, error checking and more!
[βœ“] vim-easy-align: Align your code with ease
[βœ“] nerdcommenter: Comment code with ease
[βœ“] FastFold: Recognizes languages and create folds
[βœ—] tagbar: Navigate around code (disabled currently as I'm not using it)
[βœ“] vim-stay: Memorized page position, cursor position, folds' status
[βœ—] vim-javascript: JavaScript bundle for vim (Never used. Disabled currently)
[βœ“] rainbow: Colorful parentheses, brackets... for locate with ease
[βœ“] easymotion: Move your cursor faster and easier
[βœ“] nerdtree: File explorer
[βœ“] nerdtree-git-plugin: Show Git status in NERDTree
[βœ“] vim-devicons: Prettified icons for various file types
[βœ“] vim-surround: Manipulate parentheses, brackets... around texts
[β–²] vim-expand-region: Expand and shrink selection somewhat like IntelliJ's Select code constructs, but can be improved
[βœ“] vim-textobj-user: Define text-objects on your own
[βœ“] vim-textobj-line: Make entire line as a text-objects
[βœ“] VimSpector: Debug right in Vim
[βœ“] vim-snippets: Snippets for expressing ideas in few key strokes
[βœ“] endwise.vim: Close pairs when hitting <enter> in insert mode
[βœ“] SimpylFold: Fold class and function definitions in Python
[βœ“] markdown-preview.nvim: Preview markdown on-the-fly

Other plugins or functions

[βœ“] vim-monokai: Beautiful dark theme
[βœ—] Powerline: Multi-function status line. (Using vim-airline instead as it's hard to config)
[β–²] line mover: Move line using ctrl+UP and ctrl+DOWN. (Indentation might be wrong)
[βœ“] WSL yank: Copy yanked content to Windows clipboard w/o installing other programs
[βœ“] matchit.vim: Use % to jump between correspond surrounds and if, else if, else
[βœ“] fzf: The fuzzy finder

Installation

Node.js

This guide allows you to install Node.js using nvm

step 1: Install cURL

sudo apt install curl

step 2: Select the desired version of nvm

GitHub page

step 3: Install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/<version>/install.sh | bash

for example

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

step4: Check nvm installation

command -v nvm

This should gives you nvm. If it fails to do so, please take a look at their GitHub page

step5: List installed Node.js (there should be no any at the moment)

nvm ls

example output credit goes to Microsoft

step6: Install Node.js

way1: install LTS-version

nvm install --lts

way2: install newest version (may contain bugs)

nvm install node

step7: Check Node.js status

nvm ls

Now, you should be able to see it.
example output credit goes to Microsoft

PowerLine

step1: Change directory to a place your WSL distro can reach

step2: Get PowerLine

git clone https://github.com/powerline/powerline.git

step3: Move to it

cd powerline

step4(optional, recommended): switch to a newest version of release, instead of devlopement one

git checkout $(git rev-list --tags --max-count=1)

The above line receives hash of the last release commit, and make the files conform with it

step5: Install

pip install -e .

step6: Make executables visible

Put this line in your .bashrc or something alike

export PATH="$HOME/.local/bin:$PATH"

step7: Get font

Follow their guide to get a font. Then, change settings of your Windows Terminal

step8(optional): turn on the daemon

If you use git, it's nice to turn it on to improve performance a lot. To do so, put this in your .bashrc or something alike.

powerline-daemon -q

step9: restart your terminal or source .bashrc

Plugins using vim-plug

step1: Enter your Vim

step2: Upgrade vim-plug itself by :PlugUpgrade

step3: In normal mode, type :PlugInstall to get plugins

step4: Restart Vim

Clangd of coc

step1: Enter your Vim

step2: In normal mode, type :CocCommand clangd.install

fzf

Personally, I use git to pull newest releases. Head over their guide and everything explained

VimSpector

linux

  1. It seems that it's recommended to use GDB rather than LLDB on linux
sudo apt install gdb
  1. If you want to use default settings for C/C++/C#/Rust, link the file to appropriate location
cd ~/.vim/plugged/vimspector/configurations/linux/_all
ln -s ../../../../../vimspector.json vimspector.json

Releases

No releases published