diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-06-28 23:53:07 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-06-28 23:53:07 +0200 |
| commit | f191627cbfcdf481fc17c4422e4513a410a845fa (patch) | |
| tree | ac908caf663b0c61da2a5722d831fd84562c574a /lua/plugins | |
| parent | f10a15743d5ad38ac7dd9fa37b50fc3cdadf64d0 (diff) | |
| download | dotfiles-f191627cbfcdf481fc17c4422e4513a410a845fa.tar.gz dotfiles-f191627cbfcdf481fc17c4422e4513a410a845fa.zip | |
Made colorscheme fallback
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/colorscheme.lua | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 10f0432..14edbdf 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,11 +1,17 @@ -- Colorscheme -- Available colorschemes: -- [[ nightfly ayu onedark doom-one nvimgelion github_dark tokyonight ]] -local colorscheme = "tokyonight-night" -local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) + +-- Define default color scheme +local default_colorscheme = "tokyonight-night" +local fallback_colorscheme = "desert" + +-- Attempt to set the default color scheme +local status_ok, _ = pcall(vim.cmd, "colorscheme " .. default_colorscheme) + +-- If the default color scheme is not found, use the fallback color scheme if not status_ok then - vim.notify("colorscheme " .. colorscheme .. " not found!") - return + vim.cmd("colorscheme " .. fallback_colorscheme) end --local function MyHighlights() @@ -26,7 +32,7 @@ end vim.api.nvim_command("syntax on") -vim.api.nvim_command("highlight Normal guibg=none") +vim.api.nvim_command("highlight Normal guibg=NONE") vim.api.nvim_command("highlight NormalNC guibg=none") vim.api.nvim_command("highlight SignColumn guibg=none") --vim.api.nvim_command("highlight FoldColumn guibg=none") |
