On Wed, May 17, 2006 at 05:13:46PM EDT, A.J.Mechelynck wrote: > cga2000 wrote: > >Does vim provide any form of native support for drawing tables? > > > >I have tried a couple of plugins and they don't seem to play well with > >my setup, presumably because I have temporarily switched my locale back > >from UTF-8 to en_US (due to problems with other applications that do are > >not yet utf8-ready). > > > >When in UTF-8 I was able to manually draw nice-looking tables to dress > >up text that I had previously formatted in rows and columns by using > >digraphs (Ctrl+K hh/vv etc..) and though there were some issues with > >printing I was all-in-all quite happy. > > > >The functionalities I had in mind would probably do something like this: > > > >1. Assist text entry by letting you define tab stops, > > > Tabs stops in Vim are fixed-width; and it's usually a good idea to keep > the "hard tab" width at 8, though it is possible to define "soft tab > stops" (:h 'softtabstop') of a different width.
ok. But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Both regular tabs and "soft tabs" would appear to be more useful for indentation than column formatting. > >2. Let you select a column of text and justify it, > >3. Provide some means of inserting vertical lines at each tab stop, > > > I think that's possible using block visual mode, but I don't know the > details. that's pretty much how I was doing it manually - with a ':s' command. > >4. Assist in creating horizontal lines by adding the ad hoc character > > where a vertical and a horizontal line intersect, > >5. Reformat the table frame when box drawing characters are not > > available (replacing line intersections by '+' for instance). > > > >But then again I have little experience with vim and there is probably > >a "vim way" of doing this that I have not even imagined. So I am open > >to better strategies. > > > >Thanks, > > > >cga > > > > > > > > See also > :help :s > :help line() > :help column() > :help sub-replace-special > etc. Probably some of the building blocks of the tools I'm looking for. > > > Best regards, > Tony. Thanks, much appreciated, cga