You are not logged in.
I have a really annoying problem with copy & paste between gVim windows. When I type "+gP (or use menu/toolbar command), pasting works as expected, but when I map this command to Shift+Insert (in ~/.vimrc):
nnoremap <S-Insert> "+gP
copied text isn't inserted before cursor, but at the top of the window (or sometimes somewhere else, but not before cursor, as it should).
There is also a second problem (bug?) - I can't disable highlighting searched text in Arch's Vim - set nohlsearch in ~/.vimrc just doesn't work for me. I have to type :nohls each time I search to remove the highlighting.
Any ideas?
Last edited by agro (2009-07-29 12:26:55)
Offline
Concerning your second problem, you cannot globally turn off "hlsearch". As the Vim help states:
:noh[lsearch] Stop the highlighting for the 'hlsearch' option. It
is automatically turned back on when using a search
command, or setting the 'hlsearch' option.
This command doesn't work in an autocommand, because
the highlighting state is saved and restored when
executing autocommands |autocmd-searchpat|.
Same thing for when invoking a user function.
I have to :nohl over and over again as well.
To know or not to know ...
... the questions remain forever.
Offline
Post your .vimrc? Works fine for me.
(The highlighting issue, that is.)
Last edited by Peasantoid (2009-07-28 22:00:13)
Offline
you cannot globally turn off "hlsearch"
This is true about "nohlsearch" command (:nohlsearch, note the colon), but you should be able to permanently turn off highlighting with "nohlsearch" option (that's something quite different, although has the same name). It works this way in Vim on Windows, it worked in Vim on my previous Linux distribution, but it doesn't work on Arch.
Post your .vimrc? Works fine for me.
Now i'm testing it on .vimrc that contains only one line:
set nohlsearch
and it still doesn't work. I'm using standard (g)Vim from Arch repository; current version is 7.2.65, but it didn't work with earlier versions too.
PS the problem with highlighting affects only gVim; it works fine in console Vim.
Last edited by agro (2009-07-28 22:19:18)
Offline
I have a really annoying problem with copy & paste between gVim windows.
I have no direct solution for the "+gP problem, but have a look at the `clipboard` option. Personally I have it set to `unnamed`, which has solved all my problems with copy/paste between vim and X. I can now do a regular yank into the X clipboard buffer, and a regular paste inside vim from the X primary clipboard buffer. Very pleasant.
.]
Offline
PS the problem with highlighting affects only gVim; it works fine in console Vim.
That explains the difference, then.
Offline
This is true about "nohlsearch" command (:nohlsearch, note the colon), but you should be able to permanently turn off highlighting with "nohlsearch" option (that's something quite different, although has the same name).
Of course! I messed these up.
But I think I found a possible cause. In /etc/virc and /etc/vimrc there are explicit set hlsearch lines which are used in colored terminals and GUIs.
I have no time to really check this. But it may be worth a look.
To know or not to know ...
... the questions remain forever.
Offline
I have no direct solution for the "+gP problem, but have a look at the `clipboard` option.
Thanks, may be useful, but doesn't solve the problem. I'm currently testing gVim with the following .vimrc:
set nohlsearch
set clipboard=unnamed
vnoremap <C-y> "*y
nnoremap <C-e> "*gP
In this configuration copy & paste works as expected, but with Ctrl+y and Ctrl+e keys. However, if I map these copy & paste commands to Ctrl+Insert and Shift+Insert, it doesn't work correctly. I guess there is something wrong with these key combinations in Arch. It worked on my previous Linux distribution, so why doesn't work here?
But I think I found a possible cause. In /etc/virc and /etc/vimrc there are explicit set hlsearch lines which are used in colored terminals and GUIs.
I commented out these lines, but it didn't help
Can someone confirm that it isn't possible to disable highlighting searched text in gVim? Or is it only my problem?
Offline
Have you tried creating a ~/.gvimrc with
set nohlsearch
?
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
Have you tried creating a ~/.gvimrc with
set nohlsearch
?
Thanks!!! :):) It works! If I put config commands in ~/.gvimrc, both problems are solved!
Offline
GRRR! I always forget that Arch uses a separate .gvimrc.
Glad you found a solution.
To know or not to know ...
... the questions remain forever.
Offline