My personal configuration for development on WSL/Linux.
.vimrc– Vim config file.bashrc– Bash config fileshortcuts.txt– Quick reference for Vim, Git, Go, and debugging commands
Universal Ctags — generates tag files for code symbol navigation, required by Gutentags:
sudo apt install universal-ctagsSome useful tools(use is in shortcuts.txt):
sudo apt install ripgrep
curl -sS https://webi.sh/gh | sh- ripgrep(rg) - a fast file content search tool that replaces grep for code
- GitHub CLI(gh) - a command-line interface for GitHub operations(installed with
webito get the latest version)
For instructions on language instalations go to Specific Language Setup section.
Vim and Bash look for .vimrc and .bashrc respectively in your home
directory. Link them from this repo:
ln -sf ~/vimfiles/.vimrc ~/.vimrc
ln -sf ~/vimfiles/.bashrc ~/.bashrc
source ~/.bashrcThese are symbolic links. Keeping the files in this repo allows you to sync your configuration across different machines with a simple
git pullorgit push.
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimOpen Vim and run:
:PlugInstallThe first time you open Vim, it will automatically create and configure a global
~/.gitignore_globalto ignoretagsand debugger config files.
Debugging is powered by Vimspector using the Debug Adapter Protocol (DAP).
To set up a debugger you run a custom helper command defined in .vimrc:
:InstallDebugger <adapter_name>Examples:
:InstallDebugger delve
:InstallDebugger debugpy
:InstallDebugger CodeLLDBWhat this does:
- Runs
:VimspectorInstall <adapter_name> - Creates
.vimspector.jsonif missing, or merges into it if it already exists - Automatically assigns filetypes for known adapters (see table below)
- For unknown adapters, prompts you to enter filetypes manually
Run :Format on .vimspector.json to pretty-print the generated file
It does not install the debugger binary itself
Must be run in the project root directory
When you launch a debug session with
\gc, Vimspector will prompt you to fill in${program}. Enter the path to your entry point:
- Go:
.or./cmd/myapp- Python:
main.pyor./src/main.py- C/C++:
./myappor./build/myapp
As an example, for Go development, you must install the Delve binary manually before use:
go install github.com/go-delve/delve/cmd/dlv@latest
cd ~/my-project-dir
vim .Once inside Vim, execute:
:InstallDebugger delveGenerated .vimspector.json:
{
"configurations": {
"delve": {
"adapter": "delve",
"filetypes": ["go"],
"configuration": {
"request": "launch",
"program": "${program}",
"args": [],
"cwd": "${workspaceRoot}",
"env": {}
"mode": "debug"
}
}
}
}| Adapter | Filetypes | Language |
|---|---|---|
delve |
go |
Go |
debugpy |
python |
Python |
CodeLLDB |
c, cpp |
C / C++ |
you can add more in the
filetypesvariable on functionInstallDebuggerthat is invimrc
<leader>gb: Toggle breakpoint<leader>gc: Launch / Continue<leader>gn: Step Over<leader>gs: Stop<leader>gq: Hard Reset Vimspector
Default
leaderis\
Highlighting and completion are handled with CoC extensions. To add a new
language, add its extension name (e.g., coc-pyright) to the
g:coc_global_extensions list in your .vimrc to ensure it installs
automatically.
Ensure the Setup Instructions have been completed before proceeding
Go Setup
-
To install go: Download the latest
.tar.gzfrom and run:sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go_XX.X.tar.gzIt is already in the PATH environment variable. So just verify the instalation with:
go version
-
To install Go tooling, run this in Vim:
:GoUpdateBinaries
-
Install the Delve debugger (required for Go debugging):
go install github.com/go-delve/delve/cmd/dlv@latest
-
Run the Debugging Setup:
In the terminal, run:
vim .and then:
:InstallDebugger delve
Markdown Setup
You must install glow (terminal markdown renderer - displays formatted markdown in the terminal)
Open any .md file and press \mp or :Preview to open a rendered preview in
a terminal split inside Vim.
:Format fixes markdownlint warnings automatically (trailing spaces, missing
blank lines around headings, etc.)
The .bashrc is symlinked from this repo. After linking, run:
source ~/.bashrcWhat is included:
up [n]- Navigate up N directories.
up 2 # same as cd ../..
up 3 # same as cd ../../..-
$BROWSER- Points to Brave on Windows (WSL) and default browser on linux. -
$PATHadditions - Adds~/go/binand/usr/local/go/binso Go binaries are available globally -
mkcd <dir>- Creates a directory and immediately enters it.
mkcd my-project # same as mkdir -p my-project && cd my-project-
$EDITOR- Set tovim. Used by tools that open an editor (e.g.Ctrl+X Ctrl+Ein the terminal,git commitwithout-m). -
$HISTTIMEFORMAT- Adds timestamps to shell history output. Runhistoryto see them. -
Aliases: | Alias | Expands to | Description | |-------|-----------|-------------| |
..|cd ..| Go up one directory | |browser|$BROWSER| opens brave on wsl and the default browser on linux | |gs|git status| | |gl|git log --oneline --graph --decorate| Compact visual git log | |watch|watch -n 2| Repeat a command every 2 seconds by default |
- Filename – Current file path
- [+] – Unsaved changes
- [RO] – Read-only file
- % – File progress
- L:C – Line and column
- Block cursor in Normal mode
- Beam cursor in Insert mode
- Works correctly in WSL and common Linux terminals
Use leader with the navigation keys to move between windows.
This works inside:
- Vimspector console
:terminal- Any terminal buffer
To view the basic shortcuts:
In vim:
:Shortcutsor in the terminal:
shortcuts # alias to cat ~/vimfiles/shortcuts.txtNavigation keys apply centering(vim
zzcommand) automatically
The
shortcutscommands point to~/vimfiles/shortcuts.txt. If you cloned this repo to a different location, update the path in.vimrcat the linecommand! Shortcuts vsplit ~/vimfiles/shortcuts.txt.
Use this when you modify your config locally and want to save it to your repo:
cd ~/vimfiles
git add .
git commit -m "update config"
git pushUse this when you want to sync your environment with your repo:
cd ~/vimfiles
git pull
source ~/.bashrc # Apply any changes to the current terminal- Vim
- Git
- Go
- Universal Ctags
- ripgrep
- GitHub CLI (
gh) - Language-specific debugger binary (e.g., Delve for Go)