不能在gVim中猛拉

时间:2015-01-02 16:17:58

标签: vim windows-7

我一直在将.vimrc文件移到windows上(参见here)。我现在不能猛拉任何东西。例如,下面没有做任何事情

  • yyp
  • yjp
  • ykp
  • ywp
  • ...

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

  • ;已映射到:,但q;q:
  • 的行为不同
  • 我的宏表现得无法预测。随着更复杂的宏,它们不断分崩离析
  • 列表项

如果有帮助,我的.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

1 个答案:

答案 0 :(得分:1)

哼......首先需要检查的是:.vimrc windows下的vim本机版本的文件名应为_vimrc,并且它应放在你的HOME目录中。

然后,你似乎没有使用mswin.vim女巫对于我们这些习惯于vim的人来说是一件好事。而且我的文件中没有任何可疑内容。

如果您可以识别奇数键绑定,则可以使用:verbose imap jj(例如)来查看一切是否按预期工作。

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