jcallers.vim : grep calls to function under the cursor
| script karma
Downloaded by 245
Comments, bugs, improvements
script versions (upload new version)
|Grep every calls to the function under the cursor with your grepprg.
1 - Starts with a :normal mA .. AS A GLOBAL MARK [A] .. you can jump back to as a return point.
2 - The resulting list will be inserted as a multi-line comment in the current buffer .. you can undo at will:
src/file.js:485 caller_f:493: callee_f(args);
src/file.java:485 caller_f:493: callee_f(args);
3 - Let you navigate the grep quickfix resulting list.
- Currently tuned up to catch .js and .java calling function def lines into the list third field.
- And you will figure out how to get more by adjusting the F_callers:fdef pattern.
- USES [A global mark] as a call return point
...(there are 2 calls to [A mark] you can adjust to use another mark :normal mA and :normal 'A
- USES [b register] to store the resulting multi-line-comment
...(so as you can undo the insertion .. but keep the results handy)
...(there are 3 setreg(b) calls you can adjust to use another register
- USES [q register] to store the generated :grep call
...(so you can use @q to edit and call it yourself later)
...( :nnoremap Q @q .. may help )
|- put the file where you put your other scripts (it has no dependency)
- then map something to source it.
:nnoremap <esc><c-s-down> :so ~/VIM/scripts/jcallers.vim<cr><cr>
Click on the package to download.
ip used for rating: 22.214.171.124
||Previous version sends untouched vim [*] search pattern to egrep... BUT:
...regex escaping may be required .. depending on egrep flavors.
Please report about what you had to do at lines 65-66 to make it work for you...
||previous version issue corrected .. first quickfix list entry was missed
||Added protected access modifier to catch java caller's def-line
||- Some comments added near script lines that could be worth tuning
...(so you can adjust to your liking)
- Commented-out [word boundaries removal] from the searched function pattern
..(so as to look for the EXACT word-under-the-cursor)