Nvim: use blink instead of cmp

This commit is contained in:
Robert Kmieć
2025-01-10 11:10:51 +01:00
parent f6ecd9592c
commit 4ebfe540ad
25 changed files with 1134 additions and 762 deletions

View File

@@ -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" }
}

View File

@@ -6,64 +6,40 @@ return {
config = function() config = function()
require('themify').setup({ require('themify').setup({
activity = true,
"xero/miasma.nvim", "xero/miasma.nvim",
"wuelnerdotexe/vim-enfocado", "wuelnerdotexe/vim-enfocado",
{
"fenetikm/falcon", "fenetikm/falcon",
branch = "master"
},
"casr/vim-colors-reference", "casr/vim-colors-reference",
"blazkowolf/gruber-darker.nvim", "blazkowolf/gruber-darker.nvim",
{
"rebelot/kanagawa.nvim", "rebelot/kanagawa.nvim",
branch = "master"
},
{
"jaredgorski/spacecamp", "jaredgorski/spacecamp",
branch = "master"
},
{
"lifepillar/vim-gruvbox8", "lifepillar/vim-gruvbox8",
branch = "master"
},
"marko-cerovac/material.nvim", "marko-cerovac/material.nvim",
{
"srcery-colors/srcery-vim", "srcery-colors/srcery-vim",
branch = "master"
},
{
"tanvirtin/monokai.nvim", "tanvirtin/monokai.nvim",
branch = "master"
},
"dasupradyumna/midnight.nvim", "dasupradyumna/midnight.nvim",
{
"bluz71/vim-moonfly-colors", "bluz71/vim-moonfly-colors",
branch = "master"
},
{
"kuznetsss/meadow.nvim",
branch = "master"
},
"kepano/flexoki-neovim", "kepano/flexoki-neovim",
"nuvic/flexoki-nvim",
{ {
url = "https://gitlab.com/bartekjaszczak/distinct-nvim", url = "https://gitlab.com/bartekjaszczak/distinct-nvim",
}, },
'kevinm6/kurayami.nvim',
{ {
'gerardbm/vim-atomic', url = "https://gitlab.com/bartekjaszczak/finale-nvim",
branch = "master"
}, },
'kevinm6/kurayami.nvim',
'gerardbm/vim-atomic',
'fynnfluegge/monet.nvim', 'fynnfluegge/monet.nvim',
'sho-87/kanagawa-paper.nvim', 'sho-87/kanagawa-paper.nvim',
{
'qaptoR-nvim/chocolatier.nvim', 'qaptoR-nvim/chocolatier.nvim',
branch = "master"
},
{
'aliqyan-21/darkvoid.nvim', 'aliqyan-21/darkvoid.nvim',
branch = "master" 'paulo-granthon/hyper.nvim',
}, 'diegoulloao/neofusion.nvim',
'default', 'aktersnurra/no-clown-fiesta.nvim',
'kdheepak/monochrome.nvim',
'ficcdaf/ashen.nvim',
'default'
}) })
end end
} }

View File

@@ -14,4 +14,10 @@ return {{
{ {
"chrisbra/csv.vim", "chrisbra/csv.vim",
ft = { "csv" } ft = { "csv" }
},
{
"hat0uma/csvview.nvim",
ft = { "csv" },
cmd = { "CsvViewEnable" },
config = true
}} }}

View File

@@ -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<string> what events trigger check for cursor moves
window_events = { 'WinEnter', 'FocusGained' }, -- table<string> what events trigger cursor highlight
highlight = { bg = 'white', ctermbg = 15 }, -- vim.api.keyset.highlight table passed to vim.api.nvim_set_hl
}
}

View File

