mirror of
https://github.com/TheM1Stery/dotfiles.git
synced 2025-04-20 09:01:11 +00:00
Compare commits
No commits in common. "cf1e4aae1c609e5a64a73bf0765a523ad8401632" and "63965068e6f7c52ab5e9aaf845d8f1cb689ad385" have entirely different histories.
cf1e4aae1c
...
63965068e6
@ -2,8 +2,12 @@
|
||||
"Ionide-vim": { "branch": "master", "commit": "c7e8973426431839e9d888a4aa8d6a41251ba16f" },
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
|
||||
"blink.cmp": { "branch": "main", "commit": "18b352d12b35bca148427b607098df14b75a218f" },
|
||||
"cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"codesnap.nvim": { "branch": "main", "commit": "6400480aa6cc366cbd931146c429aaa64680dab9" },
|
||||
"conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" },
|
||||
"copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" },
|
||||
@ -31,6 +35,7 @@
|
||||
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
|
||||
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
|
||||
"nvim-dap": { "branch": "master", "commit": "52302f02fea3a490e55475de52fa4deb8af2eb11" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
|
||||
"nvim-lightbulb": { "branch": "master", "commit": "f7f61c47af5bf701b1f4af127bc565ab6491acbf" },
|
||||
@ -51,7 +56,6 @@
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "011d98eaa3a73b5a51d82ce5bc6b1397dde95562" },
|
||||
"roslyn.nvim": { "branch": "main", "commit": "633a61c30801a854cf52f4492ec8702a8c4ec0e9" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "f03035fa03ccb36cd26d0792c946fbacba1d1a39" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "4e13b24e999e844ad4e6cd9dd1bc7021262ee4d6" },
|
||||
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
|
||||
|
@ -1,50 +0,0 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
version = '*',
|
||||
|
||||
---@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 = 'super-tab' },
|
||||
completion = {
|
||||
menu = { border = 'single' },
|
||||
documentation = { window = { border = 'single' } },
|
||||
},
|
||||
signature = { window = { border = 'single' } },
|
||||
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' },
|
||||
per_filetype = {
|
||||
sql = { 'snippets', 'dadbod', 'buffer' },
|
||||
},
|
||||
-- add vim-dadbod-completion to your completion providers
|
||||
providers = {
|
||||
dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink" },
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
-- make lazydev completions top priority (see `:h blink.cmp`)
|
||||
score_offset = 100,
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
@ -33,22 +33,18 @@ return {
|
||||
}
|
||||
}
|
||||
|
||||
dap.adapters.coreclr = {
|
||||
type = "executable",
|
||||
command = vim.fn.stdpath("data") .. "/mason/bin/netcoredbg",
|
||||
args = { '--interpreter=vscode' }
|
||||
}
|
||||
|
||||
|
||||
dap.configurations.cs = {
|
||||
{
|
||||
name = "launch - netcoredbg",
|
||||
type = "coreclr",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file')
|
||||
end
|
||||
}
|
||||
}
|
||||
-- dap.configurations.rust = {
|
||||
-- {
|
||||
-- name = "Rust Debug",
|
||||
-- type = "codelldb",
|
||||
-- request = "launch",
|
||||
-- program = function()
|
||||
-- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug", "file")
|
||||
-- end,
|
||||
-- cwd = "${workspaceFolder}",
|
||||
-- stopOnEntry = true,
|
||||
-- showDisassembly = "never"
|
||||
-- }
|
||||
-- }
|
||||
end
|
||||
}
|
||||
|
@ -45,6 +45,11 @@ return {
|
||||
},
|
||||
"SmiteshP/nvim-navic",
|
||||
"Decodetalkers/csharpls-extended-lsp.nvim",
|
||||
-- {
|
||||
-- "lukas-reineke/headlines.nvim",
|
||||
-- dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
-- config = true, -- or `opts = {}`
|
||||
-- },
|
||||
{
|
||||
'MeanderingProgrammer/markdown.nvim',
|
||||
main = "render-markdown",
|
||||
|
14
nvim/lua/themystery/plugins/lazydev.lua
Normal file
14
nvim/lua/themystery/plugins/lazydev.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
|
||||
}
|
@ -26,18 +26,6 @@ return {
|
||||
vim.keymap.set("n", "<leader>cf", crates.show_features_popup, opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
|
||||
{
|
||||
"ray-x/go.nvim",
|
||||
dependencies = { -- optional packages
|
||||
@ -47,20 +35,25 @@ return {
|
||||
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
|
||||
},
|
||||
{
|
||||
"seblyng/roslyn.nvim",
|
||||
ft = "cs",
|
||||
opts = {
|
||||
}
|
||||
},
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v3.x',
|
||||
dependencies = {
|
||||
-- Mason
|
||||
-- LSP Support
|
||||
'neovim/nvim-lspconfig',
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Autocompletion
|
||||
'saghen/blink.cmp',
|
||||
'hrsh7th/nvim-cmp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
|
||||
-- Snippets
|
||||
'L3MON4D3/LuaSnip',
|
||||
'rafamadriz/friendly-snippets',
|
||||
|
||||
-- extras
|
||||
"SmiteshP/nvim-navic",
|
||||
@ -70,7 +63,6 @@ return {
|
||||
-- specific language servers
|
||||
'mrcjkb/rustaceanvim',
|
||||
'ray-x/go.nvim',
|
||||
'seblyng/roslyn.nvim'
|
||||
},
|
||||
config = function()
|
||||
-- unknown filetypes(needed for some lsp servers)
|
||||
@ -83,78 +75,24 @@ return {
|
||||
}
|
||||
|
||||
|
||||
local lsp = require("lsp-zero")
|
||||
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||
|
||||
local lspconfig_defaults = require('lspconfig').util.default_config
|
||||
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
|
||||
'force',
|
||||
lspconfig_defaults.capabilities,
|
||||
require('blink.cmp').get_lsp_capabilities()
|
||||
)
|
||||
|
||||
|
||||
|
||||
local navic = require("nvim-navic")
|
||||
|
||||
local navbuddy = require("nvim-navbuddy")
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(event)
|
||||
local opts = { buffer = event.buf, remap = false }
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
vim.lsp.inlay_hint.enable(true)
|
||||
if client and client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, event.buf)
|
||||
navbuddy.attach(client, event.buf)
|
||||
end
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "gD", function() vim.lsp.buf.declaration() end, opts)
|
||||
vim.keymap.set("n", "<leader>dc", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>ed", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
-- for the code action key map to work you need to change key binding('.' symbol) of your terminal, otherwise it won't work
|
||||
vim.keymap.set("n", "<C-.>", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>gr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
-- sometimes lsp fails, we can restart it with this keymap
|
||||
vim.keymap.set('n', "<leader>lr", vim.cmd.LspRestart, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>nv", function() navbuddy.open() end, opts)
|
||||
end
|
||||
})
|
||||
|
||||
require("go").setup({
|
||||
lsp_cfg = false
|
||||
})
|
||||
|
||||
local noop = function() end
|
||||
|
||||
local gopls_opts = require("go.lsp").config()
|
||||
local handlers = {
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup {}
|
||||
end,
|
||||
rust_analyzer = noop,
|
||||
fsautocomplete = noop,
|
||||
gopls = function()
|
||||
require('lspconfig').gopls.setup(gopls_opts)
|
||||
end,
|
||||
yamlls = function()
|
||||
require('lspconfig').yamlls.setup {
|
||||
lsp.configure('yamlls', {
|
||||
filetypes = { 'yaml', 'yaml.openapi' }
|
||||
})
|
||||
|
||||
lsp.configure('csharp_ls', {
|
||||
handlers = {
|
||||
["textDocument/definition"] = require("csharpls_extended").handler,
|
||||
["textDocument/typeDefinition"] = require("csharpls_extended").handler
|
||||
}
|
||||
end,
|
||||
clangd = function()
|
||||
require("lspconfig").clangd.setup {
|
||||
})
|
||||
|
||||
lsp.configure('clangd', {
|
||||
cmd = { 'clangd', '--offset-encoding=utf-16' },
|
||||
}
|
||||
end,
|
||||
cssls = function()
|
||||
require("lspconfig").cssls.setup {
|
||||
})
|
||||
-- this code makes it so that the css language server doesn't complain about tailwindcss classes
|
||||
lsp.configure("cssls", {
|
||||
settings = {
|
||||
css = {
|
||||
lint = { unknownAtRules = "ignore" }
|
||||
@ -166,10 +104,11 @@ return {
|
||||
lint = { unknownAtRules = "ignore" }
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
tailwindcss = function()
|
||||
require("lspconfig").tailwindcss.setup {
|
||||
})
|
||||
|
||||
lsp.configure("tailwindcss", {
|
||||
settings = {
|
||||
},
|
||||
filetypes = {
|
||||
"astro",
|
||||
"handlebars",
|
||||
@ -183,35 +122,154 @@ return {
|
||||
"templ"
|
||||
},
|
||||
init_options = { userLanguages = { rust = "html", templ = "html" } },
|
||||
}
|
||||
end
|
||||
}
|
||||
})
|
||||
--
|
||||
-- lsp.configure("rust_analyzer", {
|
||||
-- settings = {
|
||||
-- ["rust-analyzer"] = {
|
||||
-- checkOnSave = true,
|
||||
-- check = {
|
||||
-- command = "clippy"
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
|
||||
require("mason").setup({
|
||||
registries = {
|
||||
'github:mason-org/mason-registry',
|
||||
'github:Crashdummyy/mason-registry'
|
||||
}
|
||||
});
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { 'ts_ls', 'svelte', 'lua_ls', 'rust_analyzer', 'gopls' },
|
||||
handlers = handlers,
|
||||
automatic_installation = false
|
||||
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_action = lsp.cmp_action()
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
local tailwindcss_colors = require('tailwindcss-colorizer-cmp')
|
||||
|
||||
local cmp_formatter = function(entry, vim_item)
|
||||
-- vim_item as processed by tailwindcss-colorizer-cmp
|
||||
vim_item = tailwindcss_colors.formatter(entry, vim_item)
|
||||
|
||||
-- change menu (name of source)
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
buffer = "[Buffer]",
|
||||
path = "[Path]",
|
||||
emoji = "[Emoji]",
|
||||
luasnip = "[LuaSnip]",
|
||||
vsnip = "[VSCode Snippet]",
|
||||
calc = "[Calc]",
|
||||
spell = "[Spell]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end
|
||||
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
fields = { "abbr", "menu", "kind" },
|
||||
format = cmp_formatter,
|
||||
},
|
||||
preselect = 'item',
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert'
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'buffer', keyword_length = 3 },
|
||||
{ name = 'luasnip', keyword_length = 2 },
|
||||
{ name = 'lazydev', group_index = 0 }
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- confirm completion item
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Insert }),
|
||||
['<Tab>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
|
||||
|
||||
-- toggle completion menu
|
||||
['<C-e>'] = cmp_action.toggle_completion(),
|
||||
|
||||
-- tab complete
|
||||
-- ['<Tab>'] = cmp_action.tab_complete(),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- navigate between snippet placeholder
|
||||
['<C-d>'] = cmp_action.luasnip_jump_forward(),
|
||||
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
||||
|
||||
-- scroll documentation window
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(5),
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-5),
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
local navic = require("nvim-navic")
|
||||
|
||||
local navbuddy = require("nvim-navbuddy")
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
lsp.default_keymaps({ buffer = bufnr })
|
||||
vim.lsp.inlay_hint.enable(true)
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
navbuddy.attach(client, bufnr)
|
||||
end
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "<leader>dc", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>ed", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
-- for the code action key map to work you need to change key binding('.' symbol) of your terminal, otherwise it won't work
|
||||
vim.keymap.set("n", "<C-.>", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>drr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
-- sometimes lsp fails, we can restart it with this keymap
|
||||
vim.keymap.set('n', "<leader>lr", vim.cmd.LspRestart, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>nv", function() navbuddy.open() end, opts)
|
||||
end)
|
||||
|
||||
require("mason").setup({});
|
||||
require("go").setup({
|
||||
lsp_cfg = false
|
||||
})
|
||||
|
||||
local gopls_opts = require("go.lsp").config()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { 'ts_ls', 'svelte', 'lua_ls', 'csharp_ls', 'rust_analyzer', 'gopls' },
|
||||
handlers = {
|
||||
lsp.default_setup,
|
||||
lua_ls = function()
|
||||
local lua_opts = lsp.nvim_lua_ls()
|
||||
require('lspconfig').lua_ls.setup(lua_opts)
|
||||
end,
|
||||
rust_analyzer = lsp.noop,
|
||||
fsautocomplete = lsp.noop,
|
||||
gopls = function()
|
||||
require('lspconfig').gopls.setup(gopls_opts)
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
lsp.set_sign_icons({
|
||||
error = '✘',
|
||||
warn = '▲',
|
||||
hint = '⚑',
|
||||
info = ''
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
severity_sort = true,
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = '✘',
|
||||
[vim.diagnostic.severity.WARN] = '▲',
|
||||
[vim.diagnostic.severity.HINT] = '⚑',
|
||||
[vim.diagnostic.severity.INFO] = ''
|
||||
|
||||
}
|
||||
},
|
||||
float = {
|
||||
style = 'minimal',
|
||||
border = 'rounded',
|
||||
|
@ -5,6 +5,40 @@ return {
|
||||
ft = sql_ft,
|
||||
dependencies = { 'tpope/vim-dadbod', lazy = true },
|
||||
lazy = true,
|
||||
init = function()
|
||||
-- vim.api.nvim_create_autocmd("FileType", {
|
||||
-- pattern = {
|
||||
-- "sql",
|
||||
-- },
|
||||
-- command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||
-- })
|
||||
|
||||
-- taken from here https://github.com/kristijanhusak/vim-dadbod-completion/issues/53#issuecomment-1902659351
|
||||
local autocomplete_group = vim.api.nvim_create_augroup("vimrc_autocompletion", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = sql_ft,
|
||||
callback = function()
|
||||
local cmp = require("cmp")
|
||||
local global_sources = cmp.get_config().sources
|
||||
local buffer_sources = {}
|
||||
|
||||
-- add globally defined sources (see separate nvim-cmp config)
|
||||
-- this makes e.g. luasnip snippets available since luasnip is configured globally
|
||||
if global_sources then
|
||||
for _, source in ipairs(global_sources) do
|
||||
table.insert(buffer_sources, { name = source.name })
|
||||
end
|
||||
end
|
||||
|
||||
-- add vim-dadbod-completion source
|
||||
table.insert(buffer_sources, { name = "vim-dadbod-completion" })
|
||||
|
||||
-- update sources for the current buffer
|
||||
cmp.setup.buffer({ sources = buffer_sources })
|
||||
end,
|
||||
group = autocomplete_group,
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
'kristijanhusak/vim-dadbod-ui',
|
||||
|
@ -17,24 +17,17 @@ return {
|
||||
vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds)
|
||||
vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith) -- closeAllFolds == closeFoldsWith(0)
|
||||
|
||||
local lsp_capabilities = vim.tbl_deep_extend(
|
||||
'force',
|
||||
require('blink.cmp').get_lsp_capabilities(),
|
||||
{
|
||||
local lsp = require('lsp-zero')
|
||||
|
||||
lsp.set_server_config({
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
local lspconfig_defaults = require('lspconfig').util.default_config
|
||||
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
|
||||
'force',
|
||||
lspconfig_defaults.capabilities,
|
||||
lsp_capabilities
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ fi
|
||||
|
||||
# Created by newuser for 5.9
|
||||
|
||||
|
||||
# zsh settigns
|
||||
|
||||
# my alliases are in ~/.profile so this just sources it
|
||||
@ -25,6 +26,8 @@ source <(copilot completion zsh)
|
||||
export HISTSIZE=10000
|
||||
export SAVEHIST=10000
|
||||
|
||||
|
||||
|
||||
_dotnet_zsh_complete()
|
||||
{
|
||||
local completions=("$(dotnet complete "$words")")
|
||||
@ -40,6 +43,7 @@ _dotnet_zsh_complete()
|
||||
_values = "${(ps:\n:)completions}"
|
||||
}
|
||||
|
||||
|
||||
# useful plugins
|
||||
source ~/.zsh/zsh-autocomplete/zsh-autocomplete.plugin.zsh
|
||||
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
@ -82,3 +86,6 @@ export BUN_INSTALL="$HOME/.bun"
|
||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||
export FP='fzf --preview="bat --style=numbers --color=always --line-range :500 {}"'
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user