You are not logged in.
Pages: 1
Hi, I am a quite new user of Vim. I found one feather pretty annoying: when I edit tex file using vim-latex, if I type $$ or insert an equation environment by F5, vim will highlight the search result I did last time. Does anyone has the same problem?
Thanks!
Offline
*chuckles* that one bugged me as well!
Check if you are actually using 'vi' or 'vim'. Often 'vi' is just a link to 'vim'
If you actually use 'vim', then /usr/share/vim/vimrc_example.vim is your friend.
Copy it to your home directory as .vimrc as edit it to turn off 'hlsearch' - I think it says 'hlsearch on' somewhere.
If you are using 'vi', then /etc/virc or EXINIT="..." in your .bashrc
Offline
If you want to turn off highlight search, put "set nohls" in your .vimrc
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
thanks for the response!
Is there another way to solve it without turn off highlight search? I know I asked too much, but my friend told me that nothing is impossible with Vim...
hehe, just kidding. I can live without highlight search.
Offline
Sorry, I cant answer that.
Personally the colours bug me no end, so I turn off syntax as well.
Offline
thanks for the response!
Is there another way to solve it without turn off highlight search? I know I asked too much, but my friend told me that nothing is impossible with Vim...
hehe, just kidding. I can live without highlight search.
You can bind another key sequence to that action (don't ask me how because I don't know, I just know it's possible )
My blog: blog.marcdeop.com
Jabber ID: damnshock@jabber.org
Offline
You can map the function in .vimrc like this
map <F5> :set hls!<bar>set hls?<CR>
Everytime you press F5 will (de)activate the highlighting. Obviously you can change the key to whatever you want.
P.S. This will only work in normal mode.
Last edited by addox (2009-02-06 13:25:27)
Offline
Here is what I use:
set nohls
set incsearch
set showmatch
This gives me highlighting while I'm typing in the search, but not after I hit <enter>
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
You can map the function in .vimrc like this
map <F5> :set hls!<bar>set hls?<CR>
Everytime you press F5 will (de)activate the highlighting. Obviously you can change the key to whatever you want.
P.S. This will only work in normal mode.
just to clarify... does normal mode mean command mode, or the insert mode?
or is my vim knowledge painfull wrong and there is a whole other mode ? lol
Offline
addox wrote:You can map the function in .vimrc like this
map <F5> :set hls!<bar>set hls?<CR>
Everytime you press F5 will (de)activate the highlighting. Obviously you can change the key to whatever you want.
P.S. This will only work in normal mode.
just to clarify... does normal mode mean command mode, or the insert mode?
or is my vim knowledge painfull wrong and there is a whole other mode
? lol
command mode is when you press ":" insert mode is when you press "i". normal mode is after you've hit "esc" repeatedly. it's also the mode you'd use the dd, yy, p, u, etc commands for text manipulating
//github/
Offline
I copied this from somewhere I forgot. It's useful if you want to use highligh search.
" press space to turn off highlighting and clear any message already displayed.
:noremap <silent> <space> :silent noh<bar>echo<cr>
thanks for all your response!
Offline
I noticed a similar issue with :s and hlsearch
:5,10s/^/#/
Will cause the first character of EVERY line to light up. :s shouldn't highlight anything at all if you ask me.
Offline
Pages: 1