diff --git a/.config/nvim/lua/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua new file mode 100644 index 0000000..41a0292 --- /dev/null +++ b/.config/nvim/lua/plugins/blink.lua @@ -0,0 +1,39 @@ +return { + 'saghen/blink.cmp', + -- optional: provides snippets for the snippet source + dependencies = 'rafamadriz/friendly-snippets', + + -- use a release tag to download pre-built binaries + version = '*', + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' for mappings similar to built-in completion + -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate) + -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept + -- See the full "keymap" documentation for information on defining your own keymap. + keymap = { preset = 'default' }, + + appearance = { + -- Sets the fallback highlight groups to nvim-cmp's highlight groups + -- Useful for when your theme doesn't support blink.cmp + -- Will be removed in a future release + use_nvim_cmp_as_default = true, + -- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono' + }, + + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + }, + opts_extend = { "sources.default" } +} diff --git a/.config/nvim/lua/plugins/colorschemes.lua b/.config/nvim/lua/plugins/colorschemes.lua index ead6193..3f5d16f 100644 --- a/.config/nvim/lua/plugins/colorschemes.lua +++ b/.config/nvim/lua/plugins/colorschemes.lua @@ -6,64 +6,40 @@ return { config = function() require('themify').setup({ + activity = true, "xero/miasma.nvim", "wuelnerdotexe/vim-enfocado", - { - "fenetikm/falcon", - branch = "master" - }, + "fenetikm/falcon", "casr/vim-colors-reference", "blazkowolf/gruber-darker.nvim", - { - "rebelot/kanagawa.nvim", - branch = "master" - }, - { - "jaredgorski/spacecamp", - branch = "master" - }, - { - "lifepillar/vim-gruvbox8", - branch = "master" - }, + "rebelot/kanagawa.nvim", + "jaredgorski/spacecamp", + "lifepillar/vim-gruvbox8", "marko-cerovac/material.nvim", - { - "srcery-colors/srcery-vim", - branch = "master" - }, - { - "tanvirtin/monokai.nvim", - branch = "master" - }, + "srcery-colors/srcery-vim", + "tanvirtin/monokai.nvim", "dasupradyumna/midnight.nvim", - { - "bluz71/vim-moonfly-colors", - branch = "master" - }, - { - "kuznetsss/meadow.nvim", - branch = "master" - }, + "bluz71/vim-moonfly-colors", "kepano/flexoki-neovim", + "nuvic/flexoki-nvim", { url = "https://gitlab.com/bartekjaszczak/distinct-nvim", }, - 'kevinm6/kurayami.nvim', { - 'gerardbm/vim-atomic', - branch = "master" + url = "https://gitlab.com/bartekjaszczak/finale-nvim", }, + 'kevinm6/kurayami.nvim', + 'gerardbm/vim-atomic', 'fynnfluegge/monet.nvim', 'sho-87/kanagawa-paper.nvim', - { - 'qaptoR-nvim/chocolatier.nvim', - branch = "master" - }, - { - 'aliqyan-21/darkvoid.nvim', - branch = "master" - }, - 'default', + 'qaptoR-nvim/chocolatier.nvim', + 'aliqyan-21/darkvoid.nvim', + 'paulo-granthon/hyper.nvim', + 'diegoulloao/neofusion.nvim', + 'aktersnurra/no-clown-fiesta.nvim', + 'kdheepak/monochrome.nvim', + 'ficcdaf/ashen.nvim', + 'default' }) end } diff --git a/.config/nvim/lua/plugins/csv.lua b/.config/nvim/lua/plugins/csv.lua index 4888580..f4bd334 100644 --- a/.config/nvim/lua/plugins/csv.lua +++ b/.config/nvim/lua/plugins/csv.lua @@ -14,4 +14,10 @@ return {{ { "chrisbra/csv.vim", ft = { "csv" } +}, +{ + "hat0uma/csvview.nvim", + ft = { "csv" }, + cmd = { "CsvViewEnable" }, + config = true }} diff --git a/.config/nvim/lua/plugins/cursor.lua b/.config/nvim/lua/plugins/cursor.lua new file mode 100644 index 0000000..e744ef9 --- /dev/null +++ b/.config/nvim/lua/plugins/cursor.lua @@ -0,0 +1,14 @@ +return { + "DanilaMihailov/beacon.nvim", + opts = { + enabled = true, --- (boolean | fun():boolean) check if enabled + speed = 2, --- integer speed at which animation goes + width = 40, --- integer width of the beacon window + winblend = 70, --- integer starting transparency of beacon window :h winblend + fps = 60, --- integer how smooth the animation going to be + min_jump = 10, --- integer what is considered a jump. Number of lines + cursor_events = { 'CursorMoved' }, -- table what events trigger check for cursor moves + window_events = { 'WinEnter', 'FocusGained' }, -- table what events trigger cursor highlight + highlight = { bg = 'white', ctermbg = 15 }, -- vim.api.keyset.highlight table passed to vim.api.nvim_set_hl + } +} diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua index 4f44b09..eff3276 100644 --- a/.config/nvim/lua/plugins/dap.lua +++ b/.config/nvim/lua/plugins/dap.lua @@ -6,7 +6,7 @@ return { dap.adapters.gdb = { type = "executable", command = "gdb", - args = { "-i", "dap" } + args = { "--interpreter=dap", "--eval-command", "set print pretty on" } } dap.configurations.c = { { @@ -30,6 +30,26 @@ return { cwd = "${workspaceFolder}", }, } + dap.configurations.matlab = { + { + name = "Launch", + type = "matlab", + request = "launch", + program = "${file}", + cwd = "${workspaceFolder}", + rootDir = "${workspaceFolder}", + }, + } + dap.adapters.matlab = function(cb, config) + cb({ + type = 'executable', + command = 'matlab-language-server', + args = { '--stdio' }, + options = { + source_filetype = 'matlab', + }, + }) + end dap.configurations.python = { { -- The first three options are required by nvim-dap @@ -140,7 +160,7 @@ return { -- experimental features: all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine. virt_lines = false, -- show virtual lines instead of virtual text (will flicker!) - virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) , + virt_text_win_col = nil, -- position the virtual text at a fixed window column (starting from the first text column) } end } diff --git a/.config/nvim/lua/plugins/devcontainer.lua b/.config/nvim/lua/plugins/devcontainer.lua new file mode 100644 index 0000000..8a75179 --- /dev/null +++ b/.config/nvim/lua/plugins/devcontainer.lua @@ -0,0 +1,94 @@ +return { + url = "https://codeberg.org/esensar/nvim-dev-container", + opts = { + config_search_start = function() + -- By default this function uses vim.loop.cwd() + -- This is used to find a starting point for .devcontainer.json file search + -- Since by default, it is searched for recursively + -- That behavior can also be disabled + end, + workspace_folder_provider = function() + -- By default this function uses first workspace folder for integrated lsp if available and vim.loop.cwd() as a fallback + -- This is used to replace `${localWorkspaceFolder}` in devcontainer.json + -- Also used for creating default .devcontainer.json file + end, + terminal_handler = function(command) + -- By default this function creates a terminal in a new tab using :terminal command + -- It also removes statusline when that tab is active, to prevent double statusline + -- It can be overridden to provide custom terminal handling + end, + nvim_installation_commands_provider = function(path_binaries, version_string) + -- Returns table - list of commands to run when adding neovim to container + -- Each command can either be a string or a table (list of command parts) + -- Takes binaries available in path on current container and version_string passed to the command or current version of neovim + end, + devcontainer_json_template = function() + -- Returns table - list of lines to set when creating new devcontainer.json files + -- As a template + -- Used only when using functions from commands module or created commands + end, + -- Can be set to false to prevent generating default commands + -- Default commands are listed below + generate_commands = true, + -- By default no autocommands are generated + -- This option can be used to configure automatic starting and cleaning of containers + autocommands = { + -- can be set to true to automatically start containers when devcontainer.json is available + init = false, + -- can be set to true to automatically remove any started containers and any built images when exiting vim + clean = false, + -- can be set to true to automatically restart containers when devcontainer.json file is updated + update = false, + }, + -- can be changed to increase or decrease logging from library + log_level = "info", + -- can be set to true to disable recursive search + -- in that case only .devcontainer.json and .devcontainer/devcontainer.json files will be checked relative + -- to the directory provided by config_search_start + disable_recursive_config_search = false, + -- can be set to false to disable image caching when adding neovim + -- by default it is set to true to make attaching to containers faster after first time + cache_images = true, + -- By default all mounts are added (config, data and state) + -- This can be changed to disable mounts or change their options + -- This can be useful to mount local configuration + -- And any other mounts when attaching to containers with this plugin + attach_mounts = { + neovim_config = { + -- enables mounting local config to /root/.config/nvim in container + enabled = false, + -- makes mount readonly in container + options = { "readonly" } + }, + neovim_data = { + -- enables mounting local data to /root/.local/share/nvim in container + enabled = false, + -- no options by default + options = {} + }, + -- Only useful if using neovim 0.8.0+ + neovim_state = { + -- enables mounting local state to /root/.local/state/nvim in container + enabled = false, + -- no options by default + options = {} + }, + }, + -- This takes a list of mounts (strings) that should always be added to every run container + -- This is passed directly as --mount option to docker command + -- Or multiple --mount options if there are multiple values + always_mount = {}, + -- This takes a string (usually either "podman" or "docker") representing container runtime - "devcontainer-cli" is also partially supported + -- That is the command that will be invoked for container operations + -- If it is nil, plugin will use whatever is available (trying "podman" first) + container_runtime = nil, + -- Similar to container runtime, but will be used if main runtime does not support an action - useful for "devcontainer-cli" + backup_runtime = nil, + -- This takes a string (usually either "podman-compose" or "docker-compose") representing compose command - "devcontainer-cli" is also partially supported + -- That is the command that will be invoked for compose operations + -- If it is nil, plugin will use whatever is available (trying "podman-compose" first) + compose_command = nil, + -- Similar to compose command, but will be used if main command does not support an action - useful for "devcontainer-cli" + backup_compose_command = nil, + } +} diff --git a/.config/nvim/lua/plugins/fold.lua b/.config/nvim/lua/plugins/fold.lua index dc9f253..e8a428a 100644 --- a/.config/nvim/lua/plugins/fold.lua +++ b/.config/nvim/lua/plugins/fold.lua @@ -29,7 +29,7 @@ return opts = { keepFoldsAcrossSessions = false, }, - enabled = true + enabled = false }, { "kevinhwang91/nvim-ufo", dependencies = { diff --git a/.config/nvim/lua/plugins/image.lua b/.config/nvim/lua/plugins/image.lua index 4316f03..2ed114c 100644 --- a/.config/nvim/lua/plugins/image.lua +++ b/.config/nvim/lua/plugins/image.lua @@ -13,7 +13,7 @@ return { filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here }, neorg = { - enabled = true, + enabled = false, clear_in_insert_mode = false, download_remote_images = true, only_render_image_at_cursor = false, @@ -28,8 +28,8 @@ return { window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) - hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened + hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif", "*.svg" }, -- render image files as images when opened }) end, - enabled = false + enabled = true } diff --git a/.config/nvim/lua/plugins/join.lua b/.config/nvim/lua/plugins/join.lua index 068b489..409b8dd 100644 --- a/.config/nvim/lua/plugins/join.lua +++ b/.config/nvim/lua/plugins/join.lua @@ -11,5 +11,7 @@ return { -- vim.keymap.set('n', 'jT', function() -- require('treesj').toggle({ split = { recursive = true } }) -- end) - end + end, + -- it is loading very long or is it treesitter? + enabled = false } diff --git a/.config/nvim/lua/plugins/line.lua b/.config/nvim/lua/plugins/line.lua index 109d644..66b5714 100644 --- a/.config/nvim/lua/plugins/line.lua +++ b/.config/nvim/lua/plugins/line.lua @@ -1,493 +1,558 @@ --- progress data -local clients = {} -local progress = { '⠋', '⠙', '⠸', '⢰', '⣠', '⣄', '⡆', '⠇' } +-- -- 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 colorscheme = 'nightfox' +-- 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$' } }, +-- }, +-- } --- 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$' } }, - }, + -- Calls `require('slimline').setup({})` + "sschleemilch/slimline.nvim", + opts = { + bold = false, -- makes primary parts and mode bold + verbose_mode = false, -- Mode as single letter or as a word + style = 'bg', -- or "fg". Whether highlights should be applied to bg or fg of components + mode_follow_style = true, -- Whether the mode color components should follow the style option + components = { -- Choose components and their location + left = { + "mode", + "path", + "git" + }, + center = {}, + right = { + "diagnostics", + "filetype_lsp", + "progress" + } + }, + spaces = { + components = ' ', -- string between components + left = ' ', -- string at the start of the line + right = ' ', -- string at the end of the line + }, + sep = { + hide = { + first = false, -- hides the first separator + last = false, -- hides the last separator + }, + left = '', -- left separator of components + right = '', -- right separator of components + }, + hl = { + modes = { + normal = 'Type', -- highlight base of modes + insert = 'Function', + pending = 'Boolean', + visual = 'Keyword', + command = 'String', + }, + base = 'Comment', -- highlight of everything in in between components + primary = 'Normal', -- highlight of primary parts (e.g. filename) + secondary = 'Comment', -- highlight of secondary parts (e.g. filepath) + }, + icons = { + diagnostics = { + ERROR = ' ', + WARN = ' ', + HINT = ' ', + INFO = ' ', + }, + git = { + branch = '', + }, + folder = ' ', + lines = ' ', + recording = ' ', + }, + } } diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 99bbc57..fcf6d2c 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -22,7 +22,7 @@ return { -- 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 = { "CursorMoved" }, + only_current_line_autocmd = { "CursorMoved", "CursorMovedI" }, -- whether to show parameter hints with the inlay hints or not show_parameter_hints = true, -- prefix for parameter hints @@ -30,7 +30,7 @@ return { -- prefix for all the other hints (type, chaining) other_hints_prefix = "→", -- whether to align to the length of the longest line in the file - max_len_align = false, + max_len_align = true, -- padding from the left if max_len_align is true max_len_align_padding = 1, -- whether to align to the extreme right or not @@ -61,25 +61,6 @@ return { TemplateTemplateParm = "🅃", TemplateParamObject = "🅃", }, - --[[ These require codicons (https://github.com/microsoft/vscode-codicons) - role_icons = { - type = "", - declaration = "", - expression = "", - specifier = "", - statement = "", - ["template argument"] = "", - }, - - kind_icons = { - Compound = "", - Recovery = "", - TranslationUnit = "", - PackExpansion = "", - TemplateTypeParm = "", - TemplateTemplateParm = "", - TemplateParamObject = "", - }, ]] highlights = { detail = "Comment", }, @@ -127,41 +108,37 @@ return { -- }) require("clangd_extensions.inlay_hints").setup_autocmd() require("clangd_extensions.inlay_hints").set_inlay_hints() - require("better-diagnostic-virtual-text.api").setup_buf(ev.buf, {}) - - local signs = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - } - - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) - end - - vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - signs = false, - severity_sort = true, - underline = true, - update_in_insert = false, - virtual_text = { - spacing = 30, + require("better-diagnostic-virtual-text.api").setup_buf(ev.buf, { + ui = { + wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long + left_kept_space = 3, --- the number of spaces kept on the left side of the virtual text, make sure it enough to custom for each line + right_kept_space = 3, --- the number of spaces kept on the right side of the virtual text, make sure it enough to custom for each line + arrow = "  ", + up_arrow = "  ", + down_arrow = "  ", + above = false, -- the virtual text will be displayed above the line }, - float = true - } - ) + priority = 2003, -- the priority of virtual text + inline = true}) + + vim.diagnostic.config({ + underline = false, + signs = true, + virtual_text = true, + update_in_insert = false, + severity_sort = true + }) end }) - -- local capabilities = vim.lsp.protocol.make_client_capabilities() - local capabilities = require('cmp_nvim_lsp').default_capabilities() + --local capabilities = vim.lsp.protocol.make_client_capabilities() + --local capabilities = require('cmp_nvim_lsp').default_capabilities() + local capabilities = require('blink.cmp').get_lsp_capabilities() -- local capabilities = vim.tbl_deep_extend('force', -- vim.lsp.protocol.make_client_capabilities(), -- require('epo').register_cap() -- ) - capabilities.offsetEncoding = { "utf-16" } + --capabilities.offsetEncoding = { "utf-16" } nvim_lsp.groovyls.setup({ cmd = { "java", "-jar", "/home/kmcr/tools/groovy-language-server/build/libs/groovy-language-server-all.jar" }, @@ -197,7 +174,8 @@ return { nvim_lsp.matlab_ls.setup({ cmd = { "matlab-language-server", "--stdio"}, filetypes = { "matlab" }, - root_dir = nvim_lsp.util.find_git_ancestor, + -- root_dir = nvim_lsp.util.find_git_ancestor, + root_dir = vim.fs.dirname(vim.fs.find('.git', { path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), upward = true })[1]), single_file_support = true, settings = { matlab = { diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index be2afe9..a0359f0 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -16,10 +16,34 @@ return { { -- TOC default string -- WARN toc_format = '%s- [%s](<%s#%s>)', - } + }, + ft = { "md", "markdown" }, }, { 'SCJangra/table-nvim', - ft = 'markdown', + ft = {'markdown', 'md' }, opts = {}, } -} } +}, +{ + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && npm install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown", "md" }, +}, +{ + "brianhuster/live-preview.nvim", + opts = { + cmd = "LivePreview", -- Main command of live-preview.nvim + port = 5500, -- Port to run the live preview server on. + autokill = false, -- If true, the plugin will autokill other processes running on the same port (except for Neovim) when starting the server. + browser = 'default', -- Terminal command to open the browser for live-previewing (eg. 'firefox', 'flatpak run com.vivaldi.Vivaldi'). By default, it will use the default browser. + dynamic_root = false, -- If true, the plugin will set the root directory to the previewed file's directory. If false, the root directory will be the current working directory (`:lua print(vim.uv.cwd())`). + sync_scroll = false, -- If true, the plugin will sync the scrolling in the browser as you scroll in the Markdown files in Neovim. + picker = nil, -- Picker to use for opening files. 3 choices are available: 'telescope', 'fzf-lua', 'mini.pick'. If nil, the plugin look for the first available picker when you call the `pick` command. + }, + enabled = false, +} +} diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index e3fa473..c493337 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -1,175 +1,185 @@ return { -{ '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' + { + "nomnivore/ollama.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + + -- All the user commands added by the plugin + cmd = { "Ollama", "OllamaModel", "OllamaServe", "OllamaServeStop" }, + + keys = { + -- Sample keybind for prompt menu. Note that the is important for selections to work properly. + { + "oo", + ":lua require('ollama').prompt()", + desc = "ollama prompt", + mode = { "n", "v" }, + }, + + -- Sample keybind for direct prompting. Note that the is important for selections to work properly. + { + "oG", + ":lua require('ollama').prompt('Generate_Code')", + desc = "ollama Generate Code", + mode = { "n", "v" }, + }, + }, + + ---@type Ollama.Config + opts = { + model = "qwen2.5-coder", + url = "http://192.168.10.99:11434", + -- your configuration overrides + }, + enabled = false }, - -- install jsregexp (optional!). - build = "make install_jsregexp", - config = function() - local ls = require("luasnip") - end -}, -{ - 'hrsh7th/nvim-cmp', - dependencies = { + { + "mireq/luasnip-snippets", + dependencies = { + "L3MON4D3/LuaSnip" + }, + config = function() + require('luasnip_snippets.common.snip_utils').setup() + end, + enabled = false + }, + { "L3MON4D3/LuaSnip", - --'mstanciu552/cmp-matlab', - 'petertriho/cmp-git', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-cmdline', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-nvim-lsp-signature-help', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-calc', - 'JoseConseco/cmp-ai' + dependencies = { + "saadparwaiz1/cmp_luasnip" + }, + -- follow latest release. + version = "v2.*", -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + config = function() + -- Mandatory setup function + local luasnip = require("luasnip") + luasnip.setup({ + load_ft_func = require('luasnip_snippets.common.snip_utils').load_ft_func, + ft_func = require('luasnip_snippets.common.snip_utils').ft_func, + -- To enable auto expansin + enable_autosnippets = true, + }) + vim.keymap.set({"i", "s"}, "", function() if luasnip.expand_or_jumpable() then luasnip.expand_or_jump() else vim.api.nvim_input('') end end, {silent = true}) + vim.keymap.set({"i", "s"}, "", function() luasnip.jump(-1) end, {silent = true}) + vim.keymap.set({"i", "s"}, "", function() if luasnip.choice_active() then luasnip.change_choice(1) end end, {silent = true}) + end, + enabled = false }, + { + 'tzachar/cmp-ai', + dependencies = 'nvim-lua/plenary.nvim', + enabled = false + }, + { + 'hrsh7th/nvim-cmp', + dependencies = { + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/nvim-cmp', + 'L3MON4D3/LuaSnip', + "saadparwaiz1/cmp_luasnip", + 'tzachar/cmp-ai', + }, + config = function() + local cmp = require 'cmp' + local cmp_ai = require('cmp_ai.config') - event = "InsertEnter", - config = function() - local cmp = require'cmp' - --local cmp_ai = require('cmp_ai.config') - local luasnip = require('luasnip') + cmp_ai:setup({ + max_lines = 100, + provider = 'Ollama', + provider_options = { + base_url = 'http://192.168.10.99:11434/api/generate', + model = 'qwen2.5-coder:latest', + prompt = function(lines_before, lines_after) + return "<|fim_prefix|>" .. lines_before .. "<|fim_suffix|>" .. lines_after .. "<|fim_middle|>" + end, + }, + notify = true, + notify_callback = function(msg) + vim.notify(msg) + end, + run_on_every_keystroke = 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 = 'luasnip' },
-        { name = 'calc' },
-        --{ name = 'cmp_git' },
-        --{ name = 'cmp_ai' },
-    })
-
-    local bufIsBig = function(bufnr)
-      local max_filesize = 100 * 1024 -- 100 KB
-      local ok, stats = vim.loop.fs_stat(vim.api.nvim_buf_get_name(bufnr))
-      if ok and stats and stats.size > max_filesize then
-        return true
-      else
-        return false
-      end
-    end
-    -- If a file is too large, I don't want to add to it's cmp sources treesitter, see:
-    -- https://github.com/hrsh7th/nvim-cmp/issues/1522
-    vim.api.nvim_create_autocmd('BufReadPre', {
-      callback = function(t)
-        local sources = default_cmp_sources
-        if not bufIsBig(t.buf) then
-          sources[#sources+1] = {name = 'treesitter', group_index = 2}
-        end
-      cmp.setup.buffer {
-        sources = sources
-      }
-      end
-    })
-
-    cmp.setup({
+      cmp.setup({
         snippet = {
-            expand = function(args)
-                luasnip.lsp_expand(args.body)
-            end,
+          -- REQUIRED - you must specify a snippet engine
+          expand = function(args)
+            --vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
+            require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
+            -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
+            -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
+            -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
+          end,
         },
         window = {
-            completion = cmp.config.window.bordered(),
-            documentation = cmp.config.window.bordered(),
-        },
-        experimental = {
-          ghost_text = true,
+          completion = cmp.config.window.bordered(),
+          documentation = cmp.config.window.bordered(),
         },
         mapping = cmp.mapping.preset.insert({
-            [''] = cmp.mapping.select_prev_item(),
-            [''] = cmp.mapping.select_next_item(),
-            [''] = cmp.mapping.scroll_docs(-4),
-            [''] = cmp.mapping.scroll_docs(4),
-            [''] = cmp.mapping.complete(),
-            [''] = cmp.mapping.abort(),
-            [''] = cmp.mapping(function(fallback)
-              cmp.confirm({ select = true })
-            end)
-              --cmp.mapping.confirm({ select = true }),
+          [''] = cmp.mapping.scroll_docs(-4),
+          [''] = cmp.mapping.scroll_docs(4),
+          [''] = cmp.mapping.complete(),
+          [''] = cmp.mapping.abort(),
+          [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
         }),
         sources = cmp.config.sources({
-            { name = 'nvim_lsp' },
-            { name = 'nvim_lsp_signature_help' },
-            { name = 'path' },
-            { name = 'luasnip' },
-            { name = 'calc' },
-            { name = 'cmp_git' },
+          { name = 'nvim_lsp' },
+          -- { name = 'vsnip' }, -- For vsnip users.
+          { name = 'luasnip' }, -- For luasnip users.
+          -- { name = 'ultisnips' }, -- For ultisnips users.
+          -- { name = 'snippy' }, -- For snippy users.
+          --{ name = 'cmp_ai' }
         }, {
-            { name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 },
+          { name = 'buffer' },
         }),
-        --sources = sources,
-        sorting = {
-            priority_weight = 2,
-            comparators = {
-                --require('cmp_ai.compare'),
-                cmp.config.compare.offset,
-                cmp.config.compare.exact,
-                cmp.config.compare.recently_used,
-                require("clangd_extensions.cmp_scores"),
-                cmp.config.compare.kind,
-                cmp.config.compare.sort_text,
-                cmp.config.compare.length,
-                cmp.config.compare.order,
-            },
-        },
-    })
+        performance = {
+          fetching_timeout = 20,
+          debounce = 10,
+          throttle = 10,
+          async_budget = 20000,
+          max_view_entries = 10,
+          confirm_resolve_timeout = 10,
+          filtering_context_budget = 10
+        }
+      })
 
-    cmp.setup.cmdline({'/', '?'}, {
+      -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
+      -- Set configuration for specific filetype.
+      --[[ cmp.setup.filetype('gitcommit', {
+          sources = cmp.config.sources({
+            { name = 'git' },
+          }, {
+            { name = 'buffer' },
+          })
+      })
+      require("cmp_git").setup() ]]
+      --
+
+      -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
+      cmp.setup.cmdline({ '/', '?' }, {
         mapping = cmp.mapping.preset.cmdline(),
         sources = {
-            { name = 'buffer' }
+          { name = 'buffer' }
         }
-    })
+      })
 
-    cmp.setup.cmdline(':', {
+      -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
+      cmp.setup.cmdline(':', {
         mapping = cmp.mapping.preset.cmdline(),
         sources = cmp.config.sources({
-            { name = 'path' }
+          { name = 'path' }
         }, {
-            { name = 'cmdline' }
-        })
-    })
-
-    cmp.setup.filetype('gitcommit', {
-        sources = cmp.config.sources({
-            {name = 'cmp_git' },
-        }, {
-            {name = 'buffer' }
-        })
-    })
-
-    require("cmp_git").setup()
-  end,
-  enabled = true
-}
+          { name = 'cmdline' }
+        }),
+        matching = { disallow_symbol_nonprefix_matching = false }
+      })
+    end,
+    enabled = false
+  }
 }
diff --git a/.config/nvim/lua/plugins/orphans.lua b/.config/nvim/lua/plugins/orphans.lua
new file mode 100644
index 0000000..b00e5de
--- /dev/null
+++ b/.config/nvim/lua/plugins/orphans.lua
@@ -0,0 +1,6 @@
+return {
+    "ZWindL/orphans.nvim",
+    config = function()
+        require('orphans').setup({})
+    end
+}
diff --git a/.config/nvim/lua/plugins/paint.lua b/.config/nvim/lua/plugins/paint.lua
new file mode 100644
index 0000000..ce59249
--- /dev/null
+++ b/.config/nvim/lua/plugins/paint.lua
@@ -0,0 +1,57 @@
+return { -- Custom highlight for stim files
+  "folke/paint.nvim",
+  config = function()
+
+    vim.filetype.add({
+      extension = {
+        log = 'log',
+    }})
+
+    require("paint").setup({
+    ---@type PaintHighlight[]
+    highlights = {
+      {
+        filter = { filetype = "log" },
+        pattern = "EFMC",
+        hl = "DiffDelete",
+      },
+      {
+        filter = { filetype = "log" },
+        pattern = "CoCo",
+        hl = "DiffAdd",
+      },
+      {
+        filter = { filetype = "log" },
+        pattern = "EneM",
+        hl = "DiffChange",
+      },
+      {
+        filter = { filetype = "log" },
+        pattern = "CuLi",
+        hl = "DiffChange",
+      },
+      {
+        filter = { filetype = "log" },
+        pattern = "Hoca",
+        hl = "MatchParen",
+      },
+      {
+        filter = { filetype = "log" },
+        pattern = "Inverter",
+        hl = "RedrawDebugClear",
+      },
+      {
+        filter = { filetype = "log" },
+        pattern = "Wallbox",
+        hl = "RedrawDebugComposed",
+      },
+      {
+        filter = { filetype = "log" },
+        pattern = "Vehicle",
+        hl = "RedrawDebugRecompose",
+      },
+
+    },
+  })
+  end,
+}
diff --git a/.config/nvim/lua/plugins/peek.lua b/.config/nvim/lua/plugins/peek.lua
index 621c148..2c2f220 100644
--- a/.config/nvim/lua/plugins/peek.lua
+++ b/.config/nvim/lua/plugins/peek.lua
@@ -39,5 +39,6 @@ return {
         --vim.fn.system('i3-msg move left')
       end
     end, {})
-  end
+  end,
+  enabled = false
 }
