Hi all,

I have been using so far with success this plugin [1], which allowed me to
jump from logs files directly to the source code file and specific line
where a given log message was generated.
However, it worked because the source files where placed in the same
directory where the log files were.
That is not the case anymore.
The source files I want to jump to are distributed between 3 directories,
none of them being the actual directory where the log file is -and therefore
where I am invoking the plugin-.
I need to modify the plugin in order to make it to search for file_name in
any of those 3 directories.

Is there a way to achieve that?
A link with info about that, or the right :help command, should be enough...


Thanks a lot in advance.
Jose



[1]
function! GotoFileWithLineNum()
    " filename under the cursor
    let file_name = expand('<cfile>')
    if !strlen(file_name)
        echo 'NO FILE UNDER CURSOR'
        return
    endif

    " look for a line number separated by a :
    if search('\%#\f*:\zs[0-9]\+')
        " change the 'iskeyword' option temporarily to pick up just numbers
        let temp = &iskeyword
        set iskeyword=48-57
        let line_number = expand('<cword>')
        exe 'set iskeyword=' . temp
    endif

        "set path=/tmp/kk/goto/dir

    " edit the file
    exe 'e '.file_name

    " if there is a line number, go to it
    if exists('line_number')
        exe line_number
    endif
endfunction

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to