1

大约 3 周前,我刚搬到 Vim。我知道这是小问题,但我发现它以某种方式惹恼了我。每当我打开 vim 时,状态行(或状态栏?)不会立即出现(+ 光标始终位于屏幕的最后一行),除非我按下一个键(任意键)。这是我的 vimrc 供参考:

set nocompatible
" Pathogen
filetype off
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
filetype plugin indent on

" Color Schemes
set t_Co=256
syntax on
set background=dark
colorscheme ir_black

" Misc
set history=200
set backspace=indent,eol,start
set mouse=n
set lazyredraw
runtime macros/matchit.vim

" Escape Timeout
set notimeout
set ttimeout
set ttimeoutlen=10

" Backup & Undo
set noswapfile
set backup
set undofile
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//

" Scroll
set scrolloff=3

" Status Bar
set showmode
set showcmd
set ruler
set laststatus=2
set statusline=

" Tabs & Spaces
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set shiftround
set smarttab

" Text
set encoding=utf-8
set nowrap
set autoindent
set textwidth=80
set formatoptions=qrn1j

" Splitting
set splitbelow
set splitright

" Buffer
set hidden

" Wildmenu
set wildmenu
set wildmode=list:longest,full
set wildignore+=**/vendor/**
set wildignore+=**/node_modules/**

" Auto-completion
set complete=.,i,w,b,u,t
set omnifunc=
set completeopt=longest,menuone,preview

" Searching + Regex
set ignorecase
set smartcase
set hlsearch
set incsearch
set gdefault
highlight Search cterm=underline
nnoremap / /\v
vnoremap / /\v
nnoremap <space> :noh<cr>

" Mapping
let mapleader=","
noremap \ ,
inoremap jk <esc>

noremap L g_
noremap H ^

" Window Resize
nnoremap <silent> <up> <c-w>+
nnoremap <silent> <down> <c-w>-
nnoremap <silent> <left> <c-w><
nnoremap <silent> <right> <c-w>>

" Disable Arrow Keys
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>

" Move by Display Line
noremap j gj
noremap k gk

" Toggles
nnoremap <leader>wl :set wrap!<cr>
nnoremap <leader>n :setlocal number!<cr>
nnoremap <leader>l :set list!<cr>

" Wipe Whitespace
nnoremap <leader>ww mz:%s/\s\+$//<cr>:let @/=''<cr>`z

" Easy Access to Active File Directory
cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'

" Toggles
nnoremap <silent> <leader>n :set number!<cr>
nnoremap <silent> <leader>wl :set wrap!<cr>

" Buffer Navigation
nnoremap <silent> [b :bprevious<cr>
nnoremap <silent> ]b :bnext<cr>
nnoremap <silent> [B :bfirst<cr>
nnoremap <silent> ]B :blat<cr>

" Split Navigation
nnoremap <c-h> <c-w><c-h>
nnoremap <c-j> <c-w><c-j>
nnoremap <c-k> <c-w><c-k>
nnoremap <c-l> <c-w><c-l>

" Netrw
let g:netrw_banner=0

" Grep Ag
if executable("ag")
    set grepprg=ag\ --nogroup\ --nocolor\ --ignore-case\ --column
    set grepformat=%f:%l:%c:%m,%f:%l:%m
endif

有什么问题吗?

编辑:这是我的 vim 发生的屏幕截图。 在我按键之前

4

1 回答 1

0

lazyredraw也从我的vimrc固定这个中删除。

这是 Ubuntu 16.04 上的 Vim 7.4。

于 2018-03-10T02:12:21.133 回答