See tip 804 for the correct way to do upward tag searches. There are several "local vimrc" plugins available which are probably a better solution for a directory-specific .vimrc file:
* localvimrc which sources all (or configurable number of) .lvimrc files (configurable name) from the buffer's directory up to the root.
* local_vimrc which sources all _vimrc_local.vim files from $HOME to current buffer's directory
* local configuration which sources a .lvimrc file in the buffer's directory. Documentation is not clear whether/how far an upward search is performed.
* perdirvimrc which sources files of several different names, starting at the root directory (or home directory, this is not made clear) and progressing to the current working directory (or the buffer's directory, thi
Attributes | Values |
---|
rdfs:label
| - Source vimrc and use tags in a parent directory
|
rdfs:comment
| - See tip 804 for the correct way to do upward tag searches. There are several "local vimrc" plugins available which are probably a better solution for a directory-specific .vimrc file:
* localvimrc which sources all (or configurable number of) .lvimrc files (configurable name) from the buffer's directory up to the root.
* local_vimrc which sources all _vimrc_local.vim files from $HOME to current buffer's directory
* local configuration which sources a .lvimrc file in the buffer's directory. Documentation is not clear whether/how far an upward search is performed.
* perdirvimrc which sources files of several different names, starting at the root directory (or home directory, this is not made clear) and progressing to the current working directory (or the buffer's directory, thi
|
Version
| |
dbkwik:vim/property/wikiPageUsesTemplate
| |
Previous
| |
Text
| - local configuration
- local_vimrc
- localrc
- localvimrc
- perdirvimrc
|
Author
| |
Complexity
| |
Created
| |
ID
| - 441(xsd:integer)
- 571(xsd:integer)
- 727(xsd:integer)
- 1408(xsd:integer)
- 2792(xsd:integer)
- 3393(xsd:integer)
|
NEXT
| |
Rating
| |
abstract
| - See tip 804 for the correct way to do upward tag searches. There are several "local vimrc" plugins available which are probably a better solution for a directory-specific .vimrc file:
* localvimrc which sources all (or configurable number of) .lvimrc files (configurable name) from the buffer's directory up to the root.
* local_vimrc which sources all _vimrc_local.vim files from $HOME to current buffer's directory
* local configuration which sources a .lvimrc file in the buffer's directory. Documentation is not clear whether/how far an upward search is performed.
* perdirvimrc which sources files of several different names, starting at the root directory (or home directory, this is not made clear) and progressing to the current working directory (or the buffer's directory, this is not made clear either).
* localrc which sources files of a configurable name in the directory of any file you are editing, optionally only for files of a configurable file extension. Some recursive searching is done but the documentation does not specify exactly how this works. That said, here is a very simple solution: " Source .../.vimrc and use .../tags in ancestor of source directory. " useful when you have source tree eight fathom deep, " an exercise in Vim loops. let parent=1 let local_vimrc = ".vimrc" let local_tags = "tags" while parent <= 8 if filewritable(local_vimrc) echomsg "sourcing " . local_vimrc exe ":so " . local_vimrc endif let local_vimrc = "../". local_vimrc let local_tags = "../". local_tags exe ":set tags+=".local_tags let parent = parent+1 " TODO: stop at the root on any system and also ~ on Unix. endwhile unlet parent local_vimrc
|