Skip to content

Instantly share code, notes, and snippets.

@megamaddu
Last active September 29, 2023 21:48
Show Gist options
  • Save megamaddu/20e4c87c076d1c5b87dc64dd5dbc4a8e to your computer and use it in GitHub Desktop.
Save megamaddu/20e4c87c076d1c5b87dc64dd5dbc4a8e to your computer and use it in GitHub Desktop.
.obsidian.vimrc
" Have j and k navigate visual lines rather than logical ones
nmap j gj
nmap k gk
vmap j gj
vmap k gk
exmap 0 goLineLeftSmart
exmap $ goLineRight
" I like using H and L for beginning/end of line
nmap H ^
nmap L $
" Quickly remove search highlights
nmap <F9> :nohl
" Yank to system clipboard
set clipboard=unnamed
" Go back and forward with Ctrl+O and Ctrl+I
" (make sure to remove default Obsidian shortcuts for these to work)
exmap back obcommand app:go-back
nmap <C-o> :back
exmap forward obcommand app:go-forward
nmap <C-i> :forward
" Fix o ignoring cursor context
" nunmap o
" nmap o A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment