Skip to content

Commit

Permalink
Fix modifier shortcuts (shift/ctrl/opt) with tmux shell/vim.
Browse files Browse the repository at this point in the history
  • Loading branch information
henrik committed Mar 3, 2012
1 parent b24048f commit c9ee135
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ The `extras` directory contains additional configuration files that are not dotf
* [WhatFont](http://chengyinliu.com/whatfont.html)
* [iPhoto Library Manager](http://www.fatcatsoftware.com/iplm/)
* [iStat Menus](http://bjango.com/mac/istatmenus/)
* [iTerm2](http://www.iterm2.com)
* [iTerm2](http://www.iterm2.com) - Keyboard shortcuts should be xterm defaults
* [KeyRemap4MacBook](http://pqrs.org/macosx/keyremap4macbook/) – Bind right-Option to Enter
* [Little Snapper](http://www.realmacsoftware.com/littlesnapper/) – UI inspiration bin
* [Mailplane](http://mailplaneapp.com/)
* [PCKeyboardHack](http://pqrs.org/macosx/keyremap4macbook/extra.html) – Bind Caps Lock to F9 (see `.vimrc`)
* \*[Reeder](http://reederapp.com/)
* [SlimBatteryMonitor](http://www.orange-carb.org/SBM/)
* [SuperDuper](http://www.shirt-pocket.com/SuperDuper/)
Expand Down
15 changes: 14 additions & 1 deletion inputrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ set completion-ignore-case on
Control-j: menu-complete
Control-k: menu-complete-backward

# opt+left, opt+right
# Map modifiers (xterm defaults)
#
# Figure out the code in Vim:
# * go into insert mode:
# * type ctrl+v
# * type the shortcut
#
# opt+left, opt+right outside tmux
"\e[1;9D": backward-word
"\e[1;9C": forward-word
# opt+left, opt+right in tmux
"\e[1;3D": backward-word
"\e[1;3C": forward-word
# shift+left, shift+right
"\e[1;2D": backward-word
"\e[1;2C": forward-word
3 changes: 3 additions & 0 deletions tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
set-option -g default-command "reattach-to-user-namespace -l bash"

# Make shift+arrows, ctrl+arrows etc work in Vim.
set -g xterm-keys on

# Cycle panes with "C-b, b".
unbind ^B
bind ^B select-pane -t :.+
Expand Down
5 changes: 0 additions & 5 deletions vim/config/mappings.vim
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ nmap <leader><down> :rightbelow sp<CR>

" These rely on the vim-unimpaired plugin.

" Unbreak with tmux.
" http://blog.yjl.im/2010/01/key-control-code-issue-in-between-vim.html
map  <C-Up>
map  <C-Down>
" Move single lines.
nmap <C-Up> [e
nmap <C-Down> ]e
Expand Down

0 comments on commit c9ee135

Please sign in to comment.