@@ -6,7 +6,7 @@ return {
dap.adapters.gdb = { dap.adapters.gdb = {
type = "executable", type = "executable",
command = "gdb", command = "gdb",
args = { "-i", "dap" } args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
} }
dap.configurations.c = { dap.configurations.c = {
{ {
@@ -30,6 +30,26 @@ return {
cwd = "${workspaceFolder}", 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 = { dap.configurations.python = {
{ {
-- The first three options are required by nvim-dap -- The first three options are required by nvim-dap
@@ -140,7 +160,7 @@ return {
-- experimental features: -- experimental features:
all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine. 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_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 end
} }

View File

@@ -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,
}
}

View File

@@ -29,7 +29,7 @@ return
opts = { opts = {
keepFoldsAcrossSessions = false, keepFoldsAcrossSessions = false,
}, },
enabled = true enabled = false
}, { }, {
"kevinhwang91/nvim-ufo", "kevinhwang91/nvim-ufo",
dependencies = { dependencies = {

View File

@@ -13,7 +13,7 @@ return {
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
}, },
neorg = { neorg = {
enabled = true, enabled = false,
clear_in_insert_mode = false, clear_in_insert_mode = false,
download_remote_images = true, download_remote_images = true,
only_render_image_at_cursor = false, only_render_image_at_cursor = false,
@@ -28,8 +28,8 @@ return {
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, 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 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) 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, end,
enabled = false enabled = true
} }

View File

@@ -11,5 +11,7 @@ return {
-- vim.keymap.set('n', '<leader>jT', function() -- vim.keymap.set('n', '<leader>jT', function()
-- require('treesj').toggle({ split = { recursive = true } }) -- require('treesj').toggle({ split = { recursive = true } })
-- end) -- end)
end end,
-- it is loading very long or is it treesitter?
enabled = false
} }

View File

@@ -1,493 +1,558 @@
-- progress data -- -- progress data
local clients = {} -- local clients = {}
local progress = { '', '', '', '', '', '', '', '' } -- local progress = { '⠋', '⠙', '⠸', '⢰', '⣠', '⣄', '⡆', '⠇' }
--
-- check for lsp progress data -- -- check for lsp progress data
local function is_lsp_loading(client) return client and clients[client] and clients[client].percentage < 100 end -- local function is_lsp_loading(client) return client and clients[client] and clients[client].percentage < 100 end
--
-- update lsp progress -- -- update lsp progress
local function update_lsp_progress() -- local function update_lsp_progress()
local messages = vim.lsp.util.get_progress_messages() -- local messages = vim.lsp.util.get_progress_messages()
for _, message in ipairs(messages) do -- for _, message in ipairs(messages) do
if not message.name then goto continue end -- if not message.name then goto continue end
--
local client_name = message.name -- local client_name = message.name
--
if not clients[client_name] then clients[client_name] = { percentage = 0, progress_index = 0 } end -- if not clients[client_name] then clients[client_name] = { percentage = 0, progress_index = 0 } end
--
if message.done then -- if message.done then
clients[client_name].percentage = 100 -- 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 -- else
-- s = '' -- if message.percentage then clients[client_name].percentage = message.percentage end
-- 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 -- return s
-- end, -- end,
-- hl = { fg = palette.bg0, bg = palette.green.base }, -- hl = { fg = palette.bg0, bg = palette.blue.base },
-- left_sep = { -- right_sep = {
-- always_visible = true, -- always_visible = true,
-- str = separators.slant_right, -- str = separators.slant_right,
-- hl = { fg = palette.bg0, bg = palette.green.base }, -- hl = { fg = palette.blue.base, bg = palette.bg0 },
-- }, -- },
-- })
-- 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 },
-- }, -- },
-- }) --
-- file_name = {
-- table.insert(components.active[left], { -- 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() -- provider = function()
-- local status = git_diff('removed') -- local git = require('feline.providers.git')
-- local branch, icon = git.git_branch()
-- local s -- local s
-- if status then -- if #branch > 0 then
-- s = string.format(' %s %s ', '', status) -- s = string.format(' %s%s ', icon, branch)
-- else -- else
-- s = '' -- s = string.format(' %s ', 'Untracked')
-- end -- end
-- return s -- return s
-- end, -- end,
-- hl = { fg = palette.bg0, bg = palette.red.base }, -- hl = { fg = palette.bg0, bg = palette.fg3 },
-- left_sep = { -- left_sep = {
-- always_visible = true, -- always_visible = true,
-- str = separators.slant_right, -- str = string.format('%s%s', separators.block, separators.slant_right),
-- hl = { fg = palette.yellow.base, bg = palette.red.base }, -- hl = { fg = palette.white.base, bg = palette.fg3 },
-- }, -- },
-- right_sep = { -- right_sep = {
-- always_visible = true, -- always_visible = true,
-- str = separators.slant_right, -- str = separators.slant_right,
-- hl = { fg = palette.red.base, bg = palette.bg0 }, -- hl = { fg = palette.fg3, bg = palette.bg0 },
-- }, -- },
-- }) -- },
--
lsp = { -- -- table.insert(components.active[left], {
provider = function() -- -- provider = function()
if not lsp.is_lsp_attached() then return ' 󱏎 LSP ' end -- -- local status = git_diff('added')
-- -- local s
local client_name = get_lsp_client_name() -- -- if status then
if is_lsp_loading(client_name) then -- -- s = string.format(' %s %s ', '', status)
return string.format(' %s LSP ', progress[clients[client_name].progress_index]) -- -- else
else -- -- s = ''
return ' 󱁛 LSP ' -- -- end
end -- -- return s
end, -- -- end,
hl = function() -- -- hl = { fg = palette.bg0, bg = palette.green.base },
if not lsp.is_lsp_attached() then return { fg = palette.bg0, bg = palette.fg3 } end -- -- left_sep = {
-- -- always_visible = true,
local client_name = get_lsp_client_name() -- -- str = separators.slant_right,
if is_lsp_loading(client_name) then return { fg = palette.bg0, bg = palette.yellow.base } end -- -- hl = { fg = palette.bg0, bg = palette.green.base },
-- -- },
return { fg = palette.bg0, bg = palette.green.base } -- -- })
end, --
left_sep = { -- -- table.insert(components.active[left], {
always_visible = true, -- -- provider = function()
str = separators.slant_right, -- -- local status = git_diff('changed')
hl = function() -- -- local s
if not lsp.is_lsp_attached() then return { fg = palette.bg0, bg = palette.fg3 } end -- -- if status then
-- -- s = string.format(' %s %s ', '', status)
local client_name = get_lsp_client_name() -- -- else
if is_lsp_loading(client_name) then return { fg = palette.bg0, bg = palette.yellow.base } end -- -- s = ''
-- -- end
return { fg = palette.bg0, bg = palette.green.base } -- -- return s
end, -- -- end,
}, -- -- hl = { fg = palette.bg0, bg = palette.yellow.base },
right_sep = { -- -- left_sep = {
always_visible = true, -- -- always_visible = true,
str = separators.slant_right, -- -- str = separators.slant_right,
hl = function() -- -- hl = { fg = palette.green.base, bg = palette.yellow.base },
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 -- -- table.insert(components.active[left], {
-- -- provider = function()
return { fg = palette.green.base, bg = 'none' } -- -- local status = git_diff('removed')
end, -- -- local s
}, -- -- if status then
}, -- -- s = string.format(' %s %s ', '', status)
-- -- else
-- table.insert(components.active[left], { -- -- 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() -- provider = function()
-- local s -- if not lsp.is_lsp_attached() then return ' 󱏎 LSP ' end
-- local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })) --
-- if count > 0 then -- local client_name = get_lsp_client_name()
-- s = string.format(' %s %d ', '', count) -- if is_lsp_loading(client_name) then
-- return string.format(' %s LSP ', progress[clients[client_name].progress_index])
-- else -- else
-- s = '' -- return ' 󱁛 LSP '
-- end -- end
-- return s
-- end, -- end,
-- hl = { fg = palette.bg0, bg = palette.red.base }, -- 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 = { -- left_sep = {
-- always_visible = true, -- always_visible = true,
-- str = separators.slant_right, -- str = separators.slant_right,
-- hl = { fg = palette.bg0, bg = palette.red.base }, -- 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,
-- table.insert(components.active[left], { -- 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() -- provider = function()
-- local s -- local s
-- local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })) -- local recording_register = vim.fn.reg_recording()
-- if count > 0 then -- if #recording_register == 0 then
-- s = string.format(' %s %d ', '', count)
-- else
-- s = '' -- s = ''
-- else
-- s = string.format(' Recording @%s ', recording_register)
-- end -- end
-- return s -- return s
-- end, -- end,
-- hl = { fg = palette.bg0, bg = palette.magenta.base }, -- hl = { fg = palette.bg0, bg = palette.fg3 },
-- left_sep = { -- left_sep = {
-- always_visible = true, -- always_visible = true,
-- str = separators.slant_right, -- str = separators.slant_left,
-- hl = { fg = palette.red.base, bg = palette.magenta.base }, -- hl = function() return { fg = palette.fg3, bg = palette.bg0 } end,
-- }, -- },
-- }) -- },
--
-- table.insert(components.active[left], { -- search_count = {
-- provider = function() -- provider = function()
-- local s -- if vim.v.hlsearch == 0 then return '' end
-- local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO })) --
-- if count > 0 then -- local ok, result = pcall(vim.fn.searchcount, { maxcount = 999, timeout = 250 })
-- s = string.format(' %s %d ', '', count) -- 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 -- else
-- s = '' -- return file.file_type({}, { colored_icon = false, case = 'lowercase' })
-- end -- end
-- return s
-- end, -- end,
-- hl = { fg = palette.bg0, bg = palette.blue.base }, -- hl = { fg = palette.bg0, bg = palette.blue.base },
-- left_sep = { -- left_sep = {
-- always_visible = true, -- always_visible = true,
-- str = separators.slant_right, -- str = string.format('%s%s', separators.slant_left, separators.block),
-- hl = { fg = palette.magenta.base, bg = palette.blue.base }, -- hl = { fg = palette.blue.base, bg = 'none' },
-- },
-- })
-- 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 = { -- right_sep = {
-- always_visible = true, -- always_visible = true,
-- str = separators.slant_right, -- str = ' ',
-- hl = { fg = palette.orange.base, bg = 'none' }, -- 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$' } },
-- },
-- }
-- 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 { return {
'freddiehaddad/feline.nvim', -- Calls `require('slimline').setup({})`
config = config, "sschleemilch/slimline.nvim",
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 = { opts = {
force_inactive = { filetypes = { '^dapui_*', '^help$', '^neotest*', '^NvimTree$', '^qf$' } }, bold = false, -- makes primary parts and mode bold
disable = { filetypes = { '^alpha$' } }, 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 = '',
}, },
} }
}

