Re: mapping :W to :w...

2021-02-24 Thread Lifepillar
>>On 02/23 11:11, Salman Halim wrote:
>> I actually prefer to never hit shift, so map ; to : instead.
>>
>On 2021-02-24, tu...@posteo.de  wrote:
> Hi Salman,
>
> oh! :)
>
> The first is genious

Keep in mind that ; is a useful mapping in Vim. Sure, you can remap it
to :, but, in my experience, in the long term it is better not to change
Vim's default mappings (this is a matter of personal taste, of course),
except when their functionality is replicated by other mappings (as in
the next paragraph).


-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/s15nab%24ph5%241%40ciao.gmane.io.


Re: mapping :W to :w...

2021-02-24 Thread tuxic
On 02/24 08:59, aroc...@vex.net wrote:
> 
> > the distinctive feeling of flat-hand-against-my-fronthead... ;)
> >
> 
> Aka (Also known as:) a face-palm. :-)*

Ok :) another face-palm (this time correctly spoke...I am no native
speaker...sorry...

But...how can I ensure, that I am talking about my face and 
someone else face...?


> 
> -- 
> -- 
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/vim_use/03b0da16fc3d8e12971a9d203ee0b12d.squirrel%40webmail.vybenetworks.com.
> 

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20210224141114.2bdpvgl7fnobzesk%40solfire.


Re: mapping :W to :w...

2021-02-24 Thread arocker


> the distinctive feeling of flat-hand-against-my-fronthead... ;)
>

Aka (Also known as:) a face-palm. :-)*

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/03b0da16fc3d8e12971a9d203ee0b12d.squirrel%40webmail.vybenetworks.com.


Re: mapping :W to :w...

2021-02-24 Thread rwmit...@gmail.com
"I use  in much the same way and just call :update.* I also save 
automatically when the Vim window loses focus*."

Tell me more about this.
On Wednesday, February 24, 2021 at 2:54:17 AM UTC-5 Salman Halim wrote:

> I use  in much the same way and just call :update. I also save 
> automatically when the Vim window loses focus. 
>
> -- 
>
> Salman
>
> On Wed, 24 Feb 2021, 02:33 Tony Mechelynck,  
> wrote:
>
>> P.S. My solution to a similar problem was a little different:
>>
>> map  :wa|wv
>> map!  :wa|wv
>>
>> Best regards,
>> Tony.
>>
>> -- 
>> -- 
>> 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/CAJkCKXvXKsyjh5z_8%3D1AYja9fF0NvceHbiBkLBnghs9Ai848Ug%40mail.gmail.com
>> .
>>
>

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/952f24b6-e2f9-47c3-a651-b05683f054c4n%40googlegroups.com.


Re: mapping :W to :w...

2021-02-23 Thread Salman Halim
I use  in much the same way and just call :update. I also save
automatically when the Vim window loses focus.

-- 

Salman

On Wed, 24 Feb 2021, 02:33 Tony Mechelynck, 
wrote:

> P.S. My solution to a similar problem was a little different:
>
> map  :wa|wv
> map!  :wa|wv
>
> Best regards,
> Tony.
>
> --
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/CAJkCKXvXKsyjh5z_8%3D1AYja9fF0NvceHbiBkLBnghs9Ai848Ug%40mail.gmail.com
> .
>

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CANuxnEdbq6Qqm5jt%2BA%3DqvUbOK8ZuJwMC8%2B%3D7cdXsMS7TXhttFA%40mail.gmail.com.


Re: mapping :W to :w...

2021-02-23 Thread Tony Mechelynck
P.S. My solution to a similar problem was a little different:

map  :wa|wv
map!  :wa|wv

Best regards,
Tony.

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAJkCKXvXKsyjh5z_8%3D1AYja9fF0NvceHbiBkLBnghs9Ai848Ug%40mail.gmail.com.


Re: mapping :W to :w...