diff --git a/.config/nvim/lua/plugins/pendulum.lua b/.config/nvim/lua/plugins/pendulum.lua
new file mode 100644
index 0000000..8bb7ed1
--- /dev/null
+++ b/.config/nvim/lua/plugins/pendulum.lua
@@ -0,0 +1,6 @@
+return {
+    "ptdewey/pendulum-nvim",
+    config = function()
+        require("pendulum").setup()
+    end,
+}
diff --git a/.config/nvim/lua/plugins/quicker.lua b/.config/nvim/lua/plugins/quicker.lua
new file mode 100644
index 0000000..09ea85e
--- /dev/null
+++ b/.config/nvim/lua/plugins/quicker.lua
@@ -0,0 +1,34 @@
+return {
+  'stevearc/quicker.nvim',
+  config = function()
+    require('quicker').setup()
+    vim.keymap.set("n", "q", function()
+      require("quicker").toggle()
+    end, {
+      desc = "Toggle quickfix",
+    })
+    vim.keymap.set("n", "l", function()
+      require("quicker").toggle({ loclist = true })
+    end, {
+      desc = "Toggle loclist",
+    })
+    require("quicker").setup({
+      keys = {
+        {
+          ">",
+          function()
+            require("quicker").expand({ before = 2, after = 2, add_to_existing = true })
+          end,
+          desc = "Expand quickfix context",
+        },
+        {
+          "<",
+          function()
+            require("quicker").collapse()
+          end,
+          desc = "Collapse quickfix context",
+        },
+      },
+    })
+  end
+}
diff --git a/.config/nvim/lua/plugins/repl.lua b/.config/nvim/lua/plugins/repl.lua
index 15e9c29..0d7d101 100644
--- a/.config/nvim/lua/plugins/repl.lua
+++ b/.config/nvim/lua/plugins/repl.lua
@@ -1,21 +1,29 @@
 return {
-    "petrichorma/nvim_ds_repl",
-    requires = "nvim-treesitter",
-  config = function ()
-    vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
-      pattern = {"*.py", "*.R"},
+  "petrichorma/nvim_ds_repl",
+  requires = "nvim-treesitter",
+  config = function()
+    vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
+      pattern = { "*.py", "*.R" },
       callback = function()
+        -- Execute the current statement or block under the cursor
         vim.keymap.set("n", '', function()
           require('nvim_ds_repl').send_statement_definition()
-        end, {noremap = true})
+        end, { noremap = true })
+
+        -- Execute the selected visual block of code
         vim.keymap.set("v", '', function()
           require('nvim_ds_repl').send_visual_to_repl()
-        end, {noremap = true})
-        vim.keymap.set("n", 'fa', function()
-          require('nvim_ds_repl').send_buffer_to_repl()
-        end, {noremap = true})
-        vim.api.nvim_set_keymap('n', 'pp', "lua require('nvim_ds_repl').get_envs()", {noremap = true, silent = true})
-        vim.api.nvim_set_keymap('n', 'pj', "lua require('nvim_ds_repl').inspect()", {noremap = true, silent = true})
+        end, { noremap = true })
+
+        -- Query global environment variable information
+        vim.keymap.set("n", 'wi', function()
+          require('nvim_ds_repl').query_global()
+        end, { noremap = true })
+
+        -- Query information about the specific object under the cursor
+        vim.keymap.set("n", 'si', function()
+          require('nvim_ds_repl').inspect()
+        end, { noremap = true })
       end
     })
   end
