Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't do recursive searching in project? #290

Closed
NullVoxPopuli opened this issue Apr 9, 2020 · 9 comments
Closed

Doesn't do recursive searching in project? #290

NullVoxPopuli opened this issue Apr 9, 2020 · 9 comments

Comments

@NullVoxPopuli
Copy link

Before submitting your issue(请在提交 issue 前一定要检查以下项目!)

  1. Update to the latest version of CtrlSF.
  2. Update your backend(ag/ack/pt/rg) to their latest version.
  3. Enable debug mode to try to find what is going wrong yourself. You can enable debug mode by let g:ctrlsf_debug_mode = 1.

If you can't find out why things do not work or can be sure it's a bug of CtrlSF, please fulfill below issue template. Thanks in advance!

Issue template

Issue description

You can describe your issue here.(请将你的 issue 内容填写于此)

It seems the search with this minimal config does not search over files in directories.

# cwd is my dotfiles repo
$ nvim -u home/.config/nvim/-tests/ctrlsf.vim
call plug#begin('~/.local/share/nvim/plugged')

  Plug 'dyng/ctrlsf.vim'
  let g:ctrlsf_default_root = 'cwd'
  let g:ctrlsf_auto_focus = {
      \ 'at': 'start',
      \ }

call plug#end()

nmap <C-f> <Plug>CtrlSFPrompt
vmap <C-f> <Plug>CtrlSFVwordExec

Things about your system and environment(请在此填写你的系统信息)

field value
os Ubuntu 19.10
vim NVIM v0.5.0-426-g30a6e374d
backend ag version 2.2.0
locale en_US.UTF-8
  • log:

    " attach debug-mode log here
    " you can pipe logs into a file by vim's :redir command
    :let g:ctrlsf_debug_mode = 1
    :redir >/tmp/ctrlsf.log
    :CtrlSF something...
    :redir END


StopJob
StopTimer: id=-1
Tokens: ['nmap']
ParsedResult: {'pattern': 'nmap'}
Options: {'pattern': 'nmap', '_vimregex': '\V\cnmap', '_vimhlregex': {'normal': '\V\c\(\^\d\+:\.\*\)\@<=nmap', 'compact': '\V\c\(|\d\+ col \d\+|\.\*\)\@<=nmap'}}
Tokens: ['-C', '3']
ParsedResult: {'context': 3}
ExecCommand: rg -C 3  --smart-case --fixed-strings --follow --no-heading --color never --line-number -H -- 'nmap' '/home/lprestonsegoiii/Development/NullVoxPopuli/dotfiles'
TimerStarted: id=1
Searching...
HighlightRegex: \V\c\(\^\d\+:\.\*\)\@<=nmap
ConsumeResult: size=0
ChannelClose
ConsumeResult: size=0
StopTimer: id=1
Done!
ParseFinish

I tried ag nmap in my terminal, and had similar results.

So, this is a problem with my silver searcher config, but I'm posting here for searchability.
Will post solution when I find it.

@NullVoxPopuli
Copy link
Author

oh, it executed rip grep, interesting. (just read the log)

@NullVoxPopuli
Copy link
Author

well, ripgrep appears to behave the same as ag -- no results. :-\

@NullVoxPopuli
Copy link
Author

I wonder if it's annoying my folders that start with a .

@NullVoxPopuli
Copy link
Author

the stuff I'm searching for is in a directory called .config

@NullVoxPopuli
Copy link
Author

yup, that's it. if I cd into .config, I can find what I'm looking for (nmap). So... there must be a setting to change what stuff is ignored?

@NullVoxPopuli
Copy link
Author

Maybe related to #188

@NullVoxPopuli
Copy link
Author

oh! looks like this is it:

$ rg 'nmap'
# nothing
$ rg 'nmap' --hidden
.config/nvim/keymap.vim
26:nmap <leader>, :q<CR>
27:nmap <leader>. :qa<CR>
43:nmap <C-f> <Plug>CtrlSFPrompt
47:nmap <C-t> :Files<CR>
# ...

so that means, I need to set g:ctrlsf_extra_backend_args

@NullVoxPopuli
Copy link
Author

solution:

  let g:ctrlsf_extra_backend_args = {
      \ 'rg': '--hidden',
      \ }

yay

@dyng
Copy link
Owner

dyng commented Apr 9, 2020

Happy to hear that you figured it out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants