2020-10-31 10:01:53 +00:00
|
|
|
" TODO remove after debugging
|
|
|
|
if exists('g:loaded_zettelkasten')
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
" TODO for DEBUGGING ONLY: reloads the whole lua plugin
|
2020-10-26 14:55:40 +00:00
|
|
|
fun! ZKReload()
|
|
|
|
lua for k in pairs(package.loaded) do if k:match("^zettelkasten") then package.loaded[k] = nil end end
|
2020-10-31 10:01:53 +00:00
|
|
|
lua require 'zettelkasten'
|
2020-10-26 14:55:40 +00:00
|
|
|
endfun
|
2020-10-26 18:32:27 +00:00
|
|
|
nnoremap <leader>R :call ZKReload()<cr>
|
2020-10-26 14:55:40 +00:00
|
|
|
|
|
|
|
augroup Zettelkasten
|
|
|
|
autocmd!
|
|
|
|
augroup END
|
|
|
|
|
2021-05-03 15:31:28 +00:00
|
|
|
command! ZKOpen lua require('zettelkasten').open_link()
|
|
|
|
|
|
|
|
command! -range ZKCreate lua require('zettelkasten').create_link()
|
|
|
|
|
2020-10-31 10:01:53 +00:00
|
|
|
" example plug mappings
|
2020-10-26 14:55:40 +00:00
|
|
|
" nnoremap <Plug>Zettel_Link :call zettelkasten#zettel_link()<cr>
|
2021-04-30 11:28:39 +00:00
|
|
|
nnoremap <Plug>zettel_link_open :lua require 'zettelkasten'.open_link()<cr>
|
|
|
|
vnoremap <Plug>zettel_link_open :lua require 'zettelkasten'.open_link()<cr>
|
|
|
|
nmap <leader>i <Plug>zettel_link_open
|
|
|
|
vmap <leader>i <Plug>zettel_link_open
|
2020-10-26 14:55:40 +00:00
|
|
|
|
2021-05-03 21:02:59 +00:00
|
|
|
nnoremap <Plug>zettel_link_create :lua require 'zettelkasten'.create_link()<cr>
|
|
|
|
vnoremap <Plug>zettel_link_create :lua require 'zettelkasten'.create_link(true)<cr>
|
|
|
|
nmap <leader>o <Plug>zettel_link_create
|
|
|
|
vmap <leader>o <Plug>zettel_link_create
|
|
|
|
|
2020-10-31 10:01:53 +00:00
|
|
|
let g:loaded_zettelkasten = 1
|