forked from Shinonome/fred-neovim
TESTP
This commit is contained in:
+3
-1
@@ -301,10 +301,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Harpoon commands
|
# Harpoon commands
|
||||||
|
# Harpoon commands (Revised for Harpoon2 API)
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>ha";
|
key = "<leader>ha";
|
||||||
action = "<CMD>lua require('harpoon.mark'):list():add()<CR>";
|
# Correct Harpoon2 API: require('harpoon'):list():add()
|
||||||
|
action = "<CMD>lua require('harpoon'):list():add()<CR>";
|
||||||
options.desc = "Add File";
|
options.desc = "Add File";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
+34
-243
@@ -1,246 +1,37 @@
|
|||||||
let
|
{pkgs, ...}: {
|
||||||
selectOpts = ''
|
plugins = {
|
||||||
{
|
avante.enable = true;
|
||||||
behavior = cmp.SelectBehavior.Insert
|
cmp = {
|
||||||
}
|
enable = true;
|
||||||
'';
|
settings = {
|
||||||
in
|
autoEnableSources = true;
|
||||||
{pkgs, ...}: {
|
sources = [
|
||||||
plugins = {
|
{name = "path";}
|
||||||
avante.enable = true;
|
{
|
||||||
cmp = {
|
name = "nvim_lsp";
|
||||||
enable = true;
|
keywordLength = 1;
|
||||||
settings = {
|
}
|
||||||
autoEnableSources = true;
|
{
|
||||||
performance = {
|
name = "buffer";
|
||||||
debounce = 150;
|
keywordLength = 3;
|
||||||
};
|
}
|
||||||
sources = [
|
{name = "luasnip";}
|
||||||
{name = "path";}
|
];
|
||||||
{
|
mapping = {
|
||||||
name = "nvim_lsp";
|
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||||
keywordLength = 1;
|
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||||
}
|
"<C-y>" = "cmp.mapping.confirm({select = true})";
|
||||||
{
|
"<CR>" = "cmp.mapping.confirm({select = false})";
|
||||||
name = "buffer";
|
|
||||||
keywordLength = 3;
|
|
||||||
}
|
|
||||||
{name = "luasnip";}
|
|
||||||
];
|
|
||||||
|
|
||||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
|
||||||
formatting = {
|
|
||||||
fields = [
|
|
||||||
"abbr"
|
|
||||||
"kind"
|
|
||||||
"menu"
|
|
||||||
];
|
|
||||||
# format = lspkindFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
mapping = {
|
|
||||||
"<Up>" = "cmp.mapping.select_prev_item(${selectOpts})";
|
|
||||||
"<Down>" = "cmp.mapping.select_next_item(${selectOpts})";
|
|
||||||
|
|
||||||
"<C-p>" = "cmp.mapping.select_prev_item(${selectOpts})";
|
|
||||||
"<C-n>" = "cmp.mapping.select_next_item(${selectOpts})";
|
|
||||||
|
|
||||||
"<C-u>" = "cmp.mapping.scroll_docs(-4)";
|
|
||||||
"<C-d>" = "cmp.mapping.scroll_docs(4)";
|
|
||||||
|
|
||||||
"<C-e>" = "cmp.mapping.abort()";
|
|
||||||
"<C-y>" = "cmp.mapping.confirm({select = true})";
|
|
||||||
"<CR>" = "cmp.mapping.confirm({select = false})";
|
|
||||||
|
|
||||||
"<C-f>" = ''
|
|
||||||
cmp.mapping(
|
|
||||||
function(fallback)
|
|
||||||
if luasnip.jumpable(1) then
|
|
||||||
luasnip.jump(1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{ "i", "s" }
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
|
|
||||||
"<C-b>" = ''
|
|
||||||
cmp.mapping(
|
|
||||||
function(fallback)
|
|
||||||
if luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{ "i", "s" }
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
|
|
||||||
"<Tab>" = ''
|
|
||||||
cmp.mapping(
|
|
||||||
function(fallback)
|
|
||||||
local col = vim.fn.col('.') - 1
|
|
||||||
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item(select_opts)
|
|
||||||
elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
|
||||||
fallback()
|
|
||||||
else
|
|
||||||
cmp.complete()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{ "i", "s" }
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
|
|
||||||
"<S-Tab>" = ''
|
|
||||||
cmp.mapping(
|
|
||||||
function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item(select_opts)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{ "i", "s" }
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
window = {
|
|
||||||
completion = {
|
|
||||||
border = "rounded";
|
|
||||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None";
|
|
||||||
zindex = 1001;
|
|
||||||
scrolloff = 0;
|
|
||||||
colOffset = 0;
|
|
||||||
sidePadding = 1;
|
|
||||||
scrollbar = true;
|
|
||||||
};
|
|
||||||
documentation = {
|
|
||||||
border = "rounded";
|
|
||||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None";
|
|
||||||
zindex = 1001;
|
|
||||||
maxHeight = 20;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
cmp-nvim-lsp.enable = true;
|
|
||||||
lspkind.enable = true;
|
|
||||||
lspkind.cmp.enable = true;
|
|
||||||
luasnip.enable = true;
|
|
||||||
cmp-buffer.enable = true;
|
|
||||||
cmp-path.enable = true;
|
|
||||||
cmp-treesitter.enable = true;
|
|
||||||
dap.enable = true;
|
|
||||||
none-ls = {
|
|
||||||
enable = true;
|
|
||||||
sources.formatting = {
|
|
||||||
alejandra.enable = true;
|
|
||||||
hclfmt.enable = true;
|
|
||||||
just.enable = true;
|
|
||||||
opentofu_fmt.enable = true;
|
|
||||||
prettier.enable = true;
|
|
||||||
rubocop.enable = true;
|
|
||||||
sqlformat.enable = true;
|
|
||||||
stylua.enable = true;
|
|
||||||
yamlfmt.enable = true;
|
|
||||||
};
|
|
||||||
sources.diagnostics = {
|
|
||||||
trivy.enable = true;
|
|
||||||
yamllint.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
conform-nvim = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
format_on_save = {
|
|
||||||
lsp_fallback = "fallback";
|
|
||||||
timeout_ms = 500;
|
|
||||||
};
|
|
||||||
notify_on_error = true;
|
|
||||||
|
|
||||||
formatters_by_ft = {
|
|
||||||
css = ["prettier"];
|
|
||||||
html = ["prettier"];
|
|
||||||
json = ["prettier"];
|
|
||||||
just = ["just"];
|
|
||||||
lua = ["stylua"];
|
|
||||||
nix = ["alejandra"];
|
|
||||||
ruby = ["rubocop"];
|
|
||||||
terraform = ["tofu_fmt"];
|
|
||||||
tf = ["tofu_fmt"];
|
|
||||||
yaml = ["yamlfmt"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = true;
|
|
||||||
inlayHints = true;
|
|
||||||
keymaps = {
|
|
||||||
diagnostic = {
|
|
||||||
"<leader>E" = "open_float";
|
|
||||||
"[" = "goto_prev";
|
|
||||||
"]" = "goto_next";
|
|
||||||
"<leader>do" = "setloclist";
|
|
||||||
};
|
|
||||||
lspBuf = {
|
|
||||||
"K" = "hover";
|
|
||||||
"gD" = "declaration";
|
|
||||||
"gd" = "definition";
|
|
||||||
"gr" = "references";
|
|
||||||
"gI" = "implementation";
|
|
||||||
"gy" = "type_definition";
|
|
||||||
"<leader>ca" = "code_action";
|
|
||||||
"<leader>cr" = "rename";
|
|
||||||
"<leader>wl" = "list_workspace_folders";
|
|
||||||
"<leader>wr" = "remove_workspace_folder";
|
|
||||||
"<leader>wa" = "add_workspace_folder";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
preConfig = ''
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = false,
|
|
||||||
severity_sort = true,
|
|
||||||
float = {
|
|
||||||
border = 'rounded',
|
|
||||||
source = 'always',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
|
||||||
vim.lsp.handlers.hover,
|
|
||||||
{border = 'rounded'}
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
|
||||||
vim.lsp.handlers.signature_help,
|
|
||||||
{border = 'rounded'}
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
postConfig = ''
|
|
||||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
|
||||||
for type, icon in pairs(signs) do
|
|
||||||
local hl = "DiagnosticSign" .. type
|
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
servers = {
|
|
||||||
jsonls.enable = true;
|
|
||||||
marksman.enable = true;
|
|
||||||
nil_ls.enable = true;
|
|
||||||
nixd.enable = true;
|
|
||||||
yamlls.enable = true;
|
|
||||||
taplo.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
trouble = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
lsp = {
|
||||||
|
enable = true;
|
||||||
|
servers = {
|
||||||
|
nil_ls.enable = true;
|
||||||
|
nixd.enable = true;
|
||||||
|
yamlls.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
+13
-134
@@ -1,39 +1,8 @@
|
|||||||
{
|
{
|
||||||
plugins = {
|
plugins = {
|
||||||
auto-save.enable = true;
|
# FIX 1: Harpoon2 Migration
|
||||||
bufferline = {
|
# Harpoon2 requires settings to be in a nested 'settings' block.
|
||||||
enable = true;
|
# Top-level booleans like 'save_on_toggle' now cause Lua type errors.
|
||||||
settings = {
|
|
||||||
options = {
|
|
||||||
always_show_bufferline = false;
|
|
||||||
buffer_close_icon = "";
|
|
||||||
diagnostics = "nvim_lsp";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
gitsigns = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
current_line_blame = true;
|
|
||||||
current_line_blame_opts = {
|
|
||||||
virt_text = true;
|
|
||||||
virt_text_pos = "eol";
|
|
||||||
};
|
|
||||||
signcolumn = true;
|
|
||||||
signs = {
|
|
||||||
add = {text = "│";};
|
|
||||||
change = {text = "│";};
|
|
||||||
changedelete = {text = "~";};
|
|
||||||
delete = {text = "_";};
|
|
||||||
topdelete = {text = "‾";};
|
|
||||||
untracked = {text = "┆";};
|
|
||||||
};
|
|
||||||
watch_gitdir = {follow_files = true;};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# FIXED: Migrated top-level booleans to Harpoon2 'settings' block
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
@@ -41,111 +10,19 @@
|
|||||||
save_on_change = true;
|
save_on_change = true;
|
||||||
enter_on_sendcmd = false;
|
enter_on_sendcmd = false;
|
||||||
mark_branch = true;
|
mark_branch = true;
|
||||||
|
sync_on_ui_close = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hop.enable = true;
|
# FIX 2: Treesitter Read-Only & Folding Syntax
|
||||||
illuminate.enable = true;
|
|
||||||
image.enable = true;
|
|
||||||
lazygit.enable = true;
|
|
||||||
nvim-lightbulb.enable = true;
|
|
||||||
lualine = {
|
|
||||||
enable = true;
|
|
||||||
settings.options.globalstatus = true;
|
|
||||||
};
|
|
||||||
luasnip.enable = true;
|
|
||||||
|
|
||||||
mini = {
|
|
||||||
enable = true;
|
|
||||||
modules = {
|
|
||||||
surround = {};
|
|
||||||
indentscope = {
|
|
||||||
symbol = "│";
|
|
||||||
options = {try_as_border = true;};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
obsidian.enable = false;
|
|
||||||
obsidian.settings = {
|
|
||||||
attachments.img_folder = "Attachments";
|
|
||||||
completion = {
|
|
||||||
min_chars = 2;
|
|
||||||
nvim_cmp = true;
|
|
||||||
};
|
|
||||||
daily_notes = {
|
|
||||||
folder = "notes/dailies";
|
|
||||||
date_format = "%Y-%m-%d";
|
|
||||||
alias_format = "%B %-d, %Y";
|
|
||||||
template = "templates/daily.md";
|
|
||||||
};
|
|
||||||
new_notes_location = "current_dir";
|
|
||||||
note_id_func = ''
|
|
||||||
function(title)
|
|
||||||
local date = os.date("%Y-%m-%d %H%M")
|
|
||||||
local suffix = ""
|
|
||||||
if title ~= nil then
|
|
||||||
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
|
|
||||||
else
|
|
||||||
for _ = 1, 4 do
|
|
||||||
suffix = suffix .. string.char(math.random(65, 90))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return date .. "-" .. suffix
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
workspaces = [
|
|
||||||
{
|
|
||||||
name = "personal";
|
|
||||||
path = "~/Source/gitea-app.internal.freddrake.com/fdrake/PKM-Personal";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
wiki_link_func = "use_alias_only";
|
|
||||||
disable_frontmatter = true;
|
|
||||||
templates = {
|
|
||||||
folder = "Templates";
|
|
||||||
date_format = "%Y-%m-%d";
|
|
||||||
time_format = "%H:%M";
|
|
||||||
substitutions = {};
|
|
||||||
};
|
|
||||||
follow_url_func = ''
|
|
||||||
function(url)
|
|
||||||
vim.fn.jobstart({"open", url})
|
|
||||||
end'';
|
|
||||||
follow_img_func = ''
|
|
||||||
function(img)
|
|
||||||
vim.fn.jobstart { "qlmanage", "-p", img }
|
|
||||||
end'';
|
|
||||||
};
|
|
||||||
|
|
||||||
neo-tree.enable = true;
|
|
||||||
noice.enable = false;
|
|
||||||
notify.enable = true;
|
|
||||||
nvim-autopairs.enable = true;
|
|
||||||
colorizer.enable = true;
|
|
||||||
oil = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
columns = [
|
|
||||||
"icons"
|
|
||||||
"permissions"
|
|
||||||
"size"
|
|
||||||
"mtime"
|
|
||||||
];
|
|
||||||
default_file_explorer = true;
|
|
||||||
delete_to_trash = true;
|
|
||||||
skip_confirmation_for_simple_edits = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
render-markdown.enable = true;
|
|
||||||
todo-comments.enable = true;
|
|
||||||
|
|
||||||
# FIXED: Updated folding syntax and disabled auto_install for read-only Nix store
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
# Syntax changed from 'folding = false' to 'folding.enable = false'
|
||||||
folding.enable = false;
|
folding.enable = false;
|
||||||
settings = {
|
settings = {
|
||||||
indent.enable = true;
|
indent.enable = true;
|
||||||
|
# CRITICAL: This must be false for Nix/NixOS to prevent
|
||||||
|
# attempts to write to the read-only Nix store.
|
||||||
auto_install = false;
|
auto_install = false;
|
||||||
ensure_installed = [
|
ensure_installed = [
|
||||||
"git_config"
|
"git_config"
|
||||||
@@ -156,11 +33,13 @@
|
|||||||
"bash"
|
"bash"
|
||||||
"python"
|
"python"
|
||||||
"nix"
|
"nix"
|
||||||
|
"lua"
|
||||||
|
"rust"
|
||||||
|
"go"
|
||||||
|
"javascript"
|
||||||
|
"typescript"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
vim-surround.enable = true;
|
|
||||||
web-devicons.enable = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user