feat: disable lsp_lines by default
This commit is contained in:
parent
11fecdb9d0
commit
96499d0d67
3 changed files with 29 additions and 26 deletions
|
@ -17,7 +17,7 @@
|
|||
"lualine.nvim": { "branch": "master", "commit": "32a7382a75a52e8ad05f4cec7eeb8bbfbe80d461" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
|
||||
"mason.nvim": { "branch": "main", "commit": "1592493e3406c271e9128b4d424731e25f1ff2a1" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7816fcd8a43a9de84d7f4695b0688b4f54b25570" },
|
||||
"noice.nvim": { "branch": "main", "commit": "6aa6585da8cf9ffa44575b320b4d64d50f3c13a2" },
|
||||
"nui.nvim": { "branch": "main", "commit": "4939282919885e1c83aff68ecb35b3cadf6015a9" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "647a1eeeefc43ce15d941972642210637c370471" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" },
|
||||
|
|
|
@ -11,7 +11,7 @@ local default_config = {
|
|||
-- true - loads plugin and is enabled at start
|
||||
-- false - loads plugin but is not enabled at start
|
||||
-- you may use <leader>ld to toggle
|
||||
enable_on_start = true,
|
||||
enable_on_start = false,
|
||||
},
|
||||
},
|
||||
lsp = {
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
local user_config = require('cosmic.core.user')
|
||||
return {
|
||||
event = 'VeryLazy',
|
||||
url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
|
||||
config = function()
|
||||
local u = require('cosmic.utils')
|
||||
local map = require('cosmic.utils').map
|
||||
local user_config = require('cosmic.core.user')
|
||||
local vt_config = require('cosmic.lsp.diagnostics.config')
|
||||
local map = require('cosmic.utils').map
|
||||
local is_plugin_enabled = user_config.plugins.lsp_lines.enable_on_start
|
||||
|
||||
-- init lsp_lines
|
||||
require('lsp_lines').setup()
|
||||
|
||||
local function toggle()
|
||||
if is_plugin_enabled then
|
||||
vim.diagnostic.config(u.merge(vt_config, {
|
||||
|
@ -25,9 +17,20 @@ return {
|
|||
is_plugin_enabled = not is_plugin_enabled
|
||||
end
|
||||
|
||||
return {
|
||||
url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
|
||||
keys = {
|
||||
{
|
||||
'<leader>ld',
|
||||
toggle,
|
||||
desc = 'Enable lsp_lines',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
-- init lsp_lines
|
||||
require('lsp_lines').setup()
|
||||
-- run once to properly show/hide based on user config
|
||||
toggle()
|
||||
|
||||
-- map for toggling lines
|
||||
map('n', '<leader>ld', '', {
|
||||
callback = toggle,
|
||||
|
|
Loading…
Add table
Reference in a new issue