不能在 gVim 中拉取

Can not yank in gVim

我一直在将我的 .vimrc 文件移动到 windows(参见 here)。我现在不能拉任何东西。例如,以下都不做任何事情

以下是我在 windows 下使用 gVim 时遇到的一些其他问题。我已经包括了这些以防有人发现它们有用

我的.vimrc如下,希望对你有帮助

let mapleader = ","

" Swap ; and :  Convenient.
nnoremap ; :
nnoremap : ;

"Map jj to escape
inoremap jj <Esc>

" Create Blank Newlines and stay in Normal mode
nnoremap <silent> zj o<Esc>
nnoremap <silent> zk O<Esc>

"Make cursor move as expected with wrapped lines:
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk

"Map Shift+ J to previous buffer
noremap J :bp<CR>

"Map Shift + K to next buffer
noremap K :bn<CR>

"Turn on syntax
filetype plugin indent on
syntax on

" Fast saving
noremap <leader>w :w!<cr>

"Default for checking marks is 4 seconds, make it faster
set updatetime=100

"Persistent Undo
" set undodir=~/.vim/undodir
set undodir=c:\Users\user\vim\undodir
set undofile
set undolevels=10000    "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer reload

"Keep undo history when switching buffers
set hidden

"Use the smart version of backspace
set backspace=2

"Use spaces instead of tabs
set expandtab

"Line Numbers
set number

"Makes unnamed clipboard accesible to X window
set clipboard=unnamedplus

"Number of spaces to use for each step of (auto)indent.
set shiftwidth=4

"This shows what you are typing as a command
set showcmd

set smarttab

"Indent every time you press enter
set autoindent

"Cursor Always in middle
"NOTE This causes problems with word wrap of long lines as they are not
"displayed correctly
set scrolloff=999

"make word wrap wrap words, not character
set formatoptions=l
set lbr

"Use ... when word wrapping
set showbreak=...

"enable status line always
set laststatus=2

"
" statusline
" cf the default statusline: %<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
" format markers:
"   %< truncation point
"   %n buffer number
"   %f relative path to file
"   %m modified flag [+] (modified), [-] (unmodifiable) or nothing
"   %r readonly flag [RO]
"   %y filetype [ruby]
"   %= split point for left and right justification
"   %-35. width specification
"   %l current line number
"   %L number of lines in buffer
"   %c current column number
"   %V current virtual column number (-n), if different from %c
"   %P percentage through buffer
"   %) end of width specification
set statusline=%f%m%r%h%w[%n]\ [F=%{&ff}][T=%Y]\ %=[LINE=%l][%p%%]

"set it up to change the status line based on mode
if version >= 700
  au InsertEnter * hi StatusLine term=reverse ctermbg=4
  au InsertLeave * hi StatusLine term=reverse ctermbg=2
endif

"start searching as you type
set incsearch

"Highlight search strings
set hlsearch

" Set off the other paren
highlight MatchParen ctermbg=4

"Ignore case when searching
set ignorecase

"But remember case when capitals used
set smartcase

" Use english for spellchecking, but don't spellcheck by default
if version >= 700
   set spl=en spell
   set nospell
endif

"Show matching brackets when text indicator is over them
set showmatch

"How many tenths of a second to blink
"Does not seem to change anything
set mat=2

"Highlight current line
set cul

"adjust highlight color
hi CursorLine term=none cterm=none ctermbg=232

"enable 256 color
set t_Co=256

"Do not want spell checking in my commented blocks
let g:tex_comment_nospell= 1

if &t_Co == 256
    " colorscheme xoria256
    colorscheme desert
else
    colorscheme peachpuff
endif

" Font size
if has("gui_running")
  if has("gui_gtk2")
    set guifont=Inconsolata\ 12
  elseif has("gui_macvim")
    set guifont=Menlo\ Regular:h14
  elseif has("gui_win32")
    set guifont=Consolas:h14:cANSI
  endif
endif

嗯...首先需要检查的是:windows 下 vim 本机版本的 .vimrc 文件名应为 _vimrc,并且应放入您的 HOME 目录。

那么,你似乎不用mswin.vim 对我们这些习惯vim的人来说是件好事。我在你的文件中没有看到任何可疑的东西。

如果您能识别出奇怪的键绑定,您可以使用 :verbose imap jj(例如)来查看是否一切正常。

PS:交换 :; 是个坏主意:并非所有插件都正确编写为在其函数中使用 banged-mappings 或 :normal!。你最好习惯你的键盘,否则会出现意外和行为不端的插件。