Git Product home page Git Product logo

vista.vim's Introduction

Vista.vim

CI

View and search LSP symbols, tags in Vim/NeoVim.

Vista ctags

>>>> More screenshots

caveat: There is a major flaw about the tree view renderer of ctags at the moment, see #320 for more details.

Table Of Contents

Introduction

I initially started vista.vim with an intention of replacing tagbar as it seemingly doesn't have a plan to support the promising Language Server Protocol and async processing.

In addition to being a tags viewer, vista.vim can also be a symbol navigator similar to ctrlp-funky. Last but not least, one important goal of vista.vim is to support LSP symbols, which understands the semantics instead of the regex only.

Features

  • View tags and LSP symbols in a sidebar.
  • Finder for tags and LSP symbols.
  • Nested display for ctags, list display for LSP symbols.
  • Highlight the nearby tag in the vista sidebar.
  • Builtin support for displaying markdown's TOC.
  • Update automatically when switching between buffers.
  • Jump to the tag/symbol from vista sidebar with a blink.
  • Update asynchonously in the background when +job avaliable.
  • Find the nearest method or function to the cursor, which could be integrated into the statusline.
  • Display decent detailed symbol info in cmdline, also supports previewing the tag via neovim's floating window.

Notes:

  • Exuberant Ctags is unsupported, ensure you are using universal-ctags.
  • The feature of finder in vista.vim :Vista finder [EXECUTIVE] is a bit like :BTags or :Tags in fzf.vim, :CocList in coc.nvim, :LeaderfBufTag in leaderf.vim, etc. You can choose whatever you like.
  • Due to limitations of the Language Server Protocol, a tree view of nested tags is currently only available for the ctags executive. Other executives will have symbols grouped by modules, classes, functions and variables. The tree view support for LSP executives are limited at present, and only :Vista coc provider is supported.

Requirement

I don't know the mimimal supported version. But if you only care about the ctags related feature, vim 7.4.1154+ should be enough. If you want to ctags to run asynchonously, Vim 8.0.27+ should be enough.

Otherwise, if you want to try any LSP related features, then you certainly need some plugins to retrive the LSP symbols, e.g., coc.nvim. When you have these LSP plugins set up, vista.vim should be ok to go as well.

In addition, if you want to search the symbols via fzf, you will have to install it first. Note that fzf 0.22.0 or above is required.

Installation

Plugin Manager

For other plugin managers please follow their instructions accordingly.

Package management

Vim 8

$ mkdir -p ~/.vim/pack/git-plugins/start
$ git clone https://github.com/liuchengxu/vista.vim.git --depth=1 ~/.vim/pack/git-plugins/start/vista.vim

NeoVim

$ mkdir -p ~/.local/share/nvim/site/pack/git-plugins/start
$ git clone https://github.com/liuchengxu/vista.vim.git --depth=1 ~/.local/share/nvim/site/pack/git-plugins/start/vista.vim

Usage

Show the nearest method/function in the statusline

Note: This is only supported for ctags and coc executive for now.

You can do the following to show the nearest method/function in your statusline:

function! NearestMethodOrFunction() abort
  return get(b:, 'vista_nearest_method_or_function', '')
endfunction

set statusline+=%{NearestMethodOrFunction()}

" By default vista.vim never run if you don't call it explicitly.
"
" If you want to show the nearest function in your statusline automatically,
" you can add the following line to your vimrc
autocmd VimEnter * call vista#RunForNearestMethodOrFunction()

Also refer to liuchengxu/eleline#18.

let g:lightline = {
      \ 'colorscheme': 'wombat',
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'readonly', 'filename', 'modified', 'method' ] ]
      \ },
      \ 'component_function': {
      \   'method': 'NearestMethodOrFunction'
      \ },
      \ }

Commands

Command Description
Vista Open/Close vista window for viewing tags or LSP symbols
Vista! Close vista view window if already opened
Vista!! Toggle vista view window

:Vista [EXECUTIVE]: open vista window powered by EXECUTIVE.

:Vista finder [EXECUTIVE]: search tags/symbols generated from EXECUTIVE.

See :help vista-commands for more information.

Options

" How each level is indented and what to prepend.
" This could make the display more compact or more spacious.
" e.g., more compact: ["▸ ", ""]
" Note: this option only works for the kind renderer, not the tree renderer.
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]

" Executive used when opening vista sidebar without specifying it.
" See all the avaliable executives via `:echo g:vista#executives`.
let g:vista_default_executive = 'ctags'

" Set the executive for some filetypes explicitly. Use the explicit executive
" instead of the default one for these filetypes when using `:Vista` without
" specifying the executive.
let g:vista_executive_for = {
  \ 'cpp': 'vim_lsp',
  \ 'php': 'vim_lsp',
  \ }

