dot

packages and services management
Log | Files | Refs | README

commit 65c53bc5bfb48044b7cbef4a7dad01784310a8a8
parent 0a6c96c036d5470b853c954c486637f3e7beaa5c
Author: josuah <mail@josuah.net>
Date:   Wed, 21 Sep 2016 23:39:01 -0400

Added tmux config

Diffstat:
Abin/.lsync.swp | 0
Mshell/.profile | 8++++----
Atmux/.tmux.conf | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvim/.vimrc | 34+++++++++++++++++++++++++++-------
4 files changed, 114 insertions(+), 11 deletions(-)

diff --git a/bin/.lsync.swp b/bin/.lsync.swp Binary files differ. diff --git a/shell/.profile b/shell/.profile @@ -41,7 +41,7 @@ ps1() printf '\n' # Line separator - local p='----------------------------------------' + local p='________________________________________' printf '\033[30;1m%s\033[0m\r' "$p$p" # Date @@ -65,8 +65,8 @@ ps1() local abduco=" $(($(abduco 2>/dev/null | wc -l) - 1)) " printf '\033[51C\033[33;1m%s\033[0m\r' "${abduco# 0 }" - # Non printable: terminal status, bell - printf '\a\033]0;shell\007' + # Non printable: terminal status, bell, empty line at the bottom. + printf '\a\033]0;shell\007\033[s\n\n\033[2A' # Last line for prompt printf '\n$ ' @@ -79,7 +79,7 @@ export PS2='| ' # ALIAS #------------------------------------------------------------------------------- -alias l='ls -F -C -w 80 --color' +alias l='ls -F -w 80 --color' alias ll='l -lh' alias la='l -A' alias lla='l -Alh' diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf @@ -0,0 +1,83 @@ +# /\ +# / /_ ________ __ /\ __ __ +# / ___\/ __ __ \ / / / / \ \' / +# / / / / / / / // /_/ / ,' ,' +# \/ \/ \/ \/ \____/ /_,\_\ 2016-09-21 +#=============================================================================== + +set -g base-index 1 +set -g pane-base-index 1 +set -g renumber-windows on + + +# KEYBINDINGS 2016-09-21 +# ------------------------------------------------------------------------------ + +set -g prefix C-Space +unbind C-b + +set-option -g status-keys vi + +# Copy mode +bind -t vi-copy v begin-selection +bind -t vi-copy C-v rectangle-toggle +bind -t vi-copy y copy-pipe "xclip -i" + +# Vim/Tmux Navigation +bind -n C-k if "[ $(tmux display -p '#{pane_current_command}') = vim ]" \ + "send-keys C-k" "select-pane -U" +bind -n C-j if "[ $(tmux display -p '#{pane_current_command}') = vim ]" \ + "send-keys C-j" "select-pane -D" +bind -n C-h if "[ $(tmux display -p '#{pane_current_command}') = vim ]" \ + "send-keys C-h" "select-pane -L" +bind -n C-l if "[ $(tmux display -p '#{pane_current_command}') = vim ]" \ + "send-keys C-l" "select-pane -R" + +# Reload config +bind r source-file ~/.tmux.conf\; display-message "Config reloaded" + + +# APPEARANCE 2016-09-21 +#------------------------------------------------------------------------------- + +set -g message-fg white +set -g message-bg black +set -g message-attr bright + +set -g display-panes-colour red + + +# STATUS 2016-09-21 +#------------------------------------------------------------------------------- + +set -g status-position bottom +set -g status-keys vi +set -g status-justify left + +set -g status-left " #S " +set -g status-right " %y-%m-%d #[bold] %R " + +set -g status-fg white +set -g status-bg black + +set -g window-status-separator " " + +set -g window-status-format " #I #W " +set -g window-status-style bold,fg=black + +set -g window-status-current-format " #I #W " +set -g window-status-current-style bold,fg=white + +set -g window-status-bell-style default +set -g window-status-bell-fg black +set -g window-status-bell-bg red + + +# BORDERS 2016-09-21 +#------------------------------------------------------------------------------- + +set -g pane-border-bg default +set -g pane-border-fg white + +set -g pane-active-border-bg default +set -g pane-active-border-fg white diff --git a/vim/.vimrc b/vim/.vimrc @@ -11,11 +11,11 @@ "------------------------------------------------------------------------------- set autoindent copyindent " Indentation -set laststatus=0 " Status +set laststatus=2 ruler statusline= " Status set smartcase ignorecase " Case set showmatch " Highlight set list listchars=tab::\ ,trail:.,nbsp:.,extends:>,precedes:< " Listchars -set ruler rulerformat=%40(%t%4m%=%l,%-7(%c%V%)%4P%) " Ruler +set fillchars=stl:_,stlnc:_,vert:\| set number numberwidth=5 cursorline nowrap " Interface set scrolloff=3 " Scroll set backupdir=~/.cache/vim// directory=~/.cache/vim// " Backup, cache @@ -23,6 +23,19 @@ set virtualedit=block formatprg=fmt " Editing set wildmenu wildmode=longest:full,full " Completion +" FUNCTIONS +"------------------------------------------------------------------------------- + +function! TmuxMove(dir) + let wnr = winnr() + silent! execute 'wincmd ' . a:dir + " If the winnr is still the same after we moved, it is the last pane + if wnr == winnr() + call system('tmux select-pane -' . tr(a:dir, 'phjkl', 'lLDUR')) + end +endfunction + + " MAPPINGS 2016-09-20 "------------------------------------------------------------------------------- @@ -52,10 +65,11 @@ nmap <leader>e :pwd \| echo ''<cr>:exe 'e' \ \| redraw!<cr> " <c>hange <o>ption <...> -nmap col :set list !<cr>:set list ?<cr> -nmap con :set number !<cr>:set number ?<cr> -nmap cop :set paste !<cr>:set paste ?<cr> -nmap coh :set hlsearch !<cr>:set hlsearch ?<cr> +nmap col :set list ! \| set list ?<cr> +nmap con :set number ! \| set number ?<cr> +nmap cor :set relativenumber ! \| set number ?<cr> +nmap cop :set paste ! \| set paste ?<cr> +nmap coh :set hlsearch ! \| set hlsearch ?<cr> nmap cov :set ve=<c-r>=(&ve =~# "all") ? 'block' : 'all'<cr><cr>:set ve ?<cr> nmap cos :if exists("g:syntax_on") \| sy off \| else \| sy enable \| end<cr> nmap cot :set tw=<c-r>=(&tw != "0" ) ? '0' : '75' <cr> <cr>:set tw ?<cr> @@ -68,6 +82,12 @@ nmap [C :cfirst<cr> | nmap ]C :clast<cr> nmap [<leader> mzO<Esc>k`z<C-e> nmap ]<leader> mzo<Esc>k`z +" Navigation +nmap <c-h> :call TmuxMove('h')<cr> +nmap <c-j> :call TmuxMove('j')<cr> +nmap <c-k> :call TmuxMove('k')<cr> +nmap <c-l> :call TmuxMove('l')<cr> + " Parentheses vmap <leader>p myomzr\|`zlhr\`ylhr/ @@ -87,7 +107,7 @@ highlight SpecialKey cterm=bold ctermfg=0 highlight Cursorline cterm=bold highlight StatusLine cterm=bold ctermfg=3 highlight StatusLineNC cterm=bold ctermfg=7 -highlight VertSplit cterm=none ctermfg=7 ctermbg=7 +highlight VertSplit cterm=none ctermfg=7 ctermbg=0 " AUTOCOMMANDS 2016-09-10