Quantcast

common shortcut key

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

common shortcut key

bill lam

shortcut keys for select-all,copy,cut,paste for most editors are
c-a,c-c,c-x,c-v, while vim has its own commands such as ggVG but it needs more
typing. Is it a normal practice in vim to map them into a shorter key combinations?

regards,


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Jeremy Cantrell

the shortcut keys you refer to were made popular by microsoft with
their software. is it any surprise that vim and its authors feel no
obligation to adhere to this standard?

aside from that, you've named 4 commands. vim's commands can be
combined in a myriad of ways to do all sorts of things. for example,
the example you gave, "ggVG" for select all, but you can also do
things like "Vap" for line-select the current paragraph, or "V2ap" for
selecting the next 2 paragraphs, or "vas" for selecting the current
sentence. do you see where i'm going with this? some of these commands
i don't even use, but i was able to piece them together, because i
know what the individual components do (i.e. v does visual, V does
visual line, ap is "a paragraph", as is "a sentence"). the commands in
vim are much more complex than some old cut-copy-paste paradigm.

all that being said, the only shortcut i define for myself is the one
that you mentioned, ggVG, which i map to a function key. the others, i
find much more intuitive as-is.

if all you want is an editor that behaves more familiar to standard
windows apps, there's a script that can be sourced from your vimrc
that maps those cut-copy-paste keys for you.

On Apr 1, 10:42 pm, bill lam <[hidden email]> wrote:
> shortcut keys for select-all,copy,cut,paste for most editors are
> c-a,c-c,c-x,c-v, while vim has its own commands such as ggVG but it needs more
> typing. Is it a normal practice in vim to map them into a shorter key combinations?
>
> regards,
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Dominique Pellé
In reply to this post by bill lam

On Wed, Apr 2, 2008 at 4:42 AM, bill lam <[hidden email]> wrote:
>
>  shortcut keys for select-all,copy,cut,paste for most editors are
>  c-a,c-c,c-x,c-v, while vim has its own commands such as ggVG but it needs more
>  typing. Is it a normal practice in vim to map them into a shorter key combinations?
>
>  regards,


I can think of a shorter way then ggVG to select the while buffer:

  :y<Enter>

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Bob Hiestand

On Wed, Apr 2, 2008 at 12:42 AM, Dominique Pelle
<[hidden email]> wrote:

>  I can think of a shorter way then ggVG to select the while buffer:
>
>   :y<Enter>

Shouldn't that be:

:%y<Enter>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: common shortcut key

Gene Kwiecinski
In reply to this post by bill lam

>shortcut keys for select-all,copy,cut,paste for most editors
>are c-a,c-c,c-x,c-v, while vim has its own commands such as
>ggVG but it needs more typing. Is it a normal practice in vim
>to map them into a shorter key combinations?

I'm beginning to think I'm the only one who uses ctl-del for ^X, ctl-ins
for ^C, and shf-ins for ^V.  :P

Those're easy shortcuts, single keychords, to do the exact same
cut/copy/paste as ^X/^C/^V.  And they mostly work in other apps, too.
File browsers (to copy/move files in a bunch), too, etc.

^A to select all, eh, I just do '1GVG' to grab everything.  Rarely need
it, as othertimes I have a specific range in mind, linewise,
paragraphwise, etc.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: common shortcut key

Gene Kwiecinski
In reply to this post by Jeremy Cantrell

>the shortcut keys you refer to were made popular by microsoft with
>their software. is it any surprise that vim and its authors feel no
>obligation to adhere to this standard?

Wellp, 'vi' was around loooooong before M$ started pir8ing apps.


>all that being said, the only shortcut i define for myself is the one
>that you mentioned, ggVG, which i map to a function key. the others, i
>find much more intuitive as-is.

I prefer '1GVG', because after the '1's done, I can just hold the
<shift> key and do the little 'gvg' dance with 2 fingers in quick
succession.  Just works a little better for me than a 'g' double-tap,
then holding down <shift>, then the 'vg', then releasing <shift>.

Ymmv.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

bill lam
In reply to this post by Gene Kwiecinski

Gene Kwiecinski wrote:
> I'm beginning to think I'm the only one who uses ctl-del for ^X, ctl-ins
> for ^C, and shf-ins for ^V.  :P

Could you show what should be set in .vimrc to use them?

regards,

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: common shortcut key

Gene Kwiecinski

>>I'm beginning to think I'm the only one who uses ctl-del for ^X,
ctl-ins
>>for ^C, and shf-ins for ^V.  :P
>Could you show what should be set in .vimrc to use them?

...

I just did.  :D

Kidding aside, they're built-in, and you don't need to include anything.
Try it.  Eg, hit 'v', 'V', etc., and visually select an item.  ctl-del
it.  Will disappear but be in the "clipboard".  Move elsewhere and
shf-ins it.  Will be put there at the cursor position.  Undo, undo.
Reselect the same taxt, only now ctl-ins it.  Text will remain, but move
elsewhere and shf-ins it, and a copy will be put there.

Works the same as yank/put for within the same file, but you can
cut/copy/paste to/from other apps as well.

Eg, when I find an interesting METAR for my METAR decoder, I'll
highlight and ^C it from the webpage, create a new .txt file, 'vim' it,
then shf-ins it to copy the text there, save the doc, and bring it home
to test it.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Jürgen Krämer-4
In reply to this post by Gene Kwiecinski


Hi,

Gene Kwiecinski wrote:
>> shortcut keys for select-all,copy,cut,paste for most editors
>> are c-a,c-c,c-x,c-v, while vim has its own commands such as
>> ggVG but it needs more typing. Is it a normal practice in vim
>> to map them into a shorter key combinations?
>
> I'm beginning to think I'm the only one who uses ctl-del for ^X, ctl-ins
> for ^C, and shf-ins for ^V.  :P

no, you are not.

> Those're easy shortcuts, single keychords, to do the exact same
> cut/copy/paste as ^X/^C/^V.  And they mostly work in other apps, too.
> File browsers (to copy/move files in a bunch), too, etc.

Outside of Vim I mostly use Ctrl/Shift-Ins and Shift-Del (Ctrl-Del
deletes, but does not copy the deleted to the clipboard -- at least with
my setup) and in Vim I sometimes use "*y, "*x, "*P, and "*p,
respectively.

Ctrl-X/C/V are reserved for those times when my right hand is on the
mouse and I select text by dragging or double/triple/quadruple-clicking.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Georg Dahn-2
In reply to this post by Jeremy Cantrell

Hi!

> the shortcut keys you refer to were made popular by microsoft with
> their software. is it any surprise that vim and its authors feel no
> obligation to adhere to this standard?

This CUA standard was not developed by Microsoft but by IBM:

http://en.wikipedia.org/wiki/Common_User_Access

But it influenced Microsoft Windows very much and thus it is associated
with Microsoft. However, as it is written in the linked article,
Microsoft moved away from CUA and keept mainly the key bindings.

Best wishes,
Georg



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Jürgen Krämer-4


Hi,

Georg Dahn wrote:
>
>> the shortcut keys you refer to were made popular by microsoft with
>> their software. is it any surprise that vim and its authors feel no
>> obligation to adhere to this standard?
>
> This CUA standard was not developed by Microsoft but by IBM:
>
> http://en.wikipedia.org/wiki/Common_User_Access

cited from this link:

  The 'Cut' command is [Shift]+[Del]; Copy is [Ctrl]+[Ins]; Paste is [Shift]+[Ins];

> But it influenced Microsoft Windows very much and thus it is associated
> with Microsoft. However, as it is written in the linked article,
> Microsoft moved away from CUA and keept mainly the key bindings.

The use of a modifier key plus X, C, or V in Windows was actually
influenced by the pre-existing functionality on Apple's Lisa and Mac
(cf. <http://en.wikipedia.org/wiki/Cut%2C_copy%2C_and_paste>).

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

bill lam

I tested that S-Insert and C-Del works as paste and cut, but C-Insert does not
work, it only beeps. Did I miss something?

version of my vim:
VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct  5 2007 01:37:41)
Included patches: 1-56
Compiled by [hidden email]
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Andreas Politz
In reply to this post by Georg Dahn-2

Georg Dahn wrote:

>Hi!
>
>  
>
>>the shortcut keys you refer to were made popular by microsoft with
>>their software. is it any surprise that vim and its authors feel no
>>obligation to adhere to this standard?
>>    
>>
>
>This CUA standard was not developed by Microsoft but by IBM:
>
>  
>
"made popular by" != "developed by"

-p

--
:wq


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Jürgen Krämer-4


Hi,

A.Politz wrote:

> Georg Dahn wrote:
>> Hi!
>>
>>> the shortcut keys you refer to were made popular by microsoft with
>>> their software. is it any surprise that vim and its authors feel no
>>> obligation to adhere to this standard?
>>>
>> This CUA standard was not developed by Microsoft but by IBM:
>>
> "made popular by" != "developed by"

