From 7fec5f870af12d9b0319700a27ee0e96866fc349 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 7 Mar 2022 13:05:28 +0100 Subject: [PATCH] home: vim: replace 'fzf' with 'telescope' I like the fact that it uses built-in buffers to preview files. It also has more inertia behind it, tighter integrations in the ecosystem. --- home/vim/after/plugin/mappings/fzf.vim | 13 ------------- home/vim/after/plugin/mappings/telescope.vim | 16 ++++++++++++++++ home/vim/default.nix | 5 ++--- home/vim/plugin/settings/fzf.vim | 8 -------- 4 files changed, 18 insertions(+), 24 deletions(-) delete mode 100644 home/vim/after/plugin/mappings/fzf.vim create mode 100644 home/vim/after/plugin/mappings/telescope.vim delete mode 100644 home/vim/plugin/settings/fzf.vim diff --git a/home/vim/after/plugin/mappings/fzf.vim b/home/vim/after/plugin/mappings/fzf.vim deleted file mode 100644 index fa98f0c..0000000 --- a/home/vim/after/plugin/mappings/fzf.vim +++ /dev/null @@ -1,13 +0,0 @@ -lua << EOF -local wk = require("which-key") - -local keys = { - f = { - name = "Fuzzy finder", - b = { "Buffers", "Open buffers" }, - f = { "GFiles", "Git tracked files" }, - }, -} - -wk.register(keys, { prefix = "" }) -EOF diff --git a/home/vim/after/plugin/mappings/telescope.vim b/home/vim/after/plugin/mappings/telescope.vim new file mode 100644 index 0000000..36fdd16 --- /dev/null +++ b/home/vim/after/plugin/mappings/telescope.vim @@ -0,0 +1,16 @@ +lua << EOF +local wk = require("which-key") +local telescope_builtin = require("telescope.builtin") + +local keys = { + f = { + name = "Fuzzy finder", + b = { telescope_builtin.buffers, "Open buffers" }, + f = { telescope_builtin.git_files, "Git tracked files" }, + F = { telescope_builtin.find_files, "Files" }, + }, +} + +wk.register(keys, { prefix = "" }) +EOF + diff --git a/home/vim/default.nix b/home/vim/default.nix index 9051027..b2bba15 100644 --- a/home/vim/default.nix +++ b/home/vim/default.nix @@ -59,8 +59,6 @@ in vim-qf # Better quick-fix list # Other wrappers - fzfWrapper # The vim plugin inside the 'fzf' package - fzf-vim # Fuzzy commands git-messenger-vim # A simple blame window # LSP and linting @@ -68,7 +66,7 @@ in null-ls-nvim # LSP integration for linters and formatters (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) # Better highlighting nvim-treesitter-textobjects # More textobjects - plenary-nvim # 'null-ls' dependency + plenary-nvim # 'null-ls', 'telescope' dependency # Completion nvim-cmp # Completion engine @@ -80,6 +78,7 @@ in # UX improvements gitsigns-nvim # Fast git UI integration which-key-nvim # Show available mappings + telescope-nvim # Fuzzy finder interface ]; extraConfig = builtins.readFile ./init.vim; diff --git a/home/vim/plugin/settings/fzf.vim b/home/vim/plugin/settings/fzf.vim deleted file mode 100644 index 7125b70..0000000 --- a/home/vim/plugin/settings/fzf.vim +++ /dev/null @@ -1,8 +0,0 @@ -" Use a floating window when availble -if has('nvim-0.4.0') || has("patch-8.2.0191") - let g:fzf_layout = { 'window': { - \ 'width': 0.9, - \ 'height': 0.7, - \ 'highlight': 'Comment', - \ 'rounded': v:false } } -endif