Update
This commit is contained in:
1 parent
b2d375f484
commit
1349e3b76f
7 files changed
+186
-14
No files matched your search
@@ -50,24 +50,33 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Enable LSP servers for Neovim 0.11+
|
-- Enable LSP servers. Configs come from nvim-lspconfig (lua/plugins/lspconfig.lua).
|
||||||
|
-- Per-server overrides go through vim.lsp.config("<server>", { ... }).
|
||||||
|
|
||||||
|
-- Server-specific overrides
|
||||||
|
|
||||||
|
-- Neovim uses LuaJIT
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = { version = "LuaJIT" },
|
||||||
|
diagnostics = { globals = { "vim" } }, -- Recognize 'vim' global
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- gdscript: Godot's LSP runs inside the Godot editor over TCP (no standalone binary).
|
-- gdscript: Godot's LSP runs inside the Godot editor over TCP (no standalone binary).
|
||||||
-- Enable it in Godot via Editor Settings > Network > Language Server (default port 6005).
|
-- Enable it in Godot via Editor Settings > Network > Language Server (default port 6005).
|
||||||
-- It is only available while the project is open in the Godot editor (or headless:
|
-- It is only available while the project is open in the Godot editor (or headless:
|
||||||
-- `godot --headless --editor --path .`); override the port with GDScript_Port.
|
-- `godot --headless --editor --path .`); override the port with GDScript_Port.
|
||||||
if vim.fn.has("nvim-0.11") == 1 then
|
|
||||||
vim.lsp.config("gdscript", {
|
|
||||||
cmd = vim.lsp.rpc.connect("127.0.0.1", tonumber(os.getenv("GDScript_Port") or "6005")),
|
|
||||||
filetypes = { "gdscript" },
|
|
||||||
root_markers = { "project.godot" },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.lsp.enable({
|
vim.lsp.enable({
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
"ols",
|
"ols",
|
||||||
"clangd",
|
"clangd",
|
||||||
"gdscript",
|
"gdscript",
|
||||||
|
"rust_analyzer",
|
||||||
|
"gopls",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Load Lsp on-demand, e.g: eslint is disable by default
|
-- Load Lsp on-demand, e.g: eslint is disable by default
|
||||||
|
|||||||
@@ -2,8 +2,15 @@ vim.pack.add({
|
|||||||
{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range("^1") },
|
{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range("^1") },
|
||||||
})
|
})
|
||||||
|
|
||||||
local default_sources = { "lsp", "path", "snippets", "buffer" }
|
local default_sources = { "lsp", "path", "snippets", "buffer", "minuet" }
|
||||||
local providers = {}
|
local providers = {
|
||||||
|
minuet = {
|
||||||
|
module = "minuet.blink",
|
||||||
|
name = "minuet",
|
||||||
|
async = true,
|
||||||
|
score_offset = 30,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
require("blink.cmp").setup({
|
require("blink.cmp").setup({
|
||||||
keymap = { preset = "super-tab" },
|
keymap = { preset = "super-tab" },
|
||||||
@@ -15,6 +22,8 @@ require("blink.cmp").setup({
|
|||||||
documentation = { auto_show = false },
|
documentation = { auto_show = false },
|
||||||
trigger = { prefetch_on_insert = false },
|
trigger = { prefetch_on_insert = false },
|
||||||
},
|
},
|
||||||
|
-- cmdline and / search are handled by wilder.nvim
|
||||||
|
cmdline = { enabled = false },
|
||||||
sources = {
|
sources = {
|
||||||
default = default_sources,
|
default = default_sources,
|
||||||
providers = providers,
|
providers = providers,
|
||||||
|
|||||||
@@ -19,10 +19,13 @@ require("plugins.mini-icons")
|
|||||||
require("plugins.illuminate")
|
require("plugins.illuminate")
|
||||||
require("plugins.treesitter")
|
require("plugins.treesitter")
|
||||||
require("plugins.blink")
|
require("plugins.blink")
|
||||||
|
require("plugins.minuet")
|
||||||
|
require("plugins.lspconfig")
|
||||||
require("plugins.whichkey")
|
require("plugins.whichkey")
|
||||||
require("plugins.lualine")
|
require("plugins.lualine")
|
||||||
require("plugins.bufferline")
|
require("plugins.bufferline")
|
||||||
require("plugins.telescope")
|
require("plugins.telescope")
|
||||||
|
require("plugins.wilder")
|
||||||
require("plugins.neotree")
|
require("plugins.neotree")
|
||||||
require("plugins.conform")
|
require("plugins.conform")
|
||||||
require("plugins.dap")
|
require("plugins.dap")
|
||||||
@@ -30,3 +33,4 @@ require("plugins.git")
|
|||||||
require("plugins.markdown")
|
require("plugins.markdown")
|
||||||
require("plugins.log-highlight")
|
require("plugins.log-highlight")
|
||||||
require("plugins.zig")
|
require("plugins.zig")
|
||||||
|
require("plugins.scrollbar")
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
-- LSP server definitions from https://github.com/neovim/nvim-lspconfig.
|
||||||
|
-- Which servers are enabled (and any per-server overrides) live in `lua/config/lsp.lua`.
|
||||||
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/neovim/nvim-lspconfig", version = vim.version.range("^2") },
|
||||||
|
})
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
if vim.loop.os_gethostname() ~= "flow" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
{ src = "https://github.com/milanglacier/minuet-ai.nvim" },
|
{ src = "https://github.com/milanglacier/minuet-ai.nvim" },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/petertriho/nvim-scrollbar" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Show illuminated word matches as scrollbar marks. nvim-scrollbar's render
|
||||||
|
-- autocmds (BufWinEnter/WinEnter/TextChanged/VimResized/WinScrolled) do not fire
|
||||||
|
-- on CursorMoved, which is when illuminate refreshes its references, so hook
|
||||||
|
-- those events directly, mirroring how the built-in diagnostic handler works.
|
||||||
|
-- illuminate also refreshes its own refs ~(delay 100ms) after CursorMoved, so
|
||||||
|
-- re-run the highlight refresh on a small debounce for snappy bars.
|
||||||
|
local utils = require("scrollbar.utils")
|
||||||
|
local render = require("scrollbar").throttled_render
|
||||||
|
|
||||||
|
local function update_illuminate_marks()
|
||||||
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
|
local config = require("scrollbar.config").get()
|
||||||
|
if
|
||||||
|
config.show == false
|
||||||
|
or not vim.api.nvim_buf_is_valid(bufnr)
|
||||||
|
or vim.tbl_contains(config.excluded_buftypes, vim.bo[bufnr].buftype)
|
||||||
|
or vim.tbl_contains(config.excluded_filetypes, vim.bo[bufnr].filetype)
|
||||||
|
then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local ok, reference = pcall(require, "illuminate.reference")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- illuminate stores refs as { {0-indexed line, col}, {0-indexed line, col} },
|
||||||
|
-- sorted. Several refs can share a line, so keep one mark per line.
|
||||||
|
local illuminate_marks = {}
|
||||||
|
local last_line = -1
|
||||||
|
for _, ref in ipairs(reference.buf_get_references(bufnr)) do
|
||||||
|
local line = ref[1][1]
|
||||||
|
if line ~= last_line then
|
||||||
|
last_line = line
|
||||||
|
illuminate_marks[#illuminate_marks + 1] = {
|
||||||
|
line = line,
|
||||||
|
text = "≡",
|
||||||
|
type = "Illuminate",
|
||||||
|
level = 1,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local marks = utils.get_scrollbar_marks(bufnr)
|
||||||
|
marks.Illuminate = illuminate_marks
|
||||||
|
utils.set_scrollbar_marks(bufnr, marks)
|
||||||
|
|
||||||
|
render()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorHold", "TextChanged", "BufEnter", "WinEnter" }, {
|
||||||
|
group = vim.api.nvim_create_augroup("scrollbar_illuminate", { clear = true }),
|
||||||
|
callback = function(args)
|
||||||
|
update_illuminate_marks()
|
||||||
|
if args.event == "CursorMoved" or args.event == "TextChanged" then
|
||||||
|
vim.defer_fn(update_illuminate_marks, 250)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
require("scrollbar").setup({
|
||||||
|
excluded_filetypes = { "neo-tree" },
|
||||||
|
handle = {
|
||||||
|
highlight = "PmenuSbar",
|
||||||
|
},
|
||||||
|
marks = {
|
||||||
|
Illuminate = { text = "≡", priority = 8, highlight = "Special" },
|
||||||
|
Search = { highlight = "DiagnosticVirtualTextInfo" },
|
||||||
|
Error = { highlight = "DiagnosticFloatingError" },
|
||||||
|
Warn = { highlight = "DiagnosticFloatingWarn" },
|
||||||
|
Info = { highlight = "DiagnosticFloatingInfo" },
|
||||||
|
Hint = { highlight = "DiagnosticFloatingHint" },
|
||||||
|
GitAdd = { highlight = "GitSignsAdd" },
|
||||||
|
GitChange = { highlight = "GitSignsChange" },
|
||||||
|
GitDelete = { highlight = "GitSignsDelete" },
|
||||||
|
},
|
||||||
|
handlers = {
|
||||||
|
search = false, -- requires hlslens
|
||||||
|
diagnostic = true,
|
||||||
|
gitsigns = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/gelguy/wilder.nvim" },
|
||||||
|
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local wilder = require("wilder")
|
||||||
|
|
||||||
|
-- Suggestions while typing in cmdline and search modes.
|
||||||
|
-- <Tab>/<S-Tab> cycle candidates, <Down> accepts.
|
||||||
|
wilder.setup({ modes = { ":", "/", "?" } })
|
||||||
|
|
||||||
|
-- Catppuccin palette
|
||||||
|
local blue = "#89b4fa"
|
||||||
|
local overlay0 = "#9399b3"
|
||||||
|
local surface0 = "#313244"
|
||||||
|
local mantle = "#181826"
|
||||||
|
local text = "#cdd6f4"
|
||||||
|
|
||||||
|
-- Derive wilder highlight groups from the catppuccin colors above. Groups
|
||||||
|
-- made with make_hl are recreated each time wilder starts, so they track
|
||||||
|
-- values computed at colorscheme load time.
|
||||||
|
local function hl(name, base, fg, bg)
|
||||||
|
return wilder.make_hl(name, base, { { a = 1 }, { a = 1 }, {
|
||||||
|
foreground = fg,
|
||||||
|
background = bg,
|
||||||
|
} })
|
||||||
|
end
|
||||||
|
|
||||||
|
local menu_hl = hl("WilderCatppuccinMenu", "Pmenu", overlay0, mantle)
|
||||||
|
local selected_hl = hl("WilderCatppuccinMenuSel", "PmenuSel", text, surface0)
|
||||||
|
local accent_hl = hl("WilderCatppuccinAccent", "Pmenu", blue, mantle)
|
||||||
|
local sel_accent_hl = hl("WilderCatppuccinSelAccent", "PmenuSel", blue, surface0)
|
||||||
|
local border_hl = hl("WilderCatppuccinBorder", "FloatBorder", blue, mantle)
|
||||||
|
|
||||||
|
-- popupmenu fits the cmdline better; wildmenu avoids overlapping the
|
||||||
|
-- window when searching with / or ?
|
||||||
|
wilder.set_option("renderer", wilder.renderer_mux({
|
||||||
|
[":"] = wilder.popupmenu_renderer(
|
||||||
|
wilder.popupmenu_border_theme({
|
||||||
|
highlighter = wilder.basic_highlighter(),
|
||||||
|
highlights = {
|
||||||
|
default = menu_hl,
|
||||||
|
selected = selected_hl,
|
||||||
|
accent = accent_hl,
|
||||||
|
selected_accent = sel_accent_hl,
|
||||||
|
border = border_hl,
|
||||||
|
},
|
||||||
|
left = { " ", wilder.popupmenu_devicons() }, -- file icons for file candidates
|
||||||
|
right = { " ", wilder.popupmenu_scrollbar() },
|
||||||
|
border = "rounded",
|
||||||
|
min_height = 3, -- keep the bordered popup a consistent size
|
||||||
|
})
|
||||||
|
),
|
||||||
|
["/"] = wilder.wildmenu_renderer({
|
||||||
|
highlighter = wilder.basic_highlighter(),
|
||||||
|
highlights = {
|
||||||
|
default = menu_hl,
|
||||||
|
selected = selected_hl,
|
||||||
|
accent = accent_hl,
|
||||||
|
selected_accent = sel_accent_hl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
}))
|
||||||
Reference in new issue
Block a user