Ctrl-X/C/V has nothing to do with CUA.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Tony Mechelynck
In reply to this post by bill lam

bill lam wrote:
> I tested that S-Insert and C-Del works as paste and cut, but C-Insert does not
> work, it only beeps. Did I miss something?
>
> version of my vim:
> VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct  5 2007 01:37:41)
> Included patches: 1-56
> Compiled by [hidden email]
> Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):

You might try the following variations on the mappings shown a few lines
below ":help <C-Insert>" for the Dos/Windows versions of Vim:

        map     <S-Insert>     "+P
         vmap    <S-Insert>     "-d"+P
         imap    <S-Insert>     <C-R><C-O>+
         vmap    <C-Insert>     "+y
         vmap    <S-Del>        "+d
         vmap    <C-Del>        "+d

I'm using the + register rather than the * register because (unlike on
Windows) on X11 they're different and + is the clipboard.

You might also want to update your version of Vim: current patchlevel is
7.1.291 -- IOW, you're missing 235 bugfixes and/or improvements: see at
http://ftp.vim.org/pub/vim/7.1/README what these patches are all about.


Best regards,
Tony.
--
While most peoples' opinions change, the conviction of their
correctness never does.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Tony Mechelynck

Tony Mechelynck wrote:
[...]
> You might also want to update your version of Vim: current patchlevel is
> 7.1.291 -- IOW, you're missing 235 bugfixes and/or improvements: see at
> http://ftp.vim.org/pub/vim/7.1/README what these patches are all about.

Oops! http://ftp.vim.org/pub/vim/patches/7.1/README

>
>
> Best regards,
> Tony.
--
We can defeat gravity.  The problem is the paperwork involved.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

bill lam
In reply to this post by Tony Mechelynck

Tony Mechelynck wrote:
> You might also want to update your version of Vim: current patchlevel is
> 7.1.291 -- IOW, you're missing 235 bugfixes and/or improvements: see at
> http://ftp.vim.org/pub/vim/7.1/README what these patches are all about.

Thanks. C-Insert now works after adding key bindings you suggested.
There is no vim binary updates for my ubuntu gutsy amd64 so that I have to wait
for ubuntu hardy that will be available at the end of this month.

regards,

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Tony Mechelynck

bill lam wrote:

> Tony Mechelynck wrote:
>> You might also want to update your version of Vim: current patchlevel is
>> 7.1.291 -- IOW, you're missing 235 bugfixes and/or improvements: see at
>> http://ftp.vim.org/pub/vim/7.1/README what these patches are all about.
>
> Thanks. C-Insert now works after adding key bindings you suggested.
> There is no vim binary updates for my ubuntu gutsy amd64 so that I have to wait
> for ubuntu hardy that will be available at the end of this month.
>
> regards,

See at http://users.skynet.be/antoine.mechelynck/vim/compunix.htm how I
compile my own Vim on Linux, thus not having to wait for the (always
hopelessly outdated) versions published by my Novell/openSUSE distribution.

I don't know whether the standard configure script checks for a 64-bit
CPU but I suppose some other Vimmer will be able to answer. (amd64 is
equivalent to x86-64, perhaps by a different maker, is that it?)

Best regards,
Tony.
--
Every improvement in communication makes the bore more terrible.
                -- Frank Moore Colby

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Dagfinn Reiersøl
In reply to this post by Tony Mechelynck

On Apr 3, 9:33 am, Tony Mechelynck <[hidden email]>
wrote:
> You might also want to update your version of Vim: current patchlevel is
> 7.1.291 -- IOW, you're missing 235 bugfixes and/or improvements: see athttp://ftp.vim.org/pub/vim/7.1/READMEwhat these patches are all about.
Dead link. Try:
ftp://ftp.vim.org/pub/vim/patches/7.1/README
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: common shortcut key

Dagfinn Reiersøl



On Apr 3, 11:22 am, dagfinn <[hidden email]> wrote:
> On Apr 3, 9:33 am, Tony Mechelynck <[hidden email]>
> wrote:> You might also want to update your version of Vim: current patchlevel is
> > 7.1.291 -- IOW, you're missing 235 bugfixes and/or improvements: see athttp://ftp.vim.org/pub/vim/7.1/READMEwhatthese patches are all about.
>
> Dead link. Try:ftp://ftp.vim.org/pub/vim/patches/7.1/README

Sorry, I saw you'd fixed it already.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

12
Loading...