Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 57cb0f7b8f | |||
| 3fc7a94efb | |||
| 19aa1b7a14 | |||
| b644b0c4e1 | |||
| 98db76ce45 | |||
| b768848495 | |||
| e36cc1ec8f | |||
| a87192fb63 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
nvim-pack-lock.json
|
||||
.worktrees/
|
||||
autoload/coc/source/codecompanion.vim
|
||||
@@ -102,4 +102,3 @@ The configuration automatically detects TTY environments and disables icons/comp
|
||||
- **Claude Code**: Primary AI assistant with keymaps under `<leader>a` for chat, diff management, and file operations
|
||||
- **Avante**: Secondary AI integration (currently configured for Copilot provider)
|
||||
- **GitHub Copilot**: Code completion integration via copilot.vim
|
||||
- Were no longer using nvim_cmp having switched to coc
|
||||
@@ -1,95 +0,0 @@
|
||||
{
|
||||
"coc.preferences.timeout": 300,
|
||||
"suggest.enablePreview": true,
|
||||
"suggest.floatEnable": true,
|
||||
"suggest.detailField": "preview",
|
||||
"suggest.maxPreviewWidth": 80,
|
||||
"signature.enable": false,
|
||||
"signature.target": "float",
|
||||
"extensions": [
|
||||
"coc-json",
|
||||
"coc-html",
|
||||
"coc-css",
|
||||
"coc-pyright",
|
||||
"coc-clangd",
|
||||
"coc-rust-analyzer",
|
||||
"coc-yaml",
|
||||
"coc-tsserver",
|
||||
"coc-lua",
|
||||
"coc-sh",
|
||||
"coc-go",
|
||||
"coc-prettier",
|
||||
"coc-eslint",
|
||||
"coc-markdownlint",
|
||||
"coc-vimlsp"
|
||||
],
|
||||
"pyright.enable": true,
|
||||
"pyright.organizeimports.provider": "pyright",
|
||||
"python.analysis.autoImportCompletions": true,
|
||||
"python.analysis.autoSearchPaths": true,
|
||||
"python.analysis.diagnosticMode": "workspace",
|
||||
"python.analysis.typeCheckingMode": "basic",
|
||||
"rust-analyzer.enable": true,
|
||||
"rust-analyzer.cargo.loadOutDirsFromCheck": true,
|
||||
"rust-analyzer.procMacro.enable": true,
|
||||
"clangd.enabled": true,
|
||||
"clangd.fallbackFlags": ["-std=c++17"],
|
||||
"html.enable": true,
|
||||
"css.enable": true,
|
||||
"typescript.enable": true,
|
||||
"javascript.enable": true,
|
||||
"eslint.enable": true,
|
||||
"prettier.enable": true,
|
||||
"languageserver": {
|
||||
"zig": {
|
||||
"command": "zls",
|
||||
"filetypes": ["zig"],
|
||||
"rootPatterns": ["build.zig", "build.zig.zon"],
|
||||
"settings": {
|
||||
"zls": {
|
||||
"enable_snippets": true,
|
||||
"enable_ast_check_diagnostics": true,
|
||||
"enable_build_on_save": true,
|
||||
"build_on_save_step": "check"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nim": {
|
||||
"command": "nimlangserver",
|
||||
"filetypes": ["nim"],
|
||||
"rootPatterns": ["*.nimble", "*.nim"],
|
||||
"settings": {
|
||||
"nim": {
|
||||
"nimsuggestPath": "nimsuggest",
|
||||
"timeout": 120000
|
||||
}
|
||||
}
|
||||
},
|
||||
"vlang": {
|
||||
"command": "vls",
|
||||
"filetypes": ["v"],
|
||||
"rootPatterns": ["v.mod"]
|
||||
},
|
||||
"lua": {
|
||||
"command": "lua-language-server",
|
||||
"filetypes": ["lua"],
|
||||
"rootPatterns": [".luarc.json", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml"],
|
||||
"settings": {
|
||||
"Lua": {
|
||||
"runtime": {
|
||||
"version": "LuaJIT"
|
||||
},
|
||||
"diagnostics": {
|
||||
"globals": ["vim"]
|
||||
},
|
||||
"workspace": {
|
||||
"library": {
|
||||
"${3rd}/luv/library": true,
|
||||
"${3rd}/busted/library": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
177
init.lua
177
init.lua
@@ -1,155 +1,47 @@
|
||||
local vim = vim
|
||||
local host = vim.loop.os_gethostname()
|
||||
obsidian_dir = "~/Documents/Notebooks"
|
||||
require("options") -- ./lua/options.lua
|
||||
require("remote_clipboard").setup() -- ./lua/remote_clipboard.lua
|
||||
require("plugins") -- ./lua/plugins.lua
|
||||
require("utils.t3_functions") -- ./lua/utils/t3_functions.lua
|
||||
require("obsidian_config") -- ./lua/obsidian_config.lua
|
||||
require("utils.t3_overrides") -- ./lua/utils/t3_overrides.lua
|
||||
require("utils.reload") -- ./lua/utils/reload.lua
|
||||
require("vimwiki") -- ./lua/vimwiki.lua
|
||||
require("keymaps") -- ./lua/keymaps.lua
|
||||
require("lsp") -- ./lua/lsp.lua
|
||||
-- require("godot") -- ./lua/godot.lua
|
||||
-- require("completion") -- ./lua/completion.lua
|
||||
require("coc") -- ./lua/coc.lua
|
||||
require("completion") -- ./lua/completion.lua
|
||||
require("treesitter") -- ./lua/treesitter.lua
|
||||
require("autocmds") -- ./lua/autocmds.lua
|
||||
require("diagnostics") -- ./lua/diagnostics.lua
|
||||
require("codecompanion_settings") -- ./lua/codecompanion_settings.lua
|
||||
require("corridor_settings") -- ./lua/corridor_settings.lua
|
||||
require('telescope_configuration') -- ./lua/telescope_configuration.lua
|
||||
require("mail") -- ./lua/mail.lua (no-op unless NEOMUTT=1)
|
||||
|
||||
local function cyberdream()
|
||||
require("cyberdream").setup({
|
||||
-- Set light or dark variant
|
||||
variant = "default", -- use "light" for the light variant. Also accepts "auto" to set dark or light colors based on the current value of `vim.o.background`
|
||||
-- Enable transparent background
|
||||
transparent = true,
|
||||
-- Reduce the overall saturation of colours for a more muted look
|
||||
saturation = 1, -- accepts a value between 0 and 1. 0 will be fully desaturated (greyscale) and 1 will be the full color (default)
|
||||
-- Enable italics comments
|
||||
italic_comments = true,
|
||||
-- Replace all fillchars with ' ' for the ultimate clean look
|
||||
hide_fillchars = false,
|
||||
-- Apply a modern borderless look to pickers like Telescope, Snacks Picker & Fzf-Lua
|
||||
borderless_pickers = true,
|
||||
-- Set terminal colors used in `:terminal`
|
||||
terminal_colors = true,
|
||||
-- Improve start up time by caching highlights. Generate cache with :CyberdreamBuildCache and clear with :CyberdreamClearCache
|
||||
cache = true,
|
||||
-- Override highlight groups with your own colour values
|
||||
-- highlights = {
|
||||
-- -- Highlight groups to override, adding new groups is also possible
|
||||
-- -- See `:h highlight-groups` for a list of highlight groups or run `:hi` to see all groups and their current values
|
||||
-- -- Example:
|
||||
-- Comment = { fg = "#696969", bg = "NONE", italic = true },
|
||||
-- -- More examples can be found in `lua/cyberdream/extensions/*.lua`
|
||||
-- },
|
||||
-- Override a highlight group entirely using the built-in colour palette
|
||||
-- overrides = function(colors) -- NOTE: This function nullifies the `highlights` option
|
||||
-- -- Example:
|
||||
-- return {
|
||||
-- Comment = { fg = colors.green, bg = "NONE", italic = true },
|
||||
-- ["@property"] = { fg = colors.magenta, bold = true },
|
||||
-- }
|
||||
-- end,
|
||||
-- Override colors
|
||||
-- colors = {
|
||||
-- -- For a list of colors see `lua/cyberdream/colours.lua`
|
||||
-- -- Override colors for both light and dark variants
|
||||
-- bg = "#000000",
|
||||
-- green = "#00ff00",
|
||||
-- -- If you want to override colors for light or dark variants only, use the following format:
|
||||
-- dark = {
|
||||
-- magenta = "#ff00ff",
|
||||
-- fg = "#eeeeee",
|
||||
-- },
|
||||
-- light = {
|
||||
-- red = "#ff5c57",
|
||||
-- cyan = "#5ef1ff",
|
||||
-- },
|
||||
-- },
|
||||
-- Disable or enable colorscheme extensions
|
||||
extensions = {
|
||||
telescope = true,
|
||||
notify = true,
|
||||
mini = true,
|
||||
treesitter = true,
|
||||
whichkey = true,
|
||||
treesittercontext = true,
|
||||
markdown = true,
|
||||
snacks = true,
|
||||
trouble = true,
|
||||
-- More extensions can be found in `lua/cyberdream/extensions/*.lua`
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if host == "xps13" then
|
||||
cyberdream()
|
||||
-- require('tokyonight').setup({
|
||||
-- style = "moon", -- "storm", "moon", "day", "night"
|
||||
-- transparent = false, -- Enable transparent background
|
||||
-- terminal_colors = true, -- Enable terminal colors
|
||||
-- styles = {
|
||||
-- comments = { italic = true }, -- Italic comments
|
||||
-- keywords = { italic = true }, -- Italic keywords
|
||||
-- functions = { bold = true }, -- Bold functions
|
||||
-- variables = {}, -- No special style for variables
|
||||
-- sidebars = "dark", -- Dark sidebars
|
||||
-- floats = "dark", -- Dark floating windows
|
||||
-- },
|
||||
-- })
|
||||
-- })
|
||||
elseif host == "Intrepid" then
|
||||
-- Uses the full Omarchy theme catalog instead of a fixed colorscheme;
|
||||
-- see set_colorscheme()/VimEnter below for the actual hot-reload wiring.
|
||||
-- require('tokyonight').setup({
|
||||
-- style = "storm", -- "storm", "moon", "day", "night"
|
||||
-- transparent = false, -- Enable transparent background
|
||||
-- terminal_colors = true, -- Enable terminal colors
|
||||
-- styles = {
|
||||
-- comments = { italic = true }, -- Italic comments
|
||||
-- keywords = { italic = true }, -- Italic keywords
|
||||
-- functions = { bold = true }, -- Bold functions
|
||||
-- variables = {}, -- No special style for variables
|
||||
-- sidebars = "dark", -- Dark sidebars
|
||||
-- floats = "dark", -- Dark floating windows
|
||||
-- },
|
||||
-- })
|
||||
elseif host == "Vector" then
|
||||
cyberdream()
|
||||
-- require('tokyonight').setup({
|
||||
-- style = "storm", -- "storm", "moon", "day", "night"
|
||||
-- transparent = false, -- Enable transparent background
|
||||
-- terminal_colors = true, -- Enable terminal colors
|
||||
-- styles = {
|
||||
-- comments = { italic = true }, -- Italic comments
|
||||
-- keywords = { italic = true }, -- Italic keywords
|
||||
-- functions = { bold = true }, -- Bold functions
|
||||
-- variables = {}, -- No special style for variables
|
||||
-- sidebars = "dark", -- Dark sidebars
|
||||
-- floats = "dark", -- Dark floating windows
|
||||
-- },
|
||||
-- })
|
||||
require('tokyonight').setup({
|
||||
style = "moon", -- "storm", "moon", "day", "night"
|
||||
transparent = false, -- Enable transparent background
|
||||
terminal_colors = true, -- Enable terminal colors
|
||||
styles = {
|
||||
comments = { italic = true }, -- Italic comments
|
||||
keywords = { italic = true }, -- Italic keywords
|
||||
functions = { bold = true }, -- Bold functions
|
||||
variables = {}, -- No special style for variables
|
||||
sidebars = "dark", -- Dark sidebars
|
||||
floats = "dark", -- Dark floating windows
|
||||
},
|
||||
})
|
||||
elseif host == "Titan" then
|
||||
cyberdream()
|
||||
-- require('tokyonight').setup({
|
||||
-- style = "storm", -- "storm", "moon", "day", "night"
|
||||
-- transparent = false, -- Enable transparent background
|
||||
-- terminal_colors = true, -- Enable terminal colors
|
||||
-- styles = {
|
||||
-- comments = { italic = true }, -- Italic comments
|
||||
-- keywords = { italic = true }, -- Italic keywords
|
||||
-- functions = { bold = true }, -- Bold functions
|
||||
-- variables = {}, -- No special style for variables
|
||||
-- sidebars = "dark", -- Dark sidebars
|
||||
-- floats = "dark", -- Dark floating windows
|
||||
-- },
|
||||
-- })
|
||||
require('tokyonight').setup({
|
||||
style = "storm", -- "storm", "moon", "day", "night"
|
||||
transparent = false, -- Enable transparent background
|
||||
terminal_colors = true, -- Enable terminal colors
|
||||
styles = {
|
||||
comments = { italic = true }, -- Italic comments
|
||||
keywords = { italic = true }, -- Italic keywords
|
||||
functions = { bold = true }, -- Bold functions
|
||||
variables = {}, -- No special style for variables
|
||||
sidebars = "dark", -- Dark sidebars
|
||||
floats = "dark", -- Dark floating windows
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
local function is_linux_console()
|
||||
@@ -162,13 +54,10 @@ local function want_truecolor()
|
||||
or ((vim.env.COLORTERM or ""):lower():find("truecolor") ~= nil)
|
||||
end
|
||||
|
||||
|
||||
local function set_colorscheme()
|
||||
if want_truecolor() then
|
||||
vim.o.termguicolors = true
|
||||
if host == "Intrepid" then
|
||||
require("omarchy_theme").setup()
|
||||
elseif not pcall(vim.cmd.colorscheme, "cyberdream") then
|
||||
if not pcall(vim.cmd.colorscheme, "tokyonight") then
|
||||
pcall(vim.cmd.colorscheme, "habamax")
|
||||
end
|
||||
else
|
||||
@@ -202,12 +91,7 @@ vim.api.nvim_create_autocmd("VimEnter", {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = { { "filename", file_status = true, path = 1 } },
|
||||
lualine_x = {
|
||||
"encoding", "fileformat", "filetype",
|
||||
require("noice").api.statusline.mode.get,
|
||||
cond = require("noice").api.statusline.mode.has,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
@@ -215,7 +99,7 @@ vim.api.nvim_create_autocmd("VimEnter", {
|
||||
else
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = "auto",
|
||||
theme = "tokyonight",
|
||||
icons_enabled = true,
|
||||
globalstatus = true,
|
||||
},
|
||||
@@ -269,3 +153,4 @@ vim.api.nvim_create_autocmd("VimEnter", {
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
local vim = vim
|
||||
local port = os.getenv 'GDScript_Port' or '6005'
|
||||
local cmd = vim.lsp.rpc.connect('127.0.0.1', tonumber(port))
|
||||
|
||||
return {
|
||||
cmd = cmd,
|
||||
filetypes = { 'gd', 'gdscript', 'gdscript3' },
|
||||
root_markers = { 'project.godot', '.git' }
|
||||
}
|
||||
46
lua/coc.lua
46
lua/coc.lua
@@ -1,46 +0,0 @@
|
||||
-- CoC configuration
|
||||
vim.g.coc_global_extensions = {
|
||||
'coc-json',
|
||||
'coc-html',
|
||||
'coc-css',
|
||||
'coc-pyright',
|
||||
'coc-clangd',
|
||||
'coc-rust-analyzer',
|
||||
'coc-yaml',
|
||||
'coc-tsserver',
|
||||
'coc-lua',
|
||||
'coc-sh',
|
||||
'coc-go',
|
||||
'coc-prettier',
|
||||
'coc-eslint',
|
||||
'coc-markdownlint',
|
||||
'coc-vimlsp',
|
||||
'coc-zig'
|
||||
}
|
||||
|
||||
|
||||
-- Use <Tab> and <S-Tab> to navigate completion list
|
||||
vim.keymap.set('i', '<Tab>', function()
|
||||
if vim.fn['coc#pum#visible']() == 1 then
|
||||
return vim.fn['coc#pum#next'](1)
|
||||
else
|
||||
return '<Tab>'
|
||||
end
|
||||
end, { expr = true, silent = true })
|
||||
|
||||
vim.keymap.set('i', '<S-Tab>', function()
|
||||
if vim.fn['coc#pum#visible']() == 1 then
|
||||
return vim.fn['coc#pum#prev'](1)
|
||||
else
|
||||
return '<S-Tab>'
|
||||
end
|
||||
end, { expr = true, silent = true })
|
||||
|
||||
-- Use <CR> to confirm completion
|
||||
vim.keymap.set('i', '<CR>', function()
|
||||
if vim.fn['coc#pum#visible']() == 1 then
|
||||
return vim.fn['coc#pum#confirm']()
|
||||
else
|
||||
return '<CR>'
|
||||
end
|
||||
end, { expr = true, silent = true })
|
||||
@@ -1,89 +0,0 @@
|
||||
local adapters = require("codecompanion.adapters")
|
||||
|
||||
require("codecompanion").setup({
|
||||
adapters = {
|
||||
http = {
|
||||
bifrost = function()
|
||||
return adapters.extend("openai_compatible", {
|
||||
name = "bifrost",
|
||||
formatted_name = "Bifrost",
|
||||
env = {
|
||||
url = vim.env.BIFROST_BASE_URL or "https://bifrost.th3r00t.net",
|
||||
api_key = vim.env.BIFROST_API_KEY
|
||||
and "BIFROST_API_KEY"
|
||||
or "file:~/.config/bifrost/api-key",
|
||||
chat_url = "/v1/chat/completions",
|
||||
models_endpoint = "/v1/models",
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = vim.env.CODECOMPANION_MODEL
|
||||
or "OllamaMSI/qwen3:30b-a3b",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
interactions = {
|
||||
chat = {
|
||||
adapter = "bifrost",
|
||||
},
|
||||
inline = {
|
||||
adapter = "bifrost",
|
||||
},
|
||||
background = {
|
||||
adapter = "bifrost",
|
||||
},
|
||||
},
|
||||
display = {
|
||||
action_palette = {
|
||||
provider = "snacks",
|
||||
},
|
||||
chat = {
|
||||
window = {
|
||||
layout = "vertical",
|
||||
position = "right",
|
||||
width = 0.42,
|
||||
border = "rounded",
|
||||
},
|
||||
start_in_insert_mode = false,
|
||||
show_token_count = true,
|
||||
},
|
||||
diff = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
log_level = "ERROR",
|
||||
language = "English",
|
||||
send_code = true,
|
||||
},
|
||||
})
|
||||
|
||||
local map = vim.keymap.set
|
||||
map({ "n", "v" }, "<leader>aa", "<cmd>CodeCompanionActions<cr>", {
|
||||
desc = "AI actions",
|
||||
})
|
||||
map("n", "<leader>ac", "<cmd>CodeCompanionChat Toggle<cr>", {
|
||||
desc = "Toggle AI chat",
|
||||
})
|
||||
map("n", "<leader>an", "<cmd>CodeCompanionChat<cr>", {
|
||||
desc = "New AI chat",
|
||||
})
|
||||
map({ "n", "v" }, "<leader>ai", "<cmd>CodeCompanion<cr>", {
|
||||
desc = "AI inline prompt",
|
||||
})
|
||||
map({ "n", "v" }, "<leader>ab", "<cmd>CodeCompanionChat Add<cr>", {
|
||||
desc = "Add buffer/selection to AI chat",
|
||||
})
|
||||
|
||||
local which_key = require("which-key")
|
||||
which_key.add({
|
||||
{ "<leader>a", group = "AI" },
|
||||
{ "<leader>aa", desc = "Actions" },
|
||||
{ "<leader>ab", desc = "Add buffer/selection" },
|
||||
{ "<leader>ac", desc = "Toggle chat" },
|
||||
{ "<leader>ai", desc = "Inline prompt" },
|
||||
{ "<leader>an", desc = "New chat" },
|
||||
})
|
||||
@@ -15,21 +15,8 @@ cmp.setup({
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
-- completion = {
|
||||
-- completeopt = 'menu,menuone,noinsert',
|
||||
-- },
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert',
|
||||
},
|
||||
performance = {
|
||||
max_view_entries = 10,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({
|
||||
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||
col_offset = -3,
|
||||
side_padding = 0,
|
||||
}),
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
@@ -101,51 +88,55 @@ cmp.setup.cmdline(":", {
|
||||
}),
|
||||
})
|
||||
|
||||
-- LSP server configurations moved to lsp.lua to avoid duplicates
|
||||
-- local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
-- require("lspconfig").clangd.setup({
|
||||
-- Set up lspconfig.
|
||||
-- require("cmp_nvim_lsp").default_capabilities()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
require("lspconfig").clangd.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig").taplo.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig").marksman.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig").lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig").rust_analyzer.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig").zls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig").gopls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
unusedwrite = true,
|
||||
shadow = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
usePlaceholders = true,
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("lspconfig").basedpyright.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig").nim_langserver.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
-- require'lspconfig'.jedi_language_server.setup {
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- require("lspconfig").taplo.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- require("lspconfig").marksman.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- require("lspconfig").lua_ls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- require("lspconfig").rust_analyzer.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- require("lspconfig").zls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- require("lspconfig").gopls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- settings = {
|
||||
-- gopls = {
|
||||
-- analyses = {
|
||||
-- unusedparams = true,
|
||||
-- unusedwrite = true,
|
||||
-- shadow = true,
|
||||
-- },
|
||||
-- staticcheck = true,
|
||||
-- usePlaceholders = true,
|
||||
-- hints = {
|
||||
-- assignVariableTypes = true,
|
||||
-- compositeLiteralFields = true,
|
||||
-- compositeLiteralTypes = true,
|
||||
-- functionTypeParameters = true,
|
||||
-- parameterNames = true,
|
||||
-- rangeVariableTypes = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- require("lspconfig").pyright.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- require("lspconfig").nim_langserver.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- }
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
local bifrost_endpoint = vim.env.BIFROST_COMPLETIONS_URL
|
||||
or "https://bifrost.th3r00t.net/v1/completions"
|
||||
local key_path = vim.fn.expand("~/.config/bifrost/api-key")
|
||||
local key_file = io.open(key_path, "r")
|
||||
local bifrost_api_key = key_file and vim.trim(key_file:read("*a")) or nil
|
||||
if key_file then
|
||||
key_file:close()
|
||||
end
|
||||
|
||||
require("corridor").setup({
|
||||
enabled = true,
|
||||
provider = "lmstudio", -- OpenAI-compatible completions (Bifrost)
|
||||
endpoint = bifrost_endpoint,
|
||||
model = vim.env.CORRIDOR_MODEL or "OllamaMSI/qwen2.5-coder:7b",
|
||||
api_key = vim.env.BIFROST_API_KEY or bifrost_api_key,
|
||||
|
||||
debounce_ms = 400,
|
||||
max_tokens = 64,
|
||||
temperature = 0.1,
|
||||
|
||||
-- CoC owns <Tab>; keep Corridor's mappings out of its way.
|
||||
accept_keymap = "<C-l>",
|
||||
dismiss_keymap = "<C-h>",
|
||||
|
||||
max_context_lines = 256,
|
||||
cross_file_context = true,
|
||||
max_cross_file_lines = 100,
|
||||
max_cross_file_count = 5,
|
||||
|
||||
exclude_filetypes = {
|
||||
"Avante",
|
||||
"TelescopePrompt",
|
||||
"help",
|
||||
"lazy",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
"snacks_picker_input",
|
||||
"terminal",
|
||||
},
|
||||
|
||||
-- qwen2.5-coder FIM token order.
|
||||
fim = {
|
||||
prefix = "<|fim_prefix|>",
|
||||
suffix = "<|fim_suffix|>",
|
||||
middle = "<|fim_middle|>",
|
||||
},
|
||||
})
|
||||
@@ -157,7 +157,6 @@ function t3_make_ctags()
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "markdown", "norg", "md", "wiki" }, -- Set for markdown file type
|
||||
callback = function()
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
local vim = vim
|
||||
local paths_to_check = {'/', '/../'}
|
||||
local is_godot_project = false
|
||||
local godot_project_path = ''
|
||||
local cwd = vim.fn.getcwd()
|
||||
|
||||
for key, value in pairs(paths_to_check) do
|
||||
if vim.uv.fs_stat(cwd .. value .. 'project.godot') then
|
||||
is_godot_project = true
|
||||
godot_project_path = cwd .. value
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
local is_server_running = vim.uv.fs_stat(godot_project_path .. '/server.pipe')
|
||||
if is_godot_project and not is_server_running then
|
||||
vim.fn.serverstart(godot_project_path .. '/server.pipe')
|
||||
end
|
||||
@@ -12,8 +12,8 @@ end, { noremap = true })
|
||||
|
||||
-- Leader Maps
|
||||
vim.keymap.set("n", "<leader>f", "", { desc = "Files"})
|
||||
-- vim.keymap.set("n", "<leader>ff", ":FzfLua files<CR>", { desc = "File Finder"})
|
||||
vim.keymap.set("n", "<leader>ff", ":Pick files<CR>", { desc = "File Picker"})
|
||||
vim.keymap.set("n", "<leader>ff", ":FzfLua files<CR>", { desc = "File Finder"})
|
||||
-- vim.keymap.set("n", "<leader>fe", ":Pick files<CR>", { desc = "File Picker"})
|
||||
vim.keymap.set("n", "<leader>ft", t3_toggle_netrw, { desc = "File Tree"})
|
||||
|
||||
vim.keymap.set("n", "<leader>b", "", { desc = "Buffers"})
|
||||
@@ -88,7 +88,6 @@ vim.keymap.set("n", "<M-x>_", ":resize -5<CR>", { desc = "Decrease Window Height
|
||||
|
||||
|
||||
-- CTRL X Maps
|
||||
vim.keymap.set("n", "<C-x>", "", { desc = "Ctrl-X"})
|
||||
vim.keymap.set("n", "<C-x><C-b>", ":Pick buffers<CR>", { desc = "Buffer Picker"})
|
||||
vim.keymap.set("n", "<C-x><C-f>", ":Pick files<CR>", { desc = "File Picker"})
|
||||
vim.keymap.set("n", "<C-x><C-h>", ":Pick help<CR>", { desc = "Help Picker"})
|
||||
@@ -101,19 +100,13 @@ vim.keymap.set("n", "<C-x><C-n>v", "<cmd>TWView<cr>", { desc = "View Tasks", nor
|
||||
vim.keymap.set("n", "<C-x><C-n>u", "<cmd>TWUpdateCurrent<cr>", { desc="Update Tasks", noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<C-x><C-n>s", "<cmd>TWSyncTasks<cr>", { desc = "Sync Tasks", noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<C-x><C-n><c-space>", "<cmd>TWToggle<cr>", { desc = "Toggle Taskwarrior", silent = true })
|
||||
vim.keymap.set("n", "<C-x><C-d>", "", { desc = "Devdocs"})
|
||||
vim.keymap.set("n", "<C-x><C-d>i", ":DevdocsInstall ", { desc = "Install Docset"})
|
||||
vim.keymap.set("n", "<C-x><C-d>o", ":DevdocsOpen ", { desc = "Open Docs In Window"})
|
||||
vim.keymap.set("n", "<C-x><C-d>f", ":DevdocsOpenFloat ", { desc = "Open Docs In Float"})
|
||||
vim.keymap.set("n", "<C-x><C-d>t", "<cmd>DevdocsToggle<cr>", { desc = "Toggle Float"})
|
||||
|
||||
|
||||
-- FN Keys --
|
||||
vim.keymap.set("n", "<F1>", ":nohlsearch<CR>", { desc = "Clear Search Highlight"})
|
||||
vim.keymap.set("n", "<F2>", ":UndotreeToggle<CR>", { desc = "Undo Tree Toggle"})
|
||||
vim.keymap.set("n", "<F3>", ":Ranger<CR>", { desc = "Ranger"})
|
||||
vim.keymap.set("n", "<c-F3>", ":RangerNewTab<CR>", { desc = "Ranger New Tab"})
|
||||
vim.keymap.set("n", "<f9>", ":Telescope live_grep<cr>", { desc = "live grep"})
|
||||
vim.keymap.set("n", "<F9>", ":Telescope live_grep<CR>", { desc = "Live Grep"})
|
||||
vim.keymap.set("n", "<F11>", ":setlocal spell! spelllang=en_us<CR>", { desc = "Toggle Spell Check"})
|
||||
vim.keymap.set("n", "<F12>", ":setlocal wrap!<CR>", { desc = "Toggle Line Wrap"})
|
||||
|
||||
@@ -128,6 +121,12 @@ vim.keymap.set( "v", "<leader>as", "<cmd>ClaudeCodeSend<cr>", {desc = "Send to C
|
||||
-- vim.keymap.set( "n", "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>", {desc = "Add file", ft = { "NvimTree", "neo-tree", "oil", "minifiles" }})
|
||||
vim.keymap.set( "n", "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", {desc = "Accept diff" })
|
||||
vim.keymap.set( "n", "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", {desc = "Deny diff" })
|
||||
-- LSP Related Keys --
|
||||
vim.keymap.set( "n", "<leader>l", "", {desc = "LSP" })
|
||||
vim.keymap.set( "n", "<leader>lo", "", {desc = "LSP Overlays" })
|
||||
vim.keymap.set( "n", "<leader>los", "<cmd>Trouble symbols<cr>", {desc = "Symbols" })
|
||||
vim.keymap.set( "n", "<leader>lod", "<cmd>Trouble diagnostics<cr>", {desc = "Diagnostics" })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "NvimTree", "neo-tree", "oil", "minifiles" },
|
||||
callback = function()
|
||||
@@ -137,59 +136,3 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- COC Keybindings
|
||||
|
||||
vim.keymap.set( "n", "K", function() _G.ShowDocumentation() end, { noremap = true, silent = true, desc = "Show Documentation" })
|
||||
vim.keymap.set( "n", "<leader>l", "", {desc = "LSP" })
|
||||
vim.keymap.set( "n", "<leader>lc", "", {desc = "Completions" })
|
||||
vim.keymap.set( "n", "<leader>lch", "<cmd>CocCommand document.toggleInlayHint<cr>", {desc = "Toggle Inline Hints" })
|
||||
vim.keymap.set( "n", "<leader>lcs", "<cmd>CocOutline<cr>", {desc = "Show Symbol Outline" })
|
||||
vim.keymap.set( "n", "<leader>lcl", "<cmd>CocCommand document.toggleCodeLens<cr>", {desc = "Show Code Lens" })
|
||||
vim.keymap.set( "n", "<leader>lo", "", {desc = "Overlays" })
|
||||
vim.keymap.set( "n", "<leader>lod", "<cmd>Trouble dignostics<cr>", {desc = "Diagnostics" })
|
||||
vim.keymap.set( "n", "<leader>los", "<cmd>Trouble symbols<cr>", {desc = "Symbols" })
|
||||
|
||||
-- Tag-like functionality using LSP
|
||||
vim.keymap.set( "n", "<leader>lt", "", {desc = "Tags" })
|
||||
vim.keymap.set( "n", "<leader>lts", ":Telescope lsp_document_symbols<CR>", {desc = "Document Symbols" })
|
||||
vim.keymap.set( "n", "<leader>ltw", ":Telescope lsp_workspace_symbols<CR>", {desc = "Workspace Symbols" })
|
||||
vim.keymap.set( "n", "<leader>ltd", ":Telescope lsp_dynamic_workspace_symbols<CR>", {desc = "Dynamic Workspace Symbols" })
|
||||
vim.keymap.set( "n", "<C-]>", "<cmd>lua vim.lsp.buf.definition()<cr>", {desc = "Go to Definition" })
|
||||
vim.keymap.set( "n", "<C-t>", "<C-o>", {desc = "Jump Back" })
|
||||
vim.keymap.set( "n", "g]", "<cmd>lua vim.lsp.buf.references()<cr>", {desc = "Find References" })
|
||||
|
||||
-- Top Pickers & Explorer
|
||||
vim.keymap.set("n", "<leader><space>", ":lua Snacks.picker.smart()<cr>", { desc = "Smart Find Files" })
|
||||
vim.keymap.set("n", "<leader>/", ":lua Snacks.picker.grep()<cr>", { desc = "Grep" })
|
||||
vim.keymap.set("n", "<leader>:", ":lua Snacks.picker.command_history()<cr>", { desc = "Command History" })
|
||||
vim.keymap.set("n", "<leader>n", ":lua Snacks.picker.notifications()<cr>", { desc = "Notification History" })
|
||||
-- vim.keymap.set("n", "<leader>e", ":lua Snacks.explorer()<cr>", { desc = "File Explorer" })
|
||||
vim.keymap.set("n", "<leader>e", ":Lexplore<cr>", { desc = "File Explorer" })
|
||||
vim.keymap.set("n", "<leader>fb", ":lua Snacks.picker.buffers()<cr>", { desc = "Buffers" })
|
||||
vim.keymap.set("n", "<leader>ff", ":lua Snacks.picker.files()<cr>", { desc = "Find Files" })
|
||||
vim.keymap.set("n", "<leader>fg", ":lua Snacks.picker.git_files()<cr>", { desc = "Find Git Files" })
|
||||
vim.keymap.set("n", "<leader>fp", ":lua Snacks.picker.projects()<cr>", { desc = "Projects" })
|
||||
vim.keymap.set("n", "<leader>fr", ":lua Snacks.picker.recent()<cr>", { desc = "Recent" })
|
||||
vim.keymap.set("n", "<leader>Gb", ":lua Snacks.picker.git_branches()<cr>", { desc = "Git Branches" })
|
||||
vim.keymap.set("n", "<leader>Gl", ":lua Snacks.picker.git_log()<cr>", { desc = "Git Log" })
|
||||
vim.keymap.set("n", "<leader>GL", ":lua Snacks.picker.git_log_line()<cr>", { desc = "Git Log Line" })
|
||||
vim.keymap.set("n", "<leader>Gs", ":lua Snacks.picker.git_status()<cr>", { desc = "Git Status" })
|
||||
vim.keymap.set("n", "<leader>GS", ":lua Snacks.picker.git_stash()<cr>", { desc = "Git Stash" })
|
||||
vim.keymap.set("n", "<leader>Gd", ":lua Snacks.picker.git_diff()<cr>", { desc = "Git Diff (Hunks)" })
|
||||
vim.keymap.set("n", "<leader>Gf", ":lua Snacks.picker.git_log_file()<cr>", { desc = "Git Log File" })
|
||||
vim.keymap.set("n", "<leader>sb", ":lua Snacks.picker.buffers()<cr>", { desc = "Buffers" })
|
||||
vim.keymap.set("n", "<leader>ss", ":lua Snacks.picker.smart()<cr>", { desc = "Smart Find Files" })
|
||||
vim.keymap.set("n", "<leader>sp", ":lua Snacks.picker.projects()<cr>", { desc = "Projects" })
|
||||
vim.keymap.set("n", "<leader>sr", ":lua Snacks.picker.recent()<cr>", { desc = "Recent" })
|
||||
vim.keymap.set("n", "<leader>sw", ":lua Snacks.picker.words()<cr>", { desc = "Next Reference" })
|
||||
vim.keymap.set("n", "<leader>sw", ":lua Snacks.words.jump(vim.v.count1)<cr>", { desc = "Next Reference" })
|
||||
vim.keymap.set("n", "<leader>sw", ":lua Snacks.words.jump(-vim.v.count1)<cr>", { desc = "Prev Reference" })
|
||||
|
||||
-- Terminal
|
||||
-- vim.keymap.set("n", "<c-/>", ":lua Snacks.terminal()<cr>", { desc = "Toggle Terminal" })
|
||||
-- vim.keymap.set("n", "<c-_>", ":lua Snacks.terminal()<cr>", { desc = "which_key_ignore" })
|
||||
|
||||
-- Words Jump
|
||||
vim.keymap.set("n", "]]", ":lua Snacks.words.jump(vim.v.count1)<cr>", { desc = "Next Reference", })
|
||||
vim.keymap.set("n", "[[", ":lua Snacks.words.jump(-vim.v.count1)<cr>", { desc = "Prev Reference", })
|
||||
|
||||
140
lua/lsp.lua
140
lua/lsp.lua
@@ -40,35 +40,147 @@ vim.lsp.enable('basedpyright', {
|
||||
}
|
||||
})
|
||||
|
||||
-- vim.lsp.config('gdscript', {})
|
||||
-- vim.lsp.enable('gdscript')
|
||||
-- Alternative: If you have regular pyright installed
|
||||
-- vim.lsp.enable('pyright', {
|
||||
-- settings = {
|
||||
-- python = {
|
||||
-- analysis = {
|
||||
-- typeCheckingMode = "basic",
|
||||
-- autoSearchPaths = true,
|
||||
-- useLibraryCodeForTypes = true,
|
||||
-- diagnosticMode = "workspace",
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
|
||||
-- Alternative: Manual LSP start if vim.lsp.enable doesn't work
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- pattern = 'python',
|
||||
-- callback = function()
|
||||
-- -- Check if basedpyright is available first
|
||||
-- if vim.fn.executable('basedpyright-langserver') == 1 then
|
||||
-- vim.lsp.start({
|
||||
-- name = 'basedpyright',
|
||||
-- cmd = { 'basedpyright-langserver', '--stdio' },
|
||||
-- root_dir = vim.fs.dirname(
|
||||
-- vim.fs.find({ 'pyproject.toml', 'setup.py', '.git' }, { upward = true })[1]
|
||||
-- ),
|
||||
-- settings = {
|
||||
-- basedpyright = {
|
||||
-- analysis = {
|
||||
-- typeCheckingMode = "basic",
|
||||
-- autoSearchPaths = true,
|
||||
-- useLibraryCodeForTypes = true,
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
-- elseif vim.fn.executable('pyright-langserver') == 1 then
|
||||
-- vim.lsp.start({
|
||||
-- name = 'pyright',
|
||||
-- cmd = { 'pyright-langserver', '--stdio' },
|
||||
-- root_dir = vim.fs.dirname(
|
||||
-- vim.fs.find({ 'pyproject.toml', 'setup.py', '.git' }, { upward = true })[1]
|
||||
-- ),
|
||||
-- settings = {
|
||||
-- python = {
|
||||
-- analysis = {
|
||||
-- typeCheckingMode = "basic",
|
||||
-- autoSearchPaths = true,
|
||||
-- useLibraryCodeForTypes = true,
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
-- else
|
||||
-- print("Neither basedpyright-langserver nor pyright-langserver found")
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
require("lsp_signature").setup({
|
||||
debug = false,
|
||||
bind = true,
|
||||
doc_lines = 5,
|
||||
max_height = 8,
|
||||
max_width = function() return math.floor(vim.api.nvim_win_get_width(0) * 0.7) end,
|
||||
doc_lines = 10,
|
||||
max_height = 12,
|
||||
max_width = function() return math.floor(vim.api.nvim_win_get_width(0) * 0.8) end,
|
||||
wrap = true,
|
||||
floating_window = true,
|
||||
floating_window_above_cur_line = false,
|
||||
floating_window_above_cur_line = true,
|
||||
floating_window_off_x = 1,
|
||||
floating_window_off_y = 2,
|
||||
-- hint_enable = true,
|
||||
hint_enable = false,
|
||||
floating_window_off_y = 0,
|
||||
hint_enable = true,
|
||||
hint_inline = function() return false end,
|
||||
-- hint_prefix = "🐼 ",
|
||||
hint_prefix = "",
|
||||
hint_prefix = "🐼 ",
|
||||
hint_scheme = "String",
|
||||
hi_parameter = "LspSignatureActiveParameter",
|
||||
handler_opts = { border = "rounded" },
|
||||
always_trigger = false,
|
||||
auto_close_after = 5,
|
||||
extra_trigger_chars = { "(", "," },
|
||||
-- zindex = 200,
|
||||
zindex = 50,
|
||||
zindex = 200,
|
||||
padding = "",
|
||||
timer_interval = 200,
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- local vim = vim
|
||||
-- -- vim.cmd [[
|
||||
-- -- augroup LspCompletion
|
||||
-- -- autocmd!
|
||||
-- -- autocmd InsertEnter * setlocal omnifunc=v:lua.vim.lsp.omnifunc
|
||||
-- -- autocmd TextChangedI * if pumvisible() == 0 | silent! lua vim.fn.complete(vim.fn.col('.'), vim.fn["vim.lsp.omnifunc"]()) | endif
|
||||
-- -- augroup END
|
||||
-- -- ]]
|
||||
-- vim.lsp.enable('lua_ls')
|
||||
-- vim.lsp.enable('gopls', {
|
||||
-- settings = {
|
||||
-- gopls = {
|
||||
-- analyses = {
|
||||
-- unusedparams = true,
|
||||
-- unusedwrite = true,
|
||||
-- shadow = true,
|
||||
-- },
|
||||
-- staticcheck = true,
|
||||
-- usePlaceholders = true,
|
||||
-- hints = {
|
||||
-- assignVariableTypes = true,
|
||||
-- compositeLiteralFields = true,
|
||||
-- compositeLiteralTypes = true,
|
||||
-- functionTypeParameters = true,
|
||||
-- parameterNames = true,
|
||||
-- rangeVariableTypes = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- vim.lsp.enable('nim_langserver')
|
||||
-- vim.lsp.enable('pyright')
|
||||
-- require("lsp_signature").setup({
|
||||
-- debug = false,
|
||||
-- bind = true, -- registers signature handler
|
||||
-- doc_lines = 10,
|
||||
-- max_height = 12,
|
||||
-- max_width = function() return math.floor(vim.api.nvim_win_get_width(0) * 0.8) end,
|
||||
-- wrap = true,
|
||||
-- floating_window = true, -- show the popup
|
||||
-- floating_window_above_cur_line = true,
|
||||
-- floating_window_off_x = 1,
|
||||
-- floating_window_off_y = 0,
|
||||
--
|
||||
-- -- IMPORTANT: don’t inline (you can change later if you want)
|
||||
-- hint_enable = true,
|
||||
-- hint_inline = function() return false end,
|
||||
--
|
||||
-- hint_prefix = "🐼 ",
|
||||
-- hint_scheme = "String",
|
||||
-- hi_parameter = "LspSignatureActiveParameter",
|
||||
-- handler_opts = { border = "rounded" },
|
||||
--
|
||||
-- always_trigger = false,
|
||||
-- extra_trigger_chars = { "(", "," }, -- good default
|
||||
-- zindex = 200,
|
||||
-- padding = "",
|
||||
-- timer_interval = 200,
|
||||
-- })
|
||||
|
||||
155
lua/mail.lua
155
lua/mail.lua
@@ -1,155 +0,0 @@
|
||||
-- Mail compose mode: NeoMutt + nvim-mail integration.
|
||||
-- Activates ONLY when the NEOMUTT environment variable is set.
|
||||
-- In neomuttrc: set editor = "env NEOMUTT=1 nvim"
|
||||
--
|
||||
-- Notmuch: optional indexed search only via <leader>mn. Never initialised or synced.
|
||||
-- mbsync: never invoked.
|
||||
|
||||
local M = {}
|
||||
|
||||
-- Exact-match guard: only "1" activates mail mode.
|
||||
-- Any other value (empty, "yes", "true") leaves this module dormant.
|
||||
local function in_neomutt()
|
||||
return vim.env.NEOMUTT == "1"
|
||||
end
|
||||
|
||||
if not in_neomutt() then
|
||||
return M
|
||||
end
|
||||
|
||||
-- === NeoMutt session active ===
|
||||
|
||||
local function is_tty()
|
||||
return vim.env.TERM == "linux"
|
||||
end
|
||||
|
||||
-- Configure nvim-mail (idempotent: the plugin guards with _configured flag).
|
||||
local ok_mail, mail_plugin = pcall(require, "nvim-mail")
|
||||
if ok_mail then
|
||||
mail_plugin.setup({
|
||||
prefix = ",m",
|
||||
spell_langs = { "en" },
|
||||
from_list = {},
|
||||
send_accounts = {},
|
||||
contacts = { cmd = "khard", args = { "email", "-p", "--remove-first-line" } },
|
||||
snippets = nil,
|
||||
})
|
||||
end
|
||||
|
||||
-- FileType autocmd: 72-column compose formatting + quote-depth highlighting.
|
||||
-- nvim-mail's attach_buffer() handles spell, wrap, marker extmarks, and
|
||||
-- BufWritePre guardrails (empty To/Subject, attachment mention check).
|
||||
local au = vim.api.nvim_create_augroup("NeoMuttMail", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = au,
|
||||
pattern = "mail",
|
||||
callback = function()
|
||||
vim.opt_local.textwidth = 72
|
||||
vim.opt_local.formatoptions = "tcqwan"
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.linebreak = true
|
||||
vim.opt_local.spell = true
|
||||
vim.opt_local.spelllang = "en"
|
||||
-- colorcolumn is meaningful only outside TTY (linux console ignores it)
|
||||
if not is_tty() then
|
||||
vim.opt_local.colorcolumn = "73"
|
||||
end
|
||||
-- Quote-depth colouring: works with both cterm (TTY) and gui colours
|
||||
vim.cmd([[
|
||||
hi def MailQuoted1 ctermfg=6 guifg=#61afef
|
||||
hi def MailQuoted2 ctermfg=2 guifg=#98c379
|
||||
hi def MailQuoted3 ctermfg=3 guifg=#e5c07b
|
||||
syn match MailQuoted3 /^>>>\+.*$/
|
||||
syn match MailQuoted2 /^>>[^>].*$\|^>>$/
|
||||
syn match MailQuoted1 /^>[^>].*$\|^>$/
|
||||
]])
|
||||
end,
|
||||
})
|
||||
|
||||
-- <leader>m group: mail compose actions (supplement to nvim-mail's ,m prefix).
|
||||
-- Descriptions are plain ASCII so they render correctly in TTY via which-key.
|
||||
local km = function(lhs, rhs, desc)
|
||||
vim.keymap.set("n", lhs, rhs, { desc = desc })
|
||||
end
|
||||
|
||||
km("<leader>m", "", "Mail")
|
||||
|
||||
-- NeoMutt's Neovim Lua runtime may be LuaJIT/Lua 5.1, which exposes only global unpack.
|
||||
local unpack_args = table.unpack or unpack
|
||||
|
||||
-- Safe wrapper: pcall so the keymap degrades gracefully if plugin not yet downloaded.
|
||||
local function nav(fn, ...)
|
||||
local args = { ... }
|
||||
local ok, nav_mod = pcall(require, "nvim-mail.navigate")
|
||||
if ok then nav_mod[fn](unpack_args(args)) end
|
||||
end
|
||||
|
||||
km("<leader>mt", function() nav("goto_field", "^[Tt]o:", "A") end, "Mail: To:")
|
||||
km("<leader>mc", function() nav("goto_field", "^[Cc]c:", "A") end, "Mail: Cc:")
|
||||
km("<leader>mf", function() nav("goto_field", "^[Ff]rom:", "A") end, "Mail: From:")
|
||||
km("<leader>ms", function() nav("goto_field", "^[Ss]ubject:", "A") end, "Mail: Subject:")
|
||||
km("<leader>mb", function() nav("goto_body") end, "Mail: Body")
|
||||
km("<leader>mS", function() nav("goto_signature") end, "Mail: Signature")
|
||||
km("<leader>mr", function() nav("goto_reply") end, "Mail: Quoted reply")
|
||||
km("<leader>me", function() nav("goto_end_of_reply") end, "Mail: End of reply")
|
||||
km("<leader>mk", function() nav("kill_quoted_sig") end, "Mail: Kill quoted sig")
|
||||
|
||||
-- Attachment guardrail: on-demand explicit check (BufWritePre also fires automatically)
|
||||
km("<leader>ma", function()
|
||||
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
||||
local ok_att, att = pcall(require, "nvim-mail.attachment")
|
||||
if not ok_att then
|
||||
vim.notify("[mail] nvim-mail.attachment unavailable", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
local missing, match = att.check(lines)
|
||||
if missing then
|
||||
vim.notify(
|
||||
string.format('[mail] Attachment mentioned ("%s") but no file attached!', match or "attach"),
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
else
|
||||
vim.notify("[mail] Attachment check: OK", vim.log.levels.INFO)
|
||||
end
|
||||
end, "Mail: Attachment check")
|
||||
|
||||
-- Header reminder: warn if To: or Subject: are empty
|
||||
km("<leader>mR", function()
|
||||
local lines = vim.api.nvim_buf_get_lines(0, 0, 20, false)
|
||||
local to, subj = false, false
|
||||
for _, l in ipairs(lines) do
|
||||
if l == "" then break end
|
||||
if l:match("^[Tt]o:%s*.+") then to = true end
|
||||
if l:match("^[Ss]ubject:%s*.+") then subj = true end
|
||||
end
|
||||
local issues = {}
|
||||
if not to then issues[#issues + 1] = "To: is empty" end
|
||||
if not subj then issues[#issues + 1] = "Subject: is empty" end
|
||||
if #issues == 0 then
|
||||
vim.notify("[mail] Headers OK", vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify("[mail] " .. table.concat(issues, " | "), vim.log.levels.WARN)
|
||||
end
|
||||
end, "Mail: Header reminder")
|
||||
|
||||
-- Notmuch: optional indexed search only. Never initialised, never synced.
|
||||
-- Opens results in a scratch buffer; does not touch the notmuch database.
|
||||
km("<leader>mn", function()
|
||||
if vim.fn.executable("notmuch") == 0 then
|
||||
vim.notify("[mail] notmuch not available (optional dependency)", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
vim.ui.input({ prompt = "Notmuch search: " }, function(query)
|
||||
if not query or query == "" then return end
|
||||
local result = vim.fn.systemlist({ "notmuch", "search", "--output=summary", query })
|
||||
vim.cmd("new")
|
||||
vim.api.nvim_buf_set_lines(0, 0, -1, false, result)
|
||||
vim.bo.buftype = "nofile"
|
||||
vim.bo.bufhidden = "wipe"
|
||||
vim.bo.modifiable = false
|
||||
vim.bo.swapfile = false
|
||||
pcall(vim.api.nvim_buf_set_name, 0, "Notmuch: " .. query)
|
||||
end)
|
||||
end, "Mail: Notmuch search")
|
||||
|
||||
return M
|
||||
@@ -1,8 +0,0 @@
|
||||
require("obsidian").setup({
|
||||
workspaces = {
|
||||
{
|
||||
name = "Notebooks",
|
||||
path = obsidian_dir,
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,109 +0,0 @@
|
||||
-- Full Omarchy theme-catalog hot-reload, for hosts that want Neovim to track
|
||||
-- the system theme (`omarchy-theme-set`) instead of a fixed colorscheme.
|
||||
--
|
||||
-- Omarchy's default LazyVim config gets this for free from lazy.nvim's file
|
||||
-- watcher + a symlinked plugin spec (lua/plugins/theme.lua ->
|
||||
-- ~/.local/state/omarchy/current/theme/neovim.lua). This config doesn't run
|
||||
-- lazy.nvim, so instead: read that same generated spec file directly (it's
|
||||
-- the authoritative theme-name -> colorscheme mapping Omarchy maintains) and
|
||||
-- watch the state directory ourselves with vim.uv.
|
||||
local M = {}
|
||||
|
||||
local state_dir = vim.fn.expand("~/.local/state/omarchy/current")
|
||||
local theme_spec_file = state_dir .. "/theme/neovim.lua"
|
||||
|
||||
local transparent_groups = {
|
||||
"Normal", "NormalFloat", "FloatBorder", "Pmenu", "Terminal", "EndOfBuffer",
|
||||
"FoldColumn", "Folded", "SignColumn", "LineNr", "CursorLineNr", "NormalNC",
|
||||
"WhichKeyFloat", "TelescopeBorder", "TelescopeNormal", "TelescopePromptBorder",
|
||||
"TelescopePromptTitle", "NvimTreeNormal", "NvimTreeVertSplit", "NvimTreeEndOfBuffer",
|
||||
"NotifyINFOBody", "NotifyERRORBody", "NotifyWARNBody", "NotifyTRACEBody", "NotifyDEBUGBody",
|
||||
"NotifyINFOTitle", "NotifyERRORTitle", "NotifyWARNTitle", "NotifyTRACETitle", "NotifyDEBUGTitle",
|
||||
"NotifyINFOBorder", "NotifyERRORBorder", "NotifyWARNBorder", "NotifyTRACEBorder", "NotifyDEBUGBorder",
|
||||
}
|
||||
|
||||
local function apply_transparency()
|
||||
for _, name in ipairs(transparent_groups) do
|
||||
local ok, hl = pcall(vim.api.nvim_get_hl, 0, { name = name, link = false })
|
||||
if ok then
|
||||
hl.bg = nil
|
||||
vim.api.nvim_set_hl(0, name, hl)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Pull the colorscheme name out of Omarchy's generated theme spec, e.g.:
|
||||
-- return {
|
||||
-- { "folke/tokyonight.nvim", priority = 1000 },
|
||||
-- { "LazyVim/LazyVim", opts = { colorscheme = "tokyonight-night" } },
|
||||
-- }
|
||||
local function read_colorscheme()
|
||||
local chunk, err = loadfile(theme_spec_file)
|
||||
if not chunk then
|
||||
vim.notify("omarchy_theme: " .. tostring(err), vim.log.levels.WARN)
|
||||
return nil
|
||||
end
|
||||
|
||||
local ok, spec = pcall(chunk)
|
||||
if not ok or type(spec) ~= "table" then
|
||||
return nil
|
||||
end
|
||||
|
||||
for _, entry in ipairs(spec) do
|
||||
if entry[1] == "LazyVim/LazyVim" and entry.opts and entry.opts.colorscheme then
|
||||
return entry.opts.colorscheme
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.reload()
|
||||
local colorscheme = read_colorscheme()
|
||||
if not colorscheme then
|
||||
return
|
||||
end
|
||||
|
||||
vim.o.background = "dark"
|
||||
vim.cmd("highlight clear")
|
||||
if vim.fn.exists("syntax_on") == 1 then
|
||||
vim.cmd("syntax reset")
|
||||
end
|
||||
|
||||
if not pcall(vim.cmd.colorscheme, colorscheme) then
|
||||
vim.notify("omarchy_theme: colorscheme '" .. colorscheme .. "' not found", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
apply_transparency()
|
||||
vim.cmd("redraw!")
|
||||
end
|
||||
|
||||
local watching = false
|
||||
|
||||
-- `omarchy-theme-set` swaps the whole `current/theme` directory (rm -rf +
|
||||
-- mv), so re-arm the watch after every fire or it goes stale once the old
|
||||
-- inode is gone.
|
||||
local function watch()
|
||||
if watching then
|
||||
return
|
||||
end
|
||||
watching = true
|
||||
|
||||
local handle = vim.uv.new_fs_event()
|
||||
local function start()
|
||||
handle:start(state_dir, {}, vim.schedule_wrap(function()
|
||||
handle:stop()
|
||||
vim.defer_fn(function()
|
||||
M.reload()
|
||||
start()
|
||||
end, 150)
|
||||
end))
|
||||
end
|
||||
start()
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
M.reload()
|
||||
watch()
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -12,16 +12,14 @@ vim.o.wildmode = "longest:full,full"
|
||||
vim.o.wildoptions = "pum"
|
||||
vim.g.mapleader = " "
|
||||
vim.o.termguicolors = true
|
||||
vim.o.winborder = "rounded"
|
||||
vim.o.winborder = "shadow"
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
vim.o.completeopt = "menuone"
|
||||
vim.o.shell = "/usr/bin/env fish"
|
||||
-- vim.o.shell = "/usr/bin/env zsh"
|
||||
-- vim.o.completeopt = "menuone,noinsert,noselect"
|
||||
|
||||
vim.o.cursorline = true
|
||||
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
vim.g.netrw_keepdir = 1
|
||||
vim.g.netrw_keepdir = 0
|
||||
vim.g.netrw_winsize = 20
|
||||
vim.g.netrw_banner = 0
|
||||
vim.g.netrw_localcopydircmd = 'cp -avr'
|
||||
|
||||
372
lua/plugins.lua
372
lua/plugins.lua
@@ -1,34 +1,8 @@
|
||||
local vim = vim
|
||||
local host = vim.loop.os_gethostname()
|
||||
|
||||
-- Omarchy's full colorscheme catalog (mirrors omarchy-nvim's all-themes.lua),
|
||||
-- only installed on hosts that hot-reload through lua/omarchy_theme.lua.
|
||||
local omarchy_theme_plugins = {
|
||||
{ src = "https://github.com/ribru17/bamboo.nvim" },
|
||||
{ src = "https://github.com/bjarneo/aether.nvim", version = "v3", name = "aether" },
|
||||
{ src = "https://github.com/bjarneo/ethereal.nvim" },
|
||||
{ src = "https://github.com/bjarneo/hackerman.nvim" },
|
||||
{ src = "https://github.com/bjarneo/vantablack.nvim" },
|
||||
{ src = "https://github.com/bjarneo/white.nvim" },
|
||||
{ src = "https://github.com/catppuccin/nvim", name = "catppuccin" },
|
||||
{ src = "https://github.com/neanias/everforest-nvim" },
|
||||
{ src = "https://github.com/kepano/flexoki-neovim" },
|
||||
{ src = "https://github.com/ellisonleao/gruvbox.nvim" },
|
||||
{ src = "https://github.com/rebelot/kanagawa.nvim" },
|
||||
{ src = "https://github.com/tahayvr/matteblack.nvim" },
|
||||
{ src = "https://github.com/gthelding/monokai-pro.nvim" },
|
||||
{ src = "https://github.com/EdenEast/nightfox.nvim" },
|
||||
{ src = "https://github.com/rose-pine/neovim", name = "rose-pine" },
|
||||
{ src = "https://github.com/ficcdaf/ashen.nvim" },
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/folke/tokyonight.nvim" },
|
||||
{ src = "https://github.com/OldJobobo/miasma.nvim" },
|
||||
{ src = "https://github.com/OldJobobo/retro-82.nvim" },
|
||||
{ src = "https://github.com/omacom-io/lumon.nvim" },
|
||||
}
|
||||
|
||||
local plugin_specs = {
|
||||
-- { src = "https://github.com/folke/tokyonight.nvim" },
|
||||
{ src = "https://github.com/scottmckendry/cyberdream.nvim" },
|
||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||
{ src = "https://github.com/ibhagwan/fzf-lua" },
|
||||
{ src = "https://github.com/echasnovski/mini.pick" },
|
||||
@@ -44,17 +18,14 @@ local plugin_specs = {
|
||||
{ src = "https://github.com/folke/which-key.nvim" },
|
||||
{ src = "https://github.com/L3MON4D3/LuaSnip" },
|
||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||
{ src = "https://github.com/neoclide/coc.nvim" },
|
||||
{ src = "https://github.com/fannheyward/coc-pyright" },
|
||||
-- { src = "https://github.com/hrsh7th/nvim-cmp" },
|
||||
-- { src = "https://github.com/hrsh7th/cmp-nvim-lsp" },
|
||||
-- { src = "https://github.com/hrsh7th/cmp-buffer" },
|
||||
-- { src = "https://github.com/hrsh7th/cmp-path" },
|
||||
-- { src = "https://github.com/hrsh7th/cmp-cmdline" },
|
||||
-- { src = "https://github.com/hrsh7th/cmp-nvim-lua" },
|
||||
-- { src = "https://github.com/saadparwaiz1/cmp_luasnip" },
|
||||
-- { src = "https://github.com/github/copilot.vim" },
|
||||
-- { src = "https://github.com/jacob411/Ollama-Copilot" },
|
||||
{ src = "https://github.com/hrsh7th/nvim-cmp" },
|
||||
{ src = "https://github.com/hrsh7th/cmp-nvim-lsp" },
|
||||
{ src = "https://github.com/hrsh7th/cmp-buffer" },
|
||||
{ src = "https://github.com/hrsh7th/cmp-path" },
|
||||
{ src = "https://github.com/hrsh7th/cmp-cmdline" },
|
||||
{ src = "https://github.com/hrsh7th/cmp-nvim-lua" },
|
||||
{ src = "https://github.com/saadparwaiz1/cmp_luasnip" },
|
||||
{ src = "https://github.com/github/copilot.vim" },
|
||||
{ src = "https://github.com/pysan3/pathlib.nvim" },
|
||||
{ src = "https://github.com/nvim-orgmode/org-bullets.nvim" },
|
||||
{ src = "https://github.com/lukas-reineke/headlines.nvim" },
|
||||
@@ -86,25 +57,12 @@ local plugin_specs = {
|
||||
{ src = "https://github.com/francoiscabrol/ranger.vim" },
|
||||
{ src = "https://github.com/folke/snacks.nvim" },
|
||||
{ src = "https://github.com/coder/claudecode.nvim" },
|
||||
{ src = "https://github.com/olimorris/codecompanion.nvim" },
|
||||
{ src = "https://github.com/orellazri/corridor.nvim" },
|
||||
{ src = "https://github.com/yetone/avante.nvim" },
|
||||
{ src = "https://github.com/alaviss/nim.nvim" },
|
||||
{ src = "https://github.com/glebzlat/arduino-nvim" },
|
||||
{ src = "https://github.com/norcalli/nvim-colorizer.lua" },
|
||||
-- { src = "https://github.com/HiPhish/rainbow-delimiters.nvim" },
|
||||
{ src = "https://github.com/lewis6991/gitsigns.nvim" },
|
||||
{ src = "https://github.com/amitds1997/remote-nvim.nvim" },
|
||||
{ src = "https://github.com/epwalsh/obsidian.nvim" },
|
||||
{ src = "https://github.com/monkeyxite/nvim-mail", version = "03b9d7d1eea8e6a06cd7f3e477e17f164d267ea5" },
|
||||
}
|
||||
})
|
||||
|
||||
if host == "Intrepid" then
|
||||
for _, spec in ipairs(omarchy_theme_plugins) do
|
||||
table.insert(plugin_specs, spec)
|
||||
if host == "xps13" then
|
||||
end
|
||||
end
|
||||
|
||||
vim.pack.add(plugin_specs)
|
||||
|
||||
require('mini.icons').setup({})
|
||||
require('mini.pick').setup({})
|
||||
@@ -114,74 +72,9 @@ require('mini.surround').setup({})
|
||||
require('mini.indentscope').setup({})
|
||||
require('mini.tabline').setup({})
|
||||
require('mini.fuzzy').setup({})
|
||||
-- require('lualine').setup({ options = { theme = 'tokyonight' } })
|
||||
require('lualine').setup({ options = { theme = 'tokyonight' } })
|
||||
require('which-key').setup({})
|
||||
require("snacks").setup({
|
||||
explorer = { enabled = true },
|
||||
image = { enabled = true },
|
||||
input = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
})
|
||||
require('fzf-lua').setup({
|
||||
winopts = {
|
||||
height = 0.85,
|
||||
width = 0.80,
|
||||
row = 0.35,
|
||||
col = 0.50,
|
||||
border = 'rounded',
|
||||
preview = {
|
||||
border = 'border',
|
||||
wrap = 'nowrap',
|
||||
hidden = 'nohidden',
|
||||
vertical = 'down:45%',
|
||||
horizontal = 'right:60%',
|
||||
layout = 'flex',
|
||||
flip_columns = 120,
|
||||
},
|
||||
},
|
||||
keymap = {
|
||||
builtin = {
|
||||
["<F1>"] = "toggle-help",
|
||||
["<F2>"] = "toggle-fullscreen",
|
||||
["<F3>"] = "toggle-preview-wrap",
|
||||
["<F4>"] = "toggle-preview",
|
||||
["<F5>"] = "toggle-preview-ccw",
|
||||
["<F6>"] = "toggle-preview-cw",
|
||||
["<S-down>"] = "preview-page-down",
|
||||
["<S-up>"] = "preview-page-up",
|
||||
["<S-left>"] = "preview-page-reset",
|
||||
},
|
||||
fzf = {
|
||||
["ctrl-z"] = "abort",
|
||||
["ctrl-u"] = "unix-line-discard",
|
||||
["ctrl-f"] = "half-page-down",
|
||||
["ctrl-b"] = "half-page-up",
|
||||
["ctrl-a"] = "beginning-of-line",
|
||||
["ctrl-e"] = "end-of-line",
|
||||
["alt-a"] = "toggle-all",
|
||||
["f3"] = "toggle-preview-wrap",
|
||||
["f4"] = "toggle-preview",
|
||||
["shift-down"] = "preview-page-down",
|
||||
["shift-up"] = "preview-page-up",
|
||||
},
|
||||
},
|
||||
previewers = {
|
||||
head = {
|
||||
cmd = "head",
|
||||
args = nil,
|
||||
},
|
||||
git_diff = {
|
||||
cmd_deleted = "git show HEAD --",
|
||||
cmd_modified = "git diff HEAD",
|
||||
cmd_untracked = "git diff --no-index /dev/null",
|
||||
},
|
||||
},
|
||||
})
|
||||
require('fzf-lua').setup({})
|
||||
require('crates').setup({})
|
||||
require('todo-comments').setup({
|
||||
options = {
|
||||
@@ -244,215 +137,34 @@ require('nvim-devdocs').setup({})
|
||||
-- inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
-- lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
-- },
|
||||
-- routes = {
|
||||
-- view = "notify",
|
||||
-- filter = { event = "msg_showmode" },
|
||||
-- },
|
||||
-- })
|
||||
require("claudecode").setup({})
|
||||
|
||||
require('arduino-nvim').setup({
|
||||
default_fqbn = "esp32:esp32:esp32",
|
||||
filetypes = {"arduino"}
|
||||
})
|
||||
require('colorizer').setup({
|
||||
'*',
|
||||
}, {
|
||||
RGB = true,
|
||||
RRGGBB = true,
|
||||
names = true,
|
||||
RRGGBBAA = true,
|
||||
rgb_fn = true,
|
||||
hsl_fn = true,
|
||||
css = true,
|
||||
css_fn = true,
|
||||
mode = 'background',
|
||||
})
|
||||
require('gitsigns').setup({
|
||||
signs = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged_enable = true,
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
auto_attach = true,
|
||||
attach_to_untracked = false,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
virt_text_priority = 100,
|
||||
use_focus = true,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
})
|
||||
require("remote-nvim").setup({
|
||||
-- Configuration for devpod connections
|
||||
devpod = {
|
||||
binary = "devpod", -- Binary to use for devpod
|
||||
docker_binary = "docker", -- Binary to use for docker-related commands
|
||||
---@diagnostic disable-next-line:param-type-mismatch
|
||||
-- ssh_config_path = utils.path_join(utils.is_windows, vim.fn.stdpath("data"), constants.PLUGIN_NAME, "ssh_config"), -- Path where devpod SSH configurations should be stored
|
||||
search_style = "current_dir_only", -- How should devcontainers be searched
|
||||
-- For dotfiles, see https://devpod.sh/docs/developing-in-workspaces/dotfiles-in-a-workspace for more information
|
||||
dotfiles = {
|
||||
path = nil, -- Path to your dotfiles which should be copied into devcontainers
|
||||
install_script = nil -- Install script that should be called to install your dotfiles
|
||||
},
|
||||
gpg_agent_forwarding = false, -- Should GPG agent be forwarded over the network
|
||||
container_list = "running_only", -- How should docker list containers ("running_only" or "all")
|
||||
},
|
||||
-- Configuration for SSH connections
|
||||
ssh_config = {
|
||||
ssh_binary = "ssh", -- Binary to use for running SSH command
|
||||
scp_binary = "scp", -- Binary to use for running SSH copy commands
|
||||
ssh_config_file_paths = { "$HOME/.ssh/config" }, -- Which files should be considered to contain the ssh host configurations. NOTE: `Include` is respected in the provided files.
|
||||
|
||||
-- These are useful for password-based SSH authentication.
|
||||
-- It provides parsing pattern for the plugin to detect that an input is requested.
|
||||
-- Each element contains the following attributes:
|
||||
-- match - The string to match (plain matching is done)
|
||||
-- type - Supports two values "plain"|"secret". Secret means when you provide the value, it should not be stored in the completion history of Neovim.
|
||||
-- value - Default value for the prompt
|
||||
-- value_type - "static"|"dynamic". For things like password, it would be needed for each new connection that the plugin initiates which could be obtrusive.
|
||||
-- So, we save the value (only for current session's interval) to ease the process. If set to "dynamic", we do not save the value even for the session. You have to provide a fresh value each time.
|
||||
ssh_prompts = {
|
||||
{
|
||||
match = "password:",
|
||||
type = "secret",
|
||||
value_type = "static",
|
||||
value = "",
|
||||
},
|
||||
{
|
||||
match = "continue connecting (yes/no/[fingerprint])?",
|
||||
type = "plain",
|
||||
value_type = "static",
|
||||
value = "",
|
||||
},
|
||||
-- There are other values here which can be checked in lua/remote-nvim/init.lua
|
||||
},
|
||||
},
|
||||
|
||||
-- Path to the script that would be copied to the remote and called to ensure that neovim gets installed.
|
||||
-- Default path is to the plugin's own ./scripts/neovim_install.sh file.
|
||||
-- neovim_install_script_path = utils.path_join(
|
||||
-- utils.is_windows,
|
||||
-- vim.fn.fnamemodify(debug.getinfo(1).source:sub(2), ":h:h:h"),
|
||||
-- "scripts",
|
||||
-- "neovim_install.sh"
|
||||
-- ),
|
||||
|
||||
-- Modify the UI for the plugin's progress viewer.
|
||||
-- type can be "split" or "popup". All options from https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup and https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/split are supported.
|
||||
-- Note that some options like "border" are only available for "popup".
|
||||
progress_view = {
|
||||
type = "popup",
|
||||
},
|
||||
|
||||
|
||||
-- Offline mode configuration. For more details, see the "Offline mode" section below.
|
||||
offline_mode = {
|
||||
-- Should offline mode be enabled?
|
||||
enabled = false,
|
||||
-- Do not connect to GitHub at all. Not even to get release information.
|
||||
no_github = false,
|
||||
-- What path should be looked at to find locally available releases
|
||||
-- cache_dir = utils.path_join(utils.is_windows, vim.fn.stdpath("cache"), constants.PLUGIN_NAME, "version_cache"),
|
||||
},
|
||||
|
||||
-- Remote configuration
|
||||
remote = {
|
||||
app_name = "nvim", -- This directly maps to the value NVIM_APPNAME. If you use any other paths for configuration, also make sure to set this.
|
||||
-- List of directories that should be copied over
|
||||
copy_dirs = {
|
||||
-- What to copy to remote's Neovim config directory
|
||||
config = {
|
||||
base = vim.fn.stdpath("config"), -- Path from where data has to be copied
|
||||
dirs = "*", -- Directories that should be copied over. "*" means all directories. To specify a subset, use a list like {"lazy", "mason"} where "lazy", "mason" are subdirectories
|
||||
-- under path specified in `base`.
|
||||
compression = {
|
||||
enabled = false, -- Should compression be enabled or not
|
||||
additional_opts = {} -- Any additional options that should be used for compression. Any argument that is passed to `tar` (for compression) can be passed here as separate elements.
|
||||
},
|
||||
},
|
||||
-- What to copy to remote's Neovim data directory
|
||||
data = {
|
||||
base = vim.fn.stdpath("data"),
|
||||
dirs = {},
|
||||
compression = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
-- What to copy to remote's Neovim cache directory
|
||||
cache = {
|
||||
base = vim.fn.stdpath("cache"),
|
||||
dirs = {},
|
||||
compression = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
-- What to copy to remote's Neovim state directory
|
||||
state = {
|
||||
base = vim.fn.stdpath("state"),
|
||||
dirs = {},
|
||||
compression = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- You can supply your own callback that should be called to create the local client. This is the default implementation.
|
||||
-- Two arguments are passed to the callback:
|
||||
-- port: Local port at which the remote server is available
|
||||
-- workspace_config: Workspace configuration for the host. For all the properties available, see https://github.com/amitds1997/remote-nvim.nvim/blob/main/lua/remote-nvim/providers/provider.lua#L4
|
||||
-- A sample implementation using WezTerm tab is at: https://github.com/amitds1997/remote-nvim.nvim/wiki/Configuration-recipes
|
||||
client_callback = function(port, _)
|
||||
require("remote-nvim.ui").float_term(("nvim --server localhost:%s --remote-ui"):format(port), function(exit_code)
|
||||
if exit_code ~= 0 then
|
||||
vim.notify(("Local client failed with exit code %s"):format(exit_code), vim.log.levels.ERROR)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
|
||||
-- Plugin log related configuration [PREFER NOT TO CHANGE THIS]
|
||||
log = {
|
||||
-- Where is the log file
|
||||
-- filepath = utils.path_join(utils.is_windows, vim.fn.stdpath("state"), ("%s.log"):format(constants.PLUGIN_NAME)),
|
||||
-- Level of logging
|
||||
level = "info",
|
||||
-- At what size, should we truncate the logs
|
||||
max_size = 1024 * 1024 * 2, -- 2MB
|
||||
},
|
||||
require('avante').setup({
|
||||
opts = {
|
||||
-- add any opts here
|
||||
-- this file can contain specific instructions for your project
|
||||
instructions_file = "avante.md",
|
||||
-- for example
|
||||
provider = "copilot",
|
||||
providers = {
|
||||
-- claude = {
|
||||
-- endpoint = "https://api.anthropic.com",
|
||||
-- model = "claude-sonnet-4-20250514",
|
||||
-- timeout = 30000, -- Timeout in milliseconds
|
||||
-- extra_request_body = {
|
||||
-- temperature = 0.75,
|
||||
-- max_tokens = 20480,
|
||||
-- },
|
||||
-- },
|
||||
-- moonshot = {
|
||||
-- endpoint = "https://api.moonshot.ai/v1",
|
||||
-- model = "kimi-k2-0711-preview",
|
||||
-- timeout = 30000, -- Timeout in milliseconds
|
||||
-- extra_request_body = {
|
||||
-- temperature = 0.75,
|
||||
-- max_tokens = 32768,
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
-- Clipboard for sessions whose yanks may need to reach another machine:
|
||||
-- every copy is emitted as OSC 52 (inside tmux this becomes a tmux buffer,
|
||||
-- rebroadcast to every attached client, local or SSH). Paste prefers the
|
||||
-- local Wayland clipboard when one is available, so content copied in other
|
||||
-- apps remains pasteable; without a display, paste is an OSC 52 query that
|
||||
-- tmux (or the terminal) answers.
|
||||
--
|
||||
-- Ported from Omarchy's default nvim config (config/remote_clipboard.lua) so
|
||||
-- this config keeps working over SSH/tmux the same way Omarchy's does.
|
||||
local M = {}
|
||||
|
||||
local function proc_lines(pid, file)
|
||||
local ok, lines = pcall(vim.fn.readfile, "/proc/" .. pid .. "/" .. file)
|
||||
return ok and lines or {}
|
||||
end
|
||||
|
||||
local function proc_ppid(pid)
|
||||
for _, line in ipairs(proc_lines(pid, "status")) do
|
||||
local ppid = line:match("^PPid:%s+(%d+)")
|
||||
if ppid then
|
||||
return tonumber(ppid)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function ancestor_process_named(name)
|
||||
local pid = vim.fn.getpid()
|
||||
|
||||
for _ = 1, 16 do
|
||||
local ppid = proc_ppid(pid)
|
||||
if not ppid or ppid <= 1 then
|
||||
return false
|
||||
end
|
||||
|
||||
local comm = proc_lines(ppid, "comm")[1] or ""
|
||||
if comm:find(name, 1, true) then
|
||||
return true
|
||||
end
|
||||
|
||||
pid = ppid
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
local in_tmux = vim.env.TMUX ~= nil
|
||||
local in_ssh = vim.env.SSH_TTY ~= nil or vim.env.SSH_CONNECTION ~= nil
|
||||
local in_herdr = vim.env.HERDR_PANE_ID ~= nil or ancestor_process_named("herdr")
|
||||
|
||||
if not (in_tmux or in_ssh or in_herdr) then
|
||||
return
|
||||
end
|
||||
|
||||
local osc52 = require("vim.ui.clipboard.osc52")
|
||||
local has_wayland = vim.env.WAYLAND_DISPLAY ~= nil
|
||||
and vim.fn.executable("wl-copy") == 1
|
||||
and vim.fn.executable("wl-paste") == 1
|
||||
|
||||
local function copy(register)
|
||||
local emit = osc52.copy(register)
|
||||
|
||||
return function(lines)
|
||||
if has_wayland then
|
||||
local cmd = { "wl-copy", "--sensitive", "--type", "text/plain" }
|
||||
if register == "*" then
|
||||
cmd[#cmd + 1] = "--primary"
|
||||
end
|
||||
vim.fn.system(cmd, lines)
|
||||
end
|
||||
|
||||
emit(lines)
|
||||
end
|
||||
end
|
||||
|
||||
local function paste(register)
|
||||
if not has_wayland then
|
||||
return osc52.paste(register)
|
||||
end
|
||||
|
||||
return function()
|
||||
local cmd = { "wl-paste", "--no-newline" }
|
||||
if register == "*" then
|
||||
cmd[#cmd + 1] = "--primary"
|
||||
end
|
||||
|
||||
local lines = vim.fn.systemlist(cmd, "", 1)
|
||||
return vim.v.shell_error == 0 and lines or {}
|
||||
end
|
||||
end
|
||||
|
||||
vim.g.clipboard = {
|
||||
name = "RemoteClipboard",
|
||||
copy = { ["+"] = copy("+"), ["*"] = copy("*") },
|
||||
paste = { ["+"] = paste("+"), ["*"] = paste("*") },
|
||||
cache_enabled = 0,
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -1,10 +1,10 @@
|
||||
-- local configs = require('nvim-treesitter.configs')
|
||||
require'nvim-treesitter'.setup({
|
||||
ensure_installed = {
|
||||
"ini", "bash", "c", "lua", "vim", "vimdoc", "query", "python",
|
||||
"rust", "zig", "typescript", "svelte", "css", "html", "nix"
|
||||
},
|
||||
sync_install = true,
|
||||
local configs = require('nvim-treesitter.configs')
|
||||
configs.setup({
|
||||
-- ensure_installed = {
|
||||
-- "ini", "bash", "c", "lua", "vim", "vimdoc", "query", "python",
|
||||
-- "rust", "zig", "typescript", "svelte", "css", "html", "nix"
|
||||
-- },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true, disable = { "norg" }, },
|
||||
incremental_selection = { enable = true },
|
||||
|
||||
@@ -185,13 +185,3 @@ vim.api.nvim_create_user_command("Vsplit", function()
|
||||
vim.cmd("vsplit")
|
||||
vim.cmd("wincmd l")
|
||||
end, {})
|
||||
|
||||
function _G.ShowDocumentation()
|
||||
local filetype = vim.bo.filetype
|
||||
if filetype == "vim" or filetype == "help" then
|
||||
vim.cmd("h " .. vim.fn.expand("<cword>"))
|
||||
else
|
||||
vim.fn.CocActionAsync("doHover")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
-- Test: lua/mail.lua NEOMUTT=1 activation
|
||||
-- Run from repo root: NEOMUTT=1 nvim --headless -u NONE -i NONE --noplugin -l tests/mail_spec.lua
|
||||
-- Exit 0 = all assertions passed; non-zero = failure.
|
||||
-- Does NOT require nvim-mail to be installed (pcall-guarded in mail.lua).
|
||||
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Resolve repo root from this file's path and expose lua/ to require()
|
||||
local src = debug.getinfo(1, "S").source:sub(2) -- strip leading '@'
|
||||
local repo = vim.fn.fnamemodify(src, ":h:h") -- tests/../ = repo root
|
||||
package.path = repo .. "/lua/?.lua;" .. package.path
|
||||
|
||||
-- 1. Module loads when NEOMUTT=1 is present in the environment
|
||||
local ok, err = pcall(require, "mail")
|
||||
assert(ok, "require('mail') failed: " .. tostring(err))
|
||||
print("[pass] mail module loaded")
|
||||
|
||||
-- 2. Create a scratch buffer, make it current, set filetype to fire the autocmd
|
||||
local buf = vim.api.nvim_create_buf(false, true)
|
||||
vim.api.nvim_set_current_buf(buf)
|
||||
vim.cmd("set filetype=mail")
|
||||
|
||||
-- 3. Buffer-local option checks (set via vim.opt_local in the FileType callback)
|
||||
local tw = vim.bo.textwidth
|
||||
assert(tw == 72, ("textwidth: expected 72, got %d"):format(tw))
|
||||
print("[pass] textwidth = 72")
|
||||
|
||||
local fo = vim.bo.formatoptions
|
||||
assert(fo:find("q", 1, true), ("formatoptions %q missing 'q'"):format(fo))
|
||||
print("[pass] formatoptions contains 'q'")
|
||||
|
||||
-- 4. Window-local option checks (wrap and spell are 'wo', not 'bo')
|
||||
assert(vim.wo.wrap, "wrap should be true")
|
||||
print("[pass] wrap = true")
|
||||
|
||||
assert(vim.wo.spell, "spell should be true")
|
||||
print("[pass] spell = true")
|
||||
|
||||
-- 5. Representative keymap registered at global scope by mail.lua
|
||||
local found_mt = false
|
||||
for _, m in ipairs(vim.api.nvim_get_keymap("n")) do
|
||||
if m.desc == "Mail: To:" then found_mt = true; break end
|
||||
end
|
||||
assert(found_mt, "<leader>mt (Mail: To:) keymap not registered")
|
||||
print("[pass] <leader>mt keymap registered")
|
||||
|
||||
print("\nALL TESTS PASSED")
|
||||
Reference in New Issue
Block a user