Help can anybody tell me my search string background color need to be change

已查看 32 次
跳至第一个未读帖子

Kunal Chauhan

未读,
2020年4月27日 07:22:002020/4/27
收件人 vim_use
hi team,

I search text and then press shift * but the string is not properly highlighted the background color I want to change.


Thanks
kunal 

Tim Chase

未读,
2020年4月27日 08:17:232020/4/27
收件人 Kunal Chauhan、vim...@googlegroups.com
On 2020-04-27 04:00, Kunal Chauhan wrote:
> I search text and then press shift * but the string is not properly
> highlighted the background color I want to change.

I'm not sure which colorscheme you're using, but I created my own
(based on an existing one) and set the colors I wanted in it. So you
would have something like

hi Search term=reverse ctermbg=yellow ctermfg=black guibg=yellow guifgi=black

adjusting your colors as you see fit (I believe the default is
black-on-yellow).

-tim





Kunal Chauhan

未读,
2020年4月27日 09:15:182020/4/27
收件人 Tim Chase、vim...@googlegroups.com
Hi  tim,

It is not working for me. 
this is giving error "hi Search term=reverse ctermbg=yellow ctermfg=black guibg=yellow guifgi=black  " iillegal argument last one argument I corrected 
but still it is not working no change on my vim editor.
 1.I am using mobax term and under which I am using vim.
2. my vim background color is black and foreground text is white.
3. I search the text , then cursor come on text found and then press shift +*  but it did not highligh the whole word only first character is highlighted.

--
Thanks with Regards!

Kunal Chauhan
Mob:09813614826
Mob:08860397903

Tony Mechelynck

未读,
2020年4月27日 10:25:012020/4/27
收件人 vim_use、Tim Chase、Kunal Chauhan
On Mon, Apr 27, 2020 at 3:15 PM Kunal Chauhan <atkunal...@gmail.com> wrote:
>
> Hi tim,
>
> It is not working for me.
> this is giving error "hi Search term=reverse ctermbg=yellow ctermfg=black guibg=yellow guifgi=black " iillegal argument last one argument I corrected
> but still it is not working no change on my vim editor.
> 1.I am using mobax term and under which I am using vim.
> 2. my vim background color is black and foreground text is white.
> 3. I search the text , then cursor come on text found and then press shift +* but it did not highligh the whole word only first character is highlighted.

There are two highlight settings which might be involved: one (Search)
for all matches for the latest pattern, and another one (IncSearch)
for the next match for the pattern you are typing between hitting / or
? and the corresponding <Enter>. To see how they are set on your Vim,
and where (if anywhere) those settings were defined, use

:verbose exe "hi Search" | hi IncSearch

When I do this after starting "vim -u DEFAULTS", the answer (in Vim 8.2.646) is

Search xxx term=reverse ctermbg=11 guibg=Yellow
IncSearch xxx term=reverse cterm=reverse gui=reverse

With my usual vimrc and my homemade colorscheme the answer in gvim is

Search xxx term=reverse ctermfg=0 ctermbg=14 guibg=Yellow
Last set from ~/.vim/colors/almost-default.vim line 22
IncSearch xxx term=reverse cterm=reverse gui=reverse
Last set from ~/.vim/colors/almost-default.vim line 22

In both cases both search-related highlights are set the way I want them to be.

See also
:help :colorscheme
:view $VIMRUNTIME/colors/README.txt
:help :highlight (which is two long sections, numbered 13 and
14 in that helpfile)

Best regards,
Tony.

Gary Johnson

未读,
2020年4月27日 11:20:512020/4/27
收件人 vim...@googlegroups.com
On 2020-04-27, Kunal Chauhan wrote:
> Hi  tim,
>
> It is not working for me. 
> this is giving error "hi Search term=reverse ctermbg=yellow ctermfg=black guibg
> =yellow guifgi=black  " iillegal argument last one argument I corrected 
> but still it is not working no change on my vim editor.
>  1.I am using mobax term and under which I am using vim.
> 2. my vim background color is black and foreground text is white.
> 3. I search the text , then cursor come on text found and then press shift +* 
> but it did not highligh the whole word only first character is highlighted.

What is your 'hlsearch' setting?

:verbose set hlsearch?

It defaults to off but must be on for highlighting to be applied to
highlight the entire text of a search match. See

:help 'hlsearch'

HTH,
Gary

Kunal Chauhan

未读,
2020年4月27日 12:12:432020/4/27
收件人 vim...@googlegroups.com
1. when I do :verbose set hlsearch  , it gives or highlight all the string with background to yellow and foreground white is all search strings.

2. help hlsearch // what to see in it ,i am not able to get points from help ?

--
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200427151936.GD28061%40phoenix.

Kunal Chauhan

未读,
2020年4月27日 12:25:462020/4/27
收件人 vim...@googlegroups.com
Also I have noticed right now "verbose set hlsearch" is working when separately opening file but when I use cscope -R and from there I entered in file there it is not working ?

Gary Johnson

未读,
2020年4月27日 13:58:242020/4/27
收件人 vim...@googlegroups.com
On 2020-04-27, Kunal Chauhan wrote:

> On Mon, Apr 27, 2020 at 8:50 PM Gary Johnson wrote:
>
> On 2020-04-27, Kunal Chauhan wrote:
> > Hi  tim,
> >
> > It is not working for me. 
> > this is giving error "hi Search term=reverse ctermbg=yellow ctermfg=black
> guibg
> > =yellow guifgi=black  " iillegal argument last one argument I corrected 
> > but still it is not working no change on my vim editor.
> >  1.I am using mobax term and under which I am using vim.
> > 2. my vim background color is black and foreground text is white.
> > 3. I search the text , then cursor come on text found and then press
> shift +* 
> > but it did not highligh the whole word only first character is
> highlighted.
>
> What is your 'hlsearch' setting?
>
>     :verbose set hlsearch?
>
> It defaults to off but must be on for highlighting to be applied to
> highlight the entire text of a search match.  See
>
>     :help 'hlsearch'
>
> HTH,
> Gary

(I took the liberty of reformatting your post from top-posting to
bottom-posting style so that I could read it more easily.)

> 1. when I do :verbose set hlsearch  , it gives or highlight all
> the string with background to yellow and foreground white is all
> search strings.

The command I wrote included the question mark (?) at the end.

:verbose set hlsearch?

That command will tell you the current setting of 'hlsearch' and
where it was last set.

I don't understand why the foreground of your search highlighting is
white. The Search highlight setting that Tim gave you should have
set the foreground to black. It does for me.

> 2. help hlsearch // what to see in it ,i am not able to get points
> from help ?

I just added that for reference, so that you could read more about
the 'hlsearch' option if you wanted to.

I don't completely understand the problem. What do want to see when
you search and what are you seeing instead? Also, what are the
results of these commands:

:hi Search
:version

Regards,
Gary

Gary Johnson

未读,
2020年4月27日 14:06:012020/4/27
收件人 vim...@googlegroups.com
On 2020-04-27, Kunal Chauhan wrote:
> Also I have noticed right now "verbose set hlsearch" is working when
> separately opening file but when I use cscope -R and from there I entered in
> file there it is not working ?

I would think that once you set 'hlsearch', it would stay set until
you explicitly changed it. Perhaps some plugin is setting it to
off. If you add the question mark (?) to that command as I wrote
a moment ago, you should see what set 'hlsearch' to off. So, after
you execute your cscope command, execute

:verbose set hlsearch?

with the question mark included. That should tell you what set
'hlsearch' to off.

Regards,
Gary

Tim Chase

未读,
2020年4月27日 15:26:262020/4/27
收件人 vim...@googlegroups.com
On 2020-04-27 10:57, Gary Johnson wrote:
> The Search highlight setting that Tim gave you should have
> set the foreground to black. It does for me.

...modulo my fat-fingered typo:

guifgi=black

should have been

guifg=black

-tim


Kunal Chauhan

未读,
2020年4月28日 08:47:512020/4/28
收件人 vim...@googlegroups.com
`Hi 
, I have tried just with  : hi Search ctermbg=LightBlue" it works as initially I tried with verbose command
but  I have puted in my .vimrc it is only showing yellow background and white text as I search by "/text" in vim 

--
--
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+u...@googlegroups.com.

Kunal Chauhan

未读,
2020年4月28日 08:52:482020/4/28
收件人 vim...@googlegroups.com、Tim Chase
Hi 
, I have tried just with  : hi Search ctermbg=LightBlue" it works as initially I tried with verbose command
but  I have puted in my .vimrc it is only showing yellow background and white text as I search by "/text" in vim 

On Tue, Apr 28, 2020 at 12:56 AM Tim Chase <v...@tim.thechases.com> wrote:
--
--
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+u...@googlegroups.com.

Tim Chase

未读,
2020年4月28日 16:29:512020/4/28
收件人 Kunal Chauhan、vim...@googlegroups.com、Tim Chase
On 2020-04-28 18:22, Kunal Chauhan wrote:
> , I have tried just with : hi Search ctermbg=LightBlue" it works as
> initially I tried with verbose command
> but I have puted in my .vimrc it is only showing yellow background
> and white text as I search by "/text" in vim

I suspect your vimrc sets your colorscheme after you explicitly set

:hi Search …

That means that your setting gets overridden by your colorscheme.

This is why I recommended forking your favorite color-scheme into,
say, ~/.vim/colors/kunal.vim and then making the modifications there.
Then you can change your vimrc to have

colorscheme kunal

for whatever colors you prefer.

-tim


回复全部
回复作者
转发
0 个新帖子