Advertisement
Guest User

Untitled

a guest
Jan 28th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.75 KB | None | 0 0
  1.  let workspace = $WORKSPACE
  2.  let arxml_index = workspace . "/.arxml_index"
  3.  
  4.  function! ArxmlCreateIndex()
  5.      execute "!grep -Haron \"<SHORT-NAME>[^<]*</SHORT-NAME>\" --include=\"*.arxml\" ".g:workspace." > ".g:arxml_index
  6.  endfunction
  7.  
  8.  function! ArxmlFind(symbol)
  9.      cgetexpr system('grep ">' . a:symbol . '<" ' . g:arxml_index)
  10.      botright copen
  11.  endfunction
  12.  
  13.  function! ArxmlGFind(symbol)
  14.      let l:mybufname=bufname('%')
  15.      call ArxmlFind(a:symbol)
  16.      exec bufwinnr(l:mybufname) . 'wincmd w'
  17.  endfunction
  18.  
  19.  command! ArxmlCreateIndex call CreateIndex()
  20.  command! -nargs=1 ArxmlFind call ArxmlFind(<f-args>)
  21.  command! -nargs=1 ArxmlGFind call ArxmlGFind(<f-args>)
  22.  
  23.  nmap ,Af yiw:ArxmlFind ^R0<cr>
  24.  nmap ,Agf yiw:ArxmlGFind ^R0<cr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement