question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Leaderf rg does not search in working directory?

See original GitHub issue
  • vim or neovim?
    • vim
    • neovim
  • Output of vim --version or nvim --version:
NVIM v0.3.4
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe /DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG -DMIN_LOG_LEVEL=3 /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -IC:/projects/neovim/build/config -IC:/projects/neovim/src -IC:/projects/neovim/.deps/usr/include -IC:/projects/neovim/build/src/nvim/auto -IC:/projects/neovim/build/include
Compiled by appveyor@APPVYR-WIN

Features: -acl +iconv -jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files/nvim/share/nvim"
  • Output of :echo has("python"): 0
  • Output of :echo has("python3"): 1
  • Output of :echo &pythondll(only vim, not neovim):
  • Output of :echo &pythonthreedll(only vim, not neovim):
  • Output of :py print(sys.version): E319 No “python” provider found.
  • Output of :py3 print(sys.version): 3.7.2
  • Output of :echo g:Lf_Debug_Cmd:
  • Operating system:
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Configurations related to LeaderF in vimrc:
let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git']
let g:Lf_WorkingDirectoryMode = 'Ac'
let g:Lf_WindowHeight = 0.36
"nnoremap <A-p> :LeaderfFunction!<CR>
nnoremap <C-p> :Leaderf file<CR>
" search word under cursor, the pattern is treated as regex, and enter normal mode directly
noremap <C-F> :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cword>"))<CR>
" search word under cursor, the pattern is treated as regex,
" append the result to previous search results.
noremap <C-G> :<C-U><C-R>=printf("Leaderf! rg --append -e %s ", expand("<cword>"))<CR>
" search visually selected text literally, don't quit LeaderF after accepting an entry
xnoremap gf :<C-U><C-R>=printf("Leaderf! rg -F --stayOpen -e %s ", leaderf#Rg#visual())<CR>
" recall last search. If the result window is closed, reopen it.
noremap go :<C-U>Leaderf! rg --stayOpen --recall<CR>

Describe your question, feature request, or bug.

I found that Leaderf! rg search string under directory same with :pwd, but Leaderf file search files under working directory which indicated by g:Lf_RootMarkers. Why they have different behaves? I already set this in my init.vim:

let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git']
let g:Lf_WorkingDirectoryMode = 'Ac'

Can I get the root working directory and set it to rg path?

Steps to reproduce

directory structure:

my-project (root working directory)
  - .git
  - sub-folder
    - test.c

open test.c using neovim, use Leaderf rg -e to search something.

Actual behaviour

searching under my-project path.

Expected behaviour

searching under sub-folder path.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Yggdrootcommented, Feb 26, 2019

Now you can use Leaderf rg like this:

Leaderf rg --wd-mode=ac -e xxx

--wd-mode <MODE>      Specify the working directory mode, value has the same
                        meaning as g:Lf_WorkingDirectoryMode.
0reactions
xaljercommented, Mar 2, 2019

Thanks 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

LeaderF: https://github.com/Yggdroot/LeaderF backup - Gitee
LeaderF. This plugin is mainly used for locating files, buffers, mrus, ctags, gtags, etc. in large project. Written in Python.
Read more >
File search & search in files : r/neovim - Reddit
Searching in files is something I can't really make work as I want it to. ... You can use :Leaderf rg which uses...
Read more >
systemd.exec - Freedesktop.org
Sets the working directory for executed processes. If set to " ~ ", the home directory of the user specified in User= is...
Read more >
Online LDS Tools Directory – Church of Jesus Christ
These tools have been provided to help members, leaders, staff, and administration to organize and assist in their responsibilities.
Read more >
Find Your Representative | house.gov
Not sure of your congressional district or who your member is? ... FIND YOUR REP BY ZIP ... Why doesn't my newly-elected Representative...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found