View File

@@ -22,7 +22,7 @@ return {
-- not that this may cause higher CPU usage. -- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and -- This option is only respected when only_current_line and
-- autoSetHints both are true. -- autoSetHints both are true.
only_current_line_autocmd = { "CursorMoved" }, only_current_line_autocmd = { "CursorMoved", "CursorMovedI" },
-- whether to show parameter hints with the inlay hints or not -- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true, show_parameter_hints = true,
-- prefix for parameter hints -- prefix for parameter hints
@@ -30,7 +30,7 @@ return {
-- prefix for all the other hints (type, chaining) -- prefix for all the other hints (type, chaining)
other_hints_prefix = "", other_hints_prefix = "",
-- whether to align to the length of the longest line in the file -- 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 -- padding from the left if max_len_align is true
max_len_align_padding = 1, max_len_align_padding = 1,
-- whether to align to the extreme right or not -- whether to align to the extreme right or not
@@ -61,25 +61,6 @@ return {
TemplateTemplateParm = "🅃", TemplateTemplateParm = "🅃",
TemplateParamObject = "🅃", 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 = { highlights = {
detail = "Comment", detail = "Comment",
}, },
@@ -127,41 +108,37 @@ return {
-- }) -- })
require("clangd_extensions.inlay_hints").setup_autocmd() require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints() require("clangd_extensions.inlay_hints").set_inlay_hints()
require("better-diagnostic-virtual-text.api").setup_buf(ev.buf, {}) require("better-diagnostic-virtual-text.api").setup_buf(ev.buf, {
ui = {
local signs = { wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long
{ name = "DiagnosticSignError", text = "" }, 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
{ name = "DiagnosticSignWarn", text = "" }, 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
{ name = "DiagnosticSignHint", text = "" }, arrow = "",
{ name = "DiagnosticSignInfo", text = "" }, up_arrow = "",
} down_arrow = "",
above = false, -- the virtual text will be displayed above the line
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,
}, },
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 end
}) })
--local capabilities = vim.lsp.protocol.make_client_capabilities() --local capabilities = vim.lsp.protocol.make_client_capabilities()
local capabilities = require('cmp_nvim_lsp').default_capabilities() --local capabilities = require('cmp_nvim_lsp').default_capabilities()
local capabilities = require('blink.cmp').get_lsp_capabilities()
-- local capabilities = vim.tbl_deep_extend('force', -- local capabilities = vim.tbl_deep_extend('force',
-- vim.lsp.protocol.make_client_capabilities(), -- vim.lsp.protocol.make_client_capabilities(),
-- require('epo').register_cap() -- require('epo').register_cap()
-- ) -- )
capabilities.offsetEncoding = { "utf-16" } --capabilities.offsetEncoding = { "utf-16" }
nvim_lsp.groovyls.setup({ nvim_lsp.groovyls.setup({
cmd = { "java", "-jar", "/home/kmcr/tools/groovy-language-server/build/libs/groovy-language-server-all.jar" }, 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({ nvim_lsp.matlab_ls.setup({
cmd = { "matlab-language-server", "--stdio"}, cmd = { "matlab-language-server", "--stdio"},
filetypes = { "matlab" }, 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, single_file_support = true,
settings = { settings = {
matlab = { matlab = {

View File

@@ -16,10 +16,34 @@ return { {
-- TOC default string -- TOC default string
-- WARN -- WARN
toc_format = '%s- [%s](<%s#%s>)', toc_format = '%s- [%s](<%s#%s>)',
} },
ft = { "md", "markdown" },
}, { }, {
'SCJangra/table-nvim', 'SCJangra/table-nvim',
ft = 'markdown', ft = {'markdown', 'md' },
opts = {}, 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,
}
}

View File

@@ -1,149 +1,167 @@
return { return {
{ 'JoseConseco/cmp-ai', dependencies = 'nvim-lua/plenary.nvim', enabled = false}, {
{ 'petertriho/cmp-git', enabled = true}, "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 <c-u> is important for selections to work properly.
{
"<leader>oo",
":<c-u>lua require('ollama').prompt()<cr>",
desc = "ollama prompt",
mode = { "n", "v" },
},
-- Sample keybind for direct prompting. Note that the <c-u> is important for selections to work properly.
{
"<leader>oG",
":<c-u>lua require('ollama').prompt('Generate_Code')<cr>",
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
},
{
"mireq/luasnip-snippets",
dependencies = {
"L3MON4D3/LuaSnip"
},
config = function()
require('luasnip_snippets.common.snip_utils').setup()
end,
enabled = false
},
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
dependencies = {
"saadparwaiz1/cmp_luasnip"
},
-- follow latest release. -- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release) version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
dependencies = {
--'saadparwaiz1/cmp_luasnip'
},
-- install jsregexp (optional!). -- install jsregexp (optional!).
build = "make install_jsregexp", build = "make install_jsregexp",
config = function() config = function()
local ls = require("luasnip") -- Mandatory setup function
end 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"}, "<Tab>", function() if luasnip.expand_or_jumpable() then luasnip.expand_or_jump() else vim.api.nvim_input('<C-V><Tab>') end end, {silent = true})
vim.keymap.set({"i", "s"}, "<S-Tab>", function() luasnip.jump(-1) end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-E>", 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', 'hrsh7th/nvim-cmp',
dependencies = { dependencies = {
"L3MON4D3/LuaSnip",
--'mstanciu552/cmp-matlab',
'petertriho/cmp-git',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lsp-signature-help', 'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'hrsh7th/cmp-calc', 'hrsh7th/cmp-cmdline',
'JoseConseco/cmp-ai' 'hrsh7th/nvim-cmp',
'L3MON4D3/LuaSnip',
"saadparwaiz1/cmp_luasnip",
'tzachar/cmp-ai',
}, },
event = "InsertEnter",
config = function() config = function()
local cmp = require 'cmp' local cmp = require 'cmp'
--local cmp_ai = require('cmp_ai.config') local cmp_ai = require('cmp_ai.config')
local luasnip = require('luasnip')
-- cmp_ai:setup({ cmp_ai:setup({
-- max_lines = 100, max_lines = 100,
-- provider = 'Ollama', provider = 'Ollama',
-- provider_options = { provider_options = {
-- model = 'codellama', base_url = 'http://192.168.10.99:11434/api/generate',
-- base_url = 'http://batman.local:11434/api/generate', model = 'qwen2.5-coder:latest',
-- prompt = function(lines_before, lines_after) prompt = function(lines_before, lines_after)
-- -- prompt depends on the model you use. Here is an example for deepseek coder return "<|fim_prefix|>" .. lines_before .. "<|fim_suffix|>" .. lines_after .. "<|fim_middle|>"
-- return '<PRE> ' .. lines_before .. ' <SUF>' .. lines_after .. ' <MID>' -- for codellama end,
-- end, },
-- }, notify = true,
-- debounce_delay = 600, -- ms llama may be GPU hungry, wait x ms after last key input, before sending request to it notify_callback = function(msg)
-- notify = true, vim.notify(msg)
-- notify_callback = function(msg) end,
-- vim.notify(msg) run_on_every_keystroke = true,
-- 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 = { snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args) expand = function(args)
luasnip.lsp_expand(args.body) --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, end,
}, },
window = { window = {
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
experimental = {
ghost_text = true,
},
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<C-y>'] = cmp.mapping(function(fallback) ['<C-y>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
cmp.confirm({ select = true })
end)
--cmp.mapping.confirm({ select = true }),
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lsp_signature_help' }, -- { name = 'vsnip' }, -- For vsnip users.
{ name = 'path' }, { name = 'luasnip' }, -- For luasnip users.
{ name = 'luasnip' }, -- { name = 'ultisnips' }, -- For ultisnips users.
{ name = 'calc' }, -- { name = 'snippy' }, -- For snippy users.
{ name = 'cmp_git' }, --{ name = 'cmp_ai' }
}, { }, {
{ name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 }, { name = 'buffer' },
}), }),
--sources = sources, performance = {
sorting = { fetching_timeout = 20,
priority_weight = 2, debounce = 10,
comparators = { throttle = 10,
--require('cmp_ai.compare'), async_budget = 20000,
cmp.config.compare.offset, max_view_entries = 10,
cmp.config.compare.exact, confirm_resolve_timeout = 10,
cmp.config.compare.recently_used, filtering_context_budget = 10
require("clangd_extensions.cmp_scores"), }
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
}) })
-- 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({ '/', '?' }, { cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
@@ -151,25 +169,17 @@ return {
} }
}) })
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', { cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'path' } { name = 'path' }
}, { }, {
{ name = 'cmdline' } { name = 'cmdline' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
}) })
})
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{name = 'cmp_git' },
}, {
{name = 'buffer' }
})
})
require("cmp_git").setup()
end, end,
enabled = true enabled = false
} }
} }

View File

@@ -0,0 +1,6 @@
return {
"ZWindL/orphans.nvim",
config = function()
require('orphans').setup({})
end
}

View File

@@ -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,
}

View File

@@ -39,5 +39,6 @@ return {
--vim.fn.system('i3-msg move left') --vim.fn.system('i3-msg move left')
end end
end, {}) end, {})
end end,
enabled = false
} }

View File

@@ -0,0 +1,6 @@
return {
"ptdewey/pendulum-nvim",
config = function()
require("pendulum").setup()
end,
}

View File

@@ -0,0 +1,34 @@
return {
'stevearc/quicker.nvim',
config = function()
require('quicker').setup()
vim.keymap.set("n", "<leader>q", function()
require("quicker").toggle()
end, {
desc = "Toggle quickfix",
})
vim.keymap.set("n", "<leader>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
}

View File

@@ -5,17 +5,25 @@ return {
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.py", "*.R" }, pattern = { "*.py", "*.R" },
callback = function() callback = function()
-- Execute the current statement or block under the cursor
vim.keymap.set("n", '<CR>', function() vim.keymap.set("n", '<CR>', function()
require('nvim_ds_repl').send_statement_definition() require('nvim_ds_repl').send_statement_definition()
end, { noremap = true }) end, { noremap = true })
-- Execute the selected visual block of code
vim.keymap.set("v", '<CR>', function() vim.keymap.set("v", '<CR>', function()
require('nvim_ds_repl').send_visual_to_repl() require('nvim_ds_repl').send_visual_to_repl()
end, { noremap = true }) end, { noremap = true })
vim.keymap.set("n", '<leader>fa', function()
require('nvim_ds_repl').send_buffer_to_repl() -- Query global environment variable information
vim.keymap.set("n", '<leader>wi', function()
require('nvim_ds_repl').query_global()
end, { noremap = true })
-- Query information about the specific object under the cursor
vim.keymap.set("n", '<leader>si', function()
require('nvim_ds_repl').inspect()
end, { noremap = true }) end, { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>pp', "<cmd>lua require('nvim_ds_repl').get_envs()<CR>", {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>pj', "<cmd>lua require('nvim_ds_repl').inspect()<CR>", {noremap = true, silent = true})
end end
}) })
end end

