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

neovim ultisnips activation does not recognize newline keystroke

我已经在基于 Ubuntu 的发行版上安装了 neovim(0.1.5),其中包含 YouCompleteMe 以及其他插件。但是,当我安装 Ultisnips 时,neovim 无法识别任何文件中的 return 回车键。你知道我如何解决冲突吗?我尝试将 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

TERM 的值无关紧要。

vim(像任何 vi 实现一样)使用 newline 作为行终止符。那是一个 ASCII 换行符,但是你在 keyboardEnter 上按下的键实际上发送了一个 ASCII carriage-return (^M),终端驱动程序将其转换为换行符。

您可以通过先按 controlV (^V) 来覆盖此翻译,称为 lnext (literal-next) 在 stty -a 的输出中。这样做会将马车 return 传递给 vim.