From d9fdab315cd452a0060d995cbb312a9774389704 Mon Sep 17 00:00:00 2001 From: biscuit Date: Tue, 27 May 2025 17:36:09 -0500 Subject: [PATCH] test --- pkgs/neovim/custom/telescope.nix | 39 ++++++ pkgs/neovim/default.nix | 197 +++---------------------------- 2 files changed, 53 insertions(+), 183 deletions(-) create mode 100644 pkgs/neovim/custom/telescope.nix diff --git a/pkgs/neovim/custom/telescope.nix b/pkgs/neovim/custom/telescope.nix new file mode 100644 index 0000000..184cb1c --- /dev/null +++ b/pkgs/neovim/custom/telescope.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + pkgs, + ... +}: { + plugins.telescope = { + enable = true; + extensions = { + fzf-native = { + enable = true; + }; + }; + settings = { + defaults = { + vimgrep_arguments = ["${pkgs.ripgrep}/bin/rg" "-L" "--color=never" "--no-heading" "--with-filename" "--line-number" "--column" "--smart-case" "--fixed-strings"]; + selection_caret = " "; + entry_prefix = " "; + layout_strategy = "flex"; + layout_config = { + horizontal = { + prompt_position = "top"; + }; + }; + sorting_strategy = "ascending"; + file_ignore_patterns = ["^.git/" "^.mypy_cache/" "^__pycache__/" "^output/" "^data/" "%.ipynb"]; + set_env.COLORTERM = "truecolor"; + }; + + pickers = { + colorscheme = { + enable_preview = true; + }; + }; + }; + }; + + extraPackages = with pkgs; [ripgrep]; +} diff --git a/pkgs/neovim/default.nix b/pkgs/neovim/default.nix index 709c2cf..af72f5e 100644 --- a/pkgs/neovim/default.nix +++ b/pkgs/neovim/default.nix @@ -11,196 +11,27 @@ sha256 = "sha256-Plo7edu9vXDDzZxyPu+traIAyHOouViU/nXNkDx+/N4="; }; in { + # home.packages = with pkgs; [ + # lazygit + # ripgrep + # ]; imports = [ inputs.nixvim.homeManagerModules.default ]; programs.neovim.enable = true; programs.nixvim = { - enable = true; - plugins = { - alpha = { - enable = true; - layout = [ - { - type = "padding"; - val = 2; - } - { - type = "text"; - val = [ - " █████ █ ██" - " ██████ ██ ████ █ █" - " ██ █ █ ██ ████ ██ ███" - " █ █ █ ██ █ █ ██ █" - " █ █ ██ █ ████ ██ ███" - " ██ ██ ██ █ ███ █ ███ █ ██ ███ ███ ███ ████ ████" - " ██ ██ ██ █ █ ███ █ ████ ██ ███ ███ ███ ████ ███ █" - " ██ ██ ██ █ █ ███ ██ ██ ██ ██ ██ ██ ████ ████" - " ██ ██ ██ █ ██ █████ ██ ██ ██ ██ ██ ██ ██" - " ██ ██ ██ █ ████████ ██ ██ ██ ██ ██ ██ ██ ██" - " █ ██ ███ ███████ ██ ██ ██ ██ ██ ██ ██ ██" - " █ ███ ██ ██ ██ ██ █ ██ ██ ██ ██" - " ████ ██ ████ █ ██████ ███████ ██ ██ ██ ██" - " █ █████ ███████ ████ █████ ███ █ ███ ███ ███" - " █ ██ █████ ███ ███ ███ ███" - " █" - " █" - " ██" - ]; - opts = { - position = "center"; - hl = "Type"; - }; - } - { - type = "padding"; - val = 4; - } - { - type = "group"; - val = [ - { - type = "button"; - val = "  New File "; - on_press.__raw = "function() vim.cmd[[ene]] end"; - opts = { - shortcut = "n"; - keymap = [ - "n" - "n" - "ene" - { - noremap = true; - silent = true; - nowait = true; - } - ]; - position = "center"; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - { - type = "padding"; - val = 2; - } - { - type = "button"; - val = "  Find File "; - opts = { - shortcut = "f"; - keymap = [ - "n" - "f" - "lua require('fzf-lua').files({ cwd = vim.loop.cwd() })" - { - noremap = true; - silent = true; - nowait = true; - } - ]; - position = "center"; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - { - type = "padding"; - val = 2; - } - { - type = "button"; - val = "  Recent Files "; - on_press.__raw = "function() require('telescope.builtin').oldfiles() end"; - opts = { - shortcut = "r"; - keymap = [ - "n" - "r" - "lua require('fzf-lua').oldfiles({ cwd = vim.loop.cwd() })" - { - noremap = true; - silent = true; - nowait = true; - } - ]; - position = "center"; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - { - type = "padding"; - val = 2; - } - { - type = "button"; - val = "  Find Text "; - on_press.__raw = "function() require('telescope.builtin').live_grep() end"; - opts = { - shortcut = "g"; - keymap = [ - "n" - "g" - "lua require('fzf-lua').live_grep()" - { - noremap = true; - silent = true; - nowait = true; - } - ]; - position = "center"; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - { - type = "padding"; - val = 2; - } - { - type = "button"; - val = "  Quit Neovim "; - on_press.__raw = "function() vim.cmd[[qa]] end"; - opts = { - shortcut = "q"; - keymap = [ - "n" - "q" - "qa" - { - noremap = true; - silent = true; - nowait = true; - } - ]; - position = "center"; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - ]; - } - ]; - }; - }; imports = [ # ./custom/dashboard.nix + ./custom/telescope.nix ]; + enable = true; + plugins = { + }; + # home.file.".config/nvim" = { + # # source = /home/biscuit/Nixos/packages/nvim/nvchad; + # source = nvimSource; + # recursive = true; + # force = true; + # }; }; - home.packages = with pkgs; [ - lazygit - ripgrep - ]; - # home.file.".config/nvim" = { - # # source = /home/biscuit/Nixos/packages/nvim/nvchad; - # source = nvimSource; - # recursive = true; - # force = true; - # }; }