General vim tricks

  • calculations: in insert mode, press C-r = then insert your calculation
  • resizing panes Ctrl+w + and Ctrl + -

Required packages

  • fzf - fzf plugin
  • the_silver_searcher -searching in files for the fzf plugin
  • cargo / rust - rust LSP integration
  • pyright - Python LSP integration

Plugins

Vim-wiki bindings

Publishing my notes:

nnoremap <F1> :terminal make serve<CR>
nnoremap <F2> :!make rsync_upload<CR>
nnoremap <F3> :!make commit_push<CR>
bindingaction
F1execute mdbook serve
F2publish to notes.vdwaa.nl
F3git commit and push

Standard vimwiki bindings:

bindingaction
<C-Space>toggle listitem on/off
gl*make the item before the cursor a list
<Tab>(insert mode) go next/create cell
+create/decorate links

vimwiki diary

bindingaction
wi
go to diary index
wwcreate a new diary entry
:VimwikiDiaryGenerateLinksupdate diary index

Fugitive bindings

bindingaction
<space>gagit add
<space>gsgit status
<space>gcgit commit
<space>gtgit commit (full path)
<space>gdgit diff (:Gdiff)
<space>gegit edit (:Gedit)
<space>grgit read (:Gread)
<space>gwgit write (:Gwrite)
<space>glgit log
<space>gpgit grep
<space>gmgit move
<space>gbgit branch
<space>gogit checkout
<space>gpsgit push
<space>gplgit pull

LSP bindings

bindingaction
gdGo to definition
grGo to references
gsSymbol search
KDisplay function/type info
gRRename variable/function
dlShow diagnostic

PKGBUILD

bindingaction
F1bump pkgrel
F2run updpkgsums

Rust

bindingaction
<Leader>bcargo test
<Leader>ccargo clippy
<Leader>xcargo run
<Leader>dset break point
<Leader>rrun debugger
F5start debugger
C-bcompile rust

Telescope

bindingaction
<space>fgSearch all files
<space>ffList files
<space>fbList buffers
<space>fmMan pages
<space>ssList all snippets

DAP

bindingaction
F5Continue
F9Close
F10Continue
F11Step over
F12Step out

Wishlist

  • Git integration
  • Snippets
  • Debugging
  • Language features: completion, find function definitions

GDB shortcuts

commanddescription
continuecontinue execution normally
finishcontinue executing until function returns
stepexecute next line of source code
nextexecute next line of source code, without descending into functions

Providing args:

gdb --args python example.py

Or in the gdb shell

args --config foo.toml

Printing variables:

print filename

print config.interval

Investigate

Neovim setup

Goals

LSP

For the LSP use neovim's native LSP server and neovim/nvim-lspconfig for configuration. Use :LspInfo to verify a language server is available and works for the file you are editing.

null-ls => :NullLsInfo

Linting

Tests & Debugging

Completor

  • Git integration => tpope/vim-fugitive
  • Searching files => telescope
  • Smart commentor

TODO

  • https://github.com/nvim-treesitter/nvim-treesitter-context
  • cmp (completor)
  • lsif
  • open multiple files with telescope https://github.com/nvim-telescope/telescope.nvim/issues/1048
  • switch to new picker
  • better Git integration, rebasing in neovim (neogit??)

Resources