ojroques / nvim-lspfuzzy

A Neovim plugin to make the LSP client use FZF
BSD 2-Clause "Simplified" License
316 stars 11 forks source link

Adding option to set layout #13

Closed adisen99 closed 3 years ago

adisen99 commented 3 years ago

The option to set fzf_layout is missing. Unable to use fzf_layout = { 'down' : '30%' } to get the fzf window down rather than in the middle.

Is it there and I am missing something?

If not, please add that support.

My configuration is -

-- Lsp fuzzy seach setup

local g = vim.g
local map = vim.api.nvim_set_keymap

require('lspfuzzy').setup {
  methods = 'all',         -- either 'all' or a list of LSP methods (see below)
  fzf_layout = 'down:30%',
  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
}

map('n', '<A-g>', ':GFiles<cr>', {})
map('n', '<A-p>', ':Files<cr>', {})

I have added the option for layout as down but still the window is coming as floating window in the center.

ojroques commented 3 years ago

Hello !

As mentioned in the README.md, the plugin will respect your FZF config. So just put let g:fzf_layout = {'down': '30%'} in your .vimrc or g['fzf_layout'] = {down = '30%'} in Lua and you should be good.

For the fzf_action and fzf_preview options the plugin does not use the default values from FZF ,that's why they can be configured. Otherwise the plugin will follow either your own FZF settings or the FZF defaults.

Feel free to re-open this if you have further issues.