Merge commit '85165468f589dbb395b73f0cb17b758ac6fe33aa'
This commit is contained in:
@@ -1 +1,3 @@
|
||||
require("auto-session").setup({})
|
||||
require("auto-session").setup({
|
||||
auto_session_enabled = vim.env.KITTY_SCROLLBACK_NVIM ~= "true", -- See kitty-scrollback.nvim
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require("conform").setup({
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
format_after_save = {
|
||||
lsp_fallback = false,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
},
|
||||
@@ -16,14 +16,14 @@ require("conform").setup({
|
||||
lua = { "stylua" }, -- configured in stylua.toml
|
||||
markdown = { "prettierd", "prettier", stop_after_first = true },
|
||||
nix = { "nixfmt" },
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascript = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||
javascriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||
json = { "prettierd", "prettier", stop_after_first = true },
|
||||
jsonc = { "prettierd", "prettier", stop_after_first = true },
|
||||
python = { "isort", "black" },
|
||||
svelte = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
yaml = { "prettierd", "prettier", stop_after_first = true },
|
||||
svelte = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
|
||||
typescriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||
-- yaml = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
local gitsigns = require("gitsigns")
|
||||
|
||||
gitsigns.setup({
|
||||
current_line_blame_opts = { delay = 0 },
|
||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
|
||||
linehl = true,
|
||||
current_line_blame_opts = {
|
||||
delay = 0,
|
||||
virt_text_pos = "right_align",
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("Blame", gitsigns.toggle_current_line_blame, { nargs = "?" })
|
||||
|
||||
1
dots/.config/nvim/after/plugin/kitty-scrollback.nvim.lua
Normal file
1
dots/.config/nvim/after/plugin/kitty-scrollback.nvim.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("kitty-scrollback").setup()
|
||||
@@ -1,7 +1,5 @@
|
||||
require("neodev").setup() -- should setup before lspconfig
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- vim.g.coq_settings = { auto_start = 'shut-up' }
|
||||
-- local capabilities = coq.lsp_ensure_capabilities()
|
||||
|
||||
@@ -34,7 +32,38 @@ local servers = {
|
||||
},
|
||||
},
|
||||
},
|
||||
lua_ls = {},
|
||||
lua_ls = {
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if
|
||||
path ~= vim.fn.stdpath("config")
|
||||
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
||||
then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = {
|
||||
"lua/?.lua",
|
||||
"lua/?/init.lua",
|
||||
},
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
},
|
||||
-- marksman = {},
|
||||
nixd = {},
|
||||
pyright = {},
|
||||
@@ -104,9 +133,11 @@ local servers = {
|
||||
|
||||
for server, config in pairs(servers) do
|
||||
config.capabilities = capabilities
|
||||
lspconfig[server].setup(config)
|
||||
vim.lsp.config(server, config)
|
||||
end
|
||||
|
||||
vim.lsp.enable(vim.tbl_keys(servers))
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.bufnr }
|
||||
|
||||
@@ -63,6 +63,7 @@ cmp.setup({
|
||||
}),
|
||||
sources = {
|
||||
{ name = "copilot", group_index = 2 },
|
||||
{ name = "zk" },
|
||||
{ name = "nvim_lsp", keyword_length = 8 },
|
||||
{ name = "luasnip", max_item_count = 16 },
|
||||
{ name = "path" },
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
vim.cmd([[
|
||||
let g:taskwiki_taskrc_location='/home/h/.config/task/taskrc'
|
||||
let g:taskwiki_disable_concealcursor=1
|
||||
let g:taskwiki_dont_preserve_folds=1
|
||||
let g:taskwiki_dont_fold=1
|
||||
]])
|
||||
@@ -14,13 +14,6 @@ syn match Cloze /\({{c\d\+::\)\@<=\(\_[A-Za-z0-9$\ \\\-\*,_`()]*\)\(}}\)\@=/ con
|
||||
|
||||
hi! link ClozeDelimiter Special
|
||||
hi! link Cloze Special
|
||||
|
||||
" Fix task UUIDs not being highlighted correctly in pandoc lists
|
||||
syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocReferenceURL,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape,TaskWikiTaskUuid skipempty display
|
||||
syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
|
||||
syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}$/
|
||||
highlight link TaskWikiTaskUuid Comment
|
||||
|
||||
]])
|
||||
|
||||
vim.cmd.runtime("syntax/_comment_keywords.lua")
|
||||
|
||||
@@ -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
|
||||
10
dots/.config/nvim/skeletons/flake.nix
Normal file
10
dots/.config/nvim/skeletons/flake.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
{
|
||||
};
|
||||
}
|
||||
6
dots/.config/nvim/skeletons/shell.nix
Normal file
6
dots/.config/nvim/skeletons/shell.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs.buildPackages; [ ];
|
||||
}
|
||||
12
dots/.config/nvim/snips/lua.lua
Normal file
12
dots/.config/nvim/snips/lua.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
|
||||
return {
|
||||
s({ trig = "^M.", regTrig = true, snippetType = "autosnippet" }, {
|
||||
t("local M = {"),
|
||||
i(1),
|
||||
t({ "}", "", "", "return M" }),
|
||||
}),
|
||||
}
|
||||
@@ -700,10 +700,6 @@ local fmta = require("luasnip.extras.fmt").fmta
|
||||
-- \`\`\`
|
||||
-- endsnippet
|
||||
--
|
||||
-- snippet task "Task" i
|
||||
-- * [ ] $1 -- pro:$2
|
||||
-- endsnippet
|
||||
--
|
||||
-- snippet "(\b)fn(\d+)" "" ir
|
||||
-- `!p snip.rv = snip.basename + "_" + match.group(2).zfill(2)`$1
|
||||
-- endsnippet
|
||||
|
||||
Reference in New Issue
Block a user