vimgrep on files in 'path'
Hi there, I wonder if there is any "grep" like counterpart for the ":find" command in vim. Today, ":find" helps one find any file in the 'path'. It would be nice to perform a search for a pattern in the files reachable via 'path'. I could then invoke, say, :findgrep /mypattern/ **/*def.h ..to grep for "mypattern" in files reachable via 'path' that ends in "def.h". I tried to script it by passing the filenames to ":vimgrep" using: :exe 'vim/mypattern/'. join(getcompletion('**/*def.h', 'file_in_path'), " ") ..but getcompletion() sometimes does not give me the full path leading to errors. Regards, -Arun -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJUkyiFTzLR%3D-OWnBF-MXaB%2B451H8%3DJJ6ojsLJVmgACZMOg6jw%40mail.gmail.com.
Re: vimgrep on files in 'path'
Hi! You could use the arglist for this. I'm not sure how to set it from a path but I think you'll find a way to do it. Once your arglist is set, use `vimgrep /pattern/ ##` to grep the files in the arglist. Regards, Tris' Original Message On Dec 18, 2023, 20:27, Arun wrote: > Hi there, > > I wonder if there is any "grep" like counterpart for the ":find" command in > vim. Today, ":find" helps one find any file in the 'path'. It would be nice > to perform a search for a pattern in the files reachable via 'path'. I could > then invoke, say, > :findgrep /mypattern/ **/*def.h > > ..to grep for "mypattern" in files reachable via 'path' that ends in "def.h". > > I tried to script it by passing the filenames to ":vimgrep" using: > :exe 'vim/mypattern/'. join(getcompletion('**/*def.h', 'file_in_path'), " ") > > ..but getcompletion() sometimes does not give me the full path leading to > errors. > > Regards, > -Arun > > -- > -- > 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 > > --- > You received this message because you are subscribed to the Google Groups > "vim_use" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to vim_use+unsubscr...@googlegroups.com. > To view this discussion on the web visit > [https://groups.google.com/d/msgid/vim_use/CAJUkyiFTzLR%3D-OWnBF-MXaB%2B451H8%3DJJ6ojsLJVmgACZMOg6jw%40mail.gmail.com](https://groups.google.com/d/msgid/vim_use/CAJUkyiFTzLR%3D-OWnBF-MXaB%2B451H8%3DJJ6ojsLJVmgACZMOg6jw%40mail.gmail.com?utm_medium=email&utm_source=footer). -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/uxKxGqpo5E17_GBkoqirhH1l6D1CN_ogXgcylK2e69v4uB3M4WV2PA3gElXZDwoQXerzPCqmjX8WU26N2gzAOh2cs4_XufOn35VW9UDtKdQ%3D%40protonmail.com.
Re: vim9 exported functions not recognized by ctags
On 2023-12-16, Nicolas wrote: > this is mine .ctags.d > > --kinddef-vim=e,export,function,"Vim 9 exported functions" > --kinddef-vim=f,function,"Vim 9 non-exported functions" > --kinddef-vim=g,global,"Vim 9 global variables" > --kinddef-vim=K,const,Vim 9 constants > --regex-vim=/^\s*export\s+def\s+([^(:]+)/\1/e,export,def/ > --regex-vim=/^\s*def\s+([^(]+)/\1/f,function,def/ > --regex-vim=/^\s*(g:\w+)\b/\1/g,global/ > --regex-vim=/^(\s*export\s+)?const\s+(\w+)/\2/K,const/ > --regex-vim=/^(\s*export\s+)?final\s+(\w+)/\2/K,const/ > > with g:tagbar_type_vim = {'ctagstype': 'vim', 'kinds': ['e:export', > 'g:global', 'K:const', 'f:function']} > > Hope this helps. > nicolas That should work, shouldn't it? Or what is your issue with it? My current vim.ctags looks like this: --kinddef-vim=g,vim9global,Vim 9 global variables --kinddef-vim=K,vim9const,Vim 9 constants --kinddef-vim=L,vim9class,Vim 9 class --kinddef-vim=I,vim9interface,Vim 9 interface --regex-vim=/^export\s+def\s+([^(]+)/\1/f/ --regex-vim=/^\s*(g:\w+)\b/\1/g,vim9global/ --regex-vim=/^(export\s+)?(const|final)\s+(\w+)/\3/K,vim9const/ --regex-vim=/^\s*(export\s+)?(abstract\s+)?class\s+(\w+)/\3/L,vim9class/ --regex-vim=/^\s*(export\s+)?interface\s+(\w+)/\2/I,vim9interface/ That works with Universal Ctags 6.0.0, as confirmed by: uctags --list-kinds=Vim which outputs: a autocommand groups c user-defined commands f function definitions m maps v variable definitions n vimball filename C constant definitions g Vim 9 global variables K Vim 9 constants L Vim 9 class I Vim 9 interface In my `vimrc` I set the path to the executable: g:tagbar_ctags_bin = '/opt/local/bin/uctags' and for Vim tags: g:tagbar_type_vim = { 'kinds': [ 'L:classes', 'f:functions and methods', 'v:variables:1:0', 'g:global variables', 'K:constants', 'c:commands:0:0', 'a:autocommand groups:1', 'm:maps:1:0', ], } Life. -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ulqjdr%2416cs%241%40ciao.gmane.io.