" Declare the command including the executable and options used to generate ctags output
" for some certain filetypes.The file path will be appened to your custom command.
" For example:
let g:vista_ctags_cmd = {
      \ 'haskell': 'hasktags -x -o - -c',
      \ }

" To enable fzf's preview window set g:vista_fzf_preview.
" The elements of g:vista_fzf_preview will be passed as arguments to fzf#vim#with_preview()
" For example:
let g:vista_fzf_preview = ['right:50%']
" Ensure you have installed some decent font to show these pretty symbols, then you can enable icon for the kind.
let g:vista#renderer#enable_icon = 1

" The default icons can't be suitable for all the filetypes, you can extend it as you wish.
let g:vista#renderer#icons = {
\   "function": "\uf794",
\   "variable": "\uf71b",
\  }

See :help vista-options for more information.

Other tips

The ctags provided by the OS distribution may present issues, such as the ones described in #467. It is strongly recommended to use the newer version of ctags. The nightly build of ctags can be obtained from https://github.com/universal-ctags/ctags-nightly-build/releases. Alternatively, you can compile it yourself if you prefer.

Compile ctags with JSON format support

First of all, check if your universal-ctags supports JSON format via ctags --list-features. If not, I recommend you to install ctags with JSON format support that would make vista's parser easier and more reliable. And we are able to reduce some overhead in JSON mode by disabling the fixed fields.

The JSON support for ctags is avaliable if u-ctags is linked to libjansson when compiling.

  • macOS, included by default since February 23 2021

    $ brew tap universal-ctags/universal-ctags
    $ brew install --HEAD universal-ctags/universal-ctags/universal-ctags
  • Ubuntu

    # install libjansson first
    $ sudo apt-get install libjansson-dev
    
    # then compile and install universal-ctags.
    #
    # NOTE: Don't use `sudo apt install ctags`, which will install exuberant-ctags and it's not guaranteed to work with vista.vim.
    #
    $ git clone https://github.com/universal-ctags/ctags.git --depth=1
    $ cd ctags
    $ ./autogen.sh
    $ ./configure
    $ make
    $ sudo make install
  • Fedora

    $ sudo dnf install jansson-devel autoconf automake
    $ git clone https://github.com/universal-ctags/ctags.git --depth=1
    $ cd ctags
    $ ./autogen.sh
    $ ./configure
    $ make
    $ sudo make install

Refer to Compiling and Installing Jansson as well.

Contributing

Vista.vim is still in beta, please file an issue if you run into any trouble or have any sugguestions.

License

MIT

Copyright (c) 2019 Liu-Cheng Xu

vista.vim's People

Contributors

110y avatar acidghost avatar adnoc avatar avi-d-coder avatar bluedrink9 avatar derekschrock avatar dietrichm avatar dkarter avatar emarbo avatar farzadmf avatar frederick888 avatar get-me-power avatar gmolau avatar heroin-moose avatar infokiller avatar iv-nn avatar j0ng4b avatar jagjordi avatar jakubgros avatar jan-xyz avatar kawing-chiu avatar liuchengxu avatar matclab avatar mte90 avatar nickspoons avatar pwntester avatar singalhimanshu avatar thallada avatar wookayin avatar yushangakki 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

vista.vim's Issues

How to use finder for the whole project?

Firstly, this plugin is awesome. Something that has been missing for Vim for some time. So thank you.

When I use :Vista finder, I can only retrieve the buffer tags, like :BTags from FZF. How can I use :Vista finder to find symbols for the whole project, just like :Tags?

Improve extented ctags

follow-up problems of #35 :

  • how to take care of the custom ctags cmd.
  • transform the short kind to the long, e.g., the long kind missing in hasktags.
  • how to handle multiple filetypes share one type, e.g., cpp and cuda.
  • the new ctags options may be unneccessary for the finder functionality, which can be replaced with the previous simpler one.

Error detected while processing function <SNR>170_on_exit[6].., with neovim in ubuntu 18.04

Describe the bug
As the title, an error raised when use neovim in Ubuntu18.04

Error detected while processing function <SNR>170_on_exit[6]..<SNR>170_ApplyExtracted[14]..vista#viewer#Display[1]..<SNR>176_Render[2]..vista#renderer#default#Render[5]..<SNR>178_Re
nder[1]..303:
line    3:
E716: Key not present in Dictionary: sro
Press ENTER or type command to continue
Error detected while processing function <SNR>170_on_exit[6]..<SNR>170_ApplyExtracted[14]..vista#viewer#Display[1]..<SNR>176_Render[2]..vista#renderer#default#Render[5]..<SNR>178_Re
nder[1]..303:
line    3:
E15: Invalid expression: g:vista#types#uctags#{filetype}#['sro']
Press ENTER or type command to continue
Error detected while processing function <SNR>170_on_exit[6]..<SNR>170_ApplyExtracted[14]..vista#viewer#Display[1]..<SNR>176_Render:
line    2:
E171: Missing :endif
Press ENTER or type command to continue
Error detected while processing function <SNR>170_on_exit[6]..<SNR>170_ApplyExtracted:
line   14:
E171: Missing :endif

