-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobsidian.vimrc
executable file
·78 lines (62 loc) · 1.96 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
" insert normal mdoe
imap jk <Esc>
" invert ; <-> :
nnoremap ; :
nnoremap : ;
" j and k navigate visual lines rather than logical ones
nnoremap j gj
nnoremap k gk
" move to end/beginning of line(normal/visual mode)
nnoremap E $
nnoremap B ^
vnoremap E $
vnoremap B ^
" Yank to system clipboard
set clipboard=unnamed
exmap surround_wiki surround [[ ]]
exmap surround_double_quotes surround " "
exmap surround_single_quotes surround ' '
exmap surround_backticks surround ` `
exmap surround_brackets surround ( )
exmap surround_square_brackets surround [ ]
exmap surround_curly_brackets surround { }
" NOTE: must use 'map' and not 'nmap'
map [[ :surround_wiki
nunmap S
vunmap S
map S" :surround_double_quotes
map S' :surround_single_quotes
map S` :surround_backticks
map Sb :surround_brackets
map S( :surround_brackets
map S) :surround_brackets
map S[ :surround_square_brackets
map S[ :surround_square_brackets
map S{ :surround_curly_brackets
map S} :surround_curly_brackets
" Maps pasteinto to Alt-p
map <A-p> :pasteinto
" Emulate Folding https://vimhelp.org/fold.txt.html#fold-commands
" Emulate Folding https://vimhelp.org/fold.txt.html#fold-commands
exmap togglefold obcommand editor:toggle-fold
exmap togglefold obcommand editor:toggle-fold
nmap za :togglefold
nmap zo :togglefold
nmap zc :togglefold
exmap unfoldall obcommand editor:unfold-all
nmap zR :unfoldall
exmap foldall obcommand editor:fold-all
nmap zM :foldall
" Emulate Tab Switching https://vimhelp.org/tabpage.txt.html#gt
" requires Cycle Through Panes Plugins https://obsidian.md/plugins?id=cycle-through-panes
exmap tabnext obcommand cycle-through-panes:cycle-through-panes
nmap gt :tabnext
exmap tabprev obcommand cycle-through-panes:cycle-through-panes-reverse
nmap gT :tabprev
exmap nextHeading jsfile mdHelpers.js {jumpHeading(true)}
exmap prevHeading jsfile mdHelpers.js {jumpHeading(false)}
nmap ]] :nextHeading
nmap [[ :prevHeading
" Go Into Link
exmap goto_link obcommand editor:follow-link
nmap gd :goto_link