When using ctags
with Vim, it's possible to open a file as:
:tag <filename>
This is possible if the tags
file was generated using the --extras=+qf
flag, like in this code snippet:
$ find . -name "*.c" | xargs ctags-universal --extras=+qf -L -
This produces a line in the tags file such as this:
JPEGImageDecoder.cpp Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp 1;" F
This entry contains 4 elements: {tag name, path to file, line number, tag type}. Whenever Vim opens the tag, it goes to line number 1, despite I have configured Vim to remember the last edited position of a file and go back to it when the buffer is read.
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
endif
Is there any way of opening a file with :tag <filename>
and set the cursor to the last edited position?