started 2026 config update
This commit is contained in:
@@ -1,2 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
|
"nomnivore/ollama.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim"
|
||||||
|
},
|
||||||
|
cmd = { "Ollama", "OllamaServe", "OllamaModel", "OllamaServeStop" },
|
||||||
|
opts = {}
|
||||||
}
|
}
|
||||||
|
|||||||
76
lua/barink/plugins/completions.lua
Normal file
76
lua/barink/plugins/completions.lua
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
"onsails/lspkind.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("lspkind").init({})
|
||||||
|
vim.opt.completeopt = { "menu", "menuone", "noselect", "preview" }
|
||||||
|
local cmp = require('cmp')
|
||||||
|
local lspkind = require("lspkind")
|
||||||
|
cmp.setup({
|
||||||
|
formatting = {
|
||||||
|
format = lspkind.cmp_format({
|
||||||
|
mode = 'symbol',
|
||||||
|
maxwidth = 60,
|
||||||
|
ellipsis_char = '...',
|
||||||
|
show_labelDetails = true,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<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.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp', keyword_length = 1 },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'buffer', keyword_length = 2 },
|
||||||
|
}),
|
||||||
|
window = {
|
||||||
|
documentation = cmp.config.window.bordered()
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Set configuration for specific filetype.
|
||||||
|
cmp.setup.filetype('gitcommit', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.filetype({ "sql" }, {
|
||||||
|
sources = {
|
||||||
|
{ name = "vim-dadbod-completion" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
}
|
||||||
|
})
|
||||||
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
-- 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 = 'buffer' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
}),
|
||||||
|
matching = { disallow_symbol_nonprefix_matching = false }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
return {
|
|
||||||
"kristijanhusak/vim-dadbod-ui",
|
|
||||||
dependencies = {
|
|
||||||
{'tpope/vim-dadbod', lazy = true },
|
|
||||||
{ 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql'}, lazy = true },
|
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
'DBUI',
|
|
||||||
'DBUIToggle',
|
|
||||||
'DBUIAddConnection',
|
|
||||||
'DBUIFindBuffer',
|
|
||||||
},
|
|
||||||
init = function ()
|
|
||||||
vim.g.db_ui_use_nerd_fonts = 1
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,120 +1,24 @@
|
|||||||
return
|
return
|
||||||
{
|
{
|
||||||
'neovim/nvim-lspconfig',
|
"williamboman/mason.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
|
||||||
"folke/neoconf.nvim",
|
|
||||||
opts = {}
|
|
||||||
},
|
|
||||||
"williamboman/mason-lspconfig",
|
"williamboman/mason-lspconfig",
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"hrsh7th/cmp-cmdline",
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
{
|
|
||||||
'L3MON4D3/LuaSnip',
|
|
||||||
dependencies = {
|
|
||||||
'hrsh7th/nvim-cmp',
|
|
||||||
'rafamadriz/friendly-snippets',
|
|
||||||
},
|
|
||||||
version = "v2.*",
|
|
||||||
},
|
|
||||||
{ 'mfussenegger/nvim-jdtls', dependencies = { 'nvim-dap' } },
|
{ 'mfussenegger/nvim-jdtls', dependencies = { 'nvim-dap' } },
|
||||||
"onsails/lspkind.nvim",
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.opt.completeopt = { "menu", "menuone", "noselect", "preview" }
|
|
||||||
require("lspkind").init({})
|
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" }
|
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" }
|
||||||
})
|
})
|
||||||
local ls = require("luasnip")
|
|
||||||
ls.config.set_config({
|
|
||||||
history = true,
|
|
||||||
updateevents = "TextChanged, TextChangedI",
|
|
||||||
enable_autosnippets = true,
|
|
||||||
})
|
|
||||||
local cmp = require('cmp')
|
|
||||||
local lspkind = require("lspkind")
|
|
||||||
cmp.setup({
|
|
||||||
formatting = {
|
|
||||||
format = lspkind.cmp_format({
|
|
||||||
mode = 'symbol',
|
|
||||||
maxwidth = 60,
|
|
||||||
ellipsis_char = '...',
|
|
||||||
show_labelDetails = true,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<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.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'nvim_lsp', keyword_length = 1 },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
{ name = 'path' },
|
|
||||||
{ name = 'buffer', keyword_length = 2 },
|
|
||||||
}),
|
|
||||||
window = {
|
|
||||||
documentation = cmp.config.window.bordered()
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Set configuration for specific filetype.
|
|
||||||
cmp.setup.filetype('gitcommit', {
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup.filetype({ "sql" }, {
|
|
||||||
sources = {
|
|
||||||
{ name = "vim-dadbod-completion" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
}
|
|
||||||
})
|
|
||||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
|
||||||
-- 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 = 'buffer' }
|
|
||||||
}, {
|
|
||||||
{ name = 'cmdline' }
|
|
||||||
}),
|
|
||||||
matching = { disallow_symbol_nonprefix_matching = false }
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
vim.keymap.set({ "i", "s" }, "<C-K>", function() ls.expand() end, { silent = true })
|
|
||||||
vim.keymap.set({ "i", "s" }, "<C-n>", function() ls.jump(1) end, { silent = true })
|
|
||||||
vim.keymap.set({ "i", "s" }, "<C-p>", function() ls.jump(-1) end, { silent = true })
|
|
||||||
vim.keymap.set({ "i", "s" }, "<C-E>", function()
|
|
||||||
if ls.choice_active() then
|
|
||||||
ls.change_choice(1)
|
|
||||||
end
|
|
||||||
end, { silent = true })
|
|
||||||
|
|
||||||
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/barink/snippets" })
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
-- Set up lspconfig.
|
-- Set up lspconfig.
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
local lsp = vim.lsp.config
|
|
||||||
|
for _, data in ipairs(capabilities) do
|
||||||
|
print(data)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local language_server = {
|
local language_server = {
|
||||||
asm_lsp = true,
|
asm_lsp = true,
|
||||||
mojo = true,
|
mojo = true,
|
||||||
@@ -131,8 +35,7 @@ return
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clangd = {
|
clangd = {
|
||||||
capabilities = capabilities,
|
root_dir = vim.fs.root(0, { 'compile_commands.json', 'compile_flags.txt', '.git' }),
|
||||||
root_dir = vim.fs.root(0, { 'compile_commands.json', 'compile_flags.txt', '.git' }), -- require("lspconfig").util.root_pattern("compile_commands.json", "compile_flags.txt", ".git"),
|
|
||||||
cmd = { "clangd" },
|
cmd = { "clangd" },
|
||||||
filetypes = { "c", "cpp", "objc", "objcpp" },
|
filetypes = { "c", "cpp", "objc", "objcpp" },
|
||||||
settings = {
|
settings = {
|
||||||
@@ -145,24 +48,19 @@ return
|
|||||||
gopls = true,
|
gopls = true,
|
||||||
intelephense = true,
|
intelephense = true,
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
config = {
|
cmd = { "lua-language-server" },
|
||||||
settings = {
|
filetypes = { 'lua' },
|
||||||
Lua = {
|
settings = {
|
||||||
runtime = {
|
Lua = {
|
||||||
version = 'LuaJIT',
|
runtime = {
|
||||||
},
|
version = 'LuaJIT',
|
||||||
workspace = {
|
},
|
||||||
checkThirdParty = false,
|
diagnostics = {
|
||||||
library = {
|
globals = { 'vim' }
|
||||||
vim.env.VIMRUNTIME
|
|
||||||
}
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim' }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
26
lua/barink/plugins/snippets.lua
Normal file
26
lua/barink/plugins/snippets.lua
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
return {
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
dependencies = {
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
'rafamadriz/friendly-snippets',
|
||||||
|
},
|
||||||
|
version = "v2.*",
|
||||||
|
config = function()
|
||||||
|
local ls = require("luasnip")
|
||||||
|
ls.config.set_config({
|
||||||
|
history = true,
|
||||||
|
updateevents = "TextChanged, TextChangedI",
|
||||||
|
enable_autosnippets = true,
|
||||||
|
})
|
||||||
|
vim.keymap.set({ "i", "s" }, "<C-K>", function() ls.expand() end, { silent = true })
|
||||||
|
vim.keymap.set({ "i", "s" }, "<C-n>", function() ls.jump(1) end, { silent = true })
|
||||||
|
vim.keymap.set({ "i", "s" }, "<C-p>", function() ls.jump(-1) end, { silent = true })
|
||||||
|
vim.keymap.set({ "i", "s" }, "<C-E>", function()
|
||||||
|
if ls.choice_active() then
|
||||||
|
ls.change_choice(1)
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/barink/snippets" })
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user