-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobsidian.vimrc
More file actions
87 lines (71 loc) · 2.38 KB
/
obsidian.vimrc
File metadata and controls
87 lines (71 loc) · 2.38 KB
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
79
80
81
82
83
84
85
86
87
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""SETTINGS""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 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
" map <C-i> :back
" map <C-o> :forward
" Yank to system clipboard
set clipboard=unnamed
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""SETTINGS""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Normal vim backspace vim behaviour, instead of find and replace
imap <C-h> <BS>
" act like enter
imap <C-m> <CR>
" Enter Normal mode from Insert mode with jj
inoremap jj <Esc>
" Center cursor after moving screen
nnoremap n nzzzv
nnoremap N Nzzzv
" H, K, L
nnoremap H ^
onoremap H ^
vnoremap H ^
nnoremap L $
onoremap L $
vnoremap L $
nnoremap K %
onoremap K %
vnoremap K %
" Insert new line above and stay in Normal mode
nnoremap O o<Esc>
" Select all with <C-a>
inoremap <C-a> <Esc>ggVG
vnoremap <C-a> <Esc>ggVG
nnoremap <C-a> ggVG
" move line instead of paragraph
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""KEYMAPS COMMAND""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Esc in Normal mode turn off high light
nmap <Esc> :nohl<CR>
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 { }
" Here's an example config that implements many of the features from vim-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