1

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

wlwtvr
  • 13
  • 3
  • Is that your entire configuration, or do you also use any plugins? Does it help when you put `:redraw!` at the bottom of the vimrc? – Ingo Karkat Sep 20 '16 at 13:34
  • @IngoKarkat right now i only use abolish, surround, and commentary, i already use them about a week before the problem occur. did redraw few times, but no change. – wlwtvr Sep 20 '16 at 13:56
  • Hm, I had suspected some statusline plugin like vim-airline. Is that the only occasion that the screen contents are off? What terminal do you use, and is `$TERM` set correctly? Or, to put this differently, same problem in GVIM? – Ingo Karkat Sep 20 '16 at 14:11
  • @IngoKarkat nope, i was planning to use lightline tho. i use vim inside babun. $TERM set to xterm-256color. hmm, not a fan of gvim. – wlwtvr Sep 20 '16 at 14:20
  • Well, if you only see this in babun, but not in a native Cygwin / Windows terminal, I guess that's an issue with babun's terminal emulation, and you should report it there. I don't see an issue with your Vim setup. – Ingo Karkat Sep 20 '16 at 14:30
  • @IngoKarkat hmm i see. anyway thanks for all the feedback :) . might just consider moving fully to linux. hehe – wlwtvr Sep 21 '16 at 10:06
  • can you try withouth lazyredraw? – Christian Brabandt Sep 21 '16 at 15:49
  • @ChristianBrabandt its work! yea deleting lazyredraw from my vimrc solve it. thanks! – wlwtvr Sep 22 '16 at 06:13

1 Answers1

0

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

This was with Vim 7.4 on Ubuntu 16.04.

ewatt
  • 211
  • 4
  • 4