Nvim: new pugins + some disabled ones

Some experiments with AI
This commit is contained in:
Robert Kmieć
2024-08-06 23:55:21 +02:00
parent 0daaf4add5
commit 801ba0dfdf
18 changed files with 736 additions and 89 deletions

View File

@@ -0,0 +1,11 @@
return {
--'tools/bitbucket.nvim',
dir = '~/tools/bitbucket.nvim/',
dependencies = {
'nvim-lua/plenary.nvim'
},
-- dev = true,
config = function()
require('bitbucket-nvim').setup({ opt = "test"})
end
}

View File

@@ -138,5 +138,25 @@ return {{
config = function() config = function()
--vim.cmd.colorscheme('kurayami') --vim.cmd.colorscheme('kurayami')
end end
},
{
'gerardbm/vim-atomic',
lazy = false,
priority = 1000,
config = function()
--vim.cmd.colorscheme('atomic')
end
},
{
'fynnfluegge/monet.nvim',
config = function()
--vim.cmd.colorscheme('atomic')
end
},
{
'sho-87/kanagawa-paper.nvim',
config = function()
--vim.cmd.colorscheme('kanagawa-paper')
end
} }
} }

View File

@@ -0,0 +1,11 @@
return {
'Mr-LLLLL/cool-chunk.nvim',
event = { "CursorHold", "CursorHoldI" },
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
config = function()
require('cool-chunk').setup({})
end,
enabled = false
}

View File

@@ -81,14 +81,13 @@ return {
end end
end end
local def = { noremap = true, silent = true } vim.keymap.set('n', '\\c', function() require("dap").continue() end, { noremap = true, silent = true, desc = "Continue" });
vim.keymap.set('n', '\\c', function() require("dap").continue() end, def); vim.keymap.set('n', '\\b', function() require("dap").toggle_breakpoint() end, { noremap = true, silent = true, desc = "breakpoint toggle" });
vim.keymap.set('n', '\\b', function() require("dap").toggle_breakpoint() end, def); vim.keymap.set('n', '\\B', function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, { noremap = true, silent = true, desc = "conditional breakpoint" });
vim.keymap.set('n', '\\B', function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, def); vim.keymap.set('n', '\\n', function() require("dap").step_over() end, { noremap = true, silent = true, desc = "step over" });
vim.keymap.set('n', '\\n', function() require("dap").step_over() end, def); vim.keymap.set('n', '\\s', function() require("dap").step_into() end, { noremap = true, silent = true, desc = "step into" });
vim.keymap.set('n', '\\s', function() require("dap").step_into() end, def); vim.keymap.set('n', '\\u', function() require("dap").step_out() end, { noremap = true, silent = true, desc = "step out" });
vim.keymap.set('n', '\\u', function() require("dap").step_out() end, def); vim.keymap.set('n', '\\l', function() require("dap").run_last() end, { noremap = true, silent = true, desc = "run last" });
vim.keymap.set('n', '\\l', function() require("dap").run_last() end, def);
end end
}, },
{ {
@@ -100,12 +99,11 @@ return {
config = function() config = function()
local ui = require('dapui') local ui = require('dapui')
local dap = require('dap') local dap = require('dap')
local def = { noremap = true, silent = true }
vim.keymap.set('n', '\\d', function() vim.keymap.set('n', '\\d', function()
dap.continue() dap.continue()
ui.toggle({}) ui.toggle({})
end, def) end, { noremap = true, silent = true, desc = "toggle UI" })
vim.keymap.set('v', 'K', function() require("dapui").eval() end, def) vim.keymap.set('v', 'K', function() require("dapui").eval() end, { noremap = true, silent = true, desc = "eval val" })
ui.setup() ui.setup()
end end
}, },

View File

@@ -9,5 +9,6 @@ return {
fuzzy = true, fuzzy = true,
signature_border = 'rounded', signature_border = 'rounded',
}) })
end end,
enabled = false
} }

View File

@@ -0,0 +1,4 @@
return {
'glacambre/firenvim',
build = ":call firenvim#install(0)"
}

View File

