-
Notifications
You must be signed in to change notification settings - Fork 0
/
.obsidian.vimrc
52 lines (44 loc) · 1.3 KB
/
.obsidian.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
" Notes:
" - repo: https://github.com/esm7/obsidian-vimrc-support
" Have j and k navigate visual lines rather than logical ones
nmap j gj
nmap k gk
" Use H and L for beginning/end of line
nmap H ^
nmap L $
" Use J and K to move text blocks in visual mode
exmap lineup obcommand editor:swap-line-up
exmap linedown obcommand editor:swap-line-down
nmap K :lineup
nmap J :linedown
" 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
exmap forward obcommand app:go-forward
nmap <C-o> :back
nmap <C-i> :forward
" Go to definition style for references
exmap definition obcommand editor:follow-link
nmap gd :definition
" Fold/unfold like IJ
exmap fold obcommand editor:toggle-fold
exmap foldall obcommand editor:fold-all
exmap unfoldall obcommand editor:unfold-all
nmap <C--> :fold
"https://github.com/esm7/obsidian-vimrc-support/issues/209
"nmap <C-_> :foldall
"nmap <C-+> :unfoldall
" Pane split/switch
exmap focusRight obcommand editor:focus-right
exmap focusLeft obcommand editor:focus-left
exmap vsplit obcommand workspace:split-vertical
nmap <C-w>l :focusRight
nmap <C-w>h :focusLeft
nmap <C-w>v :vsplit
" Redo
unmap U
nmap U :redo