Environment:

  • OS: Ubuntu 18.04 ( macos with neovim 0.3.4 works good)
  • Neovim version: NVIM 0.3.1, and Vim8 works good
  • This plugin version: 268a88d
  • ctags version:
Universal Ctags 0.0.0(9630c392), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Apr 25 2019, 07:36:22
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +json, +interactive, +packcc

Vista info

Current FileType: vim
Avaliable Executives: ['ctags']
Global Variables:
let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
let g:vista#renderer#enable_icon = 0
let g:vista_default_executive = 'ctags'
let g:vista_echo_cursor = 0
let g:vista_icon_indent = ['╰─ ', '├─ ']
let g:vista_sidebar_position = 'vertical topleft'
let g:vista_stay_on_open = 0
~

Steps to reproduce given the above info

just run :Vista

Expected behavior
This is the screenshot of Vim8, the same OS, the same config
image

Neovim 0.3.4 in macOS 10.13.6
image

Actual behavior
See below

Screenshot or gif (if possible)
image

Error detected while processing function vista#cursor#FoldOrJump[17]..<SNR>230_Jump

Describe the bug
When hitting intro in a function name of Vista's window, instead of jumping to the function in the current buffer it throws the following error:

Error detected while processing function vista#cursor#FoldOrJump[17]..<SNR>230_Jump:
line   15:
E121: Undefined variable: s:cur_tag
E116: Invalid arguments for function matchstrpos
E15: Invalid expression: matchstrpos(line[0], s:cur_tag)
Press ENTER or type command to continue

Environment:

  • OS: macOS
  • Vim/Neovim version: NVIM v0.3.5 Build type: Release
  • This plugin version: 50678b1

Vista info

    Current FileType: vista_kind
Avaliable Executives: ['coc', 'ctags']
    Global Variables:
    let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
    let g:vista#renderer#ctags = 'default'
    let g:vista#renderer#enable_icon = 0
    let g:vista#renderer#icons = {'subroutine': '洛', 'method': '', 'func': '', 'variables': '', 'namespace': '', 'field': '綠', 'interface': '禍', 'type': '', 'packages': '', 'property': '襁', 'impleme
ntation': '', 'default': '', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'const': '', 'macros': '', 'map': 'פּ', 'fields': '綠', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typede f
': '', 'variable': '', 'modules': '', 'constant': '', 'struct': 'פּ', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member': '', 'var': '', 'union': '鬒'}
    let g:vista_blink = [0, 0]
    let g:vista_close_on_jump = 1
    let g:vista_default_executive = 'coc'
    let g:vista_echo_cursor = 0
    let g:vista_finder_alternative_executives = ['coc']
    let g:vista_sidebar_width = 60

Steps to reproduce given the above info

  1. Open Vista window
  2. Hit enter on any symbol

Expected behavior
Jump to the function in the current buffer

Actual behavior
Throws error described previously

Screenshot or gif (if possible)

image

Duplicated details for fields and variables

Describe the bug
When I hover over fields or variables, the details are duplicated. It doesn't happen for other types.

Steps to reproduce

  1. Call :Vista
  2. Hover on fields or variables

Expected behavior
Unique detail message.

Actual behavior
Duplicated details show up.

Screenshot or gif
image

image

Environment:

  • OS: Debian 9.7 (Stretch)
  • Vim/Neovim version:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Mar  6 2019 09:15:43)
Included patches: 1-996
  • This plugin version: 036ed923b3d1d4911eeedc07e2b32f5f5b37a5b6

Airline support

Hi,

I was wondering RunForNearestMethodOrFunction is this supported on Airline ?

Also is it possible to have Vista open on startup ?

nestestFunctionOrMethodName support for coc.nvim & lightline

Is your feature request related to a problem? Please describe.
follow README, cannot get method name when I have coc.nvim & lightline

Describe the solution you'd like
Please give doc about that

Describe alternatives you've considered
N / A

Additional context

" itchyny/lightline.vim {{
  let g:lightline = {
      \ 'colorscheme': 'powerline',
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'gitbranch', 'cocstatus', 'readonly', 'filename', 'coc', 'methodName' ] ]
      \ },
      \ 'component': {
      \   'coc': 'Powered By coc.nvim'
      \ },
      \ 'component_function': {
      \   'filename': 'LightlineFilename',
      \   'fileformat': 'LightlineFileformat',
      \   'filetype': 'LightlineFiletype',
      \   'gitbranch': 'LightlineGitBranch',
      \   'cocstatus': 'LightlineCocStatus',
      \   'methodName': 'NearestMethodOrFunction'
      \ },
      \ }

  function! LightlineFilename()
    let filename = expand('%:t') !=# '' ? expand('%:t') : '[ New File ]'
    let modified = &modified ? ' +' : ''
    return filename . modified . ' ' . WebDevIconsGetFileTypeSymbol()
  endfunction

  function! LightlineFileformat()
    return winwidth(0) > 70 ? &fileformat : ''
  endfunction

  function! LightlineFiletype()
    return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
  endfunction

  function! LightlineGitBranch()
    return  '| ⎇ ' . fugitive#head()
  endfunction

  function! LightlineCocStatus()
    return coc#status() != '' ? coc#status() : 'no info'
  endfunction

  function! NearestMethodOrFunction()
    return '' . get(b:, 'vista_nearest_method_or_function', '') . ' |'
  endfunction
" }}

Hi, is there any way to configure the key map to open or close tag tree

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
no,

Describe the solution you'd like
A clear and concise description of what you want to happen.
I want to change the default FoldOrJump key map to another key, e,g o, no change just add is also ok. o is very close to touch...:)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Open sidebar doesn't cycle through executives

With a default executive of "vim-lsp" there is no cycle to "ctags" executive when opening the sidebar with ":Vista". It does perform this cycling correctly when using ":Vista finder".

This was identified under #33

Symbol are not update when entering window

AFAICT, it seems that the auto update is handled by this autocmd

    autocmd BufWritePost,BufReadPost,CursorHold * call
                \ s:AutoUpdate(fnamemodify(expand('<afile>'), ':p'))

Is it a feature or a bug?

大佬 不好意思 这次更新后 打开vista没有任何内容显示。。。。

、、、

"vista配置{{{
"
"
function! NearestMethodOrFunction() abort
return get(b:, 'vista_nearest_method_or_function', '')
endfunction
" 启用悬浮窗预览
let g:vista_echo_cursor_strategy ='floating_win'
" 侧边栏宽度.
let g:vista_sidebar_width = 30
" 设置为0,以禁用光标移动时的回显.
let g:vista_echo_cursor = 1
" 当前游标上显示详细符号信息的时间延迟.
let g:vista_cursor_delay = 400
" 跳转到一个符号时,自动关闭vista窗口.
let g:vista_close_on_jump = 0
"打开vista窗口后移动到它.
let g:vista_stay_on_open = 1
" 跳转到标记后闪烁光标2次,间隔100ms.
let g:vista_blink = [2, 100]
" 图标美化
let g:vista#renderer#enable_icon = 1
let g:vista#renderer#icons = {
\ "function": "\uf30b",
\ "variable": "\uf5c0",
\ }
" 展示样式
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]
" Executive used when opening vista sidebar without specifying it.
" Avaliable: 'coc', 'ctags'. 'ctags' by default.
" 优先选择lsp作为标签来源,其次ctags
let g:vista_cpp_executive = 'vim_lsp'
let g:vista_default_executive = 'ctags'
" To enable fzf's preview window set g:vista_fzf_preview.
" The elements of g:vista_fzf_preview will be passed as arguments to fzf#vim#with_preview()
" For example:
let g:vista_fzf_preview = ['right:50%']
let g:vista_finder_alternative_executives = ['coc']
"}}}vista配置
、、、
这是本人配置

大佬 可不可以加上neovim的悬浮窗支持 这样相信体验更好 毕竟不会出现画面推动代码编辑区的问题 美观是兴趣的原动力啊

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add a spinner in the statusline to feel more responsive when the job is taking too long time

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Basically, ctags should be fast to genrate tags in the buffer, but it may be very slow to generate tags in a whole project. Some language server may need some time to give back the document symbols, especially when they are indexing. So, it would be better to show if these jobs are still running in the background, making me feel more responsive.

Describe the solution you'd like
A clear and concise description of what you want to happen.

  • SetBusy(1) when starting the job.
  • SetBusy(0) when the job stops.
  • draw the spinner in the duration via a timer.

I realize that Vista normally won't be a mainly focused window, so this feature may not deserve the effort. I won't add it myself.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Vista!! does not work with LSP clients

Hi,

Awesome project, thanks!

I use NeovimLanguageClient and want to use Vista!! with it:

nnoremap <Leader>e :Vista!! lcn<Return> 
nnoremap <Leader>f :Vista!! finder lcn<Return> 

But Im getting the following error:

[vista.vim] Invalid args. expected: Vista![!]

I guess I can make my own function to toggle the Vista window, but seems like Vista!! should work with other sources as well.

Thanks

Add an option for disabling rendering the statusline of vista window for other statusline plugins