View File

@@ -1,5 +1,5 @@
return { return {
'edluffy/specs.nvim', 'cxwx/specs.nvim',
config = function() config = function()
require('specs').setup{ require('specs').setup{
show_jumps = true, show_jumps = true,

View File

@@ -23,5 +23,6 @@ return {
-- Call insert link automatically when we start typing a link -- Call insert link automatically when we start typing a link
vim.keymap.set("i", "[[", "<cmd>Telekasten insert_link<CR>") vim.keymap.set("i", "[[", "<cmd>Telekasten insert_link<CR>")
end end,
enabled = false
} }

View File

@@ -0,0 +1,3 @@
return {
"QuentinGruber/timespent.nvim",
}

View File

@@ -11,6 +11,7 @@ return {
extra_groups = {}, -- table: additional groups that should be cleared extra_groups = {}, -- table: additional groups that should be cleared
exclude_groups = {}, -- table: groups you don't want to clear exclude_groups = {}, -- table: groups you don't want to clear
}) })
vim.cmd([[TransparentEnable]])
end, end,
--cmd = {"TransparentEnable", "TransparentDisable", "TransparentToggle" }, --cmd = {"TransparentEnable", "TransparentDisable", "TransparentToggle" },
} }

View File

@@ -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' }
}

View File

@@ -0,0 +1,15 @@
return {
"daltongd/yanklock.nvim",
opts = {
notify = true, -- optional
},
keys = {
{
"<leader>yl",
function()
require("yanklock").toggle()
end,
desc = "yanklock toggle",
},
},
}