Skip to content

Instantly share code, notes, and snippets.

@tyru
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyru/5bed4d937ae83133342a to your computer and use it in GitHub Desktop.
Save tyru/5bed4d937ae83133342a to your computer and use it in GitHub Desktop.
Empty CmdWin Bufname
scriptencoding utf-8
source spec/base.vim
let g:VB = vital#of('vital').import('Vim.Buffer')
Context Vim.Buffer.is_cmdwin()
It detects if current window is cmdwin.
" normal! q:
let save_cedit = &cedit
let &cedit = "<C-f>"
try
execute "normal! :\<C-f>\<CR>"
Should g:VB.is_cmdwin()
quit
Should !g:VB.is_cmdwin()
finally
let &cedit = save_cedit
endtry
End
End
" (以下省略)
let s:save_cpo = &cpo
set cpo&vim
function! s:_vital_loaded(V)
let s:V = a:V
let s:P = s:V.import('Prelude')
endfunction
function! s:_vital_depends()
return ['Prelude']
endfunction
function! s:is_cmdwin()
echom string(bufname('%'))
sleep 5
return bufname('%') ==# '[Command Line]'
endfunction
" (以下省略)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment