Vim Tips Wiki
Advertisement

New tips June 2009

For each proposed new tip:

  • Is it worth keeping as a separate tip?
  • Should it be merged into an existing tip? Which?
  • If it should be kept, is it ready for release? Which points need fixing? Should it be renamed?

Please edit this page (not the talk page) in the appropriate section below the following table.
Alternatively, comments can be posted on the mailing list.

Proposed new tip Current consensus
Change visual mode paste command behaviour -
Indent with tabs, align with spaces -
Toggle Insert-Normal Mode via ctrl-space Merged to VimTip285
Undo through :edit -

Please add your comment (sign with ~~~~) below the appropriate heading. Use ---- between comments.

General comments (not for a specific tip)

Change visual mode paste command behaviour

Merge? This might be good in one of visual mode tips (like VimTip1011, or Short mappings for common tasks. Since this was spawned from a vim_use discussion to address a specific issue, I'm a little uncertain about this one. If we do merge it, we need to be sure to keep the title as a redirect and maybe create a couple more redirects. --Fritzophrenic 19:12, 7 July 2009 (UTC)

Yes, let's merge this. Of the above, I like 1011. Other possible merge targets are 497 Replacing a string with default buffer contents (an empty tip), and 605 Replace a word with the yanked text. I'll think more later. JohnBeckett 12:02, 28 July 2009 (UTC)

Indent with tabs, align with spaces

Unless I'm mistaken, this is just a plugin feature. Should we merge this to our Vim scripts page? --Fritzophrenic 19:12, 7 July 2009 (UTC)

Yes, I'll merge this somewhere. Perhaps mention the plugin on the scripts page and also mention some of the stuff in a related tip, but I don't think we need the three external links. If I find a good place to mention them, I might, but they don't look helpful to me. JohnBeckett 12:02, 28 July 2009 (UTC)

Toggle Insert-Normal Mode via ctrl-space

Merged to VimTip285 (an extremely similar suggestion was already in the tip). I do not think this title is worth keeping and I propose deleting it. Let me know if contrary view. JohnBeckett 12:02, 28 July 2009 (UTC)

Merge to Avoid the escape key as suggested in the comments of the tip. --Fritzophrenic 19:12, 7 July 2009 (UTC)

Undo through :edit

Rename to "Reload file without losing undo history" or similar, and keep. There are some problems and potential solutions mentioned in the comments, but they are clear enough that the tip is relatively solid. --Fritzophrenic 21:17, 26 July 2009 (UTC)

Are you sure? I hate a tip that starts by deleting all my text! Moreover, the builtin :e will refuse to work (with a warning) if the file is modifed (I need :e!). That is a good thing, and compatible with how I expect Vim to work (and training people to become used to :e working some other way is not really a good idea). I accept that if nothing goes wrong, I will be able to undo everything, but it's a bit dodgy for my liking. I suppose that if it were a user command like :Reload it would appeal more. JohnBeckett 12:02, 28 July 2009 (UTC)
Actually, I too would like it more if it were a user command. I was meaning to mention this but it seems I forgot. I also do not like the idea of overriding the :e command in this way! I will often use :e as a (somewhat lazy) way to refresh syntax highlighting or reload the ftplugin on an unmodified file, and this tip will not do that.
That being said, the tip's entire purpose is to allow you to "undo" past the reload, so I'm not too worried about causing problems there. Perhaps we should check the setting of the 'undolevels' option before deleting the text though :-).
I do think this tip is worth keeping, though I also agree it would be best to present it as a user-defined command rather than a replacement for :e (but we can still mention that this is possible, probably with an "if you're brave..." prefix). This idea is one reason I am proposing the rename; it's hard to say that a tip called "Undo through :edit" should do nothing to the :edit command at all. An alternate title allows this with no head-scratching.
--Fritzophrenic 02:31, 29 July 2009 (UTC)

Advertisement