0
這是一個非常奇怪的問題,它一直讓我瘋狂。在一個點上,在我的.vimrc文件裏,我有一條線,看起來像以下:即使從.vimrc刪除Vim映射仍然存在
nnoremap <tab> gg=G''
我用它來重新縮進我的整個文件。時間繼續,我決定使用像%這樣的標籤,在打開/關閉標籤/ parens /等之間移動。所以我刪除線之上,並重新映射命令來控制-I(如Eclipse),並與
nnoremap <tab> %
vnoremap <tab> %
我保存的文件替換它,源,關VIM,重啓一下電腦,爲所欲爲,但不管我所做的,按Tab仍然縮進整個文件。當我檢查的映射與
:verbose map <tab>
我得到的輸出是:
v <Tab> * %
Last set from ~/.vimrc
n <Tab> * gg=G''
Last set from ~/.vimrc
同樣,如果我嘗試
:verbose nnoremap <tab>
我得到:
n <Tab> * gg=G''
Last set from ~/.vimrc
我我真的不確定這裏發生了什麼事情,這個映射大多數ce當然不再存在。這是我的.vimrc:
set nocompatible " be iMproved
filetype off " required!
let mapleader = ","
nnoremap <leader><space> :noh<cr>
nnoremap ; :
nnoremap <leader>v <C-w>v<C-w>l
nnoremap <leader>h <C-w>s<C-w>j
nnoremap <leader>f :CtrlP<CR>
nnoremap <tab> %
vnoremap <tab> %
inoremap jk <ESC>l
nnoremap <C-i> gg=G''
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
syntax enable
set t_Co=16
set background=dark
set tabstop=2
set shiftwidth=2
set softtabstop=2
set smarttab
set expandtab
set number
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
set nobackup
set noswapfile
set smartindent
set hidden
set wildmenu
set nonumber
set nowrap
set relativenumber
set timeoutlen=100
set backspace=indent,eol,start
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-rails.git'
Bundle 'tpope/vim-endwise.git'
Bundle 'tpope/vim-surround.git'
Bundle 'scrooloose/nerdcommenter.git'
Bundle 'scrooloose/syntastic.git'
Bundle 'jiangmiao/auto-pairs.git'
Bundle 'kien/ctrlp.vim'
Bundle 'altercation/vim-colors-solarized.git'
colorscheme solarized
" vim-scripts repos
Bundle 'bufexplorer.zip'
Bundle 'HTML-AutoCloseTag'
Bundle 'matchit.zip'
Bundle 'ruby-matchit'
Bundle 'Rename2'
filetype plugin indent on " required!
filetype indent on
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
可以區分?你的意思是不能? – FDinoff
哇,我永遠不會猜到!謝謝 – BSprague
@FDinoff你是對的。我修復了這個帖子 –