Move debug plugin setup to separate debug.vim file
Begin to prepare using the plugin by moving debug stuff away from the normal mode of operation.
This commit is contained in:
parent
477ec45d22
commit
f67c22bfa7
2 changed files with 24 additions and 22 deletions
20
plugin/debug.vim
Normal file
20
plugin/debug.vim
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
" TODO for DEBUGGING ONLY: reloads the whole lua plugin
|
||||||
|
fun! ZKReload()
|
||||||
|
lua for k in pairs(package.loaded) do if k:match("^zettelkasten") then package.loaded[k] = nil end end
|
||||||
|
lua require 'zettelkasten'
|
||||||
|
endfun
|
||||||
|
nnoremap <leader>R :call ZKReload()<cr>
|
||||||
|
|
||||||
|
augroup Zettelkasten
|
||||||
|
autocmd!
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
command! ZKOpen lua require('zettelkasten').open_link()
|
||||||
|
|
||||||
|
command! -range ZKCreate lua require('zettelkasten').create_link()
|
||||||
|
|
||||||
|
" example plug mappings
|
||||||
|
" nnoremap <Plug>Zettel_Link :call zettelkasten#zettel_link()<cr>
|
||||||
|
map <leader>i <Plug>zettel_link_open
|
||||||
|
|
||||||
|
map <cr> <Plug>zettel_link_follow
|
|
@ -2,31 +2,13 @@
|
||||||
if exists('g:loaded_zettelkasten')
|
if exists('g:loaded_zettelkasten')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
" TODO for DEBUGGING ONLY: reloads the whole lua plugin
|
|
||||||
fun! ZKReload()
|
|
||||||
lua for k in pairs(package.loaded) do if k:match("^zettelkasten") then package.loaded[k] = nil end end
|
|
||||||
lua require 'zettelkasten'
|
|
||||||
endfun
|
|
||||||
nnoremap <leader>R :call ZKReload()<cr>
|
|
||||||
|
|
||||||
augroup Zettelkasten
|
noremap <Plug>zettel_link_open :lua require 'zettelkasten'.open_link()<cr>
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
command! ZKOpen lua require('zettelkasten').open_link()
|
|
||||||
|
|
||||||
command! -range ZKCreate lua require('zettelkasten').create_link()
|
|
||||||
|
|
||||||
" example plug mappings
|
|
||||||
" nnoremap <Plug>Zettel_Link :call zettelkasten#zettel_link()<cr>
|
|
||||||
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
|
|
||||||
|
|
||||||
nnoremap <Plug>zettel_link_make :lua require 'zettelkasten'.make_link()<cr>
|
nnoremap <Plug>zettel_link_make :lua require 'zettelkasten'.make_link()<cr>
|
||||||
vnoremap <Plug>zettel_link_make :lua require 'zettelkasten'.make_link(true)<cr>
|
vnoremap <Plug>zettel_link_make :lua require 'zettelkasten'.make_link(true)<cr>
|
||||||
nmap <leader>o <Plug>zettel_link_make
|
|
||||||
vmap <leader>o <Plug>zettel_link_make
|
nnoremap <Plug>zettel_link_follow :lua require 'zettelkasten'.open_or_make_link()<cr>
|
||||||
|
vnoremap <Plug>zettel_link_follow :lua require 'zettelkasten'.open_or_make_link(true)<cr>
|
||||||
|
|
||||||
let g:loaded_zettelkasten = 1
|
let g:loaded_zettelkasten = 1
|
||||||
|
|
Loading…
Reference in a new issue