commit f97c9c9a129a0964e5d6754608e4976d1a1364cd Author: Dmitry Chumak Date: Fri Aug 5 20:52:23 2022 +0300 initial commit + tmux.conf diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1af14d0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "dotbot"] + path = dotbot + url = https://github.com/anishathalye/dotbot + ignore = dirty diff --git a/dotbot b/dotbot new file mode 160000 index 0000000..d2f76a2 --- /dev/null +++ b/dotbot @@ -0,0 +1 @@ +Subproject commit d2f76a25933f97cd37ef94e3bf9c134b9c55a02a diff --git a/install b/install new file mode 100755 index 0000000..5a7e72c --- /dev/null +++ b/install @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +CONFIG="install.conf.yaml" +DOTBOT_DIR="dotbot" + +DOTBOT_BIN="bin/dotbot" +BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +cd "${BASEDIR}" +git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive +git submodule update --init --recursive "${DOTBOT_DIR}" + +"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}" diff --git a/install.conf.yaml b/install.conf.yaml new file mode 100644 index 0000000..bd10ab8 --- /dev/null +++ b/install.conf.yaml @@ -0,0 +1,11 @@ +- defaults: + link: + relink: true + +- clean: ['~'] + +- link: + ~/.tmux.conf: tmux.conf + +- shell: + - [git submodule update --init --recursive, Installing submodules] diff --git a/tmux.conf b/tmux.conf new file mode 100755 index 0000000..b74f377 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,79 @@ + +set -g mouse on +set -g set-clipboard external +set-option -g status-position top + +# remap prefix from 'C-b' to 'C-x', 0x18 hex code for iterm2 +unbind C-b +set-option -g prefix C-x +bind-key C-x send-prefix + +# reload config file (change file location to your the tmux.conf you want to use) +bind r source-file ~/.tmux.conf \; display "Reloaded!" + +# split panes using | and - +bind | split-window -h +bind - split-window -v +unbind '"' +unbind % + +# switching and creating windows using Shift-arrow without prefix +bind -n S-down new-window +bind -n S-left prev +bind -n S-right next + +# resizing panes using Ctrl-Alt-arrows without prefix +bind -n C-M-Up resize-pane -U 2 +bind -n C-M-Down resize-pane -D 2 +bind -n C-M-Left resize-pane -L 10 +bind -n C-M-Right resize-pane -R 10 +bind -n C-M-k resize-pane -U 2 +bind -n C-M-j resize-pane -D 2 +bind -n C-M-h resize-pane -L 10 +bind -n C-M-l resize-pane -R 10 + +# switch panes using Alt-arrow without prefix +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" +bind -n WheelDownPane select-pane -t= \; send-keys -M +bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M +bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up +bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down +bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up +bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down + + +########################### +# Colors +########################### + +# color status bar +set -g status-style fg=white,bg=colour235 +# color of message bar +set -g message-style fg=white,bold,bg=green + +# highlight current window +setw -g window-status-style fg=cyan,bg=colour235 +setw -g window-status-current-style fg=white,bold,bg=red + +# set color of active pane +set -g pane-border-style fg=colour240,bg=black +set -g pane-active-border-style fg=green,bg=black + +# To copy, left click and drag to highlight text in yellow, +# once you release left click yellow text will disappear and will automatically be available in clibboard +# # Use vim keybindings in copy mode +setw -g mode-keys vi +# Update default binding of `Enter` to also use copy-pipe +unbind -T copy-mode-vi Enter +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c" +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"