Added tmux and neovim bar integration
This commit is contained in:
parent
7b1a711969
commit
d1063519b5
|
@ -10,11 +10,20 @@ with lib; let
|
||||||
in {
|
in {
|
||||||
options.aa.apps.neovim = with types; {
|
options.aa.apps.neovim = with types; {
|
||||||
enable = mkEnableOption "neovim";
|
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 {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [fzf fd];
|
environment.systemPackages = with pkgs; [fzf fd];
|
||||||
|
|
||||||
|
aa.home.dataFile = {
|
||||||
|
${cfg.tmuxThemePath}.source = ./tmux_theme;
|
||||||
|
};
|
||||||
aa.home.extraOptions = {
|
aa.home.extraOptions = {
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
21
modules/apps/neovim/theme
Normal file
21
modules/apps/neovim/theme
Normal 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]"
|
21
modules/apps/neovim/tmux_theme
Normal file
21
modules/apps/neovim/tmux_theme
Normal 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]"
|
|
@ -7,6 +7,7 @@
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.aa.apps.tmux;
|
cfg = config.aa.apps.tmux;
|
||||||
|
user_cfg = config.home-manager.users.${config.aa.user.name};
|
||||||
in {
|
in {
|
||||||
options.aa.apps.tmux = with types; {
|
options.aa.apps.tmux = with types; {
|
||||||
enable = mkEnableOption "tmux";
|
enable = mkEnableOption "tmux";
|
||||||
|
@ -35,45 +36,52 @@ in {
|
||||||
vim-tmux-navigator
|
vim-tmux-navigator
|
||||||
];
|
];
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig =
|
||||||
# Color fix
|
''
|
||||||
# set-option -ga terminal-overrides ",alacritty:Tc,xterm-256color:Tc"
|
# Color fix
|
||||||
|
# set-option -ga terminal-overrides ",alacritty:Tc,xterm-256color:Tc"
|
||||||
|
|
||||||
# Scrolling with mouse wheel scrolls output instead of previous commands
|
# Scrolling with mouse wheel scrolls output instead of previous commands
|
||||||
setw -g mouse on
|
setw -g mouse on
|
||||||
|
|
||||||
# Open panes in the same directory
|
# Open panes in the same directory
|
||||||
bind c new-window -c "#{pane_current_path}"
|
bind c new-window -c "#{pane_current_path}"
|
||||||
bind '"' split-window -c "#{pane_current_path}"
|
bind '"' split-window -c "#{pane_current_path}"
|
||||||
bind % split-window -h -c "#{pane_current_path}"
|
bind % split-window -h -c "#{pane_current_path}"
|
||||||
|
|
||||||
# Eye Candy
|
# Eye Candy
|
||||||
# set -g @plugin 'mattdavis90/base16-tmux'
|
# set -g @plugin 'mattdavis90/base16-tmux'
|
||||||
# set -g @colors-base16 'darktooth'
|
# set -g @colors-base16 'darktooth'
|
||||||
|
|
||||||
# Integration with tmuxline.vim
|
# Smart pane switching with awareness of Vim splits.
|
||||||
source-file ~/theme
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||||
|
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||||
|
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?\\.?g?(view|n?vim?x?)(-wrapped)?(diff)?$'"
|
||||||
|
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
||||||
|
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
||||||
|
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
||||||
|
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
||||||
|
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
||||||
|
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
||||||
|
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
||||||
|
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
||||||
|
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
||||||
|
|
||||||
# Smart pane switching with awareness of Vim splits.
|
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
||||||
# See: https://github.com/christoomey/vim-tmux-navigator
|
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
||||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
bind-key -T copy-mode-vi 'C-k' select-pane -U
|
||||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?\\.?g?(view|n?vim?x?)(-wrapped)?(diff)?$'"
|
bind-key -T copy-mode-vi 'C-l' select-pane -R
|
||||||
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
bind-key -T copy-mode-vi 'C-\' select-pane -l
|
||||||
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
''
|
||||||
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
+ (
|
||||||
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
if config.aa.apps.neovim.enable
|
||||||
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
then ''
|
||||||
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
|
||||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
|
||||||
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
|
||||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
|
||||||
|
|
||||||
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
# Integration with tmuxline.vim
|
||||||
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
source-file ${user_cfg.xdg.dataHome}/${config.aa.apps.neovim.tmuxThemePath}
|
||||||
bind-key -T copy-mode-vi 'C-k' select-pane -U
|
''
|
||||||
bind-key -T copy-mode-vi 'C-l' select-pane -R
|
else ""
|
||||||
bind-key -T copy-mode-vi 'C-\' select-pane -l
|
);
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,11 @@ in {
|
||||||
default = {};
|
default = {};
|
||||||
description = "A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
|
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 {
|
extraOptions = mkOption {
|
||||||
type = attrs;
|
type = attrs;
|
||||||
default = {};
|
default = {};
|
||||||
|
@ -37,6 +42,7 @@ in {
|
||||||
home.file = mkAliasDefinitions options.aa.home.file;
|
home.file = mkAliasDefinitions options.aa.home.file;
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
xdg.configFile = mkAliasDefinitions options.aa.home.configFile;
|
xdg.configFile = mkAliasDefinitions options.aa.home.configFile;
|
||||||
|
xdg.dataFile = mkAliasDefinitions options.aa.home.dataFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
|
|
Loading…
Reference in a new issue