feat: disable lsp_lines by default

This commit is contained in:
Matthew Leong 2022-12-30 13:00:04 -08:00
parent 11fecdb9d0
commit 96499d0d67
3 changed files with 29 additions and 26 deletions

View file

@ -17,7 +17,7 @@
"lualine.nvim": { "branch": "master", "commit": "32a7382a75a52e8ad05f4cec7eeb8bbfbe80d461" }, "lualine.nvim": { "branch": "master", "commit": "32a7382a75a52e8ad05f4cec7eeb8bbfbe80d461" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
"mason.nvim": { "branch": "main", "commit": "1592493e3406c271e9128b4d424731e25f1ff2a1" }, "mason.nvim": { "branch": "main", "commit": "1592493e3406c271e9128b4d424731e25f1ff2a1" },
"noice.nvim": { "branch": "main", "commit": "7816fcd8a43a9de84d7f4695b0688b4f54b25570" }, "noice.nvim": { "branch": "main", "commit": "6aa6585da8cf9ffa44575b320b4d64d50f3c13a2" },
"nui.nvim": { "branch": "main", "commit": "4939282919885e1c83aff68ecb35b3cadf6015a9" }, "nui.nvim": { "branch": "main", "commit": "4939282919885e1c83aff68ecb35b3cadf6015a9" },
"null-ls.nvim": { "branch": "main", "commit": "647a1eeeefc43ce15d941972642210637c370471" }, "null-ls.nvim": { "branch": "main", "commit": "647a1eeeefc43ce15d941972642210637c370471" },
"nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" }, "nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" },

View file

@ -11,7 +11,7 @@ local default_config = {
-- true - loads plugin and is enabled at start -- true - loads plugin and is enabled at start
-- false - loads plugin but is not enabled at start -- false - loads plugin but is not enabled at start
-- you may use <leader>ld to toggle -- you may use <leader>ld to toggle
enable_on_start = true, enable_on_start = false,
}, },
}, },
lsp = { lsp = {

View file

@ -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 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 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 local is_plugin_enabled = user_config.plugins.lsp_lines.enable_on_start
-- init lsp_lines
require('lsp_lines').setup()
local function toggle() local function toggle()
if is_plugin_enabled then if is_plugin_enabled then
vim.diagnostic.config(u.merge(vt_config, { vim.diagnostic.config(u.merge(vt_config, {
@ -25,9 +17,20 @@ return {
is_plugin_enabled = not is_plugin_enabled is_plugin_enabled = not is_plugin_enabled
end 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 -- run once to properly show/hide based on user config
toggle() toggle()
-- map for toggling lines -- map for toggling lines
map('n', '<leader>ld', '', { map('n', '<leader>ld', '', {
callback = toggle, callback = toggle,