diff --git a/.config/nvim/lua/plugins/specs.lua b/.config/nvim/lua/plugins/specs.lua
index 98c2d53..5fed2ca 100644
--- a/.config/nvim/lua/plugins/specs.lua
+++ b/.config/nvim/lua/plugins/specs.lua
@@ -1,5 +1,5 @@
 return {
-  'edluffy/specs.nvim',
+  'cxwx/specs.nvim',
   config = function()
     require('specs').setup{
       show_jumps  = true,
diff --git a/.config/nvim/lua/plugins/telekasten.lua b/.config/nvim/lua/plugins/telekasten.lua
index 2dbdcb4..f4539f8 100644
--- a/.config/nvim/lua/plugins/telekasten.lua
+++ b/.config/nvim/lua/plugins/telekasten.lua
@@ -23,5 +23,6 @@ return {
 
     -- Call insert link automatically when we start typing a link
     vim.keymap.set("i", "[[", "Telekasten insert_link")
-  end
+  end,
+  enabled = false
 }
diff --git a/.config/nvim/lua/plugins/timespent.lua b/.config/nvim/lua/plugins/timespent.lua
new file mode 100644
index 0000000..fdf4421
--- /dev/null
+++ b/.config/nvim/lua/plugins/timespent.lua
@@ -0,0 +1,3 @@
+return {
+  "QuentinGruber/timespent.nvim",
+}
diff --git a/.config/nvim/lua/plugins/transparent.lua b/.config/nvim/lua/plugins/transparent.lua
index 0a6c6c4..7434431 100644
--- a/.config/nvim/lua/plugins/transparent.lua
+++ b/.config/nvim/lua/plugins/transparent.lua
@@ -7,10 +7,11 @@ return {
       'Statement', 'PreProc', 'Type', 'Underlined', 'Todo', 'String', 'Function',
       'Conditional', 'Repeat', 'Operator', 'Structure', 'LineNr', 'NonText',
       'SignColumn', 'CursorLineNr', 'EndOfBuffer',
-    },
-    extra_groups = {}, -- table: additional groups that should be cleared
-    exclude_groups = {}, -- table: groups you don't want to clear
-  })
+      },
+      extra_groups = {}, -- table: additional groups that should be cleared
+      exclude_groups = {}, -- table: groups you don't want to clear
+    })
+    vim.cmd([[TransparentEnable]])
   end,
   --cmd = {"TransparentEnable", "TransparentDisable", "TransparentToggle" },
 }
diff --git a/.config/nvim/lua/plugins/vimwiki.lua b/.config/nvim/lua/plugins/vimwiki.lua
new file mode 100644
index 0000000..680407a
--- /dev/null
+++ b/.config/nvim/lua/plugins/vimwiki.lua
@@ -0,0 +1,12 @@
+return {
+  'vimwiki/vimwiki',
+  init = function()
+    vim.g.vimwiki_list = {{
+      path = '~/vimwiki/',
+      syntax= 'markdown',
+      ext= 'md'
+    }}
+    vim.g.vimwiki_global_ext = 0
+  end,
+  filetype = { 'vimwiki' }
+}
diff --git a/.config/nvim/lua/plugins/yanklock.lua b/.config/nvim/lua/plugins/yanklock.lua
new file mode 100644
index 0000000..c13a6dc
--- /dev/null
+++ b/.config/nvim/lua/plugins/yanklock.lua
@@ -0,0 +1,15 @@
+return {
+  "daltongd/yanklock.nvim",
+  opts = {
+    notify = true, -- optional
+  },
+  keys = {
+    {
+      "yl",
+      function()
+        require("yanklock").toggle()
+      end,
+      desc = "yanklock toggle",
+    },
+  },
+}