function! s:is_cmdwin() try wincmd n wincmd q catch return 1 endtry return 0 endfunction " nnoremap \c :echomsg is_cmdwin()