运行Ubuntu 15并打开tmux会话。在该会话中,我打开vim并按Ctrl-p并开始搜索文件。当我点击向上箭头时没有任何反应。
如果我不打开tmux并且只是打开vim ctrl-p工作正常。想法?
tmux.conf
setw -g xterm-keys on
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# act like GNU screen
unbind C-b
set -g prefix C-a
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# soften status bar color from harsh green to light gray
set -g status-bg '#666666'
set -g status-fg '#aaaaaa'
# remove administrative debris (session name, hostname, time) in status bar
set -g status-left ''
set -g status-right ''
# increase scrollback lines
set -g history-limit 10000
# switch to last pane
bind-key C-a last-pane
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
的.vimrc
set nocompatible
let mapleader = ","
set backspace=2
set nobackup
set nowritebackup
set noswapfile
set history=50
set ruler
set showcmd
set incsearch
set laststatus=2
set autoread
set ignorecase
set smartcase
set tabstop=2
set shiftwidth=2
set shiftround
set list listchars=tab:»·,trail:·,nbsp:·
set textwidth=80
set colorcolumn=+1
"set number
set splitbelow
set splitright
set winwidth=84
set winheight=5
set winminheight=5
set winheight=999
set matchpairs+=<:>
" Treat <li> and <p> tags like the block tags they are
let g:html_indent_tags = 'li\|p'
set scrolloff=8
set sidescrolloff=15
set sidescroll=1
" Load up all of our plugins
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif
filetype plugin indent on
" Dynamic line numbers
set rnu
function! ToggleNumbersOn()
set nu!
set rnu
endfunction
function! ToggleRelativeOn()
set rnu!
set nu
endfunction
autocmd FocusLost * call ToggleRelativeOn()
autocmd FocusGained * call ToggleRelativeOn()
autocmd InsertEnter * call ToggleRelativeOn()
autocmd InsertLeave * call ToggleRelativeOn()
map <Esc>[B <Down>]
Vimrc.bundles
if &compatible
set nocompatible
end
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'christoomey/vim-tmux-runner.git'
Plugin 'christoomey/vim-run-interactive'
Plugin 'vim-scripts/ctags.vim'
Plugin 'scrooloose/syntastic' "Syntax Highlighting
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter.git'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'ervandew/supertab'
Plugin 'vim-scripts/tComment'
Plugin 'vim-scripts/HTML-AutoCloseTag'
Plugin 'jiangmiao/auto-pairs'
Plugin 'tpope/vim-fugitive' "Make git awesome
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'Slava/vim-spacebars'
Plugin 'groenewege/vim-less'
Plugin 'godlygeek/tabular'
Plugin 'romainl/Apprentice'
Plugin 'morhetz/gruvbox'
Plugin 'bling/vim-airline' "Awesome looking meta at bottom
Plugin 'majutsushi/tagbar'
Plugin 'vim-scripts/matchit.zip'
Plugin 'vimwiki/vimwiki'
Plugin 'mattn/calendar-vim'
call vundle#end()
filetype on
set t_Co=256
set background=dark
colorscheme gruvbox
syntax enable
" Plugin Tweaks
nnoremap <silent> <C-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <C-j> :TmuxNavigateDown<cr>
nnoremap <silent> <C-k> :TmuxNavigateUp<cr>
nnoremap <silent> <C-l> :TmuxNavigateRight<cr>
"tmux integration
let g:tmux_navigator_no_mappings = 1
let g:tmux_navigator_save_on_switch = 1
map <C-n> :NERDTreeToggle<cr>
nnoremap <C-t> :call ToggleRelativeOn()<cr>
" Ctrlp Settings
let g:ctrlp_custom_ignore = 'node_modules\|bower_components\|git'
" mapping for Vimwiki
autocmd FileType vimwiki map <leader>c :call ToggleCalendar() <cr>
let g:vimwiki_list = [{'path':'$HOME/Dropbox/vimwiki'}]
let g:airline_powerline_fonts = 1
let g:syntastic_check_on_open=1
map <Leader>ct :!ctags -R .<CR>
function! ToggleCalendar()
execute ":Calendar"
if exists("g:calendar_open")
if g:calendar_open == 1
execute "q"
unlet g:calendar_open
else
g:calendar_open = 1
end
else
let g:calendar_open = 1
end
endfunction
" Setting up keyboard shortcuts for tabular
if exists(":Tabularize")
nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
nmap <Leader>a: :Tabularize /:\zs<CR>
vmap <Leader>a: :Tabularize /:\zs<CR>
endif
" Tagbar settings
nmap <F8> :TagbarToggle<CR>
这是我的终端在运行tmux
时的样子这里看起来如何没有tmux
答案 0 :(得分:3)
尝试停用Vim插件(CtrlP除外)并查看行为是否自行纠正。这将告诉你其他一个插件是否在干扰。
您的屏幕截图显示tmux运行时颜色不同。我注意到你的.vimrc
表示256色模式:
set t_Co=256
你是在256色模式下运行tmux吗?
tmux -2
我也想知道你是否应该在通过Vundle加载插件之前声明tmux_navigator设置,例如将这两行移到Vundle加载之前。
let g:tmux_navigator_no_mappings = 1
let g:tmux_navigator_save_on_switch = 1