Squashed 'dots/' changes from 357b97a..24ce8f3
24ce8f3Migrate '.vim/plugin' to neovime3d9612Remove vim yin/yang colorschemes05986a3Migrate '.vim/ftplugin' to neovim05bc2ecMigrate vim snippets to neovim (LuaSnip)128ae8eMigrate '.vim/ftdetect/prolog' to neovimf3188f7Migrate '.vim/after/syntax' to neovim85d56f9Migrate vim init config to neovimafca2caMigrate '.vim/after' to neovimd6875c9Add 'eslint_d' PID to 'nvim-lint' config568e45fRemove jira aliases78fa170Disable 'xdg-user-dirs' by default5216f79Alias bash 'history' command to 'h'0f29dc3Add neovim dependencies to flakec901a1ctestdc4ebfcMerge commit '490998275cbdc5ff032d4a39794bf850f4bfefec'73fd4afAdd neovim 'auto-session' plugin setupff47da9Add minimal readme to my neovim configuration6dff3ebAdd minimal readme to my neovim configurationc94ccd3Remove neovim lazy load related config75ca003Fall back to 'paq.nvim' only when not on 'nixCats'78094a0Add 'nixCatsUtils' from 'nixCats'6e81624Add neovim packages to 'nixCats' flake6ded0b1Add minimal 'nixCats' flake templated0550b3Link NixOS repo in dotfiles repository git-subtree-dir: dots git-subtree-split:24ce8f39af
This commit is contained in:
1
.config/nvim/ftplugin/javascript.lua
Normal file
1
.config/nvim/ftplugin/javascript.lua
Normal file
@@ -0,0 +1 @@
|
||||
vim.opt.matchpairs:append("=:;")
|
||||
@@ -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, {})
|
||||
24
.config/nvim/ftplugin/pandoc/anki.lua
Normal file
24
.config/nvim/ftplugin/pandoc/anki.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
vim.cmd([[
|
||||
" Anki helper functions
|
||||
|
||||
" Convert cloze note to regular text
|
||||
"
|
||||
" * `AnkiRemoveAllClozes` all cloze notes in file
|
||||
" * `AnkiRemoveSelectedClozes` all clozes in selected range
|
||||
"
|
||||
" E.g.
|
||||
"
|
||||
" ```markdown
|
||||
" START
|
||||
" Cloze
|
||||
" In this sentence {{c1::this word}} was closed.
|
||||
" END
|
||||
" ```
|
||||
"
|
||||
" ```markdown
|
||||
" In this sentence this word was closed.
|
||||
" ```
|
||||
|
||||
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
|
||||
]])
|
||||
37
.config/nvim/ftplugin/pandoc/wiki.lua
Normal file
37
.config/nvim/ftplugin/pandoc/wiki.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
-- 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 cocu=""
|
||||
func! GetContext()
|
||||
" https://stackoverflow.com/questions/9464844/how-to-get-group-name-of-highlighting-under-cursor-in-vim
|
||||
if !exists("*synstack")
|
||||
return
|
||||
endif
|
||||
let matches = map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
|
||||
if index(matches, 'pandocLaTeXInlineMath') >= 0
|
||||
echo 'math_inline'
|
||||
elseif index(matches, 'pandocLaTeXMathBlock') >= 0
|
||||
echo 'math_block'
|
||||
elseif !empty(matches)
|
||||
echo matches[0]
|
||||
else
|
||||
echo ''
|
||||
endif
|
||||
endfunc
|
||||
com! -nargs=0 GetContext :call GetContext()
|
||||
]])
|
||||
27
.config/nvim/ftplugin/scheme/repl.vim
Normal file
27
.config/nvim/ftplugin/scheme/repl.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
vim.cmd([[
|
||||
"
|
||||
" Source: https://wiki.call-cc.org/vim / Jonathan Palardy
|
||||
"
|
||||
|
||||
" Note, this is assuming you have an R5RS Scheme REPL runnning in the second
|
||||
" TMUX pane.
|
||||
|
||||
" Send `(load <current-file>)` to tmux pane
|
||||
nmap <leader>rf :call Scheme_send_sexp("(#%require xrepl)(load \"" . expand("%:p") . "\")\n")<cr>
|
||||
nmap <leader>re :call Scheme_eval_defun()<cr>
|
||||
|
||||
" Send s-expression to TMUX buffer
|
||||
fun! Scheme_send_sexp(sexp)
|
||||
let ss = escape(a:sexp, '\"')
|
||||
" Send to second tmux pane
|
||||
call system("tmux send-keys -t 1 \"" . ss . "\n\"")
|
||||
endfun
|
||||
|
||||
" Send s-expression under cursor to TMUX buffer
|
||||
fun! Scheme_eval_defun()
|
||||
let pos = getpos('.')
|
||||
silent! exec "normal! 99[(yab"
|
||||
call Scheme_send_sexp(@")
|
||||
call setpos('.', pos)
|
||||
endfun
|
||||
]])
|
||||
Reference in New Issue
Block a user