Saxt
Saxt

Reputation: 27

ctrlp only searching lines in ag.1.md file?

:CtrlPBuffer<CR><c-d> and :CtrlPMRU<CR><c-d> work normally, but when I use :CtrlP<CR><c-d>, the listing is always empty, and if I type -- inside the prompt, it matches these lines:

>      --ackmate            Print results in AckMate-parseable format
>      --ignore PATTERN     Ignore files/directories matching PATTERN
>      --one-device         Don't follow links to other devices.
>      --[no]group          Same as --[no]break --[no]heading
>      --column             Print column numbers in results
>      --search-binary      Search binary files for matches
>      --stats-only         Print stats and nothing else.
> ag: unrecognized option `--hiden'
>   ag --list-file-types
>   ag --html needle

which appear to be in the_silver_searcher/doc/ag.1.md. I found the --hiden typo in let g:ctrlp_user_command = 'ag %s -l --nocolor --hiden -g ""' and fixed it, so now :echo g:ctrlp_user_command prints ag %s -l --nocolor --hidden -g "", but it still gives the same results for :CtrlPBuffer<CR><c-d>

in my .vimrc:

    Plugin 'ctrlpvim/ctrlp.vim', {'on': ['CtrlP', 'CtrlPMixed', 'CtrlPMRU']}
    Plugin 'FelikZ/ctrlp-py-matcher'
    ...
    let g:ctrlp_mruf_max = 20
    nnoremap <silent> <Space>f :CtrlP<CR><c-d>
    nnoremap <silent> <Space>F :CtrlP<CR>
    nnoremap <silent> <Space>b :CtrlPBuffer<CR><c-d>
    nnoremap <silent> <Space>r :CtrlPMRU<CR><c-d>
    let g:ctrlp_working_path_mode = 'c'
    ...
    let g:ctrlp_prompt_mappings = {
      \ 'CreateNewFile()':      ['<c-n>'],
      \ }

    let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
    let g:ctrlp_lazy_update = 350
    let g:ctrlp_clear_cache_on_exit = 0
    let g:ctrlp_max_files = 0
    " If ag is available use it as filename list generator instead of 'find'
    if executable("ag")
        set grepprg=ag\ --nogroup\ --nocolor
        let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
    endif

in my .bash_profile:

    alias ag='ag --path-to-ignore ~/.ignore'

my global .ignore:

pyc
__pycache__/
git
tmp
swp
swo

my .gitignore_global:

*~
.DS_Store
.pyc
__pycache__/

my .hgignore_global:

syntax: glob

*~
.DS_Store

how do I fix this? is something wrong with my ignore files?

Upvotes: 0

Views: 98

Answers (1)

Saxt
Saxt

Reputation: 27

sourcing the .vimrc file was not enough; I had to run CtrlPClearCach or CtrlPClearAllCaches, and alias ag='ag -U --skip-vcs-ignores --path-to-ignore ~/.ignore' in my .bash_prifile will use only the .ignore file.

Upvotes: 0

Related Questions