Vim Tips Wiki
Advertisement

New tips March 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 Link Current consensus
Auto indent on finishing a code block discuss -
Change cursor shape in different modes discuss -
Editing crontab discuss Keep
Creating a screenshot discuss -
Determining indent settings (shiftwidth etc.) for python files discuss -
Indent C blocks where braces are opened and closed on a single line discuss Keep
Make-compile current buffer discuss Merged to VimTip210
Using GUI color settings in a terminal discuss Keep

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

General comments (not for a specific tip)

Auto indent on finishing a code block

Change cursor shape in different modes

Editing crontab

Keep I renamed to simplify title and remove typo. Old title was: Configuring vim so it can be callled from "crontab -e" JohnBeckett 09:35, 4 July 2009 (UTC)

Creating a screenshot

Delete. This is trivial information that is probably already in the repertoire of most people that use Vim. For those few that don't know about it, why on earth would they search on the Vim Tips Wiki for that information? Furthermore, this tip consists of nothing but a collection of external links, and I think I've made my stance on such tips clear in the past. --Fritzophrenic 16:59, 7 July 2009 (UTC)

In general, I would agree. However, George Reilly is the author (George is a vital contributor to the Windows-specific stuff in Vim) so I am inclined to sacrifice my principles. Is there any chance we could (eventually) make a "how to ask an intelligible question" tip out of this? The whole exercise is of course pointless because the clueless would never look here, but I suppose George felt it might be useful to have a place to point them for next time. JohnBeckett 03:47, 8 July 2009 (UTC)

Determining indent settings (shiftwidth etc.) for python files

Indent C blocks where braces are opened and closed on a single line

Keep Little short and unnecessarily vague, but good. JohnBeckett 11:44, 12 July 2009 (UTC)

Kind of neat, and provides a very simple and immediately useful demonstration of overriding the default filetype indent rules. Keep, unless we have another filetype indent tip you'd like to merge it to. I think it is fine on its own. --Fritzophrenic 16:59, 7 July 2009 (UTC)

Make-compile current buffer

Merged to VimTip210 (while keeping the new title; 210 has been renamed). I tried some funky stuff and have combined the edit histories of the old and new tips. Amazing. JohnBeckett 04:54, 14 July 2009 (UTC)


This is an interesting and potentially useful but very trivial function/mapping. Do we have somewhere to merge it? I'd like to keep the info but am not sure whether there is enough content to make a full tip out of, though it is too much for Short mappings for common tasks IMO. --Fritzophrenic 16:59, 7 July 2009 (UTC)


We have these (345 has some relevant info including an F7 map):

Perhaps rename 210 to something more generic and merge this tip to 210? Maybe keep this tip's title as the new name for 210? JohnBeckett 11:44, 12 July 2009 (UTC)


I agree with a merge to 210 and rename. Maybe it would actually be better to merge 210 into this one instead (and redirect 210) to avoid page title confusion? --Fritzophrenic 02:34, 13 July 2009 (UTC)

Using GUI color settings in a terminal

Keep JohnBeckett 09:35, 4 July 2009 (UTC)


Well, it's definitely a useful tip. I think it's much better to recommend CSApprox over GuiColorScheme, but I might be biased since I'm the author. Here are a few reasons:

  • Doesn't work by reading and parsing the colorscheme. GuiColorScheme gets confused by things as simple as leading spaces on :highlight lines, let alone conditionals, or a colorscheme that sources another then makes some small tweaks
  • Works transparently, doesn't require a separate command to set the scheme, or a hack to load the plugin before plugins are normally loaded, and doesn't make any changes if the scheme is already high color or if the terminal doesn't support enough colors (though it warns loudly in that case).
  • Handles 3 different 256-color palettes. It can handle choosing the correct colors even given the subtle differences between konsole, xterm, and Eterm's color palettes, as long as it knows what the terminal is (either because $TERM is set properly or a global variable is set saying "I'm a (konsole|eterm)".
  • 90% as many downloads on vim.org as GuiColorScheme, and with a higher rating, despite being available for 1/4 the time.

The only disadvantage is that making it work in a vim without +gui requires running gvim and using :CSApproxSnapshot to dump out a version of the scheme that supports 88-/256-color terminals. CSApprox.vim works by querying the current gvim colors, and unfortunately this isn't possible where vim is -gui (yet, hopefully I can convince Bram to change that when I give him a patch). godlygeek 11:11, 15 March 2009 (UTC)

In response to your comment, latest version of guicolorscheme does handle properly indentation before :highlight command. I know since I stumbled upon precisely that issue too and I submitted a patch to fix it among minor other things. The author updated the script accordingly. I have not tried CSApprox yet, so I won't compare with it but from your description, CSApprox seems interesting too. dominiko Mar 15 16:08:28 UTC 2009.
I have added info in this tip about CSApprox plugin. dominiko Mar 17 21:19:11 UTC 2009

Now that this discussion has started, I'll add my voice in the Keep section, especially since both plugins are now mentioned in the tip. However, I'll also watch this page, and remind other commentators that they should do so too, because, as mentioned here at top, until March 31 a bot might remove all our comments. — Tonymec 08:43, 18 March 2009 (UTC)



Advertisement