2009/6/15 Efraim Yawitz <[email protected]>: > > Sometimes I have different projects open in different tabs, and I want > each project to have its own setting for 'tags', i.e. one should > include the tags file from the linux kernel source, etc. I found the > following from a post in 2007: > >>To edit files from different projects in split-windows in a single Vim, then >>(if the default option of searching from the current file's dir doesn't suit >>you), remember that this option is |global-local| : you can use ":setlocal" to >>set a different value for one buffer. > > The problem is that 'tags' is only local to the buffer, so that as > soon as I go to one tag, I can't go to another one in that window. > > Anyone have any advice (obviously I could just open another Vim, but > is there anything less drastic than that?)
I can't suggest a perfect solution to you, but: Option A: What I use is the project.vim plugin (http://www.vim.org/scripts/script.php?script_id=69). If you use the in= option for a project, it will run a set of commands in a provided .vim file on BufEnter events. For each project, I have a project_config.vim file that contains things like: setlocal tags=... let b:MyBufferSpecificVariable = SomeValue However, this is only set if the file is opened using the project window. You can work around this by using the \l or \L mappings to load all of the files in the project (assuming there aren't too many), which will install the BufEnter command. Option B: Create a file called something like project_config.vim containing the line: setlocal tags=... Put it in the same directory as your source file and add the following lines to one of your sourced files (vimrc/ftplugin or something); function LoadProjectConfig() if filereadable(expand('%:h') . '/project_config.vim')) exe 'source %:h/project_config.vim' endif endfunction au BufEnter * call LoadProjectConfig() I haven't tested this code at all, so it may not work at all! Hope that helps, Al --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
