aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-10-23 01:24:32 +0800
committerjdhao <jdhao@hotmail.com>2021-10-23 01:24:32 +0800
commit2e69db655178fdb0d669348138e18ffafd921497 (patch)
tree3f0dcdf9e8af7d99aa48d5fe357ca3a57d966a7b
parente2a8687e486dadf6d1dc745bc683363560a6dcb5 (diff)
add global variable logging_level
-rw-r--r--core/globals.vim1
-rw-r--r--core/themes.vim6
-rw-r--r--lua/config/lsp.lua6
3 files changed, 9 insertions, 4 deletions
diff --git a/core/globals.vim b/core/globals.vim
index a89fad6..e6d4665 100644
--- a/core/globals.vim
+++ b/core/globals.vim
@@ -4,6 +4,7 @@
let g:is_win = (has('win32') || has('win64')) ? v:true : v:false
let g:is_linux = (has('unix') && !has('macunix')) ? v:true : v:false
let g:is_mac = has('macunix') ? v:true : v:false
+let g:logging_level = 'debug'
"}}
"{{ Builtin variables
diff --git a/core/themes.vim b/core/themes.vim
index d1aa961..7bfc588 100644
--- a/core/themes.vim
+++ b/core/themes.vim
@@ -85,8 +85,10 @@ let s:colorscheme_func = printf('s:my_theme_dict.%s()', s:theme)
if has_key(s:my_theme_dict, s:theme)
execute 'call ' . s:colorscheme_func
- let s:msg1 = "Currently loaded theme: " . s:theme
- call v:lua.vim.notify(s:msg1, 'info', {'title': 'nvim-config'})
+ if g:logging_level == 'debug'
+ let s:msg1 = "Currently loaded theme: " . s:theme
+ call v:lua.vim.notify(s:msg1, 'info', {'title': 'nvim-config'})
+ endif
else
let s:msg = "Invalid colorscheme function: " . s:colorscheme_func
call v:lua.vim.notify(s:msg, 'error', {'title': 'nvim-config'})
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
index ae94b67..7cc8062 100644
--- a/lua/config/lsp.lua
+++ b/lua/config/lsp.lua
@@ -61,8 +61,10 @@ local custom_attach = function(client, bufnr)
]])
end
- local msg = string.format("Language server %s started!", client.name)
- vim.notify(msg, 'info', {title = 'Nvim-config'})
+ if vim.g.logging_level == 'debug' then
+ local msg = string.format("Language server %s started!", client.name)
+ vim.notify(msg, 'info', {title = 'Nvim-config'})
+ end
end
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())