【发布时间】:2018-04-26 01:25:43
【问题描述】:
初步信息:
- 问题在于终端 Vim,而不是 gVim
- 我使用 CMDER(基于 conemu)作为终端仿真器
- 我使用的是 Windows 10
详细说明:
当我处于插入模式时,我可以正常输入文本,但退格键不起作用。在正常模式下,退格键删除文本。这与我今天早些时候的行为完全相反。我在网上阅读了许多其他描述 Vim 非正统退格行为的帖子,但建议的配置设置(即 bs=2 或 bs=indent,eol,start)什么也没做。
更不寻常的是 gVim 的行为“正常”,即:退格键在正常模式下将光标向左移动,并在插入模式下删除文本。
我希望退格键在插入模式下删除文本(就像大多数其他程序一样)并在正常模式下导航/禁用。我怎样才能恢复这种行为?
下面是我的 _vimrc 的副本:(我会把它放在 github 上,但我的 git 目前搞砸了,我还没有修复它。)此外,默认情况下,_vimrc 内部还有一个函数.我不知道它做了什么,但为了节省空间而省略了它。如果你想看看我是否可以在回复中发布。
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
" Pathogen - Plugin manager
execute pathogen#infect()
set nocompatible " Turns off Vi compatability gubbinz
" Color Theme
if !has("gui_running") " Allows some 256 color themes to work in Terminal
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
colorscheme gruvbox
endif
let g:gruvbox_dark_contrast = 'hard' " Both of these are just visual gruvbox tweaks
let g:gruvbox_light_contrast = 'hard'
set guifont=Consolas:h10:cANSI:qDRAFT " Changes font
set bs=indent,eol,start " Makes backspace be normal
set filetype=ON " Has vim check for filetype
set showcmd " Displays incomplete commands
set ruler " Shows position of cursor in document
set syntax=ON " Turns on syntax highlighting
set number " Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set hlsearch " Highlight all search results
set smartcase " Enable smart-case search
set incsearch " Searches for strings incrementally
set autoindent " Auto-indent new lines
set shiftwidth=4 " Number of auto-indent spaces
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
set undolevels=1000 " Number of undo levels
set backspace=indent,eol,start " Backspace behaviour
set go=egrLTm " Changes flags that specify how the GUI loads
【问题讨论】:
-
你试过没有你的配置吗,
$ vim -Nu NONE? -
@romainl 你能澄清一下实际上需要在命令中添加什么吗? Vim 给了我无效的命令错误。
-
没什么。只需使用该命令在没有配置的情况下启动 Vim 即可查看问题是 Vim 问题还是配置问题。
标签: vim