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 ignore Lf_WildIgnore

See original GitHub issue
  • vim or neovim?
    • vim
    • neovim
  • Output of vim --version or nvim --version:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 24 2018 08:30:22)
macOS version
Included patches: 1-1633
Compiled by travis@Traviss-Mac-913.local
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_netterm     +tag_binary
+arabic            +file_in_path      +mouse_sgr         +tag_old_static
+autocmd           +find_in_path      -mouse_sysmouse    -tag_any_white
-autoservername    +float             +mouse_urxvt       -tcl
+balloon_eval      +folding           +mouse_xterm       +termguicolors
+balloon_eval_term -footer            +multi_byte        +terminal
+browse            +fork()            +multi_lang        +terminfo
++builtin_terms    +fullscreen        -mzscheme          +termresponse
+byte_offset       -gettext           +netbeans_intg     +textobjects
+channel           -hangul_input      +num64             +timers
+cindent           +iconv             +odbeditor         +title
+clientserver      +insert_expand     +packages          +toolbar
+clipboard         +job               +path_extra        +transparency
+cmdline_compl     +jumplist          +perl/dyn          +user_commands
+cmdline_hist      +keymap            +persistent_undo   +vertsplit
+cmdline_info      +lambda            +postscript        +virtualedit
+comments          +langmap           +printer           +visual
+conceal           +libcall           +profile           +visualextra
+cryptv            +linebreak         +python/dyn        +viminfo
+cscope            +lispindent        +python3/dyn       +vreplace
+cursorbind        +listcmds          +quickfix          +wildignore
+cursorshape       +localmap          +reltime           +wildmenu
+dialog_con_gui    +lua/dyn           +rightleft         +windows
+diff              +menu              +ruby/dyn          +writebackup
+digraphs          +mksession         +scrollbind        -X11
+dnd               +modify_fname      +signs             -xfontset
-ebcdic            +mouse             +smartindent       +xim
+emacs_tags        +mouseshape        +startuptime       -xpm
+eval              +mouse_dec         +statusline        -xsmp
+ex_extra          -mouse_gpm         -sun_workshop      -xterm_clipboard
+extra_search      -mouse_jsbterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework AppKit   -fstack-protector  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE
  • 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):
  • Output of :py3 print(sys.version):
  • Output of :echo g:Lf_Debug_Cmd:
  • Operating system:
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Configurations related to LeaderF in vimrc:
Plug 'Yggdroot/LeaderF', { 'do': './install.sh' }
let g:Lf_WildIgnore = {
        \ 'dir': ['.svn','.git','.hg', '.mypy_cache'],
        \ 'file': ['*.sw?','~$*','*.bak','*.exe','*.o','*.so','*.py[co]']
        \}
let g:Lf_WorkingDirectoryMode='a'
let g:Lf_RootMarkers = ['.git', '.hg', '.svn']
let g:Lf_UseCache = 0
let g:Lf_UseMemoryCache = 0

Describe your question, feature request, or bug.

我希望在找文件的时候忽略.mypy_cache中的文件,但是发现设置这个并不起效果,所以我就深入调试了一下,发现在fileExpl.py文件中getContent函数下,

            if cmd:
                executor = AsyncExecutor()
                self._executor.append(executor)
                if cmd.split(None, 1)[0] == "dir":
                    content = executor.execute(cmd)
                else:
                    content = executor.execute(cmd, encoding=lfEval("&encoding"))
                self._cmd_start_time = time.time()
                return content
            else:
                self._content = self._getFileList(dir)

这一步我发现cmd是:

git ls-files && git ls-files --others --exclude-standard

因此它没有运行self._getFileList函数,所以没有用到Lf_WildIgnore。 而git ls-files && git ls-files --others --exclude-standard的返回结果仅仅忽略了.git等文件。

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sillybuncommented, Jul 4, 2018

之所以有.mypy_cache是因为我vim,ale插件使用了.mypy_cache,所以从网上下载来的代码里的.gitignore里面是没有的,我觉得一个个改太麻烦,现在的解决方式是:

let g:Lf_UseVersionControlTool = 0

当然如果能加入两者都筛选的方式就更好了,我觉得最好还是能够尊重一下WildIgnore定义的忽略项。

0reactions
Yggdrootcommented, Jul 4, 2018

不客气。

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vim documentation: todo - Polarhome
Issue 64: when 'incsearch' is on can't paste LF on command line. On MS-Windows a temp dir with a & init causes system()...
Read more >
LustyExplorer - Dynamic filesystem and buffer explorer - Vim
package script version date Vim version user lusty‑explorer‑5.0.zip 5.0 2018‑07‑25 7.0 Stephen Bach lusty‑explorer.vim 4.3 2012‑02‑25 7.0 Stephen Bach lusty‑explorer.vim 4.2 2011‑11‑25 7.0 Stephen Bach
Read more >
Vim documentation: pi_netrw - SourceForge
*g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank lines that o/s's ftp "provides" on transfers =0 force normal ftp behavior (no...
Read more >
version8.txt - Vim
(Gary Johnson) Solution: Ignore the error when locating the word. ... Patch 7.4.871 Problem: Vim leaks memory, when 'wildignore' filters out all matches....
Read more >
vim book
+viminfo +wildmenu +wildignore +writebackup +X11 –xfontset –xim ... causes it to ignore this protection and to destroy any existing file.
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