Update all dotfiles
This commit is contained in:
126
configs/dotfiles/nvim/lua/gib_nvim/avante.lua
Normal file
126
configs/dotfiles/nvim/lua/gib_nvim/avante.lua
Normal file
@ -0,0 +1,126 @@
|
||||
require('avante').setup({
|
||||
--provider = "openai",
|
||||
--openai = {
|
||||
--endpoint = "https://api.openai.com/v1",
|
||||
--model = "gpt-4o", -- your desired model (or use gpt-4o, etc.)
|
||||
--timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models
|
||||
--temperature = 0,
|
||||
--max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models)
|
||||
----reasoning_effort = "medium", -- low|medium|high, only used for reasoning models
|
||||
--},
|
||||
provider = "claude",
|
||||
mode = "agentic",
|
||||
auto_suggestions_provider = "claude",
|
||||
claude = {
|
||||
endpoint = "https://api.anthropic.com",
|
||||
model = "claude-3-7-sonnet-latest",
|
||||
temperature = 0,
|
||||
max_tokens = 4096,
|
||||
},
|
||||
dual_boost = {
|
||||
enabled = false,
|
||||
--first_provider = "openai",
|
||||
--second_provider = "claude",
|
||||
--prompt = "Based on the two reference outputs below, generate a response that incorporates elements from both but reflects your own judgment and unique perspective. Do not provide any explanation, just give the response directly. Reference Output 1: [{{provider1_output}}], Reference Output 2: [{{provider2_output}}]",
|
||||
--timeout = 60000, -- in milliseconds
|
||||
},
|
||||
behaviour = {
|
||||
--auto_suggestions = false,
|
||||
--auto_set_highlight_group = true,
|
||||
--auto_set_keymaps = true,
|
||||
--auto_apply_diff_after_generation = false,
|
||||
--support_paste_from_clipboard = false,
|
||||
--minimize_diff = true, -- Whether to remove unchanged lines when applying a code block
|
||||
--enable_token_counting = true, -- Whether to enable token counting. Default to true.
|
||||
},
|
||||
mappings = {
|
||||
--- @class AvanteConflictMappings
|
||||
diff = {
|
||||
ours = "co",
|
||||
theirs = "ct",
|
||||
all_theirs = "ca",
|
||||
both = "cb",
|
||||
cursor = "cc",
|
||||
next = "]x",
|
||||
prev = "[x",
|
||||
},
|
||||
suggestion = {
|
||||
accept = "<M-l>",
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
jump = {
|
||||
next = "]]",
|
||||
prev = "[[",
|
||||
},
|
||||
submit = {
|
||||
normal = "<CR>",
|
||||
insert = "<C-s>",
|
||||
},
|
||||
cancel = {
|
||||
normal = { "<C-c>", "<Esc>", "q" },
|
||||
insert = { "<C-c>" },
|
||||
},
|
||||
sidebar = {
|
||||
apply_all = "A",
|
||||
apply_cursor = "a",
|
||||
retry_user_request = "r",
|
||||
edit_user_request = "e",
|
||||
switch_windows = "<Tab>",
|
||||
reverse_switch_windows = "<S-Tab>",
|
||||
remove_file = "d",
|
||||
add_file = "@",
|
||||
close = { "<Esc>", "q" },
|
||||
close_from_input = nil, -- e.g., { normal = "<Esc>", insert = "<C-d>" }
|
||||
},
|
||||
},
|
||||
hints = { enabled = true },
|
||||
windows = {
|
||||
---@type "right" | "left" | "top" | "bottom"
|
||||
position = "right", -- the position of the sidebar
|
||||
wrap = true, -- similar to vim.o.wrap
|
||||
width = 30, -- default % based on available width
|
||||
sidebar_header = {
|
||||
enabled = true, -- true, false to enable/disable the header
|
||||
align = "center", -- left, center, right for title
|
||||
rounded = true,
|
||||
},
|
||||
input = {
|
||||
prefix = "> ",
|
||||
height = 8, -- Height of the input window in vertical layout
|
||||
},
|
||||
edit = {
|
||||
border = "rounded",
|
||||
start_insert = true, -- Start insert mode when opening the edit window
|
||||
},
|
||||
ask = {
|
||||
floating = false, -- Open the 'AvanteAsk' prompt in a floating window
|
||||
start_insert = true, -- Start insert mode when opening the ask window
|
||||
border = "rounded",
|
||||
---@type "ours" | "theirs"
|
||||
focus_on_apply = "ours", -- which diff to focus after applying
|
||||
},
|
||||
},
|
||||
highlights = {
|
||||
---@type AvanteConflictHighlights
|
||||
diff = {
|
||||
current = "DiffText",
|
||||
incoming = "DiffAdd",
|
||||
},
|
||||
},
|
||||
--- @class AvanteConflictUserConfig
|
||||
diff = {
|
||||
autojump = true,
|
||||
---@type string | fun(): any
|
||||
list_opener = "copen",
|
||||
--- Override the 'timeoutlen' setting while hovering over a diff (see :help timeoutlen).
|
||||
--- Helps to avoid entering operator-pending mode with diff mappings starting with `c`.
|
||||
--- Disable by setting to -1.
|
||||
override_timeoutlen = 500,
|
||||
},
|
||||
suggestion = {
|
||||
debounce = 600,
|
||||
throttle = 600,
|
||||
},
|
||||
})
|
24
configs/dotfiles/nvim/lua/gib_nvim/image.lua
Normal file
24
configs/dotfiles/nvim/lua/gib_nvim/image.lua
Normal file
@ -0,0 +1,24 @@
|
||||
require('image').setup({
|
||||
backend = "kitty",
|
||||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||
},
|
||||
neorg = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "norg" },
|
||||
},
|
||||
},
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
max_width_window_percentage = nil,
|
||||
max_height_window_percentage = 50,
|
||||
kitty_method = "normal",
|
||||
})
|
@ -11,6 +11,7 @@ require("gib_nvim.nerdcomments")
|
||||
require("gib_nvim.refactoring")
|
||||
require("gib_nvim.telescope")
|
||||
require("gib_nvim.treesitter")
|
||||
require("gib_nvim.trouble")
|
||||
require("gib_nvim.undotree")
|
||||
require("gib_nvim.barbar")
|
||||
require("gib_nvim.avante")
|
||||
require("gib_nvim.image")
|
||||
|
@ -21,8 +21,44 @@ require("lazy").setup({
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
'folke/trouble.nvim', dependencies =
|
||||
{ 'nvim-tree/nvim-web-devicons' }
|
||||
"folke/trouble.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
opts = {}, -- for default options, refer to the configuration section for custom setup.
|
||||
cmd = "Trouble",
|
||||
keys = {
|
||||
{
|
||||
"<leader>xx",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
desc = "Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xX",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||
desc = "Buffer Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cs",
|
||||
"<cmd>Trouble symbols toggle focus=false<cr>",
|
||||
desc = "Symbols (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cl",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP Definitions / references / ... (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xL",
|
||||
"<cmd>Trouble loclist toggle<cr>",
|
||||
desc = "Location List (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xQ",
|
||||
"<cmd>Trouble qflist toggle<cr>",
|
||||
desc = "Quickfix List (Trouble)",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
@ -58,6 +94,7 @@ require("lazy").setup({
|
||||
{'hrsh7th/cmp-path'},
|
||||
{'hrsh7th/cmp-buffer'},
|
||||
{'hrsh7th/cmp-nvim-lua'},
|
||||
{'onsails/lspkind.nvim'},
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
{'saadparwaiz1/cmp_luasnip'},
|
||||
{'rafamadriz/friendly-snippets'},
|
||||
@ -70,7 +107,7 @@ require("lazy").setup({
|
||||
clear_suggestion = '<C-]>',
|
||||
accept_word = '<C-.>',
|
||||
},
|
||||
disable_inline_completion = false, -- for cmp
|
||||
disable_inline_completion = true, -- for cmp
|
||||
})
|
||||
end,
|
||||
},
|
||||
@ -112,23 +149,6 @@ require("lazy").setup({
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require('neo-tree').setup({
|
||||
close_if_last_window = true,
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
padding = 1,
|
||||
}
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'romgrk/barbar.nvim', dependencies = {
|
||||
@ -177,29 +197,56 @@ require("lazy").setup({
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
opts = {
|
||||
backend = "kitty",
|
||||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||
},
|
||||
neorg = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "norg" },
|
||||
},
|
||||
{
|
||||
"rest-nvim/rest.nvim",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function (_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
table.insert(opts.ensure_installed, "http")
|
||||
end,
|
||||
}
|
||||
},
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
version = false, -- Never set this value to "*"! Never!
|
||||
build = "make", -- or `make BUILD_FROM_SOURCE=true`
|
||||
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
--- The below dependencies are optional,
|
||||
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
|
||||
"ibhagwan/fzf-lua", -- for file_selector provider fzf
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
{
|
||||
-- support for image pasting
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- recommended settings
|
||||
default = {
|
||||
embed_image_as_base64 = false,
|
||||
prompt_for_file_name = false,
|
||||
drag_and_drop = {
|
||||
insert_mode = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
max_width_window_percentage = nil,
|
||||
max_height_window_percentage = 50,
|
||||
kitty_method = "normal",
|
||||
{
|
||||
-- Make sure to set this up properly if you have lazy=true
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ 'vuciv/golf' },
|
||||
})
|
||||
|
@ -1,4 +1,5 @@
|
||||
local lsp = require('lsp-zero')
|
||||
local lspkind = require('lspkind')
|
||||
|
||||
lsp.preset('recommended')
|
||||
|
||||
@ -29,8 +30,6 @@ require('mason').setup({
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'bashls',
|
||||
'cssls',
|
||||
'cssmodules_ls',
|
||||
'docker_compose_language_service',
|
||||
'dockerls',
|
||||
'eslint',
|
||||
@ -40,7 +39,6 @@ require('mason-lspconfig').setup({
|
||||
'pyright',
|
||||
'rust_analyzer',
|
||||
'sqlls',
|
||||
'svelte',
|
||||
'tailwindcss',
|
||||
'yamlls',
|
||||
},
|
||||
@ -63,20 +61,63 @@ cmp.setup({
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
--{name = 'supermaven'},
|
||||
{name = 'supermaven'},
|
||||
{name = 'path'},
|
||||
{name = 'nvim_lsp'},
|
||||
{name = 'nvim_lua'},
|
||||
{name = 'luasnip', keyword_length = 2},
|
||||
{name = 'buffer', keyword_length = 3},
|
||||
},
|
||||
formatting = lsp.cmp_format(),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol',
|
||||
maxwidth = {
|
||||
menu = 50,
|
||||
abbr = 50,
|
||||
},
|
||||
symbol_map = {
|
||||
Supermaven = "",
|
||||
},
|
||||
ellipsis_char = '...',
|
||||
show_labelDetails = true,
|
||||
before = function (entry, vim_item)
|
||||
-- ...
|
||||
return vim_item
|
||||
end
|
||||
})
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
-- Tab to select the next item
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if cmp.get_selected_entry() then
|
||||
cmp.confirm({select = false})
|
||||
else
|
||||
cmp.select_next_item()
|
||||
end
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
}),
|
||||
preselect = cmp.PreselectMode.Item,
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert',
|
||||
}
|
||||
--mapping = cmp.mapping.preset.insert({
|
||||
--['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
--['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
--['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
--['<C-Space>'] = cmp.mapping.complete(),
|
||||
--}),
|
||||
})
|
||||
|
||||
lsp.setup()
|
||||
|
@ -196,6 +196,30 @@ require("neo-tree").setup({
|
||||
-- window like netrw would, regardless of window.position
|
||||
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
|
||||
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
|
||||
|
||||
commands = {
|
||||
avante_add_files = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local filepath = node:get_id()
|
||||
local relative_path = require('avante.utils').relative_path(filepath)
|
||||
|
||||
local sidebar = require('avante').get()
|
||||
|
||||
local open = sidebar:is_open()
|
||||
-- ensure avante sidebar is open
|
||||
if not open then
|
||||
require('avante.api').ask()
|
||||
sidebar = require('avante').get()
|
||||
end
|
||||
|
||||
sidebar.file_selector:add_selected_file(relative_path)
|
||||
|
||||
-- remove neo tree buffer
|
||||
if not open then
|
||||
sidebar.file_selector:remove_selected_file('neo-tree filesystem [1]')
|
||||
end
|
||||
end,
|
||||
},
|
||||
-- instead of relying on nvim autocmd events.
|
||||
window = {
|
||||
mappings = {
|
||||
@ -211,6 +235,7 @@ require("neo-tree").setup({
|
||||
["[g"] = "prev_git_modified",
|
||||
["]g"] = "next_git_modified",
|
||||
["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }},
|
||||
['oa'] = 'avante_add_files',
|
||||
["oc"] = { "order_by_created", nowait = false },
|
||||
["od"] = { "order_by_diagnostics", nowait = false },
|
||||
["og"] = { "order_by_git_status", nowait = false },
|
||||
@ -227,7 +252,6 @@ require("neo-tree").setup({
|
||||
},
|
||||
},
|
||||
|
||||
commands = {} -- Add a custom command or override a global one using the same function name
|
||||
},
|
||||
buffers = {
|
||||
follow_current_file = {
|
||||
|
@ -25,6 +25,8 @@ vim.opt.signcolumn = "yes"
|
||||
vim.opt.isfname:append("@-@")
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
vim.cmd([[set list]])
|
||||
vim.cmd([[set listchars=trail:⋅]])
|
||||
|
||||
vim.opt.colorcolumn = "120"
|
||||
vim.o.background = "dark" -- or "light" for light mode
|
||||
|
@ -1,6 +1,38 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = { "bash", "c", "c_sharp", "cmake", "cpp", "css", "dockerfile", "git_config", "git_rebase", "gitattributes", "gitcommit", "gitignore", "haskell", "html", "java", "javascript", "jq", "json", "kotlin", "lua", "make", "matlab", "php", "python", "rust", "scala", "sql", "svelte", "swift", "typescript", "vimdoc", "yaml", "zig" },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"cmake",
|
||||
"cpp",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"haskell",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"kotlin",
|
||||
"lua",
|
||||
"make",
|
||||
"php",
|
||||
"python",
|
||||
"rust",
|
||||
"scala",
|
||||
"sql",
|
||||
"svelte",
|
||||
"swift",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
"zig"
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
@ -9,14 +41,24 @@ require'nvim-treesitter.configs'.setup {
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 80 * 1024 -- 80 KB
|
||||
if lang == "tsx" then
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
--additional_vim_regex_highlighting = true,
|
||||
additional_vim_regex_highlighting = {"tsx"},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user