Skip to content

Commit

Permalink
manage tmux plugins with tpm
Browse files Browse the repository at this point in the history
  • Loading branch information
izumin5210 committed Mar 31, 2024
1 parent cfbb206 commit 9c246b0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/config/.vim/autoload/plug.vim
/config/.config/karabiner/*
!/config/.config/karabiner/karabiner.json
/config/.config/tmux/plugins

# Nix
/result
3 changes: 1 addition & 2 deletions bin/deploy-config-files
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ mkdir -p ~/.config
./bin/ln-idempotently ./config/.config/nvim ~/.config/nvim

# tmux
mkdir -p ~/.config/tmux
./bin/ln-idempotently ./config/.config/tmux/tmux.base.conf ~/.config/tmux/tmux.base.conf
./bin/ln-idempotently ./config/.config/tmux ~/.config/tmux

# ruby
./bin/ln-idempotently ./config/.config/irb ~/.config/irb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ set -g status-style "none"
# left panel
set -g status-left-length 100
set -g status-left-style "none,fg=#{@colorGray},align=right"
set -g status-left ' #S#[default] #{@separator} #(b=$(cd #{pane_current_path}; git info slug -s); test -n "$b" && echo "  $b #{@separator}")#(b=$(cd #{pane_current_path}; git info branch --max-len 24 --short); test -n "$b" && echo "  $b #{@separator}")'

set -g status-left ' #S#[default] #{@separator} #(cd #{pane_current_path} && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo "  $(git info slug -s) #{@separator}  $(git info branch --max-len 24 --short) #{@separator}")'

# right panel
set -g status-right-style "none"
Expand Down Expand Up @@ -87,7 +88,7 @@ unbind C-b
set -sg escape-time 1

# 設定ファイルをリロードする
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!"
bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display "Reloaded!"

# copy mode with vi keybind
set-window-option -g mode-keys vi
Expand All @@ -103,7 +104,7 @@ set-option -g mouse off
# plugins
# ================================================

# manage plugins with Nix
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-resurrect'
Expand All @@ -115,6 +116,13 @@ set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm,fullscreen'

tpm_version="3.1.0"
tpm_dir="${XDG_CONFIG_HOME}/tmux/plugins/tpm"
tpm_repo_url="https://github.com/tmux-plugins/tpm.git"
if "test ! -d ${tpm_dir}" \
"run 'git clone --depth=1 -b v${tpm_version} ${tpm_repo_url} ${tpm_dir} && ${tpm_dir}/bindings/install_plugins'"

run "${tpm_dir}/tpm"

# ================================================
# Vim Tmux Navigator
Expand Down
19 changes: 1 addition & 18 deletions home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
pkgs.sheldon

# tmux
pkgs.tmux
pkgs.reattach-to-user-namespace # only darwin

# middlewares
Expand Down Expand Up @@ -120,24 +121,6 @@
# EDITOR = "emacs";
};

programs= {
tmux = {
enable = true;
extraConfig = ''
source $HOME/.config/tmux/tmux.base.conf
'';
plugins = with pkgs; [
{ plugin = tmuxPlugins.yank; }
{ plugin = tmuxPlugins.open; }
{ plugin = tmuxPlugins.resurrect; }
{ plugin = tmuxPlugins.pain-control; }
{ plugin = tmuxPlugins.continuum; }
];
sensibleOnTop = false;
tmuxp.enable = false;
};
};

# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

0 comments on commit 9c246b0

Please sign in to comment.