Nvim: use blink instead of cmp
This commit is contained in:
39
.config/nvim/lua/plugins/blink.lua
Normal file
39
.config/nvim/lua/plugins/blink.lua
Normal 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" }
|
||||
}
|
||||
@@ -6,64 +6,40 @@ return {
|
||||
|
||||
config = function()
|
||||
require('themify').setup({
|
||||
activity = true,
|
||||
"xero/miasma.nvim",
|
||||
"wuelnerdotexe/vim-enfocado",
|
||||
{
|
||||
"fenetikm/falcon",
|
||||
branch = "master"
|
||||
},
|
||||
"casr/vim-colors-reference",
|
||||
"blazkowolf/gruber-darker.nvim",
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
branch = "master"
|
||||
},
|
||||
{
|
||||
"jaredgorski/spacecamp",
|
||||
branch = "master"
|
||||
},
|
||||
{
|
||||
"lifepillar/vim-gruvbox8",
|
||||
branch = "master"
|
||||
},
|
||||
"marko-cerovac/material.nvim",
|
||||
{
|
||||
"srcery-colors/srcery-vim",
|
||||
branch = "master"
|
||||
},
|
||||
{
|
||||
"tanvirtin/monokai.nvim",
|
||||
branch = "master"
|
||||
},
|
||||
"dasupradyumna/midnight.nvim",
|
||||
{
|
||||
"bluz71/vim-moonfly-colors",
|
||||
branch = "master"
|
||||
},
|
||||
{
|
||||
"kuznetsss/meadow.nvim",
|
||||
branch = "master"
|
||||
},
|
||||
"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',
|
||||
'paulo-granthon/hyper.nvim',
|
||||
'diegoulloao/neofusion.nvim',
|
||||
'aktersnurra/no-clown-fiesta.nvim',
|
||||
'kdheepak/monochrome.nvim',
|
||||
'ficcdaf/ashen.nvim',
|
||||
'default'
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
@@ -14,4 +14,10 @@ return {{
|
||||
{
|
||||
"chrisbra/csv.vim",
|
||||
ft = { "csv" }
|
||||
},
|
||||
{
|
||||
"hat0uma/csvview.nvim",
|
||||
ft = { "csv" },
|
||||
cmd = { "CsvViewEnable" },
|
||||
config = true
|
||||
}}
|
||||
|
||||
14
.config/nvim/lua/plugins/cursor.lua
Normal file
14
.config/nvim/lua/plugins/cursor.lua
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
94
.config/nvim/lua/plugins/devcontainer.lua
Normal file
94
.config/nvim/lua/plugins/devcontainer.lua
Normal 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,
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ return
|
||||
opts = {
|
||||
keepFoldsAcrossSessions = false,
|
||||
},
|
||||
enabled = true
|
||||
enabled = false
|
||||
}, {
|
||||
"kevinhwang91/nvim-ufo",
|
||||
dependencies = {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -11,5 +11,7 @@ return {
|
||||
-- vim.keymap.set('n', '<leader>jT', function()
|
||||
-- require('treesj').toggle({ split = { recursive = true } })
|
||||
-- end)
|
||||
end
|
||||
end,
|
||||
-- it is loading very long or is it treesitter?
|
||||
enabled = false
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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 = {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,175 +1,185 @@
|
||||
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",
|
||||
dependencies = {
|
||||
"saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
dependencies = {
|
||||
--'saadparwaiz1/cmp_luasnip'
|
||||
},
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
end
|
||||
},
|
||||
{
|
||||
-- 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"}, "<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',
|
||||
dependencies = {
|
||||
"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-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-calc',
|
||||
'JoseConseco/cmp-ai'
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'hrsh7th/nvim-cmp',
|
||||
'L3MON4D3/LuaSnip',
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
'tzachar/cmp-ai',
|
||||
},
|
||||
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local cmp = require'cmp'
|
||||
--local cmp_ai = require('cmp_ai.config')
|
||||
local luasnip = require('luasnip')
|
||||
local cmp = require 'cmp'
|
||||
local cmp_ai = require('cmp_ai.config')
|
||||
|
||||
-- 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 '<PRE> ' .. lines_before .. ' <SUF>' .. lines_after .. ' <MID>' -- 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_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.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
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,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-y>'] = cmp.mapping(function(fallback)
|
||||
cmp.confirm({ select = true })
|
||||
end)
|
||||
--cmp.mapping.confirm({ select = true }),
|
||||
['<C-y>'] = 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 = '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' }
|
||||
}
|
||||
})
|
||||
|
||||
-- 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 = '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,
|
||||
enabled = true
|
||||
}
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
6
.config/nvim/lua/plugins/orphans.lua
Normal file
6
.config/nvim/lua/plugins/orphans.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"ZWindL/orphans.nvim",
|
||||
config = function()
|
||||
require('orphans').setup({})
|
||||
end
|
||||
}
|
||||
57
.config/nvim/lua/plugins/paint.lua
Normal file
57
.config/nvim/lua/plugins/paint.lua
Normal 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,
|
||||
}
|
||||
@@ -39,5 +39,6 @@ return {
|
||||
--vim.fn.system('i3-msg move left')
|
||||
end
|
||||
end, {})
|
||||
end
|
||||
end,
|
||||
enabled = false
|
||||
}
|
||||
|
||||
6
.config/nvim/lua/plugins/pendulum.lua
Normal file
6
.config/nvim/lua/plugins/pendulum.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"ptdewey/pendulum-nvim",
|
||||
config = function()
|
||||
require("pendulum").setup()
|
||||
end,
|
||||
}
|
||||
34
.config/nvim/lua/plugins/quicker.lua
Normal file
34
.config/nvim/lua/plugins/quicker.lua
Normal 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
|
||||
}
|
||||
@@ -1,21 +1,29 @@
|
||||
return {
|
||||
"petrichorma/nvim_ds_repl",
|
||||
requires = "nvim-treesitter",
|
||||
config = function ()
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*.py", "*.R"},
|
||||
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", '<CR>', 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", '<CR>', function()
|
||||
require('nvim_ds_repl').send_visual_to_repl()
|
||||
end, {noremap = true})
|
||||
vim.keymap.set("n", '<leader>fa', function()
|
||||
require('nvim_ds_repl').send_buffer_to_repl()
|
||||
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, { noremap = true })
|
||||
|
||||
-- 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
|
||||
})
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
return {
|
||||
'edluffy/specs.nvim',
|
||||
'cxwx/specs.nvim',
|
||||
config = function()
|
||||
require('specs').setup{
|
||||
show_jumps = true,
|
||||
|
||||
@@ -23,5 +23,6 @@ return {
|
||||
|
||||
-- Call insert link automatically when we start typing a link
|
||||
vim.keymap.set("i", "[[", "<cmd>Telekasten insert_link<CR>")
|
||||
end
|
||||
end,
|
||||
enabled = false
|
||||
}
|
||||
|
||||
3
.config/nvim/lua/plugins/timespent.lua
Normal file
3
.config/nvim/lua/plugins/timespent.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"QuentinGruber/timespent.nvim",
|
||||
}
|
||||
@@ -11,6 +11,7 @@ return {
|
||||
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" },
|
||||
}
|
||||
|
||||
12
.config/nvim/lua/plugins/vimwiki.lua
Normal file
12
.config/nvim/lua/plugins/vimwiki.lua
Normal 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' }
|
||||
}
|
||||
15
.config/nvim/lua/plugins/yanklock.lua
Normal file
15
.config/nvim/lua/plugins/yanklock.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
"daltongd/yanklock.nvim",
|
||||
opts = {
|
||||
notify = true, -- optional
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>yl",
|
||||
function()
|
||||
require("yanklock").toggle()
|
||||
end,
|
||||
desc = "yanklock toggle",
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user