@@ -1,23 +1,27 @@
return { return {
"David-Kunz/gen.nvim", "David-Kunz/gen.nvim",
opts = { opts = {
model = "mistral", -- The default model to use. --model = "codellama:code", -- The default model to use.
host = "localhost", -- The host running the Ollama service. model = "gemma2:9b", -- The default model to use.
host = "batman.local", -- The host running the Ollama service.
port = "11434", -- The port on which the Ollama service is listening. port = "11434", -- The port on which the Ollama service is listening.
display_mode = "split", -- The display mode. Can be "float" or "split". quit_map = "q", -- set keymap for closing the response window
show_prompt = true, -- Shows the Prompt submitted to Ollama. retry_map = "<c-r>", -- set keymap to re-send the current prompt
show_model = true, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = false, -- Never closes the window automatically.
init = function(options) pcall(io.popen, "ollama serve > /dev/null 2>&1 &") end, init = function(options) pcall(io.popen, "ollama serve > /dev/null 2>&1 &") end,
-- Function to initialize Ollama -- Function to initialize Ollama
command = function(options) command = function(options)
return "curl --silent --no-buffer -X POST http://" .. options.host .. ":" .. options.port .. "/api/generate -d $body" local body = { model = options.model, stream = true }
return "curl --silent --no-buffer -X POST http://" .. options.host .. ":" .. options.port .. "/api/chat -d $body"
end, end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped). -- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string. -- This can also be a command string.
-- The executed command must return a JSON object with { response, context } -- The executed command must return a JSON object with { response, context }
-- (context property is optional). -- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names -- list_models = '<omitted lua function>', -- Retrieves a list of model names
display_mode = "float", -- The display mode. Can be "float" or "split".
show_prompt = false, -- Shows the Prompt submitted to Ollama.
show_model = false, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = false, -- Never closes the window automatically.
debug = false -- Prints errors and the command which is run. debug = false -- Prints errors and the command which is run.
} }
} }

View File

@@ -1,13 +1,13 @@
return { return {
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
opts = { opts = {
signs = { -- signs = {
add = {hl = 'GitSignsAdd' , text = '+', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, -- add = {hl = 'GitSignsAdd' , text = '+', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
change = {hl = 'GitSignsChange', text = '', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, -- change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, -- delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
topdelete = {hl = 'GitSignsDelete', text = '', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, -- topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, -- changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
}, -- },
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl` numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
@@ -85,9 +85,6 @@ return {
delay = 2000, delay = 2000,
ignore_whitespace = true, ignore_whitespace = true,
}, },
current_line_blame_formatter_opts = {
relative_time = false
},
sign_priority = 6, sign_priority = 6,
update_debounce = 100, update_debounce = 100,
status_formatter = nil, -- Use default status_formatter = nil, -- Use default
@@ -100,8 +97,5 @@ return {
row = 0, row = 0,
col = 1 col = 1
}, },
yadm = {
enable = true
},
} }
} }

View File

@@ -31,5 +31,5 @@ return {
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened
}) })
end, end,
enabled = false -- enabled = false
} }

View File

@@ -1,4 +1,493 @@
return { -- progress data
"freddiehaddad/feline.nvim", local clients = {}
config = true local progress = { '', '', '', '', '', '', '', '' }
-- check for lsp progress data
local function is_lsp_loading(client) return client and clients[client] and clients[client].percentage < 100 end
-- update lsp progress
local function update_lsp_progress()
local messages = vim.lsp.util.get_progress_messages()
for _, message in ipairs(messages) do
if not message.name then goto continue end
local client_name = message.name
if not clients[client_name] then clients[client_name] = { percentage = 0, progress_index = 0 } end
if message.done then
clients[client_name].percentage = 100
else
if message.percentage then clients[client_name].percentage = message.percentage end
end
if clients[client_name].percentage % 5 == 0 or clients[client_name].progress_index == 0 then
vim.opt.statusline = vim.opt.statusline
clients[client_name].progress_index = clients[client_name].progress_index + 1
end
if clients[client_name].progress_index > #progress then clients[client_name].progress_index = 1 end
::continue::
end
end
-- get lsp client name for buffer
local function get_lsp_client_name()
local active_clients = vim.lsp.get_clients({ bufnr = 0 })
local client_name
if #active_clients > 0 then client_name = active_clients[1].name end
return client_name
end
-- configure feline
local function config(_, opts)
local colorscheme = vim.g.colors_name
local palette = require('nightfox.palette').load(colorscheme)
local feline = require('feline')
local vi_mode = require('feline.providers.vi_mode')
local file = require('feline.providers.file')
local separators = require('feline.defaults').statusline.separators.default_value
local lsp = require('feline.providers.lsp')
local theme = {
fg = palette.fg1,
bg = palette.bg1,
black = palette.black.base,
skyblue = palette.blue.bright,
cyan = palette.cyan.base,
green = palette.green.base,
oceanblue = palette.blue.base,
magenta = palette.magenta.base,
orange = palette.orange.base,
red = palette.red.base,
violet = palette.magenta.bright,
white = palette.white.base,
yellow = palette.yellow.base,
}
local c = {
-- local function git_diff(type)
-- ---@diagnostic disable-next-line: undefined-field
-- local gsd = vim.b.gitsigns_status_dict
-- if gsd and gsd[type] and gsd[type] > 0 then return tostring(gsd[type]) end
-- return nil
-- end
-- left
vim_status = {
provider = function()
local s
if require('lazy.status').has_updates() then
s = require('lazy.status').updates()
else
s = ''
end
s = string.format(' %s ', s)
return s
end,
hl = { fg = palette.bg0, bg = palette.blue.base },
right_sep = {
always_visible = true,
str = separators.slant_right,
hl = { fg = palette.blue.base, bg = palette.bg0 },
},
},
file_name = {
provider = {
name = 'file_info',
opts = { colored_icon = false },
},
hl = { fg = palette.bg0, bg = palette.white.base },
left_sep = {
always_visible = true,
str = string.format('%s ', separators.slant_right),
hl = { fg = palette.bg0, bg = palette.white.base },
},
},
git_branch = {
provider = function()
local git = require('feline.providers.git')
local branch, icon = git.git_branch()
local s
if #branch > 0 then
s = string.format(' %s%s ', icon, branch)
else
s = string.format(' %s ', 'Untracked')
end
return s
end,
hl = { fg = palette.bg0, bg = palette.fg3 },
left_sep = {
always_visible = true,
str = string.format('%s%s', separators.block, separators.slant_right),
hl = { fg = palette.white.base, bg = palette.fg3 },
},
right_sep = {
always_visible = true,
str = separators.slant_right,
hl = { fg = palette.fg3, bg = palette.bg0 },
},
},
-- table.insert(components.active[left], {
-- provider = function()
-- local status = git_diff('added')
-- local s
-- if status then
-- s = string.format(' %s %s ', '', status)
-- else
-- s = ''
-- end
-- return s
-- end,
-- hl = { fg = palette.bg0, bg = palette.green.base },
-- left_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.bg0, bg = palette.green.base },
-- },
-- })
-- table.insert(components.active[left], {
-- provider = function()
-- local status = git_diff('changed')
-- local s
-- if status then
-- s = string.format(' %s %s ', '', status)
-- else
-- s = ''
-- end
-- return s
-- end,
-- hl = { fg = palette.bg0, bg = palette.yellow.base },
-- left_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.green.base, bg = palette.yellow.base },
-- },
-- })
-- table.insert(components.active[left], {
-- provider = function()
-- local status = git_diff('removed')
-- local s
-- if status then
-- s = string.format(' %s %s ', '', status)
-- else
-- s = ''
-- end
-- return s
-- end,
-- hl = { fg = palette.bg0, bg = palette.red.base },
-- left_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.yellow.base, bg = palette.red.base },
-- },
-- right_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.red.base, bg = palette.bg0 },
-- },
-- })
lsp = {
provider = function()
if not lsp.is_lsp_attached() then return ' 󱏎 LSP ' end
local client_name = get_lsp_client_name()
if is_lsp_loading(client_name) then
return string.format(' %s LSP ', progress[clients[client_name].progress_index])
else
return ' 󱁛 LSP '
end
end,
hl = function()
if not lsp.is_lsp_attached() then return { fg = palette.bg0, bg = palette.fg3 } end
local client_name = get_lsp_client_name()
if is_lsp_loading(client_name) then return { fg = palette.bg0, bg = palette.yellow.base } end
return { fg = palette.bg0, bg = palette.green.base }
end,
left_sep = {
always_visible = true,
str = separators.slant_right,
hl = function()
if not lsp.is_lsp_attached() then return { fg = palette.bg0, bg = palette.fg3 } end
local client_name = get_lsp_client_name()
if is_lsp_loading(client_name) then return { fg = palette.bg0, bg = palette.yellow.base } end
return { fg = palette.bg0, bg = palette.green.base }
end,
},
right_sep = {
always_visible = true,
str = separators.slant_right,
hl = function()
if not lsp.is_lsp_attached() then return { fg = palette.fg3, bg = 'none' } end
local client_name = get_lsp_client_name()
if is_lsp_loading(client_name) then return { fg = palette.yellow.base, bg = 'none' } end
return { fg = palette.green.base, bg = 'none' }
end,
},
},
-- table.insert(components.active[left], {
-- provider = function()
-- local s
-- local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }))
-- if count > 0 then
-- s = string.format(' %s %d ', '', count)
-- else
-- s = ''
-- end
-- return s
-- end,
-- hl = { fg = palette.bg0, bg = palette.red.base },
-- left_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.bg0, bg = palette.red.base },
-- },
-- })
-- table.insert(components.active[left], {
-- provider = function()
-- local s
-- local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }))
-- if count > 0 then
-- s = string.format(' %s %d ', '', count)
-- else
-- s = ''
-- end
-- return s
-- end,
-- hl = { fg = palette.bg0, bg = palette.magenta.base },
-- left_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.red.base, bg = palette.magenta.base },
-- },
-- })
-- table.insert(components.active[left], {
-- provider = function()
-- local s
-- local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }))
-- if count > 0 then
-- s = string.format(' %s %d ', '', count)
-- else
-- s = ''
-- end
-- return s
-- end,
-- hl = { fg = palette.bg0, bg = palette.blue.base },
-- left_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.magenta.base, bg = palette.blue.base },
-- },
-- })
-- table.insert(components.active[left], {
-- provider = function()
-- local s
-- local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }))
-- if count > 0 then
-- s = string.format(' %s %d ', '', count)
-- else
-- s = ''
-- end
-- return s
-- end,
-- hl = { fg = palette.bg0, bg = palette.orange.base },
-- left_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.blue.base, bg = palette.orange.base },
-- },
-- right_sep = {
-- always_visible = true,
-- str = separators.slant_right,
-- hl = { fg = palette.orange.base, bg = 'none' },
-- },
-- })
-- right
vi_mode = {
provider = function() return string.format(' %s ', vi_mode.get_vim_mode()) end,
hl = function() return { fg = palette.bg0, bg = vi_mode.get_mode_color() } end,
left_sep = {
always_visible = true,
str = separators.slant_left,
hl = function() return { fg = vi_mode.get_mode_color(), bg = 'none' } end,
},
right_sep = {
always_visible = true,
str = separators.slant_left,
hl = function() return { fg = palette.bg0, bg = vi_mode.get_mode_color() } end,
},
},
macro = {
provider = function()
local s
local recording_register = vim.fn.reg_recording()
if #recording_register == 0 then
s = ''
else
s = string.format(' Recording @%s ', recording_register)
end
return s
end,
hl = { fg = palette.bg0, bg = palette.fg3 },
left_sep = {
always_visible = true,
str = separators.slant_left,
hl = function() return { fg = palette.fg3, bg = palette.bg0 } end,
},
},
search_count = {
provider = function()
if vim.v.hlsearch == 0 then return '' end
local ok, result = pcall(vim.fn.searchcount, { maxcount = 999, timeout = 250 })
if not ok then return '' end
if next(result) == nil then return '' end
local denominator = math.min(result.total, result.maxcount)
return string.format(' [%d/%d] ', result.current, denominator)
end,
hl = { fg = palette.bg0, bg = palette.white.base },
left_sep = {
always_visible = true,
str = separators.slant_left,
hl = function() return { fg = palette.white.base, bg = palette.fg3 } end,
},
right_sep = {
always_visible = true,
str = separators.slant_left,
hl = { fg = palette.bg0, bg = palette.white.base },
},
},
cursor_position = {
provider = {
name = 'position',
opts = { padding = true },
},
hl = { fg = palette.bg0, bg = palette.blue.base },
left_sep = {
always_visible = true,
str = string.format('%s%s', separators.slant_left, separators.block),
hl = function() return { fg = palette.blue.base, bg = palette.bg0 } end,
},
right_sep = {
always_visible = true,
str = ' ',
hl = { fg = palette.bg0, bg = palette.blue.base },
},
},
scroll_bar = {
provider = {
name = 'scroll_bar',
opts = { reverse = true },
},
hl = { fg = palette.blue.dim, bg = palette.blue.base },
},
-- inactive statusline
in_file_info = {
provider = function()
if vim.api.nvim_buf_get_name(0) ~= '' then
return file.file_info({}, { colored_icon = false })
else
return file.file_type({}, { colored_icon = false, case = 'lowercase' })
end
end,
hl = { fg = palette.bg0, bg = palette.blue.base },
left_sep = {
always_visible = true,
str = string.format('%s%s', separators.slant_left, separators.block),
hl = { fg = palette.blue.base, bg = 'none' },
},
right_sep = {
always_visible = true,
str = ' ',
hl = { fg = palette.bg0, bg = palette.blue.base },
},
},
}
local active = {
{ -- left
c.vim_status,
c.file_name,
c.git_branch,
c.lsp,
},
{ -- right
c.vi_mode,
c.macro,
c.search_count,
c.cursor_position,
c.scroll_bar,
},
}
local inactive = {
{ -- left
},
{ -- right
c.in_file_info,
},
}
opts.components = { active = active, inactive = inactive }
feline.setup(opts)
feline.use_theme(theme)
end
return {
'freddiehaddad/feline.nvim',
config = config,
dependencies = { 'EdenEast/nightfox.nvim', 'lewis6991/gitsigns.nvim', 'nvim-tree/nvim-web-devicons' },
init = function()
-- use a global statusline
-- vim.opt.laststatus = 3
-- update statusbar when there's a plugin update
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyCheck',
callback = function() vim.opt.statusline = vim.opt.statusline end,
})
-- update statusbar with LSP progress
vim.api.nvim_create_autocmd('User', {
pattern = 'LspProgressUpdate',
callback = function() update_lsp_progress() end,
})
-- hide the mode
vim.opt.showmode = false
-- hide search count on command line
vim.opt.shortmess:append({ S = true })
end,
opts = {
force_inactive = { filetypes = { '^dapui_*', '^help$', '^neotest*', '^NvimTree$', '^qf$' } },
disable = { filetypes = { '^alpha$' } },
},
} }

View File

@@ -11,17 +11,17 @@ return {
local nvim_lsp = require('lspconfig') local nvim_lsp = require('lspconfig')
require('clangd_extensions').setup({ require('clangd_extensions').setup({
inlay_hints = { inlay_hints = {
inline = false, inline = true,
-- Options other than `highlight' and `priority' only work -- Options other than `highlight' and `priority' only work
-- if `inline' is disabled -- if `inline' is disabled
-- Only show inlay hints for the current line -- Only show inlay hints for the current line
only_current_line = false, only_current_line = true,
-- Event which triggers a refresh of the inlay hints. -- Event which triggers a refresh of the inlay hints.
-- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but -- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but
-- not that this may cause higher CPU usage. -- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and -- This option is only respected when only_current_line and
-- autoSetHints both are true. -- autoSetHints both are true.
only_current_line_autocmd = { "CursorHold" }, only_current_line_autocmd = { "CursorMoved" },
-- whether to show parameter hints with the inlay hints or not -- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true, show_parameter_hints = true,
-- prefix for parameter hints -- prefix for parameter hints
@@ -112,6 +112,7 @@ return {
--vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts) --vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
--vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts) --vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
--vim.keymap.set('n', '<space>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts) --vim.keymap.set('n', '<space>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, opts) vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<F6>', '<cmd>ClangdSwitchSourceHeader<CR>', opts) vim.keymap.set('n', '<F6>', '<cmd>ClangdSwitchSourceHeader<CR>', opts)
vim.keymap.set("n", "<leader>q", function() vim.lsp.buf.format{ async = true } end, opts) vim.keymap.set("n", "<leader>q", function() vim.lsp.buf.format{ async = true } end, opts)
@@ -152,11 +153,12 @@ return {
end end
}) })
--local capabilities = require('cmp_nvim_lsp').default_capabilities() -- local capabilities = vim.lsp.protocol.make_client_capabilities()
local capabilities = vim.tbl_deep_extend('force', local capabilities = require('cmp_nvim_lsp').default_capabilities()
vim.lsp.protocol.make_client_capabilities(), -- local capabilities = vim.tbl_deep_extend('force',
require('epo').register_cap() -- vim.lsp.protocol.make_client_capabilities(),
) -- require('epo').register_cap()
-- )
capabilities.offsetEncoding = { "utf-16" } capabilities.offsetEncoding = { "utf-16" }
nvim_lsp.groovyls.setup({ nvim_lsp.groovyls.setup({
@@ -171,10 +173,10 @@ return {
nvim_lsp.pylsp.setup({ nvim_lsp.pylsp.setup({
settings = { settings = {
pylint = { pylint = {
enabled = false enabled = true
}, },
pyflakes = { pyflakes = {
enabled = false, enabled = true,
}, },
}, },
capabilities = capabilities capabilities = capabilities

View File

@@ -0,0 +1,75 @@
return {
'niuiic/track.nvim',
dependencies = {
'niuiic/core.nvim'
},
config = function()
require("track").setup({
sign = {
text = "󰍒",
text_color = "#00ff00",
priority = 10,
},
search = {
--@param mark track.Mark
entry_label = function(mark)
return string.format("[%s] %s | %s:%s", mark.id, mark.desc, mark.file, mark.lnum)
end,
--@param marks track.Mark[]
--@return track.Mark[]
sort_entry = function(marks)
return require("core").lua.list.sort(marks, function(prev, cur)
return prev.id < cur.id
end)
end,
},
})
local keys = {
{
"mm",
function()
require("track").toggle()
end,
desc = "toggle mark",
},
{
"mc",
function()
require("track").remove()
end,
desc = "remove all marks",
},
{
"mj",
function()
require("track").jump_to_next()
end,
desc = "jump to next mark",
},
{
"mk",
function()
require("track").jump_to_prev()
end,
desc = "jump to prev mark",
},
{
"me",
function()
require("track").edit()
end,
desc = "edit mark",
},
{
"<space>om",
function()
require("track").search()
end,
desc = "search marks",
},
}
for key, value in pairs(keys) do
vim.keymap.set('n', value[1], value[2], {})
end
end
}

View File

@@ -1,5 +1,21 @@
return { return { {
'richardbizik/nvim-toc', 'richardbizik/nvim-toc',
ft = { "md", "markdown" }, ft = { "md", "markdown" },
config = true, config = true,
}, {
{
'ChuufMaster/markdown-toc',
opts = {
-- The heading level to match (i.e the number of "#"s to match to) max 6
heading_level_to_match = -1,
-- Set to True display a dropdown to allow you to select the heading level
ask_for_heading_level = true,
-- TOC default string
-- WARN
toc_format = '%s- [%s](<%s#%s>)',
} }
},
} }

View File

@@ -2,6 +2,7 @@ return {
-- <leader>mm -- <leader>mm
'gorbit99/codewindow.nvim', 'gorbit99/codewindow.nvim',
config = function() config = function()
require('codewindow').setup()
require('codewindow').apply_default_keybinds() require('codewindow').apply_default_keybinds()
end, end,
} }

View File

@@ -1,10 +1,23 @@
return { return {
{ 'tzachar/cmp-ai', dependencies = 'nvim-lua/plenary.nvim', enabled = false}, { 'JoseConseco/cmp-ai', dependencies = 'nvim-lua/plenary.nvim', enabled = false},
{ 'petertriho/cmp-git', enabled = false}, { 'petertriho/cmp-git', enabled = true},
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
dependencies = {
--'saadparwaiz1/cmp_luasnip'
},
-- install jsregexp (optional!).
build = "make install_jsregexp",
config = function()
local ls = require("luasnip")
end
},
{ {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
dependencies = { dependencies = {
'dcampos/cmp-snippy', "L3MON4D3/LuaSnip",
--'mstanciu552/cmp-matlab', --'mstanciu552/cmp-matlab',
'petertriho/cmp-git', 'petertriho/cmp-git',
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
@@ -13,44 +26,44 @@ return {
'hrsh7th/cmp-nvim-lsp-signature-help', 'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'hrsh7th/cmp-calc', 'hrsh7th/cmp-calc',
'tzachar/cmp-ai' 'JoseConseco/cmp-ai'
}, },
event = "InsertEnter", event = "InsertEnter",
config = function() config = function()
local cmp = require'cmp' local cmp = require'cmp'
local snippy = require'snippy' --local cmp_ai = require('cmp_ai.config')
local cmp_ai = require('cmp_ai.config') local luasnip = require('luasnip')
cmp_ai:setup({ -- cmp_ai:setup({
max_lines = 100, -- max_lines = 100,
provider = 'Ollama', -- provider = 'Ollama',
provider_options = { -- provider_options = {
model = 'deepseek-coder:6.7b', -- model = 'codellama',
base_url = 'http://batman.local:11434/api/generate', -- base_url = 'http://batman.local:11434/api/generate',
prompt = function(lines_before, lines_after) -- prompt = function(lines_before, lines_after)
-- prompt depends on the model you use. Here is an example for deepseek coder -- -- prompt depends on the model you use. Here is an example for deepseek coder
return '<PRE> ' .. lines_before .. ' <SUF>' .. lines_after .. ' <MID>' -- for codellama -- return '<PRE> ' .. lines_before .. ' <SUF>' .. lines_after .. ' <MID>' -- for codellama
end, -- end,
}, -- },
debounce_delay = 600, -- ms llama may be GPU hungry, wait x ms after last key input, before sending request to it -- debounce_delay = 600, -- ms llama may be GPU hungry, wait x ms after last key input, before sending request to it
notify = true, -- notify = true,
notify_callback = function(msg) -- notify_callback = function(msg)
vim.notify(msg) -- vim.notify(msg)
end, -- end,
run_on_every_keystroke = true, -- run_on_every_keystroke = true,
ignored_file_types = { -- ignored_file_types = {
-- default is not to ignore -- -- default is not to ignore
-- uncomment to ignore in lua: -- -- uncomment to ignore in lua:
-- lua = true -- -- lua = true
}, -- },
}) -- })
local default_cmp_sources = cmp.config.sources({ local default_cmp_sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_signature_help' },
{ name = 'path' }, { name = 'path' },
{ name = 'snippy' }, { name = 'luasnip' },
{ name = 'calc' }, { name = 'calc' },
--{ name = 'cmp_git' }, --{ name = 'cmp_git' },
--{ name = 'cmp_ai' }, --{ name = 'cmp_ai' },
@@ -82,7 +95,7 @@ return {
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
snippy.expand_snippet(args.body) luasnip.lsp_expand(args.body)
end, end,
}, },
window = { window = {
@@ -99,22 +112,26 @@ return {
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<C-y>'] = cmp.mapping.confirm({ select = true }), ['<C-y>'] = cmp.mapping(function(fallback)
cmp.confirm({ select = true })
end)
--cmp.mapping.confirm({ select = true }),
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_signature_help' },
{ name = 'path' }, { name = 'path' },
{ name = 'snippy' }, { name = 'luasnip' },
{ name = 'calc' }, { name = 'calc' },
{ name = 'cmp_git' }, { name = 'cmp_git' },
}, { }, {
{ name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 }, { name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 },
}), }),
sources = sources, --sources = sources,
sorting = { sorting = {
priority_weight = 2,
comparators = { comparators = {
require('cmp_ai.compare'), --require('cmp_ai.compare'),
cmp.config.compare.offset, cmp.config.compare.offset,
cmp.config.compare.exact, cmp.config.compare.exact,
cmp.config.compare.recently_used, cmp.config.compare.recently_used,
@@ -153,6 +170,6 @@ return {
require("cmp_git").setup() require("cmp_git").setup()
end, end,
enabled = false enabled = true
} }
} }

View File

@@ -1,8 +1,11 @@
return { return {{
'stevearc/oil.nvim', 'stevearc/oil.nvim',
opts = { opts = {
delete_to_trash = true, delete_to_trash = true,
}, },
vim.keymap.set("n", "<leader>tt", "<CMD>Oil<CR>", { desc = "Open parent directory" }) vim.keymap.set("n", "<leader>tt", "<CMD>Oil<CR>", { desc = "Open parent directory" })
} }, {
'mong8se/buffish.nvim',
vim.keymap.set("n", "<leader>tb", function() require('buffish').open() end, { desc = "Open buffers list" })
}}

View File

@@ -49,7 +49,7 @@ return {
return res return res
end end
require('symbol-usage').setup({ require('symbol-usage').setup({
vt_position = "above", vt_position = "end_of_line",
references = { enabled = true, include_declaration = true }, references = { enabled = true, include_declaration = true },
definition = { enabled = true }, definition = { enabled = true },
implementation = { enabled = true }, implementation = { enabled = true },

View File

@@ -3,6 +3,7 @@ return {
dependencies = { dependencies = {
'renerocksai/calendar-vim' 'renerocksai/calendar-vim'
}, },
ft = { "markdown" },
config = function() config = function()
require('telekasten').setup({ require('telekasten').setup({
home = vim.fn.expand("~/zettelkasten"), home = vim.fn.expand("~/zettelkasten"),