diff --git a/.config/nvim/lua/plugins/bitbucket.lua b/.config/nvim/lua/plugins/bitbucket.lua new file mode 100644 index 0000000..5152fbf --- /dev/null +++ b/.config/nvim/lua/plugins/bitbucket.lua @@ -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 +} diff --git a/.config/nvim/lua/plugins/colorschemes.lua b/.config/nvim/lua/plugins/colorschemes.lua index 58a2289..9387128 100644 --- a/.config/nvim/lua/plugins/colorschemes.lua +++ b/.config/nvim/lua/plugins/colorschemes.lua @@ -107,9 +107,9 @@ return {{ lazy = false, priority = 1000, config = function() - --require('meadow').setup() - --vim.cmd.colorscheme('meadow') - --vim.cmd [[ hi! Conceal guibg=black ]] + -- require('meadow').setup() + -- vim.cmd.colorscheme('meadow') + -- vim.cmd [[ hi! Conceal guibg=black ]] end }, { @@ -138,5 +138,25 @@ return {{ config = function() --vim.cmd.colorscheme('kurayami') 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 } } diff --git a/.config/nvim/lua/plugins/coolchunk.lua b/.config/nvim/lua/plugins/coolchunk.lua new file mode 100644 index 0000000..aa6a49b --- /dev/null +++ b/.config/nvim/lua/plugins/coolchunk.lua @@ -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 +} diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua index 35252a7..4f44b09 100644 --- a/.config/nvim/lua/plugins/dap.lua +++ b/.config/nvim/lua/plugins/dap.lua @@ -81,14 +81,13 @@ return { end end - local def = { noremap = true, silent = true } - vim.keymap.set('n', '\\c', function() require("dap").continue() end, def); - 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, def); - vim.keymap.set('n', '\\n', function() require("dap").step_over() end, def); - vim.keymap.set('n', '\\s', function() require("dap").step_into() end, def); - vim.keymap.set('n', '\\u', function() require("dap").step_out() end, def); - vim.keymap.set('n', '\\l', function() require("dap").run_last() end, def); + vim.keymap.set('n', '\\c', function() require("dap").continue() end, { noremap = true, silent = true, desc = "Continue" }); + 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").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, { noremap = true, silent = true, desc = "conditional breakpoint" }); + vim.keymap.set('n', '\\n', function() require("dap").step_over() end, { noremap = true, silent = true, desc = "step over" }); + vim.keymap.set('n', '\\s', function() require("dap").step_into() end, { noremap = true, silent = true, desc = "step into" }); + vim.keymap.set('n', '\\u', function() require("dap").step_out() end, { noremap = true, silent = true, desc = "step out" }); + vim.keymap.set('n', '\\l', function() require("dap").run_last() end, { noremap = true, silent = true, desc = "run last" }); end }, { @@ -100,12 +99,11 @@ return { config = function() local ui = require('dapui') local dap = require('dap') - local def = { noremap = true, silent = true } vim.keymap.set('n', '\\d', function() dap.continue() ui.toggle({}) - end, def) - vim.keymap.set('v', 'K', function() require("dapui").eval() end, def) + end, { noremap = true, silent = true, desc = "toggle UI" }) + vim.keymap.set('v', 'K', function() require("dapui").eval() end, { noremap = true, silent = true, desc = "eval val" }) ui.setup() end }, diff --git a/.config/nvim/lua/plugins/epo.lua b/.config/nvim/lua/plugins/epo.lua index 8ca5e2a..42ea342 100644 --- a/.config/nvim/lua/plugins/epo.lua +++ b/.config/nvim/lua/plugins/epo.lua @@ -9,5 +9,6 @@ return { fuzzy = true, signature_border = 'rounded', }) - end + end, + enabled = false } diff --git a/.config/nvim/lua/plugins/firenvim.lua b/.config/nvim/lua/plugins/firenvim.lua new file mode 100644 index 0000000..3b39447 --- /dev/null +++ b/.config/nvim/lua/plugins/firenvim.lua @@ -0,0 +1,4 @@ +return { + 'glacambre/firenvim', + build = ":call firenvim#install(0)" +} diff --git a/.config/nvim/lua/plugins/gen.lua b/.config/nvim/lua/plugins/gen.lua index 4d29e0c..53c046b 100644 --- a/.config/nvim/lua/plugins/gen.lua +++ b/.config/nvim/lua/plugins/gen.lua @@ -1,23 +1,27 @@ return { "David-Kunz/gen.nvim", opts = { - model = "mistral", -- The default model to use. - host = "localhost", -- The host running the Ollama service. + --model = "codellama:code", -- The default model to use. + 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. - display_mode = "split", -- The display mode. Can be "float" or "split". - show_prompt = true, -- Shows the Prompt submitted to Ollama. - 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. + quit_map = "q", -- set keymap for closing the response window + retry_map = "", -- set keymap to re-send the current prompt init = function(options) pcall(io.popen, "ollama serve > /dev/null 2>&1 &") end, -- Function to initialize Ollama 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, -- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped). -- This can also be a command string. -- The executed command must return a JSON object with { response, context } -- (context property is optional). -- list_models = '', -- 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. } } diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 27d773b..8599a9f 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -1,13 +1,13 @@ return { 'lewis6991/gitsigns.nvim', opts = { - signs = { - add = {hl = 'GitSignsAdd' , text = '+', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, - change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - }, + -- signs = { + -- add = {hl = 'GitSignsAdd' , text = '+', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, + -- change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + -- delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + -- topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + -- changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + -- }, signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` numhl = false, -- Toggle with `:Gitsigns toggle_numhl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl` @@ -85,9 +85,6 @@ return { delay = 2000, ignore_whitespace = true, }, - current_line_blame_formatter_opts = { - relative_time = false - }, sign_priority = 6, update_debounce = 100, status_formatter = nil, -- Use default @@ -100,8 +97,5 @@ return { row = 0, col = 1 }, - yadm = { - enable = true - }, } } diff --git a/.config/nvim/lua/plugins/image.lua b/.config/nvim/lua/plugins/image.lua index 4316f03..666e2c7 100644 --- a/.config/nvim/lua/plugins/image.lua +++ b/.config/nvim/lua/plugins/image.lua @@ -31,5 +31,5 @@ return { hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened }) end, - enabled = false + -- enabled = false } diff --git a/.config/nvim/lua/plugins/line.lua b/.config/nvim/lua/plugins/line.lua index 2c61bb0..109d644 100644 --- a/.config/nvim/lua/plugins/line.lua +++ b/.config/nvim/lua/plugins/line.lua @@ -1,4 +1,493 @@ +-- progress data +local clients = {} +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 = true + '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$' } }, + }, } diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index fbd9cbc..c0e29c9 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -11,17 +11,17 @@ return { local nvim_lsp = require('lspconfig') require('clangd_extensions').setup({ inlay_hints = { - inline = false, + inline = true, -- Options other than `highlight' and `priority' only work -- if `inline' is disabled -- 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. -- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but -- not that this may cause higher CPU usage. -- This option is only respected when only_current_line and -- 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 show_parameter_hints = true, -- prefix for parameter hints @@ -112,6 +112,7 @@ return { --vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) --vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) --vim.keymap.set('n', 'wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) vim.keymap.set('n', '', 'ClangdSwitchSourceHeader', opts) vim.keymap.set("n", "q", function() vim.lsp.buf.format{ async = true } end, opts) @@ -152,11 +153,12 @@ return { end }) - --local capabilities = require('cmp_nvim_lsp').default_capabilities() - local capabilities = vim.tbl_deep_extend('force', - vim.lsp.protocol.make_client_capabilities(), - require('epo').register_cap() - ) + -- local capabilities = vim.lsp.protocol.make_client_capabilities() + local capabilities = require('cmp_nvim_lsp').default_capabilities() + -- local capabilities = vim.tbl_deep_extend('force', + -- vim.lsp.protocol.make_client_capabilities(), + -- require('epo').register_cap() + -- ) capabilities.offsetEncoding = { "utf-16" } nvim_lsp.groovyls.setup({ @@ -171,10 +173,10 @@ return { nvim_lsp.pylsp.setup({ settings = { pylint = { - enabled = false + enabled = true }, pyflakes = { - enabled = false, + enabled = true, }, }, capabilities = capabilities diff --git a/.config/nvim/lua/plugins/mark.lua b/.config/nvim/lua/plugins/mark.lua new file mode 100644 index 0000000..d0ea34e --- /dev/null +++ b/.config/nvim/lua/plugins/mark.lua @@ -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", + }, + { + "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 +} diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index a1c2124..5586540 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -1,5 +1,21 @@ -return { +return { { 'richardbizik/nvim-toc', ft = { "md", "markdown" }, 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>)', + } + }, +} } diff --git a/.config/nvim/lua/plugins/minimap.lua b/.config/nvim/lua/plugins/minimap.lua index ae79bf8..101de2c 100644 --- a/.config/nvim/lua/plugins/minimap.lua +++ b/.config/nvim/lua/plugins/minimap.lua @@ -2,6 +2,7 @@ return { -- mm 'gorbit99/codewindow.nvim', config = function() + require('codewindow').setup() require('codewindow').apply_default_keybinds() end, } diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index 24b84e3..e3fa473 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -1,10 +1,23 @@ return { -{ 'tzachar/cmp-ai', dependencies = 'nvim-lua/plenary.nvim', enabled = false}, -{ 'petertriho/cmp-git', enabled = false}, +{ 'JoseConseco/cmp-ai', dependencies = 'nvim-lua/plenary.nvim', enabled = false}, +{ 'petertriho/cmp-git', enabled = true}, +{ + "L3MON4D3/LuaSnip", + -- follow latest release. + version = "v2.*", -- Replace 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', dependencies = { - 'dcampos/cmp-snippy', + "L3MON4D3/LuaSnip", --'mstanciu552/cmp-matlab', 'petertriho/cmp-git', 'hrsh7th/cmp-buffer', @@ -13,44 +26,44 @@ return { 'hrsh7th/cmp-nvim-lsp-signature-help', 'hrsh7th/cmp-path', 'hrsh7th/cmp-calc', - 'tzachar/cmp-ai' + 'JoseConseco/cmp-ai' }, event = "InsertEnter", config = function() 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({ - max_lines = 100, - provider = 'Ollama', - provider_options = { - model = 'deepseek-coder:6.7b', - base_url = 'http://batman.local:11434/api/generate', - prompt = function(lines_before, lines_after) - -- prompt depends on the model you use. Here is an example for deepseek coder - return '
 ' .. lines_before .. ' ' .. lines_after .. ' ' -- for codellama
-        end,
-      },
-      debounce_delay = 600, -- ms llama may be GPU hungry, wait x ms after last key input, before sending request to it
-      notify = true,
-      notify_callback = function(msg)
-        vim.notify(msg)
-      end,
-      run_on_every_keystroke = true,
-      ignored_file_types = {
-        -- default is not to ignore
-        -- uncomment to ignore in lua:
-        -- lua = true
-      },
-    })
+  --   cmp_ai:setup({
+  --     max_lines = 100,
+  --     provider = 'Ollama',
+  --     provider_options = {
+  --       model = 'codellama',
+  --       base_url = 'http://batman.local:11434/api/generate',
+  --       prompt = function(lines_before, lines_after)
+  --         -- prompt depends on the model you use. Here is an example for deepseek coder
+  --         return '
 ' .. lines_before .. ' ' .. lines_after .. ' ' -- for codellama
+  --       end,
+  --     },
+  --     debounce_delay = 600, -- ms llama may be GPU hungry, wait x ms after last key input, before sending request to it
+  --     notify = true,
+  --     notify_callback = function(msg)
+  --       vim.notify(msg)
+  --     end,
+  --     run_on_every_keystroke = true,
+  --     ignored_file_types = {
+  --       -- default is not to ignore
+  --       -- uncomment to ignore in lua:
+  --       -- lua = true
+  --     },
+  --   })
 
     local default_cmp_sources = cmp.config.sources({
         { name = 'nvim_lsp' },
         { name = 'nvim_lsp_signature_help' },
         { name = 'path' },
-        { name = 'snippy' },
+        { name = 'luasnip' },
         { name = 'calc' },
         --{ name = 'cmp_git' },
         --{ name = 'cmp_ai' },
@@ -82,7 +95,7 @@ return {
     cmp.setup({
         snippet = {
             expand = function(args)
-                snippy.expand_snippet(args.body)
+                luasnip.lsp_expand(args.body)
             end,
         },
         window = {
@@ -99,22 +112,26 @@ return {
             [''] = cmp.mapping.scroll_docs(4),
             [''] = cmp.mapping.complete(),
             [''] = cmp.mapping.abort(),
-            [''] = cmp.mapping.confirm({ select = true }),
+            [''] = cmp.mapping(function(fallback)
+              cmp.confirm({ select = true })
+            end)
+              --cmp.mapping.confirm({ select = true }),
         }),
         sources = cmp.config.sources({
             { name = 'nvim_lsp' },
             { name = 'nvim_lsp_signature_help' },
             { name = 'path' },
-            { name = 'snippy' },
+            { name = 'luasnip' },
             { name = 'calc' },
             { name = 'cmp_git' },
         }, {
             { name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 },
         }),
-        sources = sources,
+        --sources = sources,
         sorting = {
+            priority_weight = 2,
             comparators = {
-                require('cmp_ai.compare'),
+                --require('cmp_ai.compare'),
                 cmp.config.compare.offset,
                 cmp.config.compare.exact,
                 cmp.config.compare.recently_used,
@@ -153,6 +170,6 @@ return {
 
     require("cmp_git").setup()
   end,
-  enabled = false
+  enabled = true
 }
 }
diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua
index 2676cfb..6fe8099 100644
--- a/.config/nvim/lua/plugins/oil.lua
+++ b/.config/nvim/lua/plugins/oil.lua
@@ -1,8 +1,11 @@
-return {
+return {{
   'stevearc/oil.nvim',
   opts = {
     delete_to_trash = true,
 
   },
   vim.keymap.set("n", "tt", "Oil", { desc = "Open parent directory" })
-}
+}, {
+  'mong8se/buffish.nvim',
+  vim.keymap.set("n", "tb", function() require('buffish').open() end, { desc = "Open buffers list" })
+}}
diff --git a/.config/nvim/lua/plugins/symbol-usage.lua b/.config/nvim/lua/plugins/symbol-usage.lua
index 8733564..ac049c6 100644
--- a/.config/nvim/lua/plugins/symbol-usage.lua
+++ b/.config/nvim/lua/plugins/symbol-usage.lua
@@ -49,7 +49,7 @@ return {
       return res
     end
     require('symbol-usage').setup({
-      vt_position = "above",
+      vt_position = "end_of_line",
       references = { enabled = true, include_declaration = true },
       definition = { enabled = true },
       implementation = { enabled = true },
diff --git a/.config/nvim/lua/plugins/telekasten.lua b/.config/nvim/lua/plugins/telekasten.lua
index 5f9c3e8..2dbdcb4 100644
--- a/.config/nvim/lua/plugins/telekasten.lua
+++ b/.config/nvim/lua/plugins/telekasten.lua
@@ -3,6 +3,7 @@ return {
   dependencies = {
     'renerocksai/calendar-vim'
   },
+  ft = { "markdown" },
   config = function()
     require('telekasten').setup({
       home = vim.fn.expand("~/zettelkasten"),