adding modes
I'm using vim for about half a year now, so no expert yet. I like the modal idea, and not needing to do control-anything all the time. But I also think this could be taken further. For example: switching between windows now requires C-w j etcetera - not so convenient, especially not on my macbook keyboard. I would like to be able to add an extra mode for browsing through files (switching windows, buffers and scrolling). But modes seem to be hard-coded in vim. Questions: can I add modes? If not: is there a good reason for that? If not: is there any chance of it being implemented? --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
storing files without a name
hello I use vim for all kinds of different work. At times I'm using it to edit source code or other files, where it is really clear what the filenames are and where they are going. At some other times I use vim for storing a few random notes, or to edit some text that is eventually going to a web form or instant messenger message. With the latter cases I'd really like to be able to save the file just by saying :w without providing a filename. And this is something I naturally do. No one told me to do it, or said it would be ok to do. Ok or not it really gets in the way of my editing that I find myself hitting :w multiple times with always getting the complaint about file name not being defined. Then I might spend a few seconds thinking about a filename or directory for the information, just to notice that I don't have a good plan for storing such files in a file system hierarchy. Then I forget about it and after a few seconds of more editing I, by instinct, hit :w again a few times wondering why it doesn't work. Until I read the message and spend some more time thinking about the filename. I'm suggesting that vim could generate filenames for the files which do not already have them. Just store all such files somewhere under ~/.vim/drafts/. I'd like to know, if others have the same problem. I can't help myself thinking that fixing this is more important than concentrating on many advanced features that vim already has. cheers --Toni --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
Saluton Roald :) Roald d...@gmail.com dixit: Questions: can I add modes? Not exactly, but using mappings and some scripting you can achieve what you want. Just define mappings for normal mode. If not: is there a good reason for that? Current design, I suppose. Moreover, if you think about it, there's plenty of things that doesn't belong to an editor (browsing files, for example) but that you can add to an editor and that in fact are present in Vim: if you add a mode for each and every of them you will end up with dozens of modes, and it doesn't make sense. The usage pattern you explained in your message doesn't make sense as a mode for me, because those actions belong to normal mode. Current design is, IMHO, perfect. You have normal mode for performing editing tasks, visual mode to visually perform editing tasks and command mode for ex commands. Operator pending mode is not exactly a mode, but a helper to be able to fine tune normal mode mappings, and insert mode is not a mode at all (although it is treated like that to make defining maps easier), but the result of a command in normal mode (namely the i or a commands, for example). Usually Vim is called modal because it can be in insert mode or normal mode. I don't consider things like that. I prefer to consider Vim as a command-driven application, one of the commands insert text, other allows for visual selections, other runs ex commands etc. It's all about commands, just that. In you case you want commands that are easier to type than Ctr-w w for changing windows, not a new mode with a new set of mappings. My suggestion is that you can use unmapped keys to perform the actions you use the most with just one keypress, or even use already mapped keys you don't use, or use a mapleader, etc. For example, I use gqip a lot, so I've mapped çç to do that (ç is my mapleader), I've mapped çc to comment a block of visually selected lines, etc. Mappings are your friends, not new modes ;) If not: is there any chance of it being implemented? I can't speak for Bram, but I would bet that it won't ;) -- Raúl DervishD Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
On 13-Jul-09 15:04, Roald wrote: I'm using vim for about half a year now, so no expert yet. I like the modal idea, and not needing to do control-anything all the time. But I also think this could be taken further. For example: switching between windows now requires C-w j etcetera - not so convenient, especially not on my macbook keyboard. I would like to be able to add an extra mode for browsing through files (switching windows, buffers and scrolling). But modes seem to be hard-coded in vim. Questions: can I add modes? If not: is there a good reason for that? If not: is there any chance of it being implemented? The default window navigation commands are a bit tedious, I mapped CTRL-JKHL to go to the window in that direction: nnoremap C-j C-wj etc. If CTRL isn't placed convenient, you can also use ALT/META. -- regards, ingo --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: storing files without a name
On 12/07/09 14:22, Toni Ruottu wrote: hello I use vim for all kinds of different work. At times I'm using it to edit source code or other files, where it is really clear what the filenames are and where they are going. At some other times I use vim for storing a few random notes, or to edit some text that is eventually going to a web form or instant messenger message. With the latter cases I'd really like to be able to save the file just by saying :w without providing a filename. And this is something I naturally do. No one told me to do it, or said it would be ok to do. Ok or not it really gets in the way of my editing that I find myself hitting :w multiple times with always getting the complaint about file name not being defined. Then I might spend a few seconds thinking about a filename or directory for the information, just to notice that I don't have a good plan for storing such files in a file system hierarchy. Then I forget about it and after a few seconds of more editing I, by instinct, hit :w again a few times wondering why it doesn't work. Until I read the message and spend some more time thinking about the filename. I'm suggesting that vim could generate filenames for the files which do not already have them. Just store all such files somewhere under ~/.vim/drafts/. I'd like to know, if others have the same problem. I can't help myself thinking that fixing this is more important than concentrating on many advanced features that vim already has. cheers --Toni It would be easy to add some command in Vim to store nameless buffers under a random filename, but how would you find them back? If you come a week later and find the files cf7g9k5x.txt, vfg5h8qw.txt and ytdf56vq.txt, how would you remember what you'd used them for (other than by looking inside them, of course)? I'd say it's much better to save the files -- if you really need to save them -- under a descriptive name, and _only you_ can give that name, be it AuntMary.txt or resume.html or whatever. If it's a first draft for something that's going to be sent or published, save it under the name it's gonna get when finished; and if it's going to be used for a few days or weeks then scrapped, at least give it a name which tells you what there is in it. As for hitting :w again at a beep without reading the message, that's something you should never do. If there's a beep and a message, or even just a red message, then something went wrong, and the first thing you should do then is find out what went wrong and see what you should do about it. Maybe it's a page of notes which you don't need any longer, and then the right thing to do is to hit :q! or :enew! on that window to quit it without saving. If Vim saved every buffer that you forgot to close when you didn't need them anymore, imagine the clutter on your disk! Best regards, Tony. -- Fats Loves Madelyn --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
On 13/07/09 18:00, Raúl Núñez de Arenas Coronado wrote: Saluton Roald :) Roaldd...@gmail.com dixit: Questions: can I add modes? Not exactly, but using mappings and some scripting you can achieve what you want. Just define mappings for normal mode. If not: is there a good reason for that? Current design, I suppose. Moreover, if you think about it, there's plenty of things that doesn't belong to an editor (browsing files, for example) but that you can add to an editor and that in fact are present in Vim: if you add a mode for each and every of them you will end up with dozens of modes, and it doesn't make sense. The usage pattern you explained in your message doesn't make sense as a mode for me, because those actions belong to normal mode. Current design is, IMHO, perfect. You have normal mode for performing editing tasks, visual mode to visually perform editing tasks and command mode for ex commands. Command-LINE mode. Command mode is an older synonym, still used in parts of the help, for Normal mode. See :help command-mode if you don't believe me. Operator pending mode is not exactly a mode, but a helper to be able to fine tune normal mode mappings, and insert mode is not a mode at all (although it is treated like that to make defining maps easier), but the result of a command in normal mode (namely the i or a commands, for example). About Insert mode, I believe the opposite. Vim has two great families of modes, namely some in which the letters you type appear on the screen and can be removed in a different sequence (mainly Insert mode, Replace mode and Command-line mode -- with its Ex-command, Search-before and Search-back variants) and those in which they act immediately, possibly after you press several keys in succession, but in that case you cannot edit the sequence, you can either abort it, or, in some cases, remove only the last keys hit, by backspacing over them in LIFO sequence -- these are Normal mode, Visual mode (including its characterwise, linewise and blockwise variants, as well as Select mode), and Operator-pending which is where you are when entering the movement or object after an action command. Usually Vim is called modal because it can be in insert mode or normal mode. I don't consider things like that. I prefer to consider Vim as a command-driven application, one of the commands insert text, other allows for visual selections, other runs ex commands etc. It's all about commands, just that. If insert text is just one command until you leave Insert mode... well, I won't deny that to part of the Vim C code it is that, but thinking that, when I enter a new file, I'll be partway inside one long command for I don't know how long until, after having hit Esc (which is part of that long command but signals it end) I'll finally hit :wqEnter (a second command) to quit Vim... well, that's just impractical for a flesh-and-blood person who can hardly conceive that the long job of typing all the data in one file is the same kind of stuff as :wq and that he used exactly two commands during that long session. (And when I hit F3 in Insert mode, which is imapped to C-O:wa|wvCR , to me it isn't ending one command, doing two other commands, and starting a fourth one, it's just one action to save the file, and that is part of Insert mode. I might admit that after I previously went down from Normal to Insert, this goes down one further level to Normal mode, and from there to Command-line mode, as part of a mapping --which, on other programs, might be called a macro-instruction-- but I'll hold steadfastly that Insert-mode hasn't been abandoned, it is pending all the while that that mapping executes, and finally the mapping goes back to it the way a subroutine returns to its caller.) In you case you want commands that are easier to type than Ctr-w w for changing windows, not a new mode with a new set of mappings. My suggestion is that you can use unmapped keys to perform the actions you use the most with just one keypress, or even use already mapped keys you don't use, or use a mapleader, etc. For example, I use gqip a lot, so I've mapped çç to do that (ç is my mapleader), I've mapped çc to comment a block of visually selected lines, etc. Mappings are your friends, not new modes ;) Yes, here I agree. If you find that you don't like using Ctrl-W all the time, you can map it to something else, and if your keyboard is a US-QWERTY with no accented letters, you can still use :mapF5C-W and hit F5 (with one finger) wherever the help says to hit Ctrl-W (which requires two fingers). If not: is there any chance of it being implemented? I can't speak for Bram, but I would bet that it won't ;) Actually, you could say that Ctrl-W starts a new mode with a duration of just one keypress, then goes back to Normal mode -- reminds me of three-shift alphabets I knew on the mainframes of some decades ago, but let's
Re: adding modes
On 13/07/09 18:08, Ingo Karkat wrote: On 13-Jul-09 15:04, Roald wrote: I'm using vim for about half a year now, so no expert yet. I like the modal idea, and not needing to do control-anything all the time. But I also think this could be taken further. For example: switching between windows now requires C-w j etcetera - not so convenient, especially not on my macbook keyboard. I would like to be able to add an extra mode for browsing through files (switching windows, buffers and scrolling). But modes seem to be hard-coded in vim. Questions: can I add modes? If not: is there a good reason for that? If not: is there any chance of it being implemented? The default window navigation commands are a bit tedious, I mapped CTRL-JKHL to go to the window in that direction: nnoremapC-j C-wj etc. The problem with that is that you're masking existing (and useful) functions. For instance, I constantly use Ctrl-K as the digraph prefix (the option to use X BS Y instead of C-K X Y is more trouble than it is useful IMO); Ctrl-L is the redraw key, very useful when something goes half wrong, and so forth. If CTRL isn't placed convenient, you can also use ALT/META. and Alt/Meta means set the high bit which means that it conflicts with accented letters -- even in English (as spelled by the Oxford Dictionary), words like risqué, résumé (as in summary or curricumum vitæ, not continue after a halt), garçon, señorita, and others, are written with such accented letters -- yeah, I know they are foreign words which haven't yet fully made their way into the language, but if you map Alt-i to something you'll get a bad surprise if someday you want to write the word risqué the way it ought to be written. To Vim, é-acute and Alt-i are undistinguishable from each other. -- regards, ingo Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 72. Somebody at IRC just mentioned a way to obtain full motion video without a PC using a wireless protocol called NTSC, you wonder how you never heard about it --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
On Tue, Jul 14, 2009 at 12:46:37AM +0200, Tony Mechelynck wrote: On 13/07/09 18:08, Ingo Karkat wrote: The default window navigation commands are a bit tedious, I mapped CTRL-JKHL to go to the window in that direction: nnoremapC-j C-wj etc. The problem with that is that you're masking existing (and useful) functions. For instance, I constantly use Ctrl-K as the digraph prefix (the option to use X BS Y instead of C-K X Y is more trouble than it is useful IMO); That's in insert mode not normal mode. Therefore, not a conflict. Ctrl-L is the redraw key, very useful when something goes half wrong, and so forth. I find that doing :syn sync fromstart is usually a better fix. C-l only fixes the issue sometimes and in the cases it doesn't, :syn sync fromstart would be necessary anyway. The other two key combos being masked are C-h and C-j which don't override anything. They're simply alternatives for other keys. -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega james...@jamessan.com --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
On 14/07/09 01:08, James Vega wrote: On Tue, Jul 14, 2009 at 12:46:37AM +0200, Tony Mechelynck wrote: On 13/07/09 18:08, Ingo Karkat wrote: The default window navigation commands are a bit tedious, I mapped CTRL-JKHL to go to the window in that direction: nnoremapC-j C-wj etc. The problem with that is that you're masking existing (and useful) functions. For instance, I constantly use Ctrl-K as the digraph prefix (the option to use XBS Y instead ofC-K X Y is more trouble than it is useful IMO); That's in insert mode not normal mode. Therefore, not a conflict. Ah, yes. Sorry. Ctrl-L is the redraw key, very useful when something goes half wrong, and so forth. I find that doing :syn sync fromstart is usually a better fix.C-l only fixes the issue sometimes and in the cases it doesn't, :syn sync fromstart would be necessary anyway. I don't mean that. :syn sync fromstart is for times when redrawing wouldn't be useful but syntax highlighting has to be recomputed from higher than it was (much higther, sometimes). Ctrl-L is for when Vim forgot to redraw the screen and it isn't displaying what it thinks it is. The other two key combos being masked areC-h andC-j which don't override anything. They're simply alternatives for other keys. Best regards, Tony. -- Magnet, n.: Something acted upon by magnetism Magnetism, n.: Something acting upon a magnet. The two definition immediately foregoing are condensed from the works of one thousand eminent scientists, who have illuminated the subject with a great white light, to the inexpressible advancement of human knowledge. -- Ambrose Bierce, The Devil's Dictionary --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: storing files without a name
I'd be perfectly happy in doing :w! and getting the file saved under a random named (like the ones you proposed) under ~/.vim/rubbish/. If someone then wants to make more advanced user interfaces for exploring the rubbish folder, that is fine with me too, but I'd do fine without one. I don't mind tidying the files in that folder up every once in a while, as long as my work is not interrupted with irritating problems, like thinking of file names. On Tue, Jul 14, 2009 at 12:12 AM, Tony Mechelynckantoine.mechely...@gmail.com wrote: On 12/07/09 14:22, Toni Ruottu wrote: hello I use vim for all kinds of different work. At times I'm using it to edit source code or other files, where it is really clear what the filenames are and where they are going. At some other times I use vim for storing a few random notes, or to edit some text that is eventually going to a web form or instant messenger message. With the latter cases I'd really like to be able to save the file just by saying :w without providing a filename. And this is something I naturally do. No one told me to do it, or said it would be ok to do. Ok or not it really gets in the way of my editing that I find myself hitting :w multiple times with always getting the complaint about file name not being defined. Then I might spend a few seconds thinking about a filename or directory for the information, just to notice that I don't have a good plan for storing such files in a file system hierarchy. Then I forget about it and after a few seconds of more editing I, by instinct, hit :w again a few times wondering why it doesn't work. Until I read the message and spend some more time thinking about the filename. I'm suggesting that vim could generate filenames for the files which do not already have them. Just store all such files somewhere under ~/.vim/drafts/. I'd like to know, if others have the same problem. I can't help myself thinking that fixing this is more important than concentrating on many advanced features that vim already has. cheers --Toni It would be easy to add some command in Vim to store nameless buffers under a random filename, but how would you find them back? If you come a week later and find the files cf7g9k5x.txt, vfg5h8qw.txt and ytdf56vq.txt, how would you remember what you'd used them for (other than by looking inside them, of course)? I'd say it's much better to save the files -- if you really need to save them -- under a descriptive name, and _only you_ can give that name, be it AuntMary.txt or resume.html or whatever. If it's a first draft for something that's going to be sent or published, save it under the name it's gonna get when finished; and if it's going to be used for a few days or weeks then scrapped, at least give it a name which tells you what there is in it. As for hitting :w again at a beep without reading the message, that's something you should never do. If there's a beep and a message, or even just a red message, then something went wrong, and the first thing you should do then is find out what went wrong and see what you should do about it. Maybe it's a page of notes which you don't need any longer, and then the right thing to do is to hit :q! or :enew! on that window to quit it without saving. If Vim saved every buffer that you forgot to close when you didn't need them anymore, imagine the clutter on your disk! Best regards, Tony. -- Fats Loves Madelyn --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: storing files without a name
[moving from vim_dev to vim_use] On 14/07/09 02:06, Toni Ruottu wrote: I'd be perfectly happy in doing :w! and getting the file saved under a random named (like the ones you proposed) under ~/.vim/rubbish/. If someone then wants to make more advanced user interfaces for exploring the rubbish folder, that is fine with me too, but I'd do fine without one. I don't mind tidying the files in that folder up every once in a while, as long as my work is not interrupted with irritating problems, like thinking of file names. Hm, after studying some parts of the help, I think it would be harder to implement than I thought, but I still think it could be done in vimscript. The question, however, is: is the game worth the candle? If you believe that thinking of a name when saving an unnamed buffer is too irritating for you to think of, well... Hm, here's an idea. Put this in your vimrc (untested, and, lurkers: this is for Unix/Linux, not Windows): let s:savedir = '~/.vim/rubbish' while !isdirectory(s:savedir) exe '!mkdir -p' s:savedir if v:shell_error echomsg 'Cannot create' s:savedir s:savedir = input('Type another path to use: ', '', 'dir') endif endwhile command -nargs=0 -bar -bang -complete=file -range=% W \ line1,line2call s:Write(q-bang) function s:Write(bang) range try exe a:firstline ',' a:lastline 'w' a:bang catch exe 'w' savedir . '/' . localtime() . '.txt' endtry endfunction Then use :W instead of :w (when with no arguments). When there are arguments you should still use :w in lowercase. But you can use :W! instead of :w! if you want to. If I didn't goof, this should write the current buffer under its own name if possible, and if not, it writes it to some rubbish directory as a .txt file with the time in seconds since 1970 as its name -- IOW, it assumes that you won't save more than one unnamed buffer per second. The top while loop is to make sure that the rubbish directory exists -- if it doesn't and can't be created, you're asked for another name. In that case, modify your vimrc so you aren't asked at every startup. This is just a quick solution I slopped up without too much hardship. I think it can be made better, and that it shouldn't be too hard -- after all, Vim is extremely well documented. If this doesn't do all that you need, well, the solution is left as an exercise to the reader, then. I'm moving this to the vim_use group (or trying to) since it's become a question about using Vim, not a question about changing the C code of Vim. Best regards, Tony. -- Sex is not the answer. Sex is the question. Yes is the answer. -- Swami X --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
RE: storing files without a name
NEW USERS ON THIS MAILING LIST: Please bottom post on this list. Quote a small (relevant) part of the message you are replying to, and put your text underneath. Do NOT quote large amounts of irrelevant stuff. See http://groups.google.com/group/vim_use/web/vim-information --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
On Mon, Jul 13, 2009 at 7:31 PM, Tony Mechelynck wrote: On 14/07/09 01:08, James Vega wrote: On Tue, Jul 14, 2009 at 12:46:37AM +0200, Tony Mechelynck wrote: On 13/07/09 18:08, Ingo Karkat wrote: The default window navigation commands are a bit tedious, I mapped CTRL-JKHL to go to the window in that direction: nnoremapC-j C-wj etc. Ctrl-L is the redraw key, very useful when something goes half wrong, and so forth. I find that doing :syn sync fromstart is usually a better fix.C-l only fixes the issue sometimes and in the cases it doesn't, :syn sync fromstart would be necessary anyway. I don't mean that. :syn sync fromstart is for times when redrawing wouldn't be useful but syntax highlighting has to be recomputed from higher than it was (much higther, sometimes). Ctrl-L is for when Vim forgot to redraw the screen and it isn't displaying what it thinks it is. You could always do :redraw! instead of C-L though - but, who wants that? I'm also against remapping CTRL + h/j/k/l The other two key combos being masked areC-h andC-j which don't override anything. They're simply alternatives for other keys. Yes, but remapping them *would* affect those keys. If, for example, your terminal sent ^H for BS then pressing BS would suddenly move one window left - which I suppose is as sane as moving one character left, it's default behavior - but it does still change things. Not sure if there's any setup where pressing a Return key (as distinct from Enter) on the keyboard actually sends a ^J but I bet there's one out there somewhere. ~Matt --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
On Mon, Jul 13, 2009 at 6:17 PM, Tony Mechelynck wrote: On 13/07/09 18:00, Raúl Núñez de Arenas Coronado wrote: Usually Vim is called modal because it can be in insert mode or normal mode. I don't consider things like that. I prefer to consider Vim as a command-driven application, one of the commands insert text, other allows for visual selections, other runs ex commands etc. It's all about commands, just that. If insert text is just one command until you leave Insert mode... well, I won't deny that to part of the Vim C code it is that, but thinking that, when I enter a new file, I'll be partway inside one long command for I don't know how long until, after having hit Esc (which is part of that long command but signals it end) I'll finally hit :wqEnter (a second command) to quit Vim... well, that's just impractical for a flesh-and-blood person who can hardly conceive that the long job of typing all the data in one file is the same kind of stuff as :wq and that he used exactly two commands during that long session. (And when I hit F3 in Insert mode, which is imapped to C-O:wa|wvCR , to me it isn't ending one command, doing two other commands, and starting a fourth one, it's just one action to save the file, and that is part of Insert mode. Maybe that's how you choose to look at it, but it *is* ending insert mode, executing some commands, and starting a new insert command. :help ins-special-special explains this, and it's painfully obvious when you try to type, say, i)Left(Esc. and get (() instead of ()() I have to agree with Raúl in his interpretation - insert mode is really only a mode in the sense of a mode being a place that has its own mappings and keybindings, but in all other senses - for instance, what counts as beginning and ending a command, or repeating a command, or counting how many changes have been made, or any number of other metrics - it's only a command. ~Matt --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: adding modes
On 14/07/09 05:27, Matt Wozniski wrote: On Mon, Jul 13, 2009 at 6:17 PM, Tony Mechelynck wrote: On 13/07/09 18:00, Raúl Núñez de Arenas Coronado wrote: Usually Vim is called modal because it can be in insert mode or normal mode. I don't consider things like that. I prefer to consider Vim as a command-driven application, one of the commands insert text, other allows for visual selections, other runs ex commands etc. It's all about commands, just that. If insert text is just one command until you leave Insert mode... well, I won't deny that to part of the Vim C code it is that, but thinking that, when I enter a new file, I'll be partway inside one long command for I don't know how long until, after having hit Esc (which is part of that long command but signals it end) I'll finally hit :wqEnter (a second command) to quit Vim... well, that's just impractical for a flesh-and-blood person who can hardly conceive that the long job of typing all the data in one file is the same kind of stuff as :wq and that he used exactly two commands during that long session. (And when I hit F3 in Insert mode, which is imapped to C-O:wa|wvCR , to me it isn't ending one command, doing two other commands, and starting a fourth one, it's just one action to save the file, and that is part of Insert mode. Maybe that's how you choose to look at it, but it *is* ending insert mode, executing some commands, and starting a new insert command. :help ins-special-special explains this, and it's painfully obvious when you try to type, say, i)Left(Esc. and get (() instead of ()() I have to agree with Raúl in his interpretation - insert mode is really only a mode in the sense of a mode being a place that has its own mappings and keybindings, but in all other senses - for instance, what counts as beginning and ending a command, or repeating a command, or counting how many changes have been made, or any number of other metrics - it's only a command. ~Matt Well, thinking of a long typing session as one little command is still foreign to my way of thinking -- and, the word modal in fact refers to the fact that the same keys don't always do the same things in Vim. Of course, in that sense all editors are modal -- when you're typing into a dialog your keypresses don't go into your editfile -- but in most of them there is one mode which you use a huge majority of the time, while in Vim, you use the same (alphabetic) keys for very different purposes when creating a file from top to bottom and when looking at an existing file and maybe (or maybe not) making some changes in it, and neither of these, yes, modes is always predominant. Best regards, Tony. -- Dying is a very dull, dreary affair. And my advice to you is to have nothing whatever to do with it. -- W. Somerset Maugham --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: Bug report: Editing file in %system32% leads to creating file in c:\windows\Syswow64
On 14/07/09 03:56, K L wrote: Hi, I did not find a similar bug by a quick search in this mailing list. I'm sorry if there's already duplicates. Setup: == Vim 32 running on AMD64 machine. Test is done on Win Vista enterprise and Win 7 RC. Reproduction: == 1. Opening a command line window 2. cd /d c:\Windows\System32 3. notepad ddd.txt 4. This will bring up notepad window. Say Yes if asked to create a new file named ddd.txt 5. Enter any text. save and exit 6. Still in %system32%, enter: vim ddd.txt 7. Vim program is bought up. Actual Results: === * On the vim modeline, it says: ddd.txt [New File] * When editing this file and save. Vim saves it to directory c:\windows\syswow64 Expected Results: = Vim should open the correct file which is in currect working directory %system32% Comments: = The problem should be a wow64 specific bug. Please investigate. I used the Sysinternal tool Process Monitor (procmon.exe) to get a trace of activities of notepad and vim during my operation. I hope this is useful for locating the bug. Procmon.exe can be downloaded from http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx The trace file Logfile.PML can be opened by procmon.exe, while Logfile.CSV can be opened by any text editor. Kefei Lu I don't know much about Vista, but this sounds to me like one more instance of Vista paranoia. System32 is a system directory and I suspect that not everyone or every application can create files there. Maybe your cmd.exe shell (wherein you ran vim.exe) hadn't got enough privileges to access system directories? Best regards, Tony. -- There are really not many jobs that actually require a penis or a vagina, and all other occupations should be open to everyone. -- Gloria Steinem --~--~-~--~~~---~--~~ You received this message from the vim_dev maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---