Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The autocommand I would like to run is

au CmdlineModeEnter * wall

except that CmdlineModeEnter does not exist. I used to have a mapping defined like

nnoremap : :wall<CR>:

which worked fine except that the ":wall" flashing up was visible and distracting. Any ideas?

share|improve this question

2 Answers 2

up vote 1 down vote accepted
function! CmdlineEnter()
    silent! wall
    call feedkeys(":", 'n')
endfun

noremap <silent> : :call CmdlineEnter()<CR>
share|improve this answer
    
@Owen strictly speaking, Ex mode is what you enter with Q, not :: : enters Command-line mode (as do / and ?). –  accolade Jun 17 '11 at 23:14
    
Thank you! That works! –  Owen Jun 20 '11 at 20:46
    
Owen added silent! to suppress warnings. –  BloodPhilia Jun 20 '11 at 20:56

Does this help?

nnoremap <silent> : :wall<CR>:

See

:help :map-<silent>
share|improve this answer
    
Yes, it does make the ":wall" go away... unfortunately it also hides the leading : until I type the next char ;). Oh well I think I'm just too picky. –  Owen Jun 5 '11 at 6:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.