dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 0f3f8c9ddfa8bb846b8ea1a34f739ef8c73842cc
parent 68e21c4dafc88668a8b58aae7da7c35c997428ce
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date:   Thu,  4 Jun 2015 19:17:35 +0200

improve tmux-vim integration, increase spacemacs font size

Diffstat:
M.spacemacs | 2+-
M.tmux.conf | 34++++++++++++++++++++++++++++------
M.vimrc | 14+++++++++++++-
Mosx-install.sh | 2++
4 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/.spacemacs b/.spacemacs @@ -82,7 +82,7 @@ before layers configuration." ; :width normal ; :powerline-scale 1.1) dotspacemacs-default-font '("PragmataPro" - :size 11 + :size 12 :weight normal :width normal :powerline-scale 1.1) diff --git a/.tmux.conf b/.tmux.conf @@ -1,5 +1,5 @@ # C-a as tmux key -set-option -g prefix C-a +set-option -g prefix C-Space bind-key C-s last-window # Go to last window with C-a C-s bind-key C-a last-pane # Go to last pane with C-a C-a #set-option -g prefix C-b @@ -17,18 +17,40 @@ bind Escape copy-mode unbind p bind p paste-buffer bind-key -t vi-copy 'v' begin-selection -bind-key -t vi-copy 'y' copy-selection +#bind-key -t vi-copy 'y' copy-selection +bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" # vi-like movement -bind-key k select-pane -U -bind-key j select-pane -D -bind-key h select-pane -L -bind-key l select-pane -R +#bind-key k select-pane -U +#bind-key j select-pane -D +#bind-key h select-pane -L +#bind-key l select-pane -R bind -r K resize-pane -U 5 bind -r J resize-pane -D 5 bind -r H resize-pane -L 5 bind -r L resize-pane -R 5 +# Smart pane switching with awareness of vim splits +is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' +bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" +bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" +bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" +bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" +bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" +#bind h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" +#bind j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" +#bind k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" +#bind l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" +# split window +bind v split-window -v +bind C-v split-window -v +bind s split-window -h +bind C-s split-window -h + +# Copy mode with <C-Space><Space> +bind Space copy-mode +bind C-Space copy-mode + # zoom pane bind -r z resize-pane -Z diff --git a/.vimrc b/.vimrc @@ -89,6 +89,9 @@ NeoBundle 'msanders/snipmate.vim' " vim motion on speed NeoBundle 'Lokaltog/vim-easymotion' +" navigate between vim and tmux panes seamlessly +NeoBundle 'christoomey/vim-tmux-navigator' + " Take notes in rst "NeoBundle 'Rykka/clickable.vim' "NeoBundle 'Rykka/riv.vim' @@ -385,7 +388,16 @@ nmap <leader>c :Start ctags -R --python-kinds=-i --langmap=c++:.cu,c++:.cuh .<CR " Use the Ctrl-P plugin to search the tags nmap <leader>t :CtrlPTag<CR> nmap <leader>p :CtrlPBuffer<CR> -nmap <leader>o :CtrlPMRUFiles<CR> +nmap <leader>O :CtrlPMRUFiles<CR> +nmap <leader>o :CtrlP<CR> + +" Copy and paste to system clipboard with <Space>p and <Space>y +vmap <Leader>y "+y +vmap <Leader>d "+d +nmap <Leader>p "+p +nmap <Leader>P "+P +vmap <Leader>p "+p +vmap <Leader>P "+P " Launch Ack "nmap <leader>a :Ack diff --git a/osx-install.sh b/osx-install.sh @@ -25,7 +25,9 @@ brews=( "autoconf"\ "pcre"\ "pkg-config"\ "pwgen"\ + "reattach-to-user-namespace"\ "tmux"\ + "the_silver_searcher"\ "tree"\ "vim"\ "watch"\