tmux: start configuration (already looks nice)

This commit is contained in:
Théophile Bastian 2017-05-21 14:02:16 +02:00
parent 7ea527598a
commit 7f7a461aba
2 changed files with 52 additions and 4 deletions

46
files/.tmux.conf Normal file
View file

@ -0,0 +1,46 @@
# Set $TERM env
set -g default-terminal "screen-256color"
# Set prefix to ^A
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Navigation
## Navigation in panes with C+hjkl integrated with vim
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
## Navigation in windows with alt+shift+jk
bind -n M-j select-window -p
bind -n M-k select-window -n
# Splitting
unbind %
unbind '"'
bind | split-window -h
bind - split-window -v
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Reload tmux conf
unbind r
bind r source-file ~/.tmux.conf \; display-message " Config reloaded".
# Status bar
set status-bg colour237
set status-fg colour216
set-option -g status-left '#[fg=colour196][#[fg=default]#S#[fg=colour196]]#[fg=default] '
set-option -g status-right \
'#[fg=colour196][#[fg=default]#(whoami)#[fg=colour196]@\
#[fg=default]#h#[fg=colour196]]#[fg=default] \
#[fg=colour196][#[fg=default]#(date "+%H:%M %F")#[fg=colour196]]#[fg=defaultb'
# Current window
set-window-option -g window-status-current-bg colour215
set-window-option -g window-status-current-fg colour88
set-window-option -g window-status-current-format ' #I:#W#F '

View file

@ -21,10 +21,11 @@ set wildmenu
" Splitting " Splitting
set splitbelow set splitbelow
set splitright set splitright
nnoremap <C-J> <C-W><C-J> "" Replaced by christoomey/vim-tmux-navigator
nnoremap <C-K> <C-W><C-K> " nnoremap <C-J> <C-W><C-J>
nnoremap <C-L> <C-W><C-L> " nnoremap <C-K> <C-W><C-K>
nnoremap <C-H> <C-W><C-H> " nnoremap <C-L> <C-W><C-L>
" nnoremap <C-H> <C-W><C-H>
set exrc set exrc
set secure set secure
@ -60,6 +61,7 @@ Plugin 'vim-airline/vim-airline-themes'
"Plugin 'davidhalter/jedi-vim' "Plugin 'davidhalter/jedi-vim'
Plugin 'vim-scripts/a.vim' Plugin 'vim-scripts/a.vim'
Plugin 'rhysd/vim-clang-format' Plugin 'rhysd/vim-clang-format'
Plugin 'christoomey/vim-tmux-navigator'
call vundle#end() " required call vundle#end() " required
filetype plugin indent on " required filetype plugin indent on " required