Re: a simple mapping

2007-03-27 Thread LandSurveyor
The quotes are definitely not the way to go.  I've tried

vim -u test_vimrc.vim

where test_vimrc.vim contained merely your first line (slightly
modified):

nnoremap  :set nobackup

and it worked fine.  I don't know whether it has to do with
switching over to nnoremap (I prefer to be explicit when I
specify a mapping) or some other plugin that is overriding your
desired settings.  You  might try

:scriptnames

to see what scripts are being loaded (and may want to investigate
them in the event that one of them is rebinding ).

-tim

Thanks for your gnawing on this.  As it turns out, and I had responded thusly 
to another good soul, the problem was merely my method of evoking my intended 
change:

   source ~/.vimrc

That DIDN'T work!

What I had done (to begin) was borrow an already valid keymapping:

map   :nohlsearch 

and copied it to use as a template (it worked once...oughta work again)

the change became (and it ultimately worked),

   map  :set nobkackup   #bTW,  becomes  when :map

my problem was, the shell command  was the wrong way to go-it 
created problems.  As soon as I logged out and back in, everything worked fine.


Re: a simple mapping

2007-03-27 Thread Tim Chase
> Reading over my original question, I realize that it was
> awfully obtuse and confusing.  The 'nohlsearch' line is the
> one that is already in my .vimrc and works.  I yanked/put it
> to the next line down to use it as a template, modifing it to:
> 
> map  :set nobackup 
> 
> that's the one that doesn't work (the 
> part-obviously-works with my original line).
> 
> I did notice that the highlighting recognized the word 'set'
> as a command, but did not recognize 'nobackup', which remained
> white (black?).  Thus, I tried:
> 
> map  ":set nobackup" 
> 
> with no better luck.  Sorry for creating the confusion.


The quotes are definitely not the way to go.  I've tried

vim -u test_vimrc.vim

where test_vimrc.vim contained merely your first line (slightly
modified):

nnoremap  :set nobackup

and it worked fine.  I don't know whether it has to do with
switching over to nnoremap (I prefer to be explicit when I
specify a mapping) or some other plugin that is overriding your
desired settings.  You  might try

:scriptnames

to see what scripts are being loaded (and may want to investigate
them in the event that one of them is rebinding ).

-tim




Re: a simple mapping

2007-03-26 Thread LandSurveyor
Forgive my obvious ineptitude here, on many fronts.  Firstly, I don't know how 
to respond to previous responses correctly (capturing the preceding dialog) so 
I have to start from scratch each time.

Secondly, of course it works...and for me also.  Here is what I was doing wrong 
(somehow?).  After modifying my .vimrc, I was entering on the command line:

source ~/.vimrc

I was getting-not cooperation-but error messages, and of course no good results 
for my efforts.  What I did this time was the wimps' way out-I logged out and 
back in.  And then it works.  So the issue was my ineptitude with the bash 
shell, not with my .vimrc efforts.  Don't believe I'm gonna take the time 
tonight to figure it out, either.  Gotta do homework for the job tomorrow.

Thanks for your help.  And remember, the early bird may get the worm, but the 
SECOND mouse gets the cheese!


Re: a simple mapping

2007-03-26 Thread LandSurveyor
Thanks for the response.  But, I gotta apologize...

Reading over my original question, I realize that it was awfully obtuse and 
confusing.  The 'nohlsearch' line is the one that is already in my .vimrc and 
works.  I yanked/put it to the next line down to use it as a template, modifing 
it to:

map  :set nobackup 

that's the one that doesn't work (the  part-obviously-works with my 
original line).

I did notice that the highlighting recognized the word 'set' as a command, but 
did not recognize 'nobackup', which remained white (black?).  Thus, I tried:

map  ":set nobackup" 

with no better luck.  Sorry for creating the confusion.



Re: a simple mapping

2007-03-26 Thread Tim Chase
> I attempted to map this code ":set nobackup" to an 'Fx' key,
> (as a line in my .vimrc) with no good results; the formats I
> attempted were:
> 
> map  :set nobackup  map  ":set nobackup"
> 
> 
> Actually, I just yanked/put the preceding line* (which I KNOW
> works), and modified it:
> 
> *map   :nohlsearch 
> 
> with the thought that it would be easier to leave a correctly
> functioning line (after the modifications), coming from
> something that's already valid.
> 
> But...of course not.  Where did I go wrong?


It looks like you're using  instead of .  Try the
following:

:nnoremap  :nohls

or

:nnoremap   :nohls

It works for me.  If you have trouble, you might try digging
around in your vimrc to see what might be causing the problem.

-tim