vimtext-editorstatusline

Vim status line won't immediately appear unless i press a key?


I just moved to Vim about 3 weeks ago. I know this is minor problem but i find it somehow annoy me. Whenever i open vim, statusline (or statusbar?) won't immediately appear (+ cursor always positioned at the last line of the screen) unless i press a key (any key). This is my vimrc for reference:

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

is there something wrong with it?

edit: this is screenshot of what happen with my vim. before i press a key


Solution

  • Removing lazyredraw from my vimrc fixed this for me as well.

    This was with Vim 7.4 on Ubuntu 16.04.