【发布时间】:2016-11-03 03:33:03
【问题描述】:
我已经尝试解决这个问题两周了,但没有运气。
我在 OSX 上使用 Iterm2,使用 tmux 作为会话管理器。我在.vimrc 中有以下两个绑定的 VIM 设置
"_____Easy change tab left and right____
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>
nnoremap <C-h> :tabprevious<CR>
nnoremap <C-l> :tabnext<CR>
现在奇怪的部分是 ctrl h 和 l 快捷键完美地工作,而左箭头显示。
E349: No identifier under cursor
这似乎与应该发生的事情无关(它在 TMUX 之外完美运行!),但使用 :map 检查我的映射不会显示任何冲突的映射。但我就是想不通。任何帮助都将不胜感激。下面是我的 tux.conf 文件。由于这在 tmux 之外完美工作,我不相信 vimrc 应该与此有任何关系。
我感觉它的 Iterm2 向终端发送了奇怪的东西,而 tmux 误解了它们,但我不知道如何解决它。
tmux.conf
#set -g default-terminal "xterm-256color"
set -sg escape-time 0
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# don't rename windows automatically
set-option -g allow-rename off
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-S-Left previous-window
bind -n M-S-Right next-window
# Dont clear screen after other program is on
set-window-option -g alternate-screen on
#set-window-option -g xterm-keys on
【问题讨论】: