mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat(nix): migrate tmux and tpm plugins to Nix
This commit is contained in:
@@ -4,21 +4,9 @@
|
|||||||
|
|
||||||
- clean: ["~"]
|
- clean: ["~"]
|
||||||
|
|
||||||
- create:
|
|
||||||
- ~/.config/tmux
|
|
||||||
|
|
||||||
- link:
|
- link:
|
||||||
~/.config/fish: fish
|
~/.config/fish: fish
|
||||||
~/.config/nvim: nvim
|
~/.config/nvim: nvim
|
||||||
~/.config/tmux/tmux-nerd-font-window-name.yml: tmux/tmux-nerd-font-window-name.yml
|
|
||||||
~/.gitmux.conf: tmux/gitmux.conf
|
|
||||||
~/.tmux-cht-command: tmux/tmux-cht-command
|
|
||||||
~/.tmux-cht-languages: tmux/tmux-cht-languages
|
|
||||||
~/.tmux.conf: tmux/tmux.conf
|
|
||||||
|
|
||||||
- shell:
|
- shell:
|
||||||
- [git submodule update --init --recursive, Installing submodules]
|
- [git submodule update --init --recursive, Installing submodules]
|
||||||
- [
|
|
||||||
~/.tmux/plugins/tpm/scripts/install_plugins.sh >/dev/null 2>&1,
|
|
||||||
Installing tmux plugins,
|
|
||||||
]
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
"tmux" # TODO: Migrate to nix
|
"tmux" # TODO: Migrate to nix
|
||||||
"tree-sitter" # INFO: Dependency of Neovim
|
"tree-sitter" # INFO: Dependency of Neovim
|
||||||
"urlview" # URL extractor/launcher
|
"urlview" # URL extractor/launcher
|
||||||
"yq" # Process YAML, JSON, XML, CSV and properties documents from the CLI. INFO: Needed for joshmedeski/tmux-nerd-font-window-name
|
|
||||||
"zsh" # TODO: Migrate to nix
|
"zsh" # TODO: Migrate to nix
|
||||||
"zsh-syntax-highlighting" # TODO: Migration to nix
|
"zsh-syntax-highlighting" # TODO: Migration to nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ in
|
|||||||
./sesh
|
./sesh
|
||||||
./skhd
|
./skhd
|
||||||
./starship
|
./starship
|
||||||
|
./tmux
|
||||||
./wezterm
|
./wezterm
|
||||||
./wget
|
./wget
|
||||||
./yabai
|
./yabai
|
||||||
|
|||||||
@@ -5,16 +5,30 @@ session_path = "~/Code/GitHub/websites/stefanimhoff-de"
|
|||||||
script_path = "~/.config/sesh/scripts/node_dev"
|
script_path = "~/.config/sesh/scripts/node_dev"
|
||||||
|
|
||||||
[[session]]
|
[[session]]
|
||||||
name = "Dotfiles"
|
name = "⭐ Dotfiles"
|
||||||
path = "~/.dotfiles"
|
path = "~/.dotfiles"
|
||||||
startup_command = "nvim"
|
|
||||||
|
|
||||||
[[session]]
|
[[session]]
|
||||||
name = "Downloads 📥"
|
name = "📥 Downloads"
|
||||||
path = "~/Downloads"
|
path = "~/Downloads"
|
||||||
startup_command = "ll"
|
startup_command = "la"
|
||||||
|
|
||||||
[[session]]
|
[[session]]
|
||||||
name = "tmux config 🔧"
|
name = "👨💻 stefanimhoff-de"
|
||||||
path = "~/.dotfiles/tmux"
|
path = "~/Code/GitHub/websites/stefanimhoff-de/"
|
||||||
startup_command = "nvim tmux.conf"
|
|
||||||
|
[[session]]
|
||||||
|
name = "🥷 kogakure-de"
|
||||||
|
path = "~/Code/GitHub/websites/kogakure-de/"
|
||||||
|
|
||||||
|
[[session]]
|
||||||
|
name = "📦 Crate 🌳"
|
||||||
|
path = "~/Code/XING/crate.git/"
|
||||||
|
|
||||||
|
[[session]]
|
||||||
|
name = "📦 Crate"
|
||||||
|
path = "~/Code/XING/crate/"
|
||||||
|
|
||||||
|
[[session]]
|
||||||
|
name = "🍺 Brewery"
|
||||||
|
path = "~/Code/XING/brewery/"
|
||||||
|
|||||||
82
nix/home/tmux/default.nix
Normal file
82
nix/home/tmux/default.nix
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
# TODO: Wait for plugin in https://github.com/NixOS/nixpkgs/blob/maser/pkgs/misc/tmux-plugins/default.nix or add it with a PR
|
||||||
|
tmux-nerd-font-window-name = pkgs.tmuxPlugins.mkTmuxPlugin {
|
||||||
|
pluginName = "tmux-nerd-font-window-name";
|
||||||
|
version = "v2.1.1";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "joshmedeski";
|
||||||
|
repo = "tmux-nerd-font-window-name";
|
||||||
|
rev = "57961cb0a99b76f20e02639d398c973d81971d05";
|
||||||
|
sha256 = "8P4jFEkcJn/JbdRAC5PCrLAGTJwFxCknllOjkD+PK9w=";
|
||||||
|
};
|
||||||
|
# INFO: Needed rename, because nix uses underscores
|
||||||
|
postInstall = ''
|
||||||
|
mv $target/tmux-nerd-font-window-name.tmux $target/tmux_nerd_font_window_name.tmux
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home.file = {
|
||||||
|
".config/tmux/tmux-nerd-font-window-name.yml" = {
|
||||||
|
source = ./tmux-nerd-font-window-name.yml;
|
||||||
|
};
|
||||||
|
".gitmux.conf" = { source = ./gitmux.conf; };
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
terminal = "xterm";
|
||||||
|
baseIndex = 1;
|
||||||
|
escapeTime = 0;
|
||||||
|
historyLimit = 50000;
|
||||||
|
keyMode = "vi";
|
||||||
|
mouse = true;
|
||||||
|
customPaneNavigationAndResize = true;
|
||||||
|
sensibleOnTop = false;
|
||||||
|
extraConfig = builtins.readFile ./tmux.conf;
|
||||||
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
|
sensible
|
||||||
|
battery
|
||||||
|
copycat
|
||||||
|
logging
|
||||||
|
open
|
||||||
|
pain-control
|
||||||
|
sessionist
|
||||||
|
urlview
|
||||||
|
yank
|
||||||
|
{
|
||||||
|
plugin = resurrect;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @resurrect-capture-pane-contents 'on'
|
||||||
|
set -g @resurrect-strategy-nvim 'session'
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = continuum;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @continuum-restore 'on'
|
||||||
|
set -g @continuum-save-interval '10' # Save every 10 minutes
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = jump;
|
||||||
|
extraConfig = "set -g @jump-key 's'";
|
||||||
|
}
|
||||||
|
better-mouse-mode
|
||||||
|
vim-tmux-navigator
|
||||||
|
{
|
||||||
|
plugin = tmux-nerd-font-window-name;
|
||||||
|
extraConfig = "set -g @tmux-nerd-font-window-name-show-name true";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
gitmux
|
||||||
|
# Dependencies of joshmedeski/tmux-nerd-font-window-name
|
||||||
|
yq-go
|
||||||
|
nodePackages.bash-language-server
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,57 +1,26 @@
|
|||||||
# ========= Settings =========
|
# Terminal overrides
|
||||||
|
|
||||||
set -g default-terminal "xterm"
|
|
||||||
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
||||||
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
|
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
|
||||||
|
|
||||||
# Base index for windows
|
# Window settings
|
||||||
set -g base-index 1
|
|
||||||
setw -g pane-base-index 1
|
|
||||||
|
|
||||||
# Automatically rename windows when their program exits
|
|
||||||
set -g automatic-rename on
|
set -g automatic-rename on
|
||||||
set-option -g automatic-rename-format "#(tmux-icon-name #{pane_current_command})"
|
|
||||||
|
|
||||||
# Rename the current window
|
|
||||||
bind-key v command-prompt "rename-window '%%'"
|
|
||||||
|
|
||||||
# Base index for panes
|
|
||||||
set-window-option -g pane-base-index 1
|
|
||||||
|
|
||||||
# copy to system clipboard
|
|
||||||
set -g set-clipboard on
|
|
||||||
|
|
||||||
# tmux messages are displayed for 4 seconds
|
|
||||||
set -g display-time 4000
|
|
||||||
|
|
||||||
# tmux restore last session
|
|
||||||
set -g @continuum-restore 'on'
|
|
||||||
|
|
||||||
# Refresh status
|
|
||||||
set -g status-interval 1
|
|
||||||
|
|
||||||
# Set focus events for Vim
|
|
||||||
set -g focus-events on
|
|
||||||
|
|
||||||
# Allow passthrough color escape sequences (Base16)
|
|
||||||
# set -g allow-passthrough 1
|
|
||||||
|
|
||||||
# History
|
|
||||||
set-option -g history-limit 50000
|
|
||||||
|
|
||||||
# Act like vim
|
|
||||||
setw -g mode-keys vi
|
|
||||||
set -g status-keys vi
|
|
||||||
set -sg escape-time 0
|
|
||||||
|
|
||||||
# Renumber windows sequentially after closing any of them
|
|
||||||
set -g renumber-windows on
|
set -g renumber-windows on
|
||||||
|
|
||||||
# Status Bar
|
# Clipboard settings
|
||||||
|
set -g set-clipboard on
|
||||||
|
|
||||||
|
# Message display time
|
||||||
|
set -g display-time 4000
|
||||||
|
|
||||||
|
# Focus events for Vim
|
||||||
|
set -g focus-events on
|
||||||
|
|
||||||
|
# Status bar settings
|
||||||
set -g status-position top
|
set -g status-position top
|
||||||
set -g status-style 'bg=default,fg=white' # transparent status bar
|
set -g status-style 'bg=default,fg=white' # transparent status bar
|
||||||
|
set -g status-interval 1
|
||||||
|
|
||||||
# Pane Style
|
# Pane style
|
||||||
set -g pane-border-style "fg=brightblack,bg=default"
|
set -g pane-border-style "fg=brightblack,bg=default"
|
||||||
set -g pane-active-border-style "fg=white,bg=default"
|
set -g pane-active-border-style "fg=white,bg=default"
|
||||||
|
|
||||||
@@ -59,28 +28,18 @@ set -g pane-active-border-style "fg=white,bg=default"
|
|||||||
set -g status-left-length 100
|
set -g status-left-length 100
|
||||||
set -ga status-left "#[fg=white,nobold]"
|
set -ga status-left "#[fg=white,nobold]"
|
||||||
set -g status-left "#[fg=#84AEF0,bg=default]#[fg=#000000,bg=#84AEF0,bold]#S#[fg=#84aef0,bg=default]#[fg=white,bg=default] #(gitmux -timeout 500ms -cfg $HOME/.gitmux.conf)#[fg=white] ❭ " # session name
|
set -g status-left "#[fg=#84AEF0,bg=default]#[fg=#000000,bg=#84AEF0,bold]#S#[fg=#84aef0,bg=default]#[fg=white,bg=default] #(gitmux -timeout 500ms -cfg $HOME/.gitmux.conf)#[fg=white] ❭ " # session name
|
||||||
|
|
||||||
# Bar Right
|
# Bar Right
|
||||||
set -g status-right-length 100
|
set -g status-right-length 100
|
||||||
set -g status-right "#{now_playing} "
|
set -g status-right "#{now_playing} "
|
||||||
|
|
||||||
# Windows
|
# Window status format
|
||||||
set -g window-status-current-format "#[fg=magenta,bg=default]#[fg=#000000,bold,bg=magenta]#I#[fg=magenta,bg=#303042] #[fg=white,bg=#303042]#W#{?window_zoomed_flag, ,}#[fg=#303042,bg=default]"
|
set -g window-status-current-format "#[fg=magenta,bg=default]#[fg=#000000,bold,bg=magenta]#I#[fg=magenta,bg=#303042] #[fg=white,bg=#303042]#W#{?window_zoomed_flag, ,}#[fg=#303042,bg=default]"
|
||||||
set -g window-status-separator " "
|
set -g window-status-separator " "
|
||||||
set -g window-status-format "#[fg=#000000,bg=default]#[fg=white,bg=#000000]#I#[fg=#000000,bg=#303042] #[fg=white,bg=#303042]#W#{?window_bell_flag,,}#[fg=#303042,bg=default]"
|
set -g window-status-format "#[fg=#000000,bg=default]#[fg=white,bg=#000000]#I#[fg=#000000,bg=#303042] #[fg=white,bg=#303042]#W#{?window_bell_flag,,}#[fg=#303042,bg=default]"
|
||||||
|
|
||||||
# Change the default delay
|
|
||||||
set -sg escape-time 0
|
|
||||||
|
|
||||||
# Mouse integration
|
|
||||||
set -g mouse on
|
|
||||||
|
|
||||||
# Vi mode
|
|
||||||
set -g @shell_mode 'vi'
|
|
||||||
|
|
||||||
# ========= Keybindings =========
|
|
||||||
|
|
||||||
# Force a reload of the config file
|
# Force a reload of the config file
|
||||||
bind r source-file ~/.tmux.conf\; display "Reloaded!"
|
bind r source-file ~/.config/tmux/tmux.conf\; display "Reloaded!"
|
||||||
|
|
||||||
# Swap Window to Position 1
|
# Swap Window to Position 1
|
||||||
bind-key T swap-window -t 1
|
bind-key T swap-window -t 1
|
||||||
@@ -104,12 +63,6 @@ bind O new-window -c "#{pane_current_path}" -n " " lf
|
|||||||
# Yazi Terminal File Manager
|
# Yazi Terminal File Manager
|
||||||
bind W new-window -c "#{pane_current_path}" -n " " yazi
|
bind W new-window -c "#{pane_current_path}" -n " " yazi
|
||||||
|
|
||||||
# Run Neovim Telescope find files
|
|
||||||
bind F run-shell "nvr-tmux --remote-send '<ESC>:Telescope find_files<CR>'"
|
|
||||||
|
|
||||||
# Open cht.sh
|
|
||||||
bind-key -r i run-shell "tmux neww tmux-cht.sh"
|
|
||||||
|
|
||||||
# Tile all windows
|
# Tile all windows
|
||||||
bind = select-layout tiled
|
bind = select-layout tiled
|
||||||
|
|
||||||
@@ -126,8 +79,10 @@ bind-key -T copy-mode-vi Enter send-keys -X copy-selection
|
|||||||
|
|
||||||
bind P run "tmux paste-buffer"
|
bind P run "tmux paste-buffer"
|
||||||
|
|
||||||
|
# Thumbs command
|
||||||
set -g @thumbs-command 'echo -n {} | pbcopy'
|
set -g @thumbs-command 'echo -n {} | pbcopy'
|
||||||
|
|
||||||
|
# Sesh integration
|
||||||
bind-key "T" run-shell "sesh connect \"$(
|
bind-key "T" run-shell "sesh connect \"$(
|
||||||
sesh list | fzf-tmux -p 55%,60% \
|
sesh list | fzf-tmux -p 55%,60% \
|
||||||
--no-sort --border-label ' sesh ' --prompt '⚡ ' \
|
--no-sort --border-label ' sesh ' --prompt '⚡ ' \
|
||||||
@@ -140,31 +95,3 @@ bind-key "T" run-shell "sesh connect \"$(
|
|||||||
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
|
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
|
||||||
--bind 'ctrl-d:execute(tmux kill-session -t {})+change-prompt(⚡ )+reload(sesh list)'
|
--bind 'ctrl-d:execute(tmux kill-session -t {})+change-prompt(⚡ )+reload(sesh list)'
|
||||||
)\""
|
)\""
|
||||||
|
|
||||||
# ========= Plugins =========
|
|
||||||
|
|
||||||
# prefix + I to install, prefix + U to update
|
|
||||||
set -g @plugin 'tmux-plugins/tpm'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-battery'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-copycat'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-logging'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-open'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-pain-control'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-sessionist'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-urlview'
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
|
||||||
set -g @plugin 'schasse/tmux-jump'
|
|
||||||
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
|
|
||||||
set -g @plugin 'carlocab/tmux-nvr'
|
|
||||||
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
|
|
||||||
set -g @plugin 'wfxr/tmux-fzf-url' # u
|
|
||||||
# set -g @plugin 'joshmedeski/t-smart-tmux-session-manager'
|
|
||||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
|
||||||
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
|
|
||||||
set -g @plugin 'fcsonline/tmux-thumbs'
|
|
||||||
|
|
||||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
|
||||||
run '~/.tmux/plugins/tpm/tpm'
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
awk
|
|
||||||
cargo
|
|
||||||
cat
|
|
||||||
chmod
|
|
||||||
chown
|
|
||||||
cp
|
|
||||||
cp
|
|
||||||
docker
|
|
||||||
docker-compose
|
|
||||||
find
|
|
||||||
fzf
|
|
||||||
git
|
|
||||||
git-commit
|
|
||||||
git-rebase
|
|
||||||
git-status
|
|
||||||
git-worktree
|
|
||||||
grep
|
|
||||||
head
|
|
||||||
jq
|
|
||||||
kill
|
|
||||||
less
|
|
||||||
ls
|
|
||||||
lsof
|
|
||||||
make
|
|
||||||
man
|
|
||||||
mv
|
|
||||||
ps
|
|
||||||
rename
|
|
||||||
rg
|
|
||||||
rm
|
|
||||||
sed
|
|
||||||
ssh
|
|
||||||
stow
|
|
||||||
tail
|
|
||||||
tar
|
|
||||||
tldr
|
|
||||||
tr
|
|
||||||
xargs
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
bash
|
|
||||||
css
|
|
||||||
html
|
|
||||||
javascript
|
|
||||||
lua
|
|
||||||
nodejs
|
|
||||||
python
|
|
||||||
python3
|
|
||||||
ruby
|
|
||||||
rust
|
|
||||||
solidity
|
|
||||||
tmux
|
|
||||||
typescript
|
|
||||||
zsh
|
|
||||||
Reference in New Issue
Block a user