Giter Site home page Giter Site logo

yggdroot / leaderf Goto Github PK

View Code? Open in Web Editor NEW
2.1K 2.1K 173.0 2.39 MB

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.

License: Apache License 2.0

Python 67.73% C 11.23% Batchfile 0.07% Shell 0.10% Vim Script 20.88%
ctags fuzzy fuzzy-matching fuzzy-search fuzzyfinder gtags mru ripgrep vim

leaderf's Introduction

LeaderF

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly.

  • Written in Python.
  • Support fuzzy and regex searching.
  • Full-featured.
  • Well-designed fuzzy matching algorithm.
  • Extensible.

Changelog

Please see the CHANGELOG for a release history.

Wiki

Wiki.

Extensions

A list of community extensions can be found in the Extensions wiki.

Screenshots

Popup Mode

And Mode

Requirements

  • vim7.3 or higher. Only support 7.4.1126+ after v1.01.
  • Python2.7+ or Python3.1+.
  • To use the popup mode, neovim 0.5.0+ or vim 8.1.1615+ are required.

Installation

For vim-plug user:

Plug 'Yggdroot/LeaderF', { 'do': ':LeaderfInstallCExtension' }

Performance

LeaderF is already very fast. If you'd like better performance, install the C extension of the fuzzy matching algorithm, which is more than 10 times faster.
To install the C extension, firstly, make sure python2 and/or python3 commands are available on Linux/Unix/MacOS and py -2 and/or py -3 commands are available on Windows.

  • Install the C extension

    :LeaderfInstallCExtension

    There may be some errors during the installation, please google the error messages to resolve it.
    For example, "error: Unable to find vcvarsall.bat", you can turn to here for help.

  • Uninstall the C extension

    :LeaderfUninstallCExtension

After running any command of LeaderF, check the value of echo g:Lf_fuzzyEngine_C, if the value is 1, it means the C extension is loaded sucessfully.

Usage

usage: Leaderf[!] [-h] [--reverse] [--stayOpen] [--input <INPUT> | --cword]
                  [--top | --bottom | --left | --right | --belowright | --aboveleft | --fullScreen | --popup]
                  [--nameOnly | --fullPath | --fuzzy | --regexMode] [--nowrap] [--next | --previous]
                  [--recall] [--popup-height <POPUP_HEIGHT>] [--popup-width <POPUP_WIDTH>] [--no-sort]
                  [--case-insensitive] [--auto-preview | --no-auto-preview]
                  
                  {file,tag,function,mru,searchHistory,cmdHistory,help,line,colorscheme,gtags,
                      self,bufTag,buffer,rg,filetype,command,window,quickfix,loclist,jumps}
                  ...

optional arguments:
  -h, --help            show this help message and exit
  --reverse             show results in bottom-up order
  --stayOpen            don't quit LeaderF after accepting an entry
  --input <INPUT>       specifies INPUT as the pattern inputted in advance
  --cword               current word under cursor is inputted in advance
  --top                 the LeaderF window is at the top of the screen
  --bottom              the LeaderF window is at the bottom of the screen
  --left                the LeaderF window is at the left of the screen
  --right               the LeaderF window is at the right of the screen
  --belowright          the LeaderF window is at the belowright of the screen
  --aboveleft           the LeaderF window is at the aboveleft of the screen
  --fullScreen          the LeaderF window takes up the full screen
  --popup               the LeaderF window is a popup window or floating window
  --nameOnly            LeaderF is in NameOnly mode by default
  --fullPath            LeaderF is in FullPath mode by default
  --fuzzy               LeaderF is in Fuzzy mode by default
  --regexMode           LeaderF is in Regex mode by default
  --nowrap              long lines in the LeaderF window won't wrap
  --next                Jump to the next result.
  --previous            Jump to the previous result.
  --recall              Recall last search. If the result window is closed, reopen it.
  --popup-height <POPUP_HEIGHT>
                        specifies the maximum height of popup window, only available in popup mode.
  --popup-width <POPUP_WIDTH>
                        specifies the width of popup window, only available in popup mode.
  --no-sort             do not sort the result.
  --case-insensitive    fuzzy search case insensitively.
  --auto-preview        open preview window automatically.
  --no-auto-preview     don't open preview window automatically.

