Monday, September 29, 2014

Re: How to create blue & white color of status bar for input () function?

On Monday, September 29, 2014 8:08:16 AM UTC-5, Igor Forca wrote:
> Hi,
> using Vim 7.4 on Windows 7.
>
> let replacement = input('Type in your name and Enter: ')
> call inputrestore()
> execute '%s/USER_NAME/'.replacement.'/g'
> endfunction
> :let mapleader = ","
> :nnoremap <leader>r :call RepalceIt()
>
> The above function works excellent. But now the problem is that prompt is not obvious, so user may miss the input question.
>
> Question: How to make input prompt more visible? I would like to make blue background color and white text (the text above "Type in you name and Enter:") for input prompt at the bottom? You know something like if you type in :xxx end Enter you get red background and white color, but I would like to get blue background.
>

You want the :echohl command, which sets the highlight group to use for the following :echo message(s). See :help :echohl for details.

You say in a followup, 'The blue color of "question" should only be blue until Enter is pressed to be more visible, then normal color (black & white).'

It is not possible to change the color of the echo'd message after it has already been displayed. But after you press enter the prompt is no longer visible. Why does it need to be changed?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: