diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-09-04 04:06:55 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-09-04 04:06:55 +0530 |
commit | 7370fc82adaff71439fbc222359544ab308b6bb6 (patch) | |
tree | efdb839f16fc5ce64bd4fef968ca102e8bf5ae66 | |
parent | 20d6214a01dc1ba431a8a42879796f112be25a54 (diff) |
protected call for colorscheme
-rw-r--r-- | .config/nvim/lua/justsaumit/colorscheme.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/.config/nvim/lua/justsaumit/colorscheme.lua b/.config/nvim/lua/justsaumit/colorscheme.lua index f4493b2..02f84b9 100644 --- a/.config/nvim/lua/justsaumit/colorscheme.lua +++ b/.config/nvim/lua/justsaumit/colorscheme.lua @@ -1,3 +1,12 @@ +--protected call +local colorscheme = "tokyonight" + +local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) +if not status_ok then + vim.notify("colorscheme " .. colorscheme .. "notfound!") + return +end + --configuration needs to be set BEFORE loading the color scheme with colorscheme tokyonight vim.g.tokyonight_style = "night" tokyonight_terminal_colors=true @@ -13,4 +22,3 @@ tokyonight_dark_sidebar=true tokyonight_dark_float=true tokyonight_colors={} tokyonight_lualine_bold=false -vim.cmd[[colorscheme tokyonight]] |