Re: Hard tabsize vs. soft tabsize problem
Cream is a free, easy-to-use configuration of the Vim text editor
Brought to you by:
digitect
From: BG - B. A. <BAr...@dy...> - 2004-10-28 16:39:22
|
On Thu, 2004-10-28 at 00:17 +0200, Thomas de Grenier de Latour wrote: > - add your custom settings in your ~/.cream/cream-user.vim file: > set tabstop=8 > set shiftwidth=3 > set softtabstop=3 Shiftwidth and softtabstop really belong in ftplugin, because they vary depending on which file type is being edited. I'll have to play with this a bit more, and try shiftwidth=3 in conjunction with smarttab too, to see which I prefer. The latter solution still allows insertion of 8- character tabs in the middle of the line, which may be more like what people are used to. > - comment this line in cream/cream-autocmd.vim: > "autocmd BufEnter,BufNewFile * call Cream_tabstop_init() Ah, I see. If I switch to the help window and back again it messes it up. OK. I'll make this change too. Anyway, yes, softtabstop almost does what I want. In fact, I didn't tell you the whole story. Different filetypes have different tab sizes. One problem case is our custom filetype "task" for tasks in our project management system. The format is something like this: date headerline - /switches - Header 1: - point 1 - subpoint 1 2nd line of subpoint 1 ... ... ... ... ** changelog marker 1 - changelog entry 1 ... ** changelog directive I have written a syntax file to highlight this, and want to also create an ftplugin file for it setting the shiftwidth and softtabstop appropriately. Unfortunately, setting softtabstop=2 doesn't quite work because the initial tabstop is actually only 1 column wide. Then all subsequent tabstops are 2 columns. I have combed the vim docs and can't see how to accomplish this. Ideas? Ben |