Merge commit '85165468f589dbb395b73f0cb17b758ac6fe33aa'
This commit is contained in:
@@ -8,5 +8,6 @@ vim.filetype.add({
|
||||
[".*/%.ssh/config%.d/.*"] = "sshconfig",
|
||||
["%.env.*"] = "dotenv",
|
||||
["%.pl$"] = "prolog",
|
||||
[".*.containerfile.*"] = "dockerfile",
|
||||
},
|
||||
})
|
||||
|
||||
@@ -42,4 +42,5 @@ require("nixCatsUtils.catPacker").setup({
|
||||
{ "zbirenbaum/copilot.lua" },
|
||||
{ "zbirenbaum/copilot-cmp" },
|
||||
{ "qvalentin/helm-ls.nvim", ft = "helm" },
|
||||
{ "mikesmithgh/kitty-scrollback.nvim" },
|
||||
})
|
||||
|
||||
@@ -12,7 +12,6 @@ Plug 'quarto-dev/quarto-vim'
|
||||
Plug 'lervag/vimtex'
|
||||
" Wiki
|
||||
Plug 'lervag/wiki.vim'
|
||||
Plug 'hektor/taskwiki'
|
||||
" Markdown
|
||||
Plug 'vim-pandoc/vim-pandoc'
|
||||
Plug 'vim-pandoc/vim-pandoc-syntax'
|
||||
|
||||
11
dots/.config/nvim/lua/skeleton/init.lua
Normal file
11
dots/.config/nvim/lua/skeleton/init.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd("BufNewFile", {
|
||||
pattern = "shell.nix",
|
||||
command = "0r ~/.config/nvim/skeletons/shell.nix",
|
||||
})
|
||||
|
||||
autocmd("BufNewFile", {
|
||||
pattern = "flake.nix",
|
||||
command = "0r ~/.config/nvim/skeletons/flake.nix",
|
||||
})
|
||||
49
dots/.config/nvim/lua/zk/cmp.lua
Normal file
49
dots/.config/nvim/lua/zk/cmp.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
local cmp = require("cmp")
|
||||
|
||||
local source = {}
|
||||
|
||||
local function get_markdown_files(base)
|
||||
local items = {}
|
||||
local pattern = base .. "/**/*.md"
|
||||
local files = vim.fn.glob(pattern, false, true)
|
||||
for _, file in ipairs(files) do
|
||||
local label = file:gsub("^%./", ""):gsub("%.md$", "")
|
||||
table.insert(items, { label = label })
|
||||
end
|
||||
return items
|
||||
end
|
||||
|
||||
function source:complete(params, callback)
|
||||
local cursor_before_line = params.context.cursor_before_line
|
||||
local cursor_after_line = params.context.cursor_after_line or ""
|
||||
|
||||
local trigger = cursor_before_line:match("%[[^%]]*%]%(([^)]*)$")
|
||||
|
||||
if trigger ~= nil then
|
||||
local items = get_markdown_files(".")
|
||||
local next_char = cursor_after_line:sub(1, 1)
|
||||
|
||||
for _, item in ipairs(items) do
|
||||
if next_char == ")" then
|
||||
item.insertText = item.label
|
||||
else
|
||||
item.insertText = item.label .. ")"
|
||||
end
|
||||
end
|
||||
|
||||
callback(items)
|
||||
else
|
||||
callback({})
|
||||
end
|
||||
end
|
||||
|
||||
function source:get_trigger_characters()
|
||||
return { "(" }
|
||||
end
|
||||
|
||||
function source:is_available()
|
||||
local ft = vim.bo.filetype
|
||||
return ft == "markdown" or ft == "pandoc"
|
||||
end
|
||||
|
||||
cmp.register_source("zk", source)
|
||||
@@ -1,3 +1,5 @@
|
||||
require("zk.cmp")
|
||||
|
||||
vim.cmd([[
|
||||
let s:zk_preview_enabled = 0
|
||||
let s:live_server_job = -1
|
||||
Reference in New Issue
Block a user