neovim ultisnips激活无法识别换行键击

时间:2016-08-07 15:12:22

标签: linux ubuntu vim ide neovim

我在其他插件中使用YouCompleteMe在基于Ubuntu的发行版上安装了neovim(0.1.5)。但是,当我安装Ultisnips时,neovim无法识别任何文件中的回车键。你知道我怎么能搞清楚这个冲突。我尝试将TERM设置为xterm和xterm-256color,问题仍然存在。

这是我的init.vim:

set nocompatible
filetype off

call plug#begin('~/.config/nvim/plugged')

Plug 'Valloric/YouCompleteMe'
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
Plug 'scrooloose/nerdcommenter'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'

call plug#end()

filetype plugin indent on
set autowrite
"set encoding=utf-8
"set termguicolors
set cursorline
set number
set showmatch
set expandtab
set tabstop=4
set noexpandtab
set softtabstop=4
set shiftwidth=4
set splitright
set hlsearch
set colorcolumn=110
highlight ColorColumn ctermbg=darkgray

if !&scrolloff
  set scrolloff=3       " Show next 3 lines while scrolling.
endif
if !&sidescrolloff
  set sidescrolloff=5   " Show next 5 columns while side-scrolling.
endif

let mapleader="-"
set makeprg=make


"Additions for NerdTree
autocmd vimenter * NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif

" Trigger configuration. 
let g:UltiSnipsExpandTrigger="<c-m>"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
let g:UltiSnipsListSnippets="<c-l>"

" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"

" Add your own custom formats or override the defaults
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1
" Enable trimming of trailing whitespace when uncommenting
"let g:NERDTrimTrailingWhitespace = 1


" You Complete Me Additions
let g:ycm_global_ycm_extra_conf = '~/.config/nvim/.ycm_extra_conf.py'  

" Theme Additions

" Status Line Theme Additions
let g:airline_section_b = '%{strftime("%c")}%'
let g:airline_section_y = 'BN: %{bufnr("%")}%'
let g:airline#extensions#tabline#enabled = 1

1 个答案:

答案 0 :(得分:0)

TERM的价值无关紧要。

vim(与任何vi实现一样)使用换行符作为行终止符。那是一个ASCII换行符,但你在键盘上按下的键 Enter 实际上发送了一个ASCII回车符(^M),这是终端驱动程序转换为换行。

您可以首先按 control V ^V),名为 lnext (literal-next)来覆盖此翻译来自stty -a的输出。这样做会将回车传递给vim。