From f1284412e46463389933eefddc044bed356da3b2 Mon Sep 17 00:00:00 2001 From: George Rawlinson Date: Sat, 29 Oct 2016 18:09:40 +1300 Subject: [PATCH] Add tmux configuration --- Makefile | 12 +++++++--- SOFTWARE.md | 1 + nvim/.config/nvim/init.vim | 39 ++++++++++++++++++++++++------- tmux/.config/tmux/tmux.conf | 42 ++++++++++++++++++++++++++++++++++ urxvt/.Xresources | 5 +++- zsh/.oh-my-zsh/custom/tmux.zsh | 8 +++++++ 6 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 tmux/.config/tmux/tmux.conf create mode 100644 zsh/.oh-my-zsh/custom/tmux.zsh diff --git a/Makefile b/Makefile index e241254..17f44ec 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help git lftp npm nvim ssh sway urxvt wallpapers zsh clean +.PHONY: help git lftp npm nvim ssh sway tmux urxvt wallpapers zsh clean .DEFAULT: help @@ -10,13 +10,14 @@ help: @echo "nvim > neovim config & plugins" @echo "ssh > safe-ish ssh config" @echo "sway > minimal tiling wm for naughty computers" + @echo "tmux > tmux config" @echo "urxvt > terminal colours & keyboard settings" @echo "wallpapers > system wallpapers" @echo "zsh > shell, aliases and cool stuff" @echo "" @echo " mostly, i'm just lazy" -all: git lftp npm nvim ssh sway urxvt wallpapers zsh +all: git lftp npm nvim ssh sway tmux urxvt wallpapers zsh git: @stow -t ~/ git @@ -40,6 +41,10 @@ ssh: sway: @stow -t ~/ sway +tmux: + git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm + @stow -t ~/ tmux + urxvt: @stow -t ~/ urxvt @@ -52,10 +57,11 @@ zsh: @stow -t ~/ zsh clean: - @stow -D git lftp npm nvim ssh sway urxvt zsh + @stow -D git lftp npm nvim ssh sway tmux urxvt zsh @rm -rf ~/.config/git \ ~/.config/lftp ~/.local/share/lftp \ ~/.config/npm ~/.cache/npm ~/.local/share/npm \ ~/.config/nvim \ ~/.config/sway \ + ~/.config/tmux \ ~/.oh-my-zsh diff --git a/SOFTWARE.md b/SOFTWARE.md index c8a6e38..22fe97c 100644 --- a/SOFTWARE.md +++ b/SOFTWARE.md @@ -52,3 +52,4 @@ * nvim * unzip * rxvt-unicode +* tmux diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index f4354de..e3240de 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -1,18 +1,14 @@ call plug#begin() -" Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' - -" Themes Plug 'sickill/vim-monokai' - -" Git Plug 'airblade/vim-gitgutter' - -" Config Plug 'tpope/vim-sensible' Plug 'chrisbra/sudoedit.vim' +Plug 'scrooloose/nerdtree' +"Plug 'ntpeters/vim-better-whitespace' +"Plug 'nathanaelkane/vim-indent-guides' call plug#end() @@ -22,6 +18,17 @@ set encoding=utf-8 " View line numbers set number +" Display +set tabstop=4 +set shiftwidth=4 +"set expandtab +"set softtabstop=4 + +" Show tabs & trailing space +"set listchars=tab:»·,trail:· +set listchars=tab:▸\ ,trail:·,eol:¬ +set list + " Configure vim-airline let g:airline_theme='simple' set laststatus=2 @@ -29,6 +36,22 @@ set laststatus=2 " Configure vim-monokai with syntax highlighting colorscheme monokai syntax enable +let g:load_doxygen_syntax=1 -" Enable clipboard yanking +" Configure vim-indent-guides with suitable colours +"let g:indent_guides_auto_colors=0 +"hi IndentGuidesOdd ctermbg=235 +"hi IndentGuidesEven ctermbg=237 +" Also load on startup +"let g:indent_guides_enable_on_vim_startup=1 + +"Use system clipboard set clipboard+=unnamedplus + +" Disable UDLR keys (prefer HJKL) +noremap +noremap +noremap +noremap + +" TODO: commenting plugin -> commentary/tcomment/nerdcommenter diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf new file mode 100644 index 0000000..5bd4d0a --- /dev/null +++ b/tmux/.config/tmux/tmux.conf @@ -0,0 +1,42 @@ +# remap prefix from 'C-b' to 'C-a' +unbind C-b +set -g prefix C-a +bind C-a send-prefix + +# Enable mouse mode +set -g mouse on + +# Stop renaming windows automatically +set-option -g allow-rename off + +# Display +# Status Bar +set-option -g status-position top + +set -g base-index 1 # start window numbering at 1 +set -g pane-base-index 1 # make pane numbering consistent with windows +set -g renumber-windows on #renumber windows when window closed + +# TMUX plugin manager +# Conform to XDG Base Directory specification +set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins' + +#List of plugins +set -g @tpm_plugins ' \ + tmux-plugins/tpm \ + tmux-plugins/tmux-yank \ + tmux-plugins/tmux-sensible \ + tmux-plugins/tmux-pain-control \ +' + +# Other examples: +# set -g @plugin 'github_username/plugin_name' +# set -g @plugin 'git@github.com/user/plugin' +# set -g @plugin 'git@bitbucket.com/user/plugin' + +# Install TPM if not already installed +if "test ! -d ~/.config/tmux/plugins/tpm" \ + "run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm'" + +# Initialise TMUX plugin manager (always keep at bottom) +run ~/.config/tmux/plugins/tpm/tpm diff --git a/urxvt/.Xresources b/urxvt/.Xresources index 5523a2c..6148557 100644 --- a/urxvt/.Xresources +++ b/urxvt/.Xresources @@ -31,6 +31,9 @@ URxvt.scrollBar: false URxvt.internalBorder: 0 ! Perl Extensions: Clickable URLs + Simple Tabs -URxvt.perl-ext-common: default,matcher,tabbed +! URxvt.perl-ext-common: default,matcher,tabbed + +! Perl Extensions: Clickable URLs +URxvt.perl-ext-common: default,matcher URxvt.url-launcher: /usr/bin/xdg-open URxvt.matcher.button: 1 diff --git a/zsh/.oh-my-zsh/custom/tmux.zsh b/zsh/.oh-my-zsh/custom/tmux.zsh new file mode 100644 index 0000000..9c09ef1 --- /dev/null +++ b/zsh/.oh-my-zsh/custom/tmux.zsh @@ -0,0 +1,8 @@ +# Conform to XDG Base Directory specification +export TMUX_TMPDIR="$XDG_RUNTIME_DIR" +alias tmux='tmux -f ~/.config/tmux/tmux.conf' + +# Connect to remote tmux session via SSH +ssh-tmux(){ + ssh -t $@ "tmux attach || tmux new"; +}