From feab953d6ae6410d28db4e347aafde154ce0beba Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sun, 29 Dec 2024 00:00:36 +0100 Subject: [PATCH] nvim: adjust fzf-lua layouts --- home/config/nvim/nifoc/keymap.fnl | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/home/config/nvim/nifoc/keymap.fnl b/home/config/nvim/nifoc/keymap.fnl index 99eb173..15858b6 100644 --- a/home/config/nvim/nifoc/keymap.fnl +++ b/home/config/nvim/nifoc/keymap.fnl @@ -9,6 +9,9 @@ fzf-layout-dropdown {:winopts {:height 0.4 :width 0.6 :preview {:hidden :hidden}}} + fzf-layout-big-dropdown {:winopts {:height 0.6 + :width 0.7 + :preview {:layout :vertical}}} (ok-npairs npairs) (pcall require :nvim-autopairs) (ok-hover hover) (pcall require :hover) (ok-gitsigns gitsigns) (pcall require :gitsigns) @@ -21,7 +24,8 @@ (keymap.set :n : : {:noremap true}) ;; Leader Mappings (when ok-fzf - (keymap.set :n :o fzf.files {:desc "Find Files"}) + (keymap.set :n :o #(fzf.files fzf-layout-bottom) + {:desc "Find Files"}) (keymap.set :n :s #(fzf.live_grep fzf-layout-bottom) {:desc "Live Grep"})) (keymap.set :n :fn :enew {:desc "New File"}) @@ -29,9 +33,12 @@ (keymap.set :n :c repl.open-shell {:desc "Open Shell"}) (keymap.set :n :r repl.open-repl {:desc "Open REPL"}) (when ok-fzf - (keymap.set :n :bl fzf.buffers {:desc "List Buffers"}) - (keymap.set :n :bf fzf.grep_curbuf {:desc "Find In Buffer"}) - (keymap.set :n :bt fzf.treesitter {:desc "Find via Treesitter"})) + (keymap.set :n :bl #(fzf.buffers fzf-layout-big-dropdown) + {:desc "List Buffers"}) + (keymap.set :n :bf #(fzf.grep_curbuf fzf-layout-big-dropdown) + {:desc "Find In Buffer"}) + (keymap.set :n :bt #(fzf.treesitter fzf-layout-big-dropdown) + {:desc "Find via Treesitter"})) (when ok-neogit (keymap.set :n :g #(neogit.open {:kind :split}) {:desc "Open Neogit"}) @@ -110,20 +117,23 @@ (keymap.set :n :t #(fzf.lsp_document_symbols fzf-layout-dropdown) {:buffer bufnr :desc "LSP Document Symbols"}) (keymap.set :n :tw - #(fzf.lsp_workspace_symbols fzf-layout-dropdown) + #(fzf.lsp_workspace_symbols fzf-layout-big-dropdown) {:buffer bufnr :desc "LSP Workspace Symbols"})) (keymap.set :n :th #(vim.lsp.inlay_hint.enable (not (vim.lsp.inlay_hint.is_enabled bufnr)) {: bufnr}) {:buffer bufnr :desc "Toggle Inlay Hints"}) (when ok-fzf - (keymap.set :n :lca fzf.lsp_code_actions + (keymap.set :n :lca + #(fzf.lsp_code_actions fzf-layout-big-dropdown) {:buffer bufnr :desc "LSP Code Action"}) - (keymap.set :n :lfr fzf.lsp_references + (keymap.set :n :lfr #(fzf.lsp_references fzf-layout-big-dropdown) {:buffer bufnr :desc "Find References"}) - (keymap.set :n :lfd fzf.lsp_definitions + (keymap.set :n :lfd + #(fzf.lsp_definitions fzf-layout-big-dropdown) {:buffer bufnr :desc "Find Definitions"}) - (keymap.set :n :lfi fzf.lsp_implementations + (keymap.set :n :lfi + #(fzf.lsp_implementations fzf-layout-big-dropdown) {:buffer bufnr :desc "Find Implementations"}))) (fn mod.terminal-open [bufnr]