Added tmux and neovim bar integration

This commit is contained in:
Alejandro Angulo 2023-03-29 19:56:27 -07:00
parent 7b1a711969
commit d1063519b5
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
5 changed files with 98 additions and 33 deletions

View file

@ -10,11 +10,20 @@ with lib; let
in {
options.aa.apps.neovim = with types; {
enable = mkEnableOption "neovim";
tmuxThemePath = mkOption {
type = str;
default = "vim-tmuxline/tmux_theme";
description = "Where to store tmux theme generated by vim-tmuxline";
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [fzf fd];
aa.home.dataFile = {
${cfg.tmuxThemePath}.source = ./tmux_theme;
};
aa.home.extraOptions = {
programs.neovim = {
enable = true;

21
modules/apps/neovim/theme Normal file
View file

@ -0,0 +1,21 @@
# This tmux statusbar config was created by tmuxline.vim
# on Wed, 29 Mar 2023
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#a89984,bg=#504945"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#504945"
set -g status-style "none,bg=#32302f"
set -g message-style "fg=#a89984,bg=#504945"
set -g pane-border-style "fg=#32302f"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "none"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=#928374,bg=#32302f"
set -g status-left "#[fg=#928374,bg=#32302f] #S #[fg=#32302f,bg=#32302f,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#32302f,bg=#32302f,nobold,nounderscore,noitalics]#[fg=#928374,bg=#32302f] %Y-%m-%d  %H:%M #[fg=#32302f,bg=#32302f,nobold,nounderscore,noitalics]#[fg=#928374,bg=#32302f] #h "
setw -g window-status-format "#[fg=#928374,bg=#32302f] #I #[fg=#928374,bg=#32302f] #W "
setw -g window-status-current-format "#[fg=#32302f,bg=#504945,nobold,nounderscore,noitalics]#[fg=#a89984,bg=#504945] #I #[fg=#a89984,bg=#504945] #W #[fg=#504945,bg=#32302f,nobold,nounderscore,noitalics]"

View file

@ -0,0 +1,21 @@
# This tmux statusbar config was created by tmuxline.vim
# on Wed, 29 Mar 2023
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#a89984,bg=#504945"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#504945"
set -g status-style "none,bg=#32302f"
set -g message-style "fg=#a89984,bg=#504945"
set -g pane-border-style "fg=#32302f"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "none"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=#928374,bg=#32302f"
set -g status-left "#[fg=#928374,bg=#32302f] #S #[fg=#32302f,bg=#32302f,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#32302f,bg=#32302f,nobold,nounderscore,noitalics]#[fg=#928374,bg=#32302f] %Y-%m-%d  %H:%M #[fg=#32302f,bg=#32302f,nobold,nounderscore,noitalics]#[fg=#928374,bg=#32302f] #h "
setw -g window-status-format "#[fg=#928374,bg=#32302f] #I #[fg=#928374,bg=#32302f] #W "
setw -g window-status-current-format "#[fg=#32302f,bg=#504945,nobold,nounderscore,noitalics]#[fg=#a89984,bg=#504945] #I #[fg=#a89984,bg=#504945] #W #[fg=#504945,bg=#32302f,nobold,nounderscore,noitalics]"

View file

@ -7,6 +7,7 @@
}:
with lib; let
cfg = config.aa.apps.tmux;
user_cfg = config.home-manager.users.${config.aa.user.name};
in {
options.aa.apps.tmux = with types; {
enable = mkEnableOption "tmux";
@ -35,7 +36,8 @@ in {
vim-tmux-navigator
];
extraConfig = ''
extraConfig =
''
# Color fix
# set-option -ga terminal-overrides ",alacritty:Tc,xterm-256color:Tc"
@ -51,9 +53,6 @@ in {
# set -g @plugin 'mattdavis90/base16-tmux'
# set -g @colors-base16 'darktooth'
# Integration with tmuxline.vim
source-file ~/theme
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
@ -73,7 +72,16 @@ in {
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
'';
''
+ (
if config.aa.apps.neovim.enable
then ''
# Integration with tmuxline.vim
source-file ${user_cfg.xdg.dataHome}/${config.aa.apps.neovim.tmuxThemePath}
''
else ""
);
};
};
};

View file

@ -24,6 +24,11 @@ in {
default = {};
description = "A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
};
dataFile = mkOption {
type = attrs;
default = {};
description = "A set of files to be managed by home-manager's <option>xdg.dataFile</option>.";
};
extraOptions = mkOption {
type = attrs;
default = {};
@ -37,6 +42,7 @@ in {
home.file = mkAliasDefinitions options.aa.home.file;
xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.aa.home.configFile;
xdg.dataFile = mkAliasDefinitions options.aa.home.dataFile;
};
home-manager = {