2009/9/28 Ralf Schmitt <[email protected]>:
>
>
> Hi list,
>
> my question is like this. I work on different software projects each
> in a different language and a different code style.
> Project a) uses indentation with real tabs and project b) uses indentation
> with 4 spaces each step.
>
> I know all those settings for vim to control that but now I want something
> more dynamic. Some feature where vim is able to detect which indentation
> style to use without changing any project source files.

The suggestions I would have are:

a) Use the project plugin: this has an in= configuration option that
sources a script when loading a file with the plugin.  You can use
this to set the various options you require.

b) Use the DetectIndent plugin: I've not used this much, but it adds a
command (that could be used with autocmd BufEnter or similar) that
detects the current file indent and sets up vim accordingly.

c) Create a new autocmd to detect it your own way.  For example, I
used to have a configuration that detected whether my company name was
in the first 10 lines of a file and would change the tabbing options
accordingly (and also add a note to the status bar to show that it had
happened).

References:

Project plugin: http://www.vim.org/scripts/script.php?script_id=69
DetectIndent: http://www.vim.org/scripts/script.php?script_id=1171

Hope that helps,

Al

-- 
http://sites.google.com/site/abudden

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to