gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:23:46 27 4
gpt4 key购买 nike

我已经在基于 Ubuntu 的发行版上安装了 neovim(0.1.5),其中包含 YouCompleteMe 以及其他插件。但是,当我安装 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

最佳答案

TERM 的值无关紧要。

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

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

关于linux - neovim ultisnips 激活无法识别换行键击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38815526/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com