All Projects → ojroques → Nvim Lspfuzzy

ojroques / Nvim Lspfuzzy

Licence: bsd-2-clause
A Neovim plugin to make the LSP client use FZF

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Nvim Lspfuzzy

fzf-checkout.vim
Manage branches and tags with fzf
Stars: ✭ 187 (+74.77%)
Mutual labels:  fzf, neovim-plugin
Fzf Mru.vim
Vim plugin that is using fzf.vim to display your most recently used files.
Stars: ✭ 79 (-26.17%)
Mutual labels:  fzf, neovim-plugin
fm-nvim
🗂 Neovim plugin that lets you use your favorite terminal file managers (and fuzzy finders) from within Neovim.
Stars: ✭ 114 (+6.54%)
Mutual labels:  fzf, neovim-plugin
Coc Fzf
fzf ❤️ coc.nvim
Stars: ✭ 261 (+143.93%)
Mutual labels:  fzf, neovim-plugin
Fzf.kak
FZF for Kakoune
Stars: ✭ 90 (-15.89%)
Mutual labels:  fzf
Dotfiles
Workstation configuration, provisioning and tools
Stars: ✭ 67 (-37.38%)
Mutual labels:  fzf
Dotfiles
My dotfiles 🚀. Includes configs for neovim, tmux, zsh, alacritty and more.
Stars: ✭ 47 (-56.07%)
Mutual labels:  fzf
Neovim Fuzzy
Fuzzy file finding for neovim
Stars: ✭ 103 (-3.74%)
Mutual labels:  neovim-plugin
Todoist.nvim
A todoist extension for neovim
Stars: ✭ 84 (-21.5%)
Mutual labels:  neovim-plugin
Notational Fzf Vim
Notational velocity for vim.
Stars: ✭ 975 (+811.21%)
Mutual labels:  fzf
Fzf Filemru
File MRU with fzf.vim
Stars: ✭ 76 (-28.97%)
Mutual labels:  fzf
Completor.vim
Async completion framework made ease.
Stars: ✭ 1,158 (+982.24%)
Mutual labels:  neovim-plugin
Sniprun
A neovim plugin to run lines/blocs of code (independently of the rest of the file), supporting multiples languages
Stars: ✭ 93 (-13.08%)
Mutual labels:  neovim-plugin
Nvim Hlslens
Hlsearch Lens for Neovim
Stars: ✭ 55 (-48.6%)
Mutual labels:  neovim-plugin
Iterfzf
Pythonic interface to fzf, a CLI fuzzy finder
Stars: ✭ 106 (-0.93%)
Mutual labels:  fzf
Fzf Fasd
🌸 fzf + fasd integration
Stars: ✭ 43 (-59.81%)
Mutual labels:  fzf
Asyncrun.vim
🚀 Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
Stars: ✭ 1,332 (+1144.86%)
Mutual labels:  neovim-plugin
Base16 Fzf
base16 colorschemes for fzf
Stars: ✭ 76 (-28.97%)
Mutual labels:  fzf
Wishlist
A public catalogue of Lua plugins Neovim users would like to see exist
Stars: ✭ 74 (-30.84%)
Mutual labels:  neovim-plugin
Toast.vim
🍞 Toast! A colorful, medium-contrast color scheme with full Vim and Neovim support and automatic light and dark variants. Easy to read without frying your retinae.
Stars: ✭ 108 (+0.93%)
Mutual labels:  neovim-plugin

nvim-lspfuzzy

This plugin makes the Neovim LSP client use FZF to display results and navigate the code.

It works by redefining LSP handlers so that they call FZF. Therefore you don't need to change any of your exising LSP mappings. It's also small (currently at ~230 SLOC) and written entirely in Lua.

The plugin is compatible only with Neovim 0.5+.

demo

Installation

With Packer

use {
  'ojroques/nvim-lspfuzzy',
  requires = {
    {'junegunn/fzf'},
    {'junegunn/fzf.vim'},  -- to enable preview (optional)
  },
}

With Plug

Plug 'junegunn/fzf', {'do': {-> fzf#install()}}
Plug 'junegunn/fzf.vim'  " to enable preview (optional)
Plug 'ojroques/nvim-lspfuzzy'

Usage

Simply add this line to your init.lua:

require('lspfuzzy').setup {}

If you're using a .vimrc or init.vim:

lua require('lspfuzzy').setup {}

In addition, the plugin creates the following commands:

  • :LspDiagnostics <bufnr>: list diagnostics from given buffer (use 0 for current buffer)
  • :LspDiagnosticsAll: list diagnostics from all buffers

By default the following FZF actions are available:

  • tab : select multiple entries
  • shift+tab : deselect an entry
  • ctrl-a : select all entries
  • ctrl-d : deselect all entries
  • ctrl-t : go to location in a new tab
  • ctrl-v : go to location in a vertical split
  • ctrl-x : go to location in a horizontal split

Configuration

You can pass options to the setup() function. Here are all available options with their default settings:

require('lspfuzzy').setup {
  methods = 'all',         -- either 'all' or a list of LSP methods (see below)
  fzf_preview = {          -- arguments to the FZF '--preview-window' option
    'right:+{2}-/2'          -- preview on the right and centered on entry
  },
  fzf_action = {           -- FZF actions
    ['ctrl-t'] = 'tabedit',  -- go to location in a new tab
    ['ctrl-v'] = 'vsplit',   -- go to location in a vertical split
    ['ctrl-x'] = 'split',    -- go to location in a horizontal split
  },
  fzf_modifier = ':~:.',   -- format FZF entries, see |filename-modifiers|
  fzf_trim = true,         -- trim FZF entries
}

The fzf_preview and fzf_action settings are determined as follows:

  1. Values passed to setup() are used first.
  2. Otherwise the plugin will try to load values from the respective FZF options g:fzf_preview_window and g:fzf_action if they are set.
  3. Finally the default values will be used.

For others FZF options such as g:fzf_layout or g:fzf_colors the plugin will respect your settings.

Supported LSP methods

You can enable FZF only for some LSP methods by passing them as a list to the methods option when calling setup(). The supported LSP methods are:

callHierarchy/incomingCalls
callHierarchy/outgoingCalls
textDocument/codeAction
textDocument/declaration
textDocument/definition
textDocument/documentSymbol
textDocument/implementation
textDocument/references
textDocument/typeDefinition
workspace/symbol

Troubleshooting

Preview does not work

You need to install fzf.vim to enable previews. If it's already installed, make sure it's up-to-date. The plugin checks that g:loaded_fzf_vim is set, which was introduced in this commit.

Preview does not scroll to the selected location

Try to append +{2}-/2 to either g:fzf_preview_window or to the fzf_preview option in setup() to make the preview respect line numbers. For instance:

vim.g.fzf_preview_window = {'down:+{2}-/2'}

Using the fzf_modifier option breaks the plugin

The plugin uses the filename embedded in the FZF entry selected by the user to jump to the correct location. Therefore it must resolve to a valid path. For instance :. or :p can be used but not :t.

License

LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].