2021-02-23 Thread Tony Mechelynck
On Wed, Feb 24, 2021 at 5:06 AM  wrote:
>
> Hi,
>
> if my PC is heavily compiling things and I am editing and saving
> things repeatedly if often hit :W instead of :w (that is, I am
> still pressing SHIFT when hitting w.
>
> So I tried to map :W to :w...but it does not work for me.
>
> I tried
>
> [n]map W w
> and
> [n]map :W :w
>
> .
>
> Is there any way to map the accidentally hit :W
> command to :w somehow?
>
> Cheers!
> mcc

Like Salman said, you could define a user-comand W executing just w ;
but the reason your nmap didn't work is that by the time you'tr typing
the W, you aren't in Normal mode anymore, but in Command-line mode;
OTOH you don't want any W in the middle of a command's parameters to
always lowercased; so another possibility is a command-mode
abbreviation, as follows:

:cabbrev  W ((getcmdtype() == ':' && getcmdpos() <= 4)? 'w' : 'W')

Testing getcmdtype() avoids lowercasing the W in a search command, and
testing getcmdpos() allows doing it only near the left margin. A
user-command is more elegant however; but in order to make it behave
like the w command you may want to define that :W command with the
appropriate parameters, as follows (untested):

:command -nargs=* -complete=file -range=% -bang -bar W
,w 

which, after all, makes it somewhat less elegant; so you may choose a
command or an abbrev to suit youor taste.

Best regards,
Tony.

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAJkCKXvzVvZZaZ8vEY9grSZNrO_soPwE0oGczrVy1yHF8_m0pA%40mail.gmail.com.


Re: mapping :W to :w...

2021-02-23 Thread tuxic
Hi Salman,

oh! :)

The first is genious and while reading the second one I had
the distinctive feeling of flat-hand-against-my-fronthead... ;)
Of course! 

Thank you very much! That helps me a lot!

Cheers!
mcc


On 02/23 11:11, Salman Halim wrote:
> I actually prefer to never hit shift, so map ; to : instead.
> 
> You could simply define a command called W to do what you want:
> 
> command! W w
> 
> -- 
> 
> Salman
> 
> On Tue, 23 Feb 2021, 23:06 ,  wrote:
> 
> > Hi,
> >
> > if my PC is heavily compiling things and I am editing and saving
> > things repeatedly if often hit :W instead of :w (that is, I am
> > still pressing SHIFT when hitting w.
> >
> > So I tried to map :W to :w...but it does not work for me.
> >
> > I tried
> >
> > [n]map W w
> > and
> > [n]map :W :w
> >
> > .
> >
> > Is there any way to map the accidentally hit :W
> > command to :w somehow?
> >
> > Cheers!
> > mcc
> >
> > --
> > --
> > 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+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/vim_use/20210224040623.p4fmrhjxbiyf5e5n%40solfire
> > .
> >
> 
> -- 
> -- 
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/vim_use/CANuxnEcDbZWngA-58DHuvdG_fesuz5%3DCxUh_LBmOqFTzx7YTTA%40mail.gmail.com.

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20210224043343.y734qf2kskrdfjtm%40solfire.


Re: mapping :W to :w...

2021-02-23 Thread Salman Halim
I actually prefer to never hit shift, so map ; to : instead.

You could simply define a command called W to do what you want:

command! W w

-- 

Salman

On Tue, 23 Feb 2021, 23:06 ,  wrote:

> Hi,
>
> if my PC is heavily compiling things and I am editing and saving
> things repeatedly if often hit :W instead of :w (that is, I am
> still pressing SHIFT when hitting w.
>
> So I tried to map :W to :w...but it does not work for me.
>
> I tried
>
> [n]map W w
> and
> [n]map :W :w
>
> .
>
> Is there any way to map the accidentally hit :W
> command to :w somehow?
>
> Cheers!
> mcc
>
> --
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/20210224040623.p4fmrhjxbiyf5e5n%40solfire
> .
>

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CANuxnEcDbZWngA-58DHuvdG_fesuz5%3DCxUh_LBmOqFTzx7YTTA%40mail.gmail.com.