change themes for xmobar and neovim

This commit is contained in:
2022-03-18 13:25:06 +05:30
parent 2bac5bafcd
commit a2dfe8bea3
5 changed files with 52 additions and 39 deletions

View File

@@ -1,25 +1,25 @@
{config, pkgs, ...}:
{ config, pkgs, ... }:
{
programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
# package = pkgs.neovim-nightly.overrideAttrs (_:{
# nativeBuildInputs = with pkgs; [ unzip cmake pkgconfig gettext tree-sitter ];
# });
# package = pkgs.neovim-nightly.overrideAttrs (_:{
# nativeBuildInputs = with pkgs; [ unzip cmake pkgconfig gettext tree-sitter ];
# });
defaultEditor = true;
configure = {
customRC = ''
lua << EOF
${builtins.readFile ./init.lua}
EOF
'';
customRC = ''
lua << EOF
${builtins.readFile ./init.lua}
EOF
'';
packages.myVimPackage = with pkgs.unstable.vimPlugins; {
start = [
nvim-colorizer-lua
bracey-vim
auto-pairs
vim-floaterm
auto-pairs
vim-floaterm
vim-closetag
nerdcommenter
nvim-cmp
@@ -30,7 +30,7 @@
cmp-path
cmp-calc
cmp-emoji
# cmp-look
# cmp-look
cmp-buffer
nvim-lspconfig
barbar-nvim
@@ -40,7 +40,6 @@
nvim-treesitter
vim-latex-live-preview
lspkind-nvim
# (gruvbox.overrideAttrs (oa: { patches = [ ./gruvbox.patch ]; }))
base16-vim
];
};

View File

@@ -137,8 +137,6 @@ bind('n', "<M-o>", ":NvimTreeToggle<CR>", {noremap=true, silent=true})
bind('n', "<Space>r", ":NvimTreeRefresh<CR>", {noremap=true, silent=true})
bind('n', "<Space>f", ":NvimTreeFindFile<CR>", {noremap=true, silent=true})
vim.o.background="dark"
comm("colorscheme base16-tomorrow-night")
--floaterm
vim.g.floaterm_keymap_toggle = '<F1>'
@@ -321,21 +319,26 @@ local function mode()
return mode_map[m]
end
hi("Light", "guibg=#c5c8c6 guifg=#1d1f21")
hi("Dark", "guibg=#1d1f21 guifg=#c5c8c6")
hi("Gray", "guifg=#1d1f21 guibg=#b294bb")
--theming
local dark = true
comm("colorscheme base16-solarized-dark")
hi("Light", "guibg=#eee8d5 guifg=#002b36")
hi("Misc", "guibg=#dc322f guifg=#fdf6e3")
hi("Dark", "guibg=#002b36 guifg=#839496")
local function git()
local branch = io.popen([[git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n']]):read("*a")
return string.len(branch) > 0 and ''.. branch or ''
end
local statusline = {
'%#Light# ',
mode():upper() .. ' ',
'%#Dark#',
'%#Misc#',
string.len(git()) > 0 and ' ' .. git() .. ' ' or '',
'%#Gray# ',
'%#Dark# ',
'%f ',
'%#Light#',
'%=',
@@ -351,6 +354,17 @@ local statusline = {
vim.o.statusline = table.concat(statusline)
function _G.ToggleTheme()
if dark then
comm("colorscheme base16-solarized-light")
else
comm("colorscheme base16-solarized-dark")
end
dark = not dark
hi("Light", "guibg=#eee8d5 guifg=#002b36")
hi("Dark", "guibg=#002b36 guifg=#839496")
hi("Misc", "guibg=#dc322f guifg=#fdf6e3")
vim.o.statusline = table.concat(statusline)
end
bind('n', "<F7>", ":call v:lua.ToggleTheme()<CR>", {silent=true})
vim.g.tex_flavor = "latex"
comm("set syntax=off")