-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
53 lines (42 loc) · 1.76 KB
/
Copy pathinit.vim
File metadata and controls
53 lines (42 loc) · 1.76 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
" Plugin manager
call plug#begin('~/.local/share/nvim/plugged')
Plug 'vimwiki/vimwiki'
Plug 'tpope/vim-surround'
Plug 'jiangmiao/auto-pairs'
Plug 'junegunn/fzf'
" Optional nicer Markdown editing (recommended)
Plug 'plasticboy/vim-markdown'
call plug#end()
" Fuzzy search shortcut
" Normal/visual/insert mappings for <leader>f -> :FZF
nnoremap <silent> <leader>f :FZF<CR>
vnoremap <silent> <leader>f :FZF<CR>
inoremap <silent> <leader>f <Esc>:FZF<CR>
" This makes Fuzzy more relevant
" Change working dir to the directory of the current file on BufEnter
autocmd! BufEnter * if expand('%') !=# '' | silent! lcd %:p:h | endif
" Optional also cd on VimEnter if a file was passed on startup
autocmd! VimEnter * if argc() > 0 | silent! lcd expand('<afile>:p:h') | endif
" --- Vimwiki configuration ---
let g:vimwiki_list = [{
\ 'path': expand('REDACTED_WIKI_PATH'),
\ 'syntax': 'markdown',
\ 'ext': '.md',
\ },
\ {
\ 'path': expand('REDACTED_WIKI_PATH'),
\ 'syntax': 'markdown',
\ 'ext': 'md'
\ }]
" Ensure enter key creates [[link]] instead of [link](link) when using
" markdown syntax https://github.com/vimwiki/vimwiki/issues/892 & https://github.com/ericboehs/dotfiles/commit/b47547f757fc31ed5f4241874982541ba7d6cf0a#diff-c7ea3092a41e833d0c0af7c6c532995d680a2e1ff809c63901146c7ed10ac35eR11
autocmd VimEnter * let g:vimwiki_syntaxlocal_vars['markdown']['Link1'] = g:vimwiki_syntaxlocal_vars['default']['Link1']
" Scope VimWikis access to path
let g:vimwiki_global_ext = 0
" Treat .md as markdown
let g:vimwiki_ext2syntax = {'.md': 'markdown'}
" Optional open links with system default (macOS)
if has('macunix')
let g:vimwiki_global_ext = 0
autocmd FileType vimwiki nnoremap <buffer> gx :call jobstart(['open', expand('<cfile>')])<CR>
endif