Migrate '.vim/ftplugin' to neovim

main
Hektor Misplon 2025-10-20 23:45:00 +02:00
parent 05bc2ec59e
commit 05986a30bb
6 changed files with 23 additions and 16 deletions

View File

@ -0,0 +1 @@
vim.opt.matchpairs:append("=:;")

View File

@ -1,15 +0,0 @@
-- NOTE: May want to move this, as it is more specific to wiki than to pandoc
vim.api.nvim_create_user_command("AnkiDeck", function()
local handle = io.popen("get-anki-decks")
local decks = {}
for line in handle:lines() do
table.insert(decks, line)
end
handle:close()
vim.ui.select(decks, { prompt = "Select Anki deck" }, function(choice)
if choice then
vim.api.nvim_put({ choice }, "", true, true)
end
end)
end, {})

View File

@ -1,3 +1,4 @@
vim.cmd([[
" Anki helper functions " Anki helper functions
" Convert cloze note to regular text " Convert cloze note to regular text
@ -20,3 +21,4 @@
au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
]])

View File

@ -1,3 +1,20 @@
-- NOTE: May want to move this, as it is more specific to wiki than to pandoc
vim.api.nvim_create_user_command("AnkiDeck", function()
local handle = io.popen("get-anki-decks")
local decks = {}
for line in handle:lines() do
table.insert(decks, line)
end
handle:close()
vim.ui.select(decks, { prompt = "Select Anki deck" }, function(choice)
if choice then
vim.api.nvim_put({ choice }, "", true, true)
end
end)
end, {})
vim.cmd([[
set cc=81 set cc=81
set cocu="" set cocu=""
func! GetContext() func! GetContext()
@ -17,3 +34,4 @@ func! GetContext()
endif endif
endfunc endfunc
com! -nargs=0 GetContext :call GetContext() com! -nargs=0 GetContext :call GetContext()
]])

View File

@ -1,3 +1,4 @@
vim.cmd([[
" "
" Source: https://wiki.call-cc.org/vim / Jonathan Palardy " Source: https://wiki.call-cc.org/vim / Jonathan Palardy
" "
@ -23,3 +24,4 @@ fun! Scheme_eval_defun()
call Scheme_send_sexp(@") call Scheme_send_sexp(@")
call setpos('.', pos) call setpos('.', pos)
endfun endfun
]])

View File

@ -1 +0,0 @@
set mps+==:;