From 446e93f23f15ff494e711d1cd5d00d8c218cffa4 Mon Sep 17 00:00:00 2001 From: Johannes Rothe Date: Sat, 21 Dec 2024 15:08:54 +0100 Subject: [PATCH] Add telescope nvim plugin --- home/terminal/default.nix | 1 + home/terminal/nixvim/default.nix | 19 ++++++++++--------- home/terminal/nixvim/telescope.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 home/terminal/nixvim/telescope.nix diff --git a/home/terminal/default.nix b/home/terminal/default.nix index 624b382..711dbe1 100644 --- a/home/terminal/default.nix +++ b/home/terminal/default.nix @@ -26,6 +26,7 @@ python311 python311Packages.flake8 python311Packages.ipython + ripgrep rusti-cal roboto-mono silver-searcher diff --git a/home/terminal/nixvim/default.nix b/home/terminal/nixvim/default.nix index 59f25c5..80ee5c9 100644 --- a/home/terminal/nixvim/default.nix +++ b/home/terminal/nixvim/default.nix @@ -6,14 +6,20 @@ # Autocomplete # Missing plugins # Telescope and fuzzy finder - # Ruff linter for python and black + # Ruff linter for python and black formatting on save + # Language support for python, go, tofu, terraform, yaml # Format on exit + # Trailing spaces in statusline # Good example: https://github.com/fred-drake/neovim/blob/master/config/python/language.nix + imports = [ + ./telescope.nix + ]; + programs.nixvim = { colorscheme = "sonokai"; enable = true; - extraPlugins = [ + extraPlugins = [ pkgs.vimPlugins.indentLine pkgs.vimPlugins.polyglot pkgs.vimPlugins.sonokai @@ -23,12 +29,7 @@ sonokai_style = "atlantis"; sonokai_disable_italic_comment = 1; }; - keymaps = [ - { - key = "t"; - action = "Neotree toggle"; - } - ]; + keymaps = []; opts = { colorcolumn = "88"; cursorline = true; @@ -67,7 +68,7 @@ }; }; lualine.enable = true; - neo-tree.enable = true; + treesitter.enable = true; web-devicons.enable = true; }; }; diff --git a/home/terminal/nixvim/telescope.nix b/home/terminal/nixvim/telescope.nix new file mode 100644 index 0000000..f10d35f --- /dev/null +++ b/home/terminal/nixvim/telescope.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ...}: +{ + programs.nixvim = { + plugins.telescope = { + enable = true; + extensions = { + file-browser.enable = true; + frecency.enable = true; + fzf-native.enable = true; + }; + keymaps = { + # https://github.com/nvim-telescope/telescope.nvim?tab=readme-ov-file#pickers + # File pickers + "t" = "file_browser"; + "ff" = "find_files"; + "fg" = "live_grep"; + # Vim pickers + "r" = "command_history"; + "fo" = "oldfiles"; + "fs" = "spell_suggest"; + # Treesitter pickers + "ft" = "treesitter"; + # Git pickers + "fgs" = "git_status"; + # lsp + }; + }; + }; +}