3 ms·
tags and cscope look excellent. However, for the grepping and general file searching stuff, wouldn't that be better done from the shell? I generally have both
by losvedir 15y ago
tags and cscope look excellent.
However, for the grepping and general file searching stuff, wouldn't that be better done from the shell? I generally have both vim (either MacVim, or shell-vim) running, as well as a the command line sitting in a window right next to it.
What's the advantage of doing the searching inside vs. outside vim?
- gilgad13 15y agoIf you search from inside vim, it will load the results into the quickfix list. This means that it jumps you to the first result, and `:cn` and `:cp` will take you to the next and previous results, respectively. This is much easier than searching in a terminal, noting the first filename (which may be buried in some directory), opening it in vim, then jumping/scrolling down to the relevant line.
- iron_ball 15y agoSaves a few steps jumping from hit to hit, and if you set up next-result and previous-result mappings, it's even faster. This is assuming your workflow is "find, then open one or more of the results in vim."
- swah 15y agoIts faster, because with one key you're searching for the word under the cursor, and you're already on the editor, where the probable next action (editing) on the results is going to be run. Although I would slightly change it to search upwards until finding a .git directory, and from there the recursive grep :)
- ori_b 15y agoVim shells out for that, but it understands the format of results returned by the programs, which makes it easy to jump around in them.