update
This commit is contained in:
1 parent
b56cd1b897
commit
54bafa94a7
8 files changed
+179
-14
No files matched your search
@@ -30,7 +30,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||
end
|
||||
|
||||
if client:supports_method("textDocument/documentColor") then
|
||||
vim.lsp.document_color.enable(true, args.buf, {
|
||||
vim.lsp.document_color.enable(true, { bufnr = args.buf }, {
|
||||
style = "background", -- 'background', 'foreground', or 'virtual'
|
||||
})
|
||||
end
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/akinsho/bufferline.nvim", version = vim.version.range("^4") },
|
||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||
})
|
||||
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
mode = "buffers",
|
||||
diagnostics = "nvim_lsp",
|
||||
always_show_bufferline = true,
|
||||
separator_style = "thin",
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = function()
|
||||
return vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||
end,
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
separator = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
highlights = require("catppuccin.special.bufferline").get_theme(),
|
||||
})
|
||||
|
||||
local map = vim.keymap.set
|
||||
map("n", "<S-h>", "<Cmd>BufferLineCyclePrev<CR>", { desc = "Prev buffer" })
|
||||
map("n", "<S-l>", "<Cmd>BufferLineCycleNext<CR>", { desc = "Next buffer" })
|
||||
-- close current buffer, without picking; jump to the next file buffer first so the
|
||||
-- window never lands on the neo-tree buffer (nvim's own :bdelete switch prefers
|
||||
-- loaded buffers, which is always the neo-tree sidebar)
|
||||
map("n", "<leader>bd", function()
|
||||
local cur = vim.api.nvim_get_current_buf()
|
||||
require("bufferline").cycle(1) -- next buffer in bar order; skips unlisted buffers like neo-tree
|
||||
if vim.api.nvim_get_current_buf() == cur then
|
||||
vim.cmd("enew") -- no other buffer open: land on a fresh empty buffer
|
||||
end
|
||||
vim.cmd("bdelete! " .. cur)
|
||||
require("bufferline.ui").refresh()
|
||||
end, { desc = "Close current buffer" })
|
||||
@@ -0,0 +1,32 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/RRethy/vim-illuminate" },
|
||||
})
|
||||
|
||||
require("illuminate").configure({
|
||||
-- Providers in order of preference; treesitter provider needs the old
|
||||
-- nvim-treesitter API (nvim-treesitter.locals), so leave it out
|
||||
providers = { "lsp", "regex" },
|
||||
under_cursor = false,
|
||||
delay = 100,
|
||||
})
|
||||
|
||||
-- The engine picks the first *ready* provider and never falls back per query,
|
||||
-- so with an LSP attached the regex provider never runs. LSP documentHighlight
|
||||
-- is semantic-only: words inside strings and non-symbol identifiers (e.g. the
|
||||
-- `world` in "Hello, world!" or a package name) get an empty result. Patch the
|
||||
-- LSP provider to fall back to regex matching when the server returns nothing.
|
||||
local lsp = require("illuminate.providers.lsp")
|
||||
local regex = require("illuminate.providers.regex")
|
||||
local lsp_get_references = lsp.get_references
|
||||
lsp.get_references = function(bufnr, cursor)
|
||||
local refs = lsp_get_references(bufnr)
|
||||
if refs and #refs == 0 then
|
||||
return regex.get_references(bufnr, cursor)
|
||||
end
|
||||
return refs
|
||||
end
|
||||
|
||||
-- Default plugin keymaps (set unless already taken):
|
||||
-- <A-n> next reference
|
||||
-- <A-p> previous reference
|
||||
-- <A-i> select reference (text object, operator/visual pending)
|
||||
@@ -16,10 +16,12 @@ vim.api.nvim_create_autocmd("PackChanged", {
|
||||
|
||||
require("plugins.theme")
|
||||
require("plugins.mini-icons")
|
||||
require("plugins.illuminate")
|
||||
require("plugins.treesitter")
|
||||
require("plugins.blink")
|
||||
require("plugins.whichkey")
|
||||
require("plugins.lualine")
|
||||
require("plugins.bufferline")
|
||||
require("plugins.telescope")
|
||||
require("plugins.neotree")
|
||||
require("plugins.conform")
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
if vim.loop.os_gethostname() ~= "flow" then
|
||||
return
|
||||
end
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/milanglacier/minuet-ai.nvim" },
|
||||
})
|
||||
|
||||
local function setup_minuet()
|
||||
pcall(require("minuet").setup, {
|
||||
provider = "openai_fim_compatible",
|
||||
n_completions = 1,
|
||||
context_window = 2048,
|
||||
request_timeout = 2.5,
|
||||
throttle = 600,
|
||||
debounce = 250,
|
||||
provider_options = {
|
||||
openai_fim_compatible = {
|
||||
api_key = "TERM",
|
||||
name = "Llama.cpp",
|
||||
end_point = "http://localhost:8012/v1/completions",
|
||||
model = "PLACEHOLDER",
|
||||
optional = {
|
||||
max_tokens = 56,
|
||||
top_p = 0.9,
|
||||
},
|
||||
template = {
|
||||
prompt = function(context_before_cursor, context_after_cursor, _)
|
||||
return "<|fim_prefix|>"
|
||||
.. context_before_cursor
|
||||
.. "<|fim_suffix|>"
|
||||
.. context_after_cursor
|
||||
.. "<|fim_middle|>"
|
||||
end,
|
||||
suffix = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
setup_minuet()
|
||||
|
||||
vim.api.nvim_create_autocmd("PackChanged", {
|
||||
callback = function(ev)
|
||||
if ev.data.spec.name == "minuet-ai.nvim" then
|
||||
setup_minuet()
|
||||
end
|
||||
end,
|
||||
})
|
||||
@@ -6,5 +6,30 @@ vim.pack.add({
|
||||
})
|
||||
|
||||
require("neo-tree").setup({
|
||||
window = { width = 30 },
|
||||
close_if_last_window = false,
|
||||
|
||||
window = { width = 50 },
|
||||
|
||||
sort_case_insensitive = true,
|
||||
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
with_expanders = true,
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
},
|
||||
},
|
||||
|
||||
filesystem = {
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
use_libuv_file_watcher = true,
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -3,3 +3,7 @@ vim.pack.add({
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme catppuccin")
|
||||
|
||||
require("catppuccin").setup({
|
||||
integrations = { bufferline = true },
|
||||
})
|
||||
Reference in new issue
Block a user