Compare commits

...

5 Commits

Author SHA1 Message Date
siduck
cb18b424b9 misc 2023-09-27 06:14:48 +05:30
siduck
1afbaef5c7 properly disable lsp signature 2023-09-26 20:41:19 +05:30
siduck
d58ec3f55d properly disable lsp signature
https://github.com/NvChad/ui/pull/188#issuecomment-1735510051
2023-09-26 18:51:34 +05:30
siduck
17a8959bea add option for term auto_insert 2023-09-26 18:32:15 +05:30
siduck
1b20da0115 update version in core/default_config.lua 2023-09-26 11:28:45 +05:30
3 changed files with 22 additions and 15 deletions

View File

@ -1,7 +1,7 @@
local M = {} local M = {}
M.options = { M.options = {
nvchad_branch = "v2.0", nvchad_branch = "v3.0",
} }
M.ui = { M.ui = {
@ -13,7 +13,6 @@ M.ui = {
theme_toggle = { "onedark", "one_light" }, theme_toggle = { "onedark", "one_light" },
theme = "onedark", -- default theme theme = "onedark", -- default theme
transparency = false, transparency = false,
lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens
-- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations -- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations
extended_integrations = {}, -- these aren't compiled by default, ex: "alpha", "notify" extended_integrations = {}, -- these aren't compiled by default, ex: "alpha", "notify"
@ -75,14 +74,15 @@ M.ui = {
cheatsheet = { theme = "grid" }, -- simple/grid cheatsheet = { theme = "grid" }, -- simple/grid
lsp = { lsp = {
signature = { signature = true,
disabled = false, semantic_tokens = false,
silent = true, -- silences 'no signature help available' message
},
}, },
term = { term = {
sizes = { sp = 0.3, vsp = 0.2 }, sizes = { sp = 0.3, vsp = 0.2 },
behavior = {
auto_insert = true,
},
}, },
} }

View File

@ -2,23 +2,27 @@ dofile(vim.g.base46_cache .. "lsp")
require "nvchad.lsp" require "nvchad.lsp"
local M = {} local M = {}
local utils = require "core.utils"
-- export on_attach & capabilities for custom lspconfigs -- export on_attach & capabilities for custom lspconfigs
M.on_attach = function(client, bufnr) M.on_attach = function(client, bufnr)
local utils = require "core.utils"
local conf = utils.load_config().ui.lsp
-- semanticTokens
if not conf.semantic_tokens and client.supports_method "textDocument/semanticTokens" then
client.server_capabilities.semanticTokensProvider = nil
end
-- signature
if conf.signature and client.server_capabilities.signatureHelpProvider then
require("nvchad.signature").setup(client, bufnr)
end
client.server_capabilities.documentFormattingProvider = false client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false client.server_capabilities.documentRangeFormattingProvider = false
utils.load_mappings("lspconfig", { buffer = bufnr }) utils.load_mappings("lspconfig", { buffer = bufnr })
if client.server_capabilities.signatureHelpProvider then
require("nvchad.signature").setup(client)
end
if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
client.server_capabilities.semanticTokensProvider = nil
end
end end
M.capabilities = vim.lsp.protocol.make_client_capabilities() M.capabilities = vim.lsp.protocol.make_client_capabilities()

View File

@ -16,6 +16,9 @@ local default_plugins = {
"NvChad/ui", "NvChad/ui",
branch = "v3.0", branch = "v3.0",
lazy = false, lazy = false,
config = function()
require "nvchad"
end,
}, },
{ {