liuchengxu / vim-clap

:clap: Modern performant fuzzy picker, tree-sitter highlighting, and more, for both Vim and NeoVim
https://liuchengxu.github.io/vim-clap/
MIT License
2.11k stars 86 forks source link

`Clab buffer` has an inefficient layout #897

Closed rafaelrojasmiliani closed 1 year ago

rafaelrojasmiliani commented 1 year ago

Environment:

Describe the bug This plugin is amazing. However, the layout of the Clab buffer command is quite inefficient, and makes you loss time understanding what is the file you want. Screenshot from 2022-12-20 10-02-40 In fact, as you see in the picture above the columns describing the buffers are: buffer number, weight of the file, line of the position of the cursor and full path (with respect to the project) of the file. The name of the file is hidden because the path is long. This is not a particular situation and compromises the incredible time efficiency that this plugin can give you.

This is the layout of another plugin called buffer explorer. Screenshot from 2022-12-20 10-12-34

I would recommend to change the layout to something similar, where the name of the file is clearly visible at first sight. I could propose a pull request, but I'm not a vim-script/lua programmer. However, if you tell me where to look at, I can give a try.

Clap debug


            has cargo: 0
            has maple: v:null
         has +python3: 1
has py dynamic module: 0
            has ctags: ctags without JSON output support
    Current sync impl: Lua
     Current FileType: bufexplorer
Third Party Providers: []
       Global Options:
    let g:clap#autoload_dir = '/etc/vim/bundle/vim-clap/autoload'
    let g:clap#popup#display = {'shrink': function('341'), 'open': function('<SNR>115_create_display'), 'width': 46, 'shrink_if_undersize': function('340')}
    let g:clap#popup#preview = {'line_count': function('<SNR>114__line_count'), 'show': function('342'), 'hide': function('343'), 'clear': function('344'), 'add_highlight': function('345'), 'get_lines': function('<SNR>114__get_lines'), 'getbufvar': function('<SNR>114__getbufvar'), 'setbufvar_batch': function('<SNR>114__setbufvar_batch'), 'setbufvar': function('<SNR>114__setbufvar'), 'winid': 1040, 'win_is_valid': function('<SNR>114__win_is_valid'), 'goto_win': function('<SNR>114__goto_win'), 'set_syntax': function('346'), 'bufnr': 7}
    let g:clap#provider_alias = {'gfiles': 'git_files', 'hist:': 'command_history', 'hist/': 'search_history'}
    let g:clap_background_shadow_blend = 50
    let g:clap_disable_bottom_top = 0
    let g:clap_disable_matches_indicator = v:false
    let g:clap_disable_optional_async = v:false
    let g:clap_disable_run_rooter = v:false
    let g:clap_enable_background_shadow = v:false
    let g:clap_enable_debug = v:false
    let g:clap_enable_icon = 0
    let g:clap_forerunner_status_sign = {'done': '•', 'running': '!', 'using_cache': '*'}
    let g:clap_indicator_winid = 1041
    let g:clap_insert_mode_only = v:false
    let g:clap_multi_selection_warning_silent = 0
    let g:clap_no_matches_msg = 'NO MATCHES FOUND'
    let g:clap_open_action = {'ctrl-v': 'vsplit', 'ctrl-x': 'split', 'ctrl-t': 'tab split'}
    let g:clap_open_preview = 'always'
    let g:clap_popup_border = 'rounded'
    let g:clap_preview_direction = 'AUTO'
    let g:clap_preview_size = 5
    let g:clap_providers_relaunch_code = '@@'
    let g:clap_search_box_border_style = 'nil'
    let g:clap_search_box_border_symbols = {'nil': ['', ''], 'curve': ['', ''], 'arrow': ['', '']}
    let g:clap_spinner_winid = 1043
  Provider Variables:
                     []

To Reproduce Clap buffers

liuchengxu commented 1 year ago

Looks good to me, feel free to refine it here https://github.com/liuchengxu/vim-clap/blob/04708737f5/autoload/clap/provider/buffers.vim#L18-L32