Describe the bug
When hovering a symbol in the side view while having let g:vista_echo_cursor_strategy = 'floating_win' in config, the Airline statusline enters in an infinite reset loop, overloading one of my CPU cores.

Steps to reproduce

let g:vista_echo_cursor_strategy = 'floating_win'
  1. :Vista
  2. Hover any symbol

Expected behavior
No reset loop, normal Airline statusline.

Actual behavior
Statusline enters in a loop of setting and unsetting the Airline statusline.

Environment:

  • OS: Debian GNU/Linux 9.7 (stretch)
  • Vim/Neovim version:
NVIM v0.4.0-430-g8698830cb
Build type: RelWithDebInfo

问题反馈 拜托了

vista开启悬浮窗支持后,只要把光标移动到标签之上,触发悬浮窗就会不断的出现该状况。弹出这两个映射命令。
Untitled

这是fzf调用rg的映射
屏幕快照 2019-04-02 下午12 46 43
还有
屏幕快照 2019-04-02 下午12 45 55
请问这是什么原因

strategy to show details of symbol under cursor in the vista sidebar

There are several ways to show details of the tag under cursor when you are in the vista sidebar:

  1. echo the information with highlight in cmd line.
  2. popup a floating window to reveal the lines close to the target line that the tag is located.
  3. scroll the source file to make the source line of the tag visible(#80).

It's distracting to enable all these strategies, so I plan to let the option g:vista_echo_cursor_strategy could only used to choose either one, or both, but not all of them. The current valid values for g:vista_echo_cursor_strategy:

  • echo
  • floating_win
  • both

I have not figured it out what value for the third strategy, maybescroll?. Let me know if you have any ideas about this option.

屏幕快照 2019-05-11 上午10 59 51

Vista fails on c++ file

vista fails with:

Error detected while processing function <SNR>131_on_exit[6]..<SNR>131_ApplyExtracted[14]..vista#viewer#Display[1]..<SNR>137_Render[2]..vista#ren
derer#default#Render[5]..<SNR>139_Render[25]..<SNR>139_RenderDescendants[44]..<SNR>139_RenderDescendants[41]..<SNR>139_DescendantsOf:
line    1:
E874: (NFA) Could not pop the stack!

OS: Arch Linux.
Output of ctags --version

Universal Ctags 0.0.0(45968eff), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Oct 15 2018, 21:55:11
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml

neovim version

NVIM v0.3.5
Build type: Release
LuaJIT 2.0.5

vista version: 0e3e3a60f5d657f24a787472e4dbc7a7a706b4d6

File for reproduction ( convert to .h )
SmallVector.txt

Vista info


    Current FileType: cpp
Avaliable Executives: ['ctags', 'lcn']
    Global Variables:
    let g:vista#executive#ctags#support_json_format = 1
    let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
    let g:vista#render#ctags = 'default'
    let g:vista#renderer#ctags = 'default'
    let g:vista#renderer#default#vlnum_offset = 3
    let g:vista#renderer#enable_icon = 1
    let g:vista#renderer#icons = {'subroutine': '洛', 'method': '', 'func': '', 'variables': '', 'namespace': '', 'field': '綠', 'interface':
 '禍', 'type': '', 'packages': '', 'property': '襁', 'implementation': '', 'default': '', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'c
onst': '', 'macros': '', 'map': 'פּ', 'fields': '綠', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typedef': '', 'variable':
 '', 'modules': '', 'constant': '', 'struct': 'פּ', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member':
'', 'var': '', 'union': '鬒'}
    let g:vista_cursor_delay = 0
    let g:vista_sidebar_width = 35
    let g:vista_stay_on_open = 0

Steps to reproduce given the above info

nvim SmallVector.h
:Vista

Expected behavior
Show tags

Actual behavior
Error

Use --output-format=json if the compiled ctags has this feature

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

It's easier to parse if the output is json format.

To install ctags with JSON support:

$ brew reinstall --with-jansson universal-ctags/universal-ctags/universal-ctags

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Error when searching in outline view with coc

I'm using Vista with coc for editing Typescript in Neovim v0.3.4. When I press the slash button in the Vista window I get the following error:

Error detected while processing function vista#finder#fzf#Run[36]..<SNR>101_TryAlternatives[7]..vista#executive#vim_lsp#Run[1]..<SNR>104_HasAvaliableServers:
line    1:
E117: Unknown function: lsp#get_whitelisted_servers
E116: Invalid arguments for function filter
E15: Invalid expression: filter(lsp#get_whitelisted_servers(), 'lsp#capabilities#has_document_symbol_provider(v:val)')

Running :Vista finder in the same file works fine with no error. The slash behavior also works fine with JSON filetype (only other filetype I've tested).

I just have this one line in my init.vim:

let g:vista_default_executive = 'coc'

Thanks

Add ability to silently trigger Vista functionalities

Is your feature request related to a problem? Please describe.

To display the current method/function your cursor is inside it is possible to add this to the vim configuration:

function! NearestMethodOrFunction() abort
  return get(b:, 'vista_nearest_method_or_function', '')
endfunction

set statusline+=%{NearestMethodOrFunction()}

However, this does not work unless you've opened up Vista with :Vista. So if you want this functionality but don't want the actual Vista pane open, you have to perform an extra action.

Describe the solution you'd like

A way to "silently trigger" Vista functionalities like this without having to open & close the pane.

Provide a function that is callable when you open a buffer, or maybe a configuration option to automatically do this when a file is opened ?

Describe alternatives you've considered

Currently I'm just considering making a keybinding that opens and closes the pane.

Additional context

This issue was created in relation to neoclide/coc.nvim#512 (comment)

floating_window constantly blinks.

Describe the bug
when function selected floating window seems to blink.

Environment:

  • OS: 10.14.3 (18D109)
  • Neovim version: v0.4.0-dev
  • This plugin version: 3c222b3

Steps to reproduce given the above minimal vimrc
Open a file that contains method/function move your mouse to any function, floating window will show up and start blinking.

Expected behavior
floating window to pop up but not blink.

Vista window's width ignoring configuration value after first render

Describe the bug

I have set the g:vista_sidebar_width option to 60, but after the first time it shows the window, it then resets the width to its default value.

Environment:

  • OS: Mac OS
  • Vim/Neovim version: Neovim 0.3.4
  • This plugin version: 5fef8e3

Minimal vimrc to reproduce

" Vista configuration
let g:vista_default_executive = 'coc'
let g:vista_close_on_jump = 1
let g:vista_blink  = [0, 0]
let g:vista_sidebar_width = 60
let g:vista_finder_alternative_executives = ['coc']
let g:vista#renderer#enable_icon = 0
map <C-m> :Vista coc<CR>

How to reproduce

  1. Press <C-m> to open Vista's view.
  2. Press q to close it.
  3. Press <C-m> again.

First render

image

Next renders

image

No such group or event: VistaFloatingWin

Describe the bug
After the last update, when I hit enter on a symbol in Vista's view to jump to the function in the current buffer, before closing the Vista's view it displays the following error:

Error detected while processing function vista#cursor#FoldOrJump[17]..<SNR>230_Jump[27]..vista#sidebar#Close[13]..vista#floating#Close[1]..<SNR>231_ApplyClose:
line    1:
E216: No such group or event: VistaFloatingWin
Press ENTER or type command to continue

Environment:

  • OS: macOS Mojave
  • Vim/Neovim version: NVIM v0.3.4 Build type: Release
  • This plugin version: 8e7e743

Vista info

    Current FileType: elixir
Avaliable Executives: ['coc', 'ctags']
    Global Variables:
    let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
    let g:vista#renderer#ctags = 'default'
    let g:vista#renderer#enable_icon = 0
    let g:vista#renderer#icons = {'subroutine': '洛', 'method': '', 'func': '', 'enum': '', 'namespace': '', 'field': '綠', 'interface': '禍', 'type': '', 'packages': '', 'property': '襁', 'implementation': '', 'default': '', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'const': '', 'macros': '', 'map': 'פּ', 'fields': '綠', 'types': '', 'function': '', 'target': '', 'typedef': '', 'variable': '', 'modules': '', 'constant': '', 'struct': 'פּ', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member': '', 'var': '', 'union': '鬒'}
    let g:vista_blink = [0, 0]
    let g:vista_close_on_jump = 1
    let g:vista_default_executive = 'coc'
    let g:vista_finder_alternative_executives = ['coc']
    let g:vista_sidebar_width = 60

Steps to reproduce given the above info

  1. Open Vista using :Vista.
  2. Go to a symbol and press enter.

Expected behavior
Vista's windows should close and the cursor should be positioned on the function.

Actual behavior
Before closing Vista's window, it shows the error described previously.

Screenshot or gif (if possible)
image

neovim hang when call 'Vista lcn' and 'Vista finder lcn' in vista window

Describe the bug
I am using neovim 0.4.0 Nvim development (prerelease) build. from here :https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
And using LanguageClient-neovim plugin.Using default setting for python.

Then I map two key like this:
nnoremap <F2> :Vista lcn<CR>
nnoremap <F3> :Vista finder lcn<CR>

After setting those, I start a empty neovim with nothing opened,then press F2, and F3, neovim is hang,not response at all.

Environment:
macOS 10.14.4
NVIM v0.4.0-647-gf86f0a8bc

Vista info
Current FileType:
Avaliable Executives: ['ctags', 'lcn']
Global Variables:
let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
let g:vista_echo_cursor_strategy = 'floating_win'
let g:vista_icon_indent = ['▸ ', '']

Show the tags in a nested structure

Vista lists the tags grouped by type, unlike Tagbar that groups them by structure and nests them. Consider the following screenshot, with the code on the left, Tagbar in the middle, and Vista on the right:

image

The Tagbar style gives you a clear overview of the code's structure, while Vista is quite a mess to look at (especially in my example, where different methods have the same name).

Even if the tags were just ordered by their location in the file instead of being grouped by tag type the result would be much nicer. Nesting by indentation is of course a nice bonus, and so is the parameter list (that can when there is overloading)

Provide a option to show Vista's buffer in current window

As the title described, I want get a option to show Vista's buffer in current window, rather than open a new window - sidebar.

Because I want to integrate Vista with NERDTree, let them on the same side. If there is no thus option, I can not do it.

Please support if you have free time, Thanks ! 😄

同时启动goyo和

Mac系统
冲突插件junegunn/goyo.vim
插件管理器用的plug 两个插件都做了延迟加载 单独启动其中一个插件不会发生任何问题
只要启动另外一个插件就会马上提示错误 但会正常进入插件 这是错误截图
屏幕快照 2019-03-25 下午7 33 33

let g:vista_sidebar_width = 30
let g:vista_echo_cursor = 1
let g:vista_cursor_delay = 400
let g:vista_close_on_jump = 0
let g:vista_stay_on_open = 1
let g:vista_blink = [2, 100]
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]
let g:vista_default_executive = 'ctags'
let g:vista_fzf_preview = ['right:50%']
let g:vista_finder_alternative_executives = ['coc']

ctags running fail

Describe the bug
ctags runs fail.

Environment:

  • OS: macOS
  • Neovim version: 0.4
  • This plugin version: 1ea2ca7

** If this issue is related to ctags, please also provide the source file you run Vista on.
https://github.com/google/shaka-player

Vista info

Current FileType: 

Avaliable Executives: ['coc', 'ctags']
Global Variables:
let g:vista#executive#ctags#support_json_format = 0
let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
let g:vista_default_executive = 'ctags'

Steps to reproduce given the above info

  1. git clone Shaka repo
  2. run command ":Vista finder coc" in nvim

Expected behavior
Shows symbol/tags

Actual behavior
[vista.vim]Fail to run ctags: ctags --format=2 --excmd=pattern --fields=nksSaf --extras= --file-scope=yes --sort=no --append=no --language-force=javascript --javascript-kinds=cpC
fvgm -f- /var/folders/_y/d89_j12d2xq_cnlh8v6btwpw0000gn/T/nvimDqvMz2/18.js
[vista.vim] Empty data for finder

Vista ctags can't handle nested classes with stuff in them

Describe the bug
When I have a class inside a class, and have things inside that inner class, Vista doesn't work.

Environment:

  • OS: ArchLinux
  • Vim/Neovim version: Neovim 0.3.4 release
  • This plugin version: 1ea2ca7

Vista info

    Current FileType: text
Avaliable Executives: ['ctags', 'lcn']
    Global Variables:
    let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
    let g:vista_ctags_renderer = 'default'
    let g:vista_fzf_preview = ['right:50%']
    let g:vista_stay_on_open = 0

Steps to reproduce given the above info

  1. Create this file:
    class Foo:
        class Bar:
            def baz(self):
                pass
  2. Run :Vista ctags

Expected behavior
Vista's sidebar should open

Actual behavior
A blank sidebar and this error message:

Error detected while processing function <SNR>293_on_exit[6]..<SNR>293_ApplyExtracted[14]..vista#viewer#Display[1]..<SNR>299_Render[2]..vista#renderer#default#Render[5]..<SNR>301_Render[18]..<SNR>301_DescendantsOf:
line    8:
E735: Can only compare Dictionary with Dictionary
Error detected while processing function <SNR>293_on_exit[6]..<SNR>293_ApplyExtracted[14]..vista#viewer#Display[1]..vista#sidebar#OpenOrUpdate[24]..vista#util#SetBufline[3]..<SNR>295_PrependFpath:
line    8:
E745: Using a List as a Number
Error detected while processing function <SNR>293_on_exit[6]..<SNR>293_ApplyExtracted[14]..vista#viewer#Display[1]..vista#sidebar#OpenOrUpdate[24]..vista#util#SetBufline[3]..<SNR>295_PrependFpath:
line    8:
E15: Invalid expression: [fpath, ''] + a:lines

Screenshot or gif (if possible)
image

E121: Undefined variable: kind when run :Vista

Describe the bug
I recently updated the plugin and when vim loads the sidebar automatically, it gives me the following error messages:

Error detected while processing function <SNR>182_on_exit[4]..<SNR>182_ExtractLinewise[5]..vista#parser#ctags#FromExtendedRaw[12]..<SNR>196_ParseTagfield:
line    9:
E121: Undefined variable: kind
Press ENTER or type command to continue
Error detected while processing function <SNR>182_on_exit[4]..<SNR>182_ExtractLinewise[5]..vista#parser#ctags#FromExtendedRaw[12]..<SNR>196_ParseTagfield:
line    9:
E116: Invalid arguments for function index
Press ENTER or type command to continue
Error detected while processing function <SNR>182_on_exit[4]..<SNR>182_ExtractLinewise[5]..vista#parser#ctags#FromExtendedRaw[12]..<SNR>196_ParseTagfield:
line    9:
E15: Invalid expression: index(t:vista.kinds, kind) == -1

Environment:

  • OS: Linux Mint 19
  • Vim/Neovim version: NVIM v0.4.0-386-gced980ff1
  • This plugin version: c20cb84833e9e8fa730f98f92303f724e0a007d

Minimal vimrc to reproduce

call plug#begin('~/.vim/plugged')
Plug 'liuchengxu/vista.vim'
call plug#end()

Steps to reproduce given the above minimal vimrc

  1. Install the plugin using vimplug
  2. Open a file with vim
  3. Run :Vista

Expected behavior
It shouldn't give the error messages as it was fine before the last update.

Actual behavior
Display error messages.

Screenshot or gif (if possible)
See the error messages above.

Sort symbols

Hi, is it possible to sort the symbols alphabetically? Currently they appear according to the order they were declared, but it could be useful to be able to sort them.

Undefined Variable: tagfield

Describe the bug
Vista spams undefined variable tagfield when in certain files. Specifically, I've been able to replicate the problem in the source code of some vim plugins. I have isolated the problem to this line. I could be missing something, but as far as I can tell, tagfield will always be undefined in that line. Changing tagfield to a:tagfields[0], which I think is the intention, completely removes the problem. I can make a PR if that would be helpful.

Environment:

  • OS: Ubuntu 18.10
  • Vim/Neovim version: NVIM v0.4.0-dev, Build type: RelWithDebInfo
  • This plugin version: 3da62ec
  • It may be relevant that I am using coc.nvim with coc-neco

Vista info

Current FileType: vim
Avaliable Executives: ['coc', 'ctags']
Global Variables:
let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
let g:vista_fzf_preview = ['right:50%']

Steps to reproduce given the above info
I think this bug is pretty straight forward, but if a minimal init.vim/vimrc which reproduces the problem would be helpful let me know.

cursor jumps to wrong buffer when after buffer is open

Describe the bug
cursor jumps to wrong buffer when after buffer is open

Steps to reproduce

  1. open a source code and open Vista.
  2. open help
  3. move to vista window and
  4. select anything for cursor to jump onto source code

Expected behavior
the cursor should be on the right buffer and the right line.

Actual behavior
but the cursor is at another buffer (help buffer in this case)

Screenshot or gif (if possible)
Screen Shot 2019-04-01 at 4 08 51 AM

Vista generates tags of left buffer, but jumps to help buffer

Environment:

  • OS: Mac OS, 10.14.2
  • Vim/Neovim version: nvim 0.3.4
  • This plugin version: e121c68

let g:vista_sidebar_position = 'vertical topleft' does not work correctly

Describe the bug
With let g:vista_sidebar_position = 'vertical topleft', vista window should always open on the left side. However it only opens on the left side for the first time.

Environment:

  • OS: macOS 10.14.4
  • Vim/Neovim version: NVIM v0.4.0-dev
  • This plugin version: 3797c49

Vista info

Steps to reproduce given the above info

  1. Open vista window
  2. Use q to quit vista window
  3. Use :Vista or :Vista!! to open vista window again
  4. See if the vista window is open on the left

Expected behavior
The vista window should always open on the left.

Actual behavior
The vista window is open on the left only for the first time.

Screenshot or gif (if possible)

vista

E46 pops up when hovering symbol types

Describe the bug
I get the following error whenever cursor is hovering symbol types (e.g. Method, Function, Field, Variable, Class):

Error detected while processing function vista#cursor#ShowDetail:
line   11:
E46: Cannot change read-only variable "count"

Steps to reproduce

  1. Open a source file that works under LSP
  2. Call :Vista
  3. Move cursor over symbol types

Expected behavior
Error shouldn't happen.

Actual behavior
The following error pops up:

Error detected while processing function vista#cursor#ShowDetail:
line   11:
E46: Cannot change read-only variable "count"

Screenshot or gif
I hovered ▸ Method:
image

Environment:

  • OS: Debian 9.7 (Stretch)
  • Vim/Neovim version:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Mar  6 2019 09:15:43)
Included patches: 1-996
  • This plugin version: a5d77a5b061fc22030cfb3700eaed99ed19abe40

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.