minor refactoring

moved the lsp.signature to ui repo to be available for non-nvchad users too
This commit is contained in:
siduck 2024-06-27 09:28:14 +05:30
parent 61b336c030
commit 230b6c867e
8 changed files with 15 additions and 16 deletions

View File

@ -1,3 +1,5 @@
dofile(vim.g.base46_cache .. "git")
local options = { local options = {
signs = { signs = {
add = { text = "" }, add = { text = "" },

View File

@ -1,9 +1,8 @@
local M = {} local M = {}
local map = vim.keymap.set local map = vim.keymap.set
local conf = require("nvconfig").ui.lsp
-- export on_attach & capabilities -- export on_attach & capabilities
M.on_attach = function(client, bufnr) M.on_attach = function(_, bufnr)
local function opts(desc) local function opts(desc)
return { buffer = bufnr, desc = "LSP " .. desc } return { buffer = bufnr, desc = "LSP " .. desc }
end end
@ -27,11 +26,6 @@ M.on_attach = function(client, bufnr)
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Code action") map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Code action")
map("n", "gr", vim.lsp.buf.references, opts "Show references") map("n", "gr", vim.lsp.buf.references, opts "Show references")
-- setup signature popup
if conf.signature and client.server_capabilities.signatureHelpProvider then
require("nvchad.lsp.signature").setup(client, bufnr)
end
end end
-- disable semanticTokens -- disable semanticTokens

View File

@ -1,5 +1,7 @@
dofile(vim.g.base46_cache .. "mason")
local options = { local options = {
ensure_installed = { "lua-language-server", 'stylua' }, -- not an option from mason.nvim ensure_installed = { "lua-language-server", "stylua" }, -- not an option from mason.nvim
PATH = "skip", PATH = "skip",

View File

@ -1,3 +1,5 @@
dofile(vim.g.base46_cache .. "nvimtree")
local options = { local options = {
filters = { filters = {
dotfiles = false, dotfiles = false,

View File

@ -1,3 +1,5 @@
dofile(vim.g.base46_cache .. "telescope")
local options = { local options = {
defaults = { defaults = {
vimgrep_arguments = { vimgrep_arguments = {

View File

@ -1,3 +1,6 @@
dofile(vim.g.base46_cache .. "syntax")
dofile(vim.g.base46_cache .. "treesitter")
local options = { local options = {
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" }, ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },

View File

@ -55,7 +55,7 @@ g["loaded_perl_provider"] = 0
g["loaded_ruby_provider"] = 0 g["loaded_ruby_provider"] = 0
-- add binaries installed by mason.nvim to path -- add binaries installed by mason.nvim to path
local is_windows = vim.fn.has("win32") ~= 0 local is_windows = vim.fn.has "win32" ~= 0
local sep = is_windows and "\\" or "/" local sep = is_windows and "\\" or "/"
local delim = is_windows and ";" or ":" local delim = is_windows and ";" or ":"
vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) .. delim .. vim.env.PATH vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) .. delim .. vim.env.PATH

View File

@ -54,7 +54,6 @@ return {
return require "nvchad.configs.nvimtree" return require "nvchad.configs.nvimtree"
end, end,
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "nvimtree")
require("nvim-tree").setup(opts) require("nvim-tree").setup(opts)
end, end,
}, },
@ -92,7 +91,6 @@ return {
return require "nvchad.configs.gitsigns" return require "nvchad.configs.gitsigns"
end, end,
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "git")
require("gitsigns").setup(opts) require("gitsigns").setup(opts)
end, end,
}, },
@ -105,7 +103,6 @@ return {
return require "nvchad.configs.mason" return require "nvchad.configs.mason"
end, end,
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "mason")
require("mason").setup(opts) require("mason").setup(opts)
-- custom nvchad cmd to install all mason binaries listed -- custom nvchad cmd to install all mason binaries listed
@ -194,7 +191,6 @@ return {
return require "nvchad.configs.telescope" return require "nvchad.configs.telescope"
end, end,
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "telescope")
local telescope = require "telescope" local telescope = require "telescope"
telescope.setup(opts) telescope.setup(opts)
@ -228,8 +224,6 @@ return {
return require "nvchad.configs.treesitter" return require "nvchad.configs.treesitter"
end, end,
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "syntax")
dofile(vim.g.base46_cache .. "treesitter")
require("nvim-treesitter.configs").setup(opts) require("nvim-treesitter.configs").setup(opts)
end, end,
}, },