subcommands:

  {file,tag,function,mru,searchHistory,cmdHistory,help,line,colorscheme,gtags,
      self,bufTag,buffer,rg,filetype,command,window,quickfix,loclist,jumps}
    file                search files
    tag                 navigate tags using the tags file
    function            navigate functions or methods in the buffer
    mru                 search most recently used files
    searchHistory       execute the search command in the history
    cmdHistory          execute the command in the history
    help                navigate the help tags
    line                search a line in the buffer
    colorscheme         switch between colorschemes
    gtags               navigate tags using the gtags
    self                execute the commands of itself
    bufTag              navigate tags in the buffer
    buffer              search buffers
    rg                  grep using rg
    filetype            navigate the filetype
    command             execute built-in/user-defined Ex commands.
    window              search windows.
    quickfix            navigate the quickfix.
    loclist             navigate the location list.

If [!] is given, enter normal mode directly.

use :Leaderf <subcommand> -h to get specific help of subcommand, e.g., :Leaderf rg -h.

Once LeaderF is launched:

Command Description
<C-C>
<ESC>
quit from LeaderF
<C-R> switch between fuzzy search mode and regex mode
<C-F> switch between full path search mode and name only search mode
<Tab> switch to normal mode
<C-V>
<S-Insert>
paste from clipboard
<C-U> clear the prompt
<C-W> delete the word before the cursor in the prompt
<C-J> move the cursor downward in the result window
<C-K> move the cursor upward in the result window
<Up>/<Down> recall last/next input pattern from history
<2-LeftMouse>
<CR>
open the file under cursor or selected(when multiple files are selected)
<C-X> open in horizontal split window
<C-]> open in vertical split window
<C-T> open in new tabpage
<C-\> show a prompt enable to choose split window method: vertical, horizontal, tabpage, etc
<F5> refresh the cache
<C-LeftMouse>
<C-S>
select multiple files
<S-LeftMouse> select consecutive multiple files
<C-A> select all files
<C-L> clear all selections
<BS> delete the preceding character in the prompt
<Del> delete the current character in the prompt
<Home> move the cursor to the begin of the prompt
<End> move the cursor to the end of the prompt
<Left> move the cursor one character to the left in the prompt
<Right> move the cursor one character to the right in the prompt
<C-P> preview the result
<C-Up> scroll up in the popup preview window
<C-Down> scroll down in the popup preview window

Input formats:

  • In NameOnly mode (fuzzy mode)

    If the first character you input is ';', then the searching will be the same as in FullPath mode.
    If you input string as 'abc;def', then 'abc' will match the file name and 'def' will match the directory name.

  • In FullPath mode (fuzzy mode)

    Same as in NameOnly mode except that the pattern will match the full path but not the file name only.

  • In Regexp mode

    The input string is the same as the Vim's regexp.

Smart Case:

  • If the characters in search pattern are all lowercase, the matching is case-insensitive. If the search pattern contains uppercase characters, all lowercase characters still are matched case-insensitively, the uppercase characters can only match upper case. So uppercase characters can speed up the narrowing down of the searching result.

    e.g., input abcDef,it can match the following strings:

    abcDef
    AbcDef
    abcDEf
    aBcDeF
    

    but can not match the strings such as:

    abcdef
    Abcdef
    

    Note: abc and ef are still case-insensitive.

And operator:

  • In fuzzy mode, using ' '(space) as the and operator, the candidate lines should fuzzily match all the substrings separated by space.

    e.g., input abc def gh,it can match the following strings:

    ...a.b.c...d.e.f...g.h...
    ...a.b.c...g.h...d.e.f...
    ...a.d..e.g.b.c...h..f...
    ...gh...def...abc...
    

Popup Mode

Popup Mode is to open LeaderF in a popup window(vim 8.1.1615+) or floating window(nvim 0.4.2+).

To enable popup mode:

let g:Lf_WindowPosition = 'popup'

or add --popup after each subcommand, e.g.,

Leaderf file --popup

Customization

  • Change key bindings

    By default, <Up> and <Down> are used to recall last/next input pattern from history. If you want to use them to navigate the result list just like <C-K> and <C-J> :

    let g:Lf_CommandMap = {'<C-K>': ['<Up>'], '<C-J>': ['<Down>']}

    for more detail, please refer to :h g:Lf_CommandMap.

  • Change the colors used in LeaderF

    let g:Lf_PopupPalette = {
        \  'light': {
        \      'Lf_hl_match': {
        \                'gui': 'NONE',
        \                'font': 'NONE',
        \                'guifg': 'NONE',
        \                'guibg': '#303136',
        \                'cterm': 'NONE',
        \                'ctermfg': 'NONE',
        \                'ctermbg': '236'
        \              },
        \      'Lf_hl_cursorline': {
        \                'gui': 'NONE',
        \                'font': 'NONE',
        \                'guifg': 'NONE',
        \                'guibg': '#303136',
        \                'cterm': 'NONE',
        \                'ctermfg': 'NONE',
        \                'ctermbg': '236'
        \              },
        \      },
        \  'dark': {
        \         ...
        \         ...
        \      }
        \  }

    All the highlight groups supported are defined in LeaderF/autoload/leaderf/colorscheme/popup/default.vim.

  • Change the default mapping of searching files command

    e.g. let g:Lf_ShortcutF = '<C-P>'

  • Show icons (should install fonts from https://github.com/ryanoasis/nerd-fonts)

    Support commands: buffer,file,mru,window

    " Show icons, icons are shown by default
    let g:Lf_ShowDevIcons = 1
    " For GUI vim, the icon font can be specify like this, for example
    let g:Lf_DevIconsFont = "DroidSansM Nerd Font Mono"
    " If needs
    set ambiwidth=double

Configuration examples

" don't show the help in normal mode
let g:Lf_HideHelp = 1
let g:Lf_UseCache = 0
let g:Lf_UseVersionControlTool = 0
let g:Lf_IgnoreCurrentBufferName = 1
" popup mode
let g:Lf_WindowPosition = 'popup'
let g:Lf_StlSeparator = { 'left': "\ue0b0", 'right': "\ue0b2", 'font': "DejaVu Sans Mono for Powerline" }
let g:Lf_PreviewResult = {'Function': 0, 'BufTag': 0 }

let g:Lf_ShortcutF = "<leader>ff"
noremap <leader>fb :<C-U><C-R>=printf("Leaderf buffer %s", "")<CR><CR>
noremap <leader>fm :<C-U><C-R>=printf("Leaderf mru %s", "")<CR><CR>
noremap <leader>ft :<C-U><C-R>=printf("Leaderf bufTag %s", "")<CR><CR>
noremap <leader>fl :<C-U><C-R>=printf("Leaderf line %s", "")<CR><CR>

noremap <C-B> :<C-U><C-R>=printf("Leaderf! rg --current-buffer -e %s ", expand("<cword>"))<CR>
noremap <C-F> :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cword>"))<CR>
" search visually selected text literally
xnoremap gf :<C-U><C-R>=printf("Leaderf! rg -F -e %s ", leaderf#Rg#visual())<CR>
noremap go :<C-U>Leaderf! rg --recall<CR>

" should use `Leaderf gtags --update` first
let g:Lf_GtagsAutoGenerate = 0
let g:Lf_Gtagslabel = 'native-pygments'
noremap <leader>fr :<C-U><C-R>=printf("Leaderf! gtags -r %s --auto-jump", expand("<cword>"))<CR><CR>
noremap <leader>fd :<C-U><C-R>=printf("Leaderf! gtags -d %s --auto-jump", expand("<cword>"))<CR><CR>
noremap <leader>fo :<C-U><C-R>=printf("Leaderf! gtags --recall %s", "")<CR><CR>
noremap <leader>fn :<C-U><C-R>=printf("Leaderf gtags --next %s", "")<CR><CR>
noremap <leader>fp :<C-U><C-R>=printf("Leaderf gtags --previous %s", "")<CR><CR>

FAQ

https://github.com/Yggdroot/LeaderF/issues?q=label%3AFAQ+

License

This plugin is released under the Apache License, Version 2.0 (the "License").

❤️ Sponsor

If you like this software, please consider buying me a coffee.
https://github.com/Yggdroot/SponsorMe/blob/main/README.md#donate (捐赠的朋友最好备注一下自己的ID)

leaderf's People

Contributors

bennyyip avatar caizimin avatar einfachtoll avatar eyalk5 avatar fcying avatar fhopecc avatar gou4shi1 avatar hanxi avatar hawkinchina avatar hezhizhen avatar kevinkjt2000 avatar leoatchina avatar linusboyle avatar mg979 avatar multikatt avatar qx220 avatar roachsinai avatar sjwsl avatar skywind3000 avatar tamago324 avatar tc500 avatar tcx4c70 avatar tsuyoshicho avatar voldikss avatar whonore avatar xiaoyaoliu avatar yggdroot avatar youran0715 avatar zlbruce avatar zoumi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaderf's Issues

a crash

the log is >

Error detected while processing function leaderf#startFileExpl..leaderf#LfPy:
line 5:
Traceback (most recent call last):
File "", line 1, in
File "/Users/6a209/.vim/bundle/LeaderF/autoload/leaderf/manager.py", line 416, in startExplorer
self._gotoBuffer()
File "/Users/6a209/.vim/bundle/LeaderF/autoload/leaderf/manager.py", line 108, in _gotoBuffer
nr = self._bufwinnr(self._bufName)
File "/Users/6a209/.vim/bundle/LeaderF/autoload/leaderf/manager.py", line 100, in _bufwinnr
if os.path.abspath(w.buffer.name) == os.path.abspath(name):
File "/usr/lib/python2.7/posixpath.py", line 352, in abspath
if not isabs(path):
File "/usr/lib/python2.7/posixpath.py", line 61, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
Error detected while processing function leaderf#startFileExpl:
line 2:
E171: Missing :endif

switching to fuzzy mode

In the documentation, pressing switches between Regex and Fuzzy mode.
https://github.com/Yggdroot/LeaderF/blob/master/doc/leaderf.txt#L469

On my end, it's switching between Fullpath (I guess it's still fuzzy) and regex mode.

I've tried adding this in my vimrc
let g:Lf_DefaultMode="Fuzzy"

to switch to Fuzzy mode, and I'm getting mixed results:

When searching this file, view-page-desktop.js for example, if I search "view " with a space, it returns zero results. Is that an intended behaviour?

Any option to make it more fuzzy? Or do I need to switch to regex?

LeaderfFile出現錯誤

執行:LeaderfFile會出現如下錯誤.

處理 /home/dhu/.vim/plugged/LeaderF/autoload/leaderf.vim 時發生錯誤:
行   13:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/dhu/.vim/plugged/LeaderF/autoload/leaderf/bufExpl.py", line 26
    buffers = {b.number: b for b in vim.buffers
                             ^
SyntaxError: invalid syntax
處理 function leaderf#startFileExpl..leaderf#LfPy 時發生錯誤:
行    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/dhu/.vim/plugged/LeaderF/autoload/leaderf/manager.py", line 549, in startExplorer
    self._getInstance().enterBuffer(win_pos)
  File "/home/dhu/.vim/plugged/LeaderF/autoload/leaderf/manager.py", line 141, in _getInstance
    self._afterExit)
  File "/home/dhu/.vim/plugged/LeaderF/autoload/leaderf/instance.py", line 36, in __init__
    self._initStlVar()
  File "/home/dhu/.vim/plugged/LeaderF/autoload/leaderf/instance.py", line 40, in _initStlVar
    lfCmd("let g:Lf_{}_StlCategory = '-'".format(self._category))
ValueError: zero length field name in format

best match is not the first option

When I'm searching a file in fullpath way, sometimes the best match is not the first option, like the image below. So I think may be the matching algorithm can optimize.

Thanks for your great plugin!

image

Stop complaining about python error

Hi, I enjoy LeaderF very much and it is one of my basic plugins. However, sometimes I need to run Vim in environments without python support, such as Git Bash on Windows. In this case, LeaderF keep complaining when I start Vim, which is really annoying:

Error detected while processing /c/Users/tanle/vimfiles/bundle/LeaderF/plugin/leaderf.vim:
line   24:
Error: LeaderF requires vim compiled with +python or +python3
Press ENTER or type command to continue

Any suggestions for this?
Thanks very much!

LeaderF don't work anymore (on Mac at least)

I just updated the plugin and now vim doesn't start and completely mess up the shell (I can't even use the mouse to select the output.

Here are the steps I've done to determine that LeaderF was the source of the problem. At that point, LeaderF is already at it latest revision, vim crash as soon as I run it:

  • With nano, I've commented out all the plugins
  • I started vim (it works this time, without any plugin), I uncommented LeaderF, closed vim
  • I started vim again: crash.

Here's the screenshot of the shell:
capture d ecran 2017-08-09 a 11 17 16

wildignore option

nice plugin, faster than ctrlp. But, there is an issue like ctrlp.
when I'm working in a large project, thousands of dir and subdirs may add into leaderf. For my expect, some assigned directorys can add, donot use Lf_WildIgnore option, how can I fix it, man?

"Most Recently Used" shows files from other projects

The most recently usage panel is already great, but still lacks a little behind CtrlP.

  • CtrlP shows the most recently used buffer in row 0. Meaning I can invoke it, and press enter to jump to the last buffer. Making jumping back and forth between buffers really easy and fast.
  • CtrlP resets the cursor to row 0 on each invocation, LeaderF stays at some location, which might be invalidated through other jumps.
  • LeaderF shows files from other "projects" / directories, often also temporary files like COMMIT_EDITMSG.

How to exchange the keys <Esc> and <C-C> by g:Lf_CommandMap?

I'd like to exchange two keys <Esc> and <C-C>. So I write this following in my _vimrc.

let g:Lf_CommandMap = {'<C-C>': ['<Esc>'], '<Esc>': ['<C-C>']}

However, pressing will quit from LeaderF, but pressing doesn't switch to normal mode. It becomes that <C-C> equals <Esc>.
Another question is that when I switch from LeaderF to normal mode, the label ">>>"(at the bottom of window) doesn't disappear soon.
So what I shoud do? Thanks a lot!

g:Lf_CommandMap g:Lf_CommandMap
Use this option to customize the mappings inside LeaderF's
prompt(|leaderf-prompt|).
for example, if you want to change the default command <C-F> to <C-D> and
change the default command <C-Q> to <Esc>: >
let g:Lf_CommandMap = {'<C-F>': ['<C-D>'], '<C-Q>': ['<Esc>']}

the action 'remove from mru list' can't work

Platform: Ubuntu 14.04.5
Vim version:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 27 2016 23:15:46)
Included patches: 1-1425

Action:
d : remove from mru list

Erros:
Traceback (most recent call last):
File "", line 1, in
File "/home/hanson/.vim/bundle/LeaderF/autoload/leaderf/mruExpl.py", line 85, in deleteMru
self._explorer.delFromCache(line)
File "/home/hanson/.vim/bundle/LeaderF/autoload/leaderf/mruExpl.py", line 48, in delFromCache
lines.remove(name + '\n')
ValueError: list.remove(x): x not in list

中文路径支持错误

leaderF打开中文路径文件夹下文件出错,可以搜索文件名,回车后会创建一个乱码文件。

例如
打开d:\codes\Linux kernal V3.0\Linux内核完全注释V3.0书签版\init\main.c
会新建一个乱码文件。

leaderf

Some files are missing using Leaderf

I open Vim in the root directory in the Linux kernel source tree. In Leaderf name-only mode, I entered mmu.c. However, I couldn't find arch/x86/kvm/mmu.c in the list. In Leaderf full-path mode, x86/mmu.c could list arch/x86/kvm/mmu.c.
So is there something wrong with LeadF? Thanks very much!

使用`LeaderfFile`命令错误和目录改变无效

  1. 打开vim后, 切换到另一个目录后, 执行:LeaderfFile, 就会出现这个, 但是好像与文件夹有关,
    有的文件夹就不会出现, 暂时还没发现规律!
    tim 20170607094601

  2. 打开vim后, 先:LeaderfFile, 然后切换到另一个目录(:cd ...), 然后调用:LeaderfFile,
    结果浏览的还是上一次的; 多次cd无效!
    tim 20170607094610

Typing in the prompt is slow

I have 22000 files in my project (don't know if it has an impact or not for this issue) and typing in the prompt is pretty slow, like 0.5~1s slow, each time you hit a key.

I can understand that it's slow when it's filtering, but it's also slow when using the arrow keys, which gives a poor user experience in the end.

If I hit ESC then it's quick as in a regular vim buffer.

一些使用建议

循环监控输入不该被关闭

使用过程中发现,这个插件不同与ctrlp,和denite相似,监控用户输入字符,分析,作出响应,不同点,denite的normal模式,不是真正的normal模式,他还在不停监控输入,而leaderf 直接关闭的监控循环,切换到了真正的vim normal模式,虽然关闭了buffer 的 编辑权限,但是感觉这样不是非常的好, 容易出问题, 很简单一个,模式变更,触发autocmd, airline 刷新了状态栏,当再次进入insert模式时,状态栏没有得到恢复。 这里就要提到,前面我说的,不停止监控的好处了,基本上不会触发模式变更autocmd 状态栏也不会被刷新。 可以看我的 vim-chat 的实现。 纯 viml实现的。

建议即便是按esc切换到 normal模式,也不要停止监控输入,而是换成另外一套分析法则,

自定义快捷键

我是习惯于 tab 和 shift-tab键上下选择选项,目前似乎只能是上下键。

search directory is wrong, and seems that it's not working either

I've maintaining my macvim via homebrew, so when I trigger leaderF the current search directory is: /usr/local/Cellar/macvim/7.4-72/MaVim.app/Contents/Resources/vim/runtime/

but still, I don't think it's working either

PS: I'm currently calling :Leaderf.
The MRU and Buffer are ok 👍

:LeaderfMru 打开之后是空白新文件

比如,在Leaderf窗口中显示为:

book.css                   "mydata/vim/chrome_extentions/imdb/css/"

打开之后显示空白新文件,文件路径提示为:

"mydata/vim/chrome_extentions/imdb/css/book.css" [New DIRECTORY]

:LeaderMruCwd也是一样的情况

Why LeaderF supports Chinese,but CtrlP can't? Thank you!

I find CtrlP doesn't support Chinese. But LeaderF works well with files named by Chinese.
Now I have turned to LeaderF.

At last I find CtrlP supports Chinese. I got confused when I wrote
let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
im my _vimrc.

I should remove it.

suggest: step-by-step processing

hi. bother you again.

when i open a large project,then i open leaderF,it will take a long time to search files.and i have to wait it until finish finding all.

can it do some changes?

  1. search the recent changed dirs first(not all) and then show result.
  2. background process.
  3. listen for directory changes.

thx!

Leader is not always ','

Although it's a good place for a Leader key, , is not the default one (at least not on MacVim or gVim). But a lot of places in the documentation says to use ,f or ,b, but it could lead to incomprehension I think.

Navigate tags

Nice plugin!

Ctrlp also supports navigating tags. Would you consider adding this to LeaderF?

LeaderF is pushing vertical splits up, without moving them back down

Invoking LeaderF moves vertical splits up, keeping their original size, which is great. However, dismissing LeaderF keeps these splits in the pushed up position, forcing me, everytime after invoking LeaderF, to resize these splits.

The following gif is showing this a little better:

vim_leaderf

Control the height of quickfix window

Currently, the quickfix window is quite big, and, unfortunately, often messing with my split heights in Vim.
Is there a possibility to reduce the height of the quickfix window? (and, as a bonus, not change the height of my Vim splits?)

Install error on OSX

Tried to install it but got this error...

Error detected while processing ~/.vim/bundle/LeaderF/plugin/leaderf.vim:
line   82:
E806: using Float as a String
E116: Invalid arguments for function <SNR>62_InitVar
line   88:
E806: using Float as a String
E116: Invalid arguments for function <SNR>62_InitVar```

g:Lf_WildIgnore doesn't seem to work anymore

I used g:Lf_WildIgnore in my .vimrc to filter out some unwanted binary files. But until recently, it doesn't seem to filter anything anymore, the default filters works (e.g. '*.o'), but not my filters (e.g. '*.a').

I tested with that and I still see the *.a files:

            \ 'dir': ['.svn','.git','.hg'],
            \ 'file': ['*.sw?','~$*','*.bak','*.exe','*.o','*.a','*.so','*.py[co]']
            \}```

Buffer Search list by recent usage

I switched from CtrlP over to LeaderF. It's been great so far, I've only noticed one minor possibility to improve.
If I invoked CtrlP to list my buffers, it listed them by most recent usage, making it very easy to switch to recently used buffers.

Would be great if there was a possibility to do this with LeaderF.

when i use leaderf and type in "fix" or "abc" or others, errors appear.

fi
Error detected while processing function leaderf#startFileExpl..leaderf#LfPy:
line 2:
Traceback (most recent call last):
File "", line 1, in
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/manager.py", line 450, in startExplorer
self.input(False)
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/manager.py", line 463, in input
self._search(self._content)
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/manager.py", line 198, in _search
self._fuzzySearch(content)
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/manager.py", line 276, in _fuzzySearch
pairs = self._filter(30000, filter_method, content)
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/manager.py", line 221, in _filter
result.extend(filter_method(cb[:]))
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/manager.py", line 243, in
return (p for p in pairs if p[0])
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/manager.py", line 242, in
for line in iterable)
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/fuzzyMatch.py", line 308, in getWeight
val)
File "/home/fps/exvim/vimfiles/plugged/LeaderF/autoload/leaderf/fuzzyMatch.py", line 41, in evaluate
i = ((x & -x) - 1).bit_length()
AttributeError: 'int' object has no attribute 'bit_length'


vim --version | grep python

+cryptv +linebreak +python/dyn +viminfo
+cscope +lispindent -python3 +vreplace
i also tried to install python 3.4.3, but the errors still exist.
my os is cenos 6.5.
fix.txt is a file in my project.

Is it possible to load the cache according to the path ?

I may work on multiple projects in one day, I wanna use the mru feature but the cache is saved for all projects, is is possible to save the cache according to the current path?

Like, I have three projects under:
~/projA
~/projB
~/projC

I may save three cache file naming:
~/projA/.leaderf
~/projB/.leaderf
~/projC/.leaderf

Is it possible?

Could it open a new tab next to the current one?

When I use :tabedit to open a file in a new tab, the new tab would be next to my current window. I expect LeaderF would do the same, but I found it opened the new tab appending the last one.

Could it possible to open a new tab just next to my current window? I think it is useful especially when I'm working on tens of source files :)

can you let buffer sort like unite.vim

it's better to sort buffer like unite.vim when open the buffer list.
unite.vim let the buffer list to view more humanized, it's very convenient to hit the 'enter' key to go prev buffer when open the buffer list.

LeaderfColorScheme not work in win32

here is the message:

searching ...
Error detected while processing function leaderf#Colors#startExpl[1]..leaderf#LfPy:
line 1:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\tracyone\vimfiles\bundle\LeaderF\autoload\leaderf\python\leaderf\manager.py", line 643, in startExplorer
content = self._getExplorer().getContent(*args, **kwargs)
File "C:\Users\tracyone\vimfiles\bundle\LeaderF\autoload\leaderf\python\leaderf\colorschemeExpl.py", line 25, in getContent
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined

vim version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Aug 2 2017 22:09:43)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-844
Compiled by appveyor@APPVYR-WIN
Huge version with GUI. Features included (+) or not (-):
+acl +cmdline_info +emacs_tags +insert_expand +mksession +persistent_undo +startuptime +timers +writebackup
+arabic +comments +eval +job +modify_fname -postscript +statusline +title -xfontset
+autocmd +conceal +ex_extra +jumplist +mouse +printer -sun_workshop +toolbar -xim
+balloon_eval +cryptv +extra_search +keymap +mouseshape +profile +syntax +user_commands +xpm_w32
+browse +cscope +farsi +lambda +multi_byte_ime/dyn +python/dyn +tag_binary +vertsplit -xterm_save
++builtin_terms +cursorbind +file_in_path +langmap +multi_lang +python3/dyn +tag_old_static +virtualedit
+byte_offset +cursorshape +find_in_path +libcall +mzscheme/dyn +quickfix -tag_any_white +visual
+channel +dialog_con_gui +float +linebreak +netbeans_intg +reltime +tcl/dyn +visualextra
+cindent +diff +folding +lispindent +num64 +rightleft -termguicolors +viminfo
+clientserver +digraphs -footer +listcmds +ole +ruby/dyn -terminal +vreplace
+clipboard +directx +gettext/dyn +localmap +packages +scrollbind -tgetent +wildignore
+cmdline_compl -dnd -hangul_input +lua/dyn +path_extra +signs -termresponse +wildmenu
+cmdline_hist -ebcdic +iconv/dyn +menu +perl/dyn +smartindent +textobjects +windows
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM_vimrc"
user exrc file: "$HOME_exrc"
2nd user exrc file: "$VIM_exrc"
system gvimrc file: "$VIM\gvimrc"
user gvimrc file: "$HOME_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM_gvimrc"
defaults file: "$VIMRUNTIME\defaults.vim"
system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL -DFEAT_XPM_W32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_MBYTE -DFEAT_GUI_W32 -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL="tcl86.dll" -DDYNAMIC_TCL_VER="8.6" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL="lua53.dll" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL="python27.dll" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL="python35.dll" -DFEAT_MZSCHEME -I "C:\Program Files\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL="libracket3m_a0solc.dll" -DDYNAMIC_MZGC_DLL="libracket3m_a0solc.dll" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL="perl524.dll" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=22 -DDYNAMIC_RUBY_DLL="x64-msvcrt-ruby220.dll" -DFEAT_HUGE /Fd.\ObjGXOULYHTRZAMD64/ /Zi
Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:AMD64 gdi32.lib version.lib winspool.lib comctl32.lib advapi32.lib shell32.lib /machine:AMD64 /nodefaultlib libcmt.lib oleaut32.lib user32.lib /nodefaultlib:lua53.lib /STACK:8388608 /nodefaultlib:python27.lib /nodefaultlib:python35.lib "C:\Tcl\lib\tclstub86.lib" WSock32.lib xpm\x64\lib\libXpm.lib /PDB:gvim.pdb -debug

Please add a tag for v1.00

I understand that you are developing some awesome feature on a high version of vim. But I don't wanna compile a high version vim on my ubuntu 12.04 server, I can only get a version of 7.4.5 from apt-get, which is not enough to run LeaderF before. Could you make a tag for the latest version before v1.01? Like v1.00 ? Before the commit that will require 7.4.33 ?

sometimes g:Lf_CommandMap did not take effect

I'm useing esc to quit leaderf, <c-i> to switch normal mode, sometimes <c-i> did not take effect.
If I use esc to switch mode work right always.

let g:Lf_CommandMap = {'<C-C>': ['<Esc>'],'<Esc>':['<C-I>']}
let g:Lf_ShortcutF = 'ff'

os: ubuntu16.04
commit 3e7dc26

test way:

open vim
ff
<c-i>
:qa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.