diff --git a/nvim/catppuccin.lua b/nvim/catppuccin.lua new file mode 100644 index 0000000..3ebe647 --- /dev/null +++ b/nvim/catppuccin.lua @@ -0,0 +1,16 @@ +require("catppuccin").setup({ + compile_path = vim.env.out .. "/lua/colors", + integrations = { + telescope = { + enabled = true, + style = "nvchad" + }, + blink_cmp = true, + harpoon = true, + nvim_surround = true, + which_key = true, + navic = true, + leap = true, + noice = true, + }, +}) diff --git a/nvim/default.nix b/nvim/default.nix index d898d33..a67b5f0 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -24,61 +24,90 @@ in config = ./.; - plugins = with pkgs.vimPlugins; { - start = [ - (mkPlugin lz-nvim "lz-n") - # TODO: use catppuccin's compile feature. see: https://github.com/stasjok/dotfiles/blob/36037f523185ba1409dd953999fda0f0db0dbd4f/nvim/default.nix#L136C8-L148C12 - catppuccin-nvim - nvim-treesitter.withAllGrammars - nvim-treesitter-textobjects - vim-illuminate - nvim-lspconfig - oil-nvim - nvim-surround - telescope-fzf-native-nvim - vim-sleuth - auto-save-nvim + plugins = let + catppuccin-nvim = let + neovim = pkgs.neovim.override { + configure.packages.catppuccin-nvim.start = [pkgs.vimPlugins.catppuccin-nvim]; + }; + in + pkgs.runCommand "catppuccin-nvim" {} '' + mkdir -p $out + cp -r --no-preserve=mode,ownership ${pkgs.vimPlugins.catppuccin-nvim}/* $out + rm -rf $out/doc $out/colors/* - gitsigns-nvim - git-conflict-nvim + ${neovim}/bin/nvim -l ${./catppuccin.lua} + rm $out/lua/colors/cached + cd $out/lua/colors + for flavor in *; do + mv "$out/lua/colors/$flavor" "catppuccin-$flavor.lua" + cat <<-eof > $out/colors/catppuccin-''${flavor}.lua + if vim.g.colors_name == "catppuccin-$flavor" and vim.o.background ~= (vim.g.colors_name == "catppuccin-latte" and "light" or "dark") then + dofile("$out/lua/colors/catppuccin-" .. (vim.o.background == "light" and "latte" or "mocha") .. ".lua") + else + dofile("$out/lua/colors/catppuccin-$flavor.lua") + end + eof + done - mini-icons - mini-operators - mini-splitjoin - vim-wordmotion - increment-activator + cat <<-eof > $out/colors/catppuccin.lua + dofile("$out/lua/colors/catppuccin-" .. (vim.o.background == "light" and "latte" or "mocha") .. ".lua") + eof + ''; + in + with pkgs.vimPlugins; { + start = [ + (mkPlugin lz-nvim "lz-n") + catppuccin-nvim + nvim-treesitter.withAllGrammars + nvim-treesitter-textobjects + vim-illuminate + nvim-lspconfig + oil-nvim + nvim-surround + telescope-fzf-native-nvim + vim-sleuth + auto-save-nvim - leap-nvim - flit-nvim + gitsigns-nvim + git-conflict-nvim - noice-nvim - statuscol-nvim + mini-icons + mini-operators + mini-splitjoin + vim-wordmotion + increment-activator - which-key-nvim - nvim-colorizer-lua - nvim-pqf - lualine-nvim - nvim-navic - virt-column-nvim - indent-blankline-nvim + leap-nvim + flit-nvim - SchemaStore-nvim - blink-cmp - ts-comments-nvim - undotree - nvim-lint - (conform-nvim.overrideAttrs { - # clashes with oil - postPatch = "rm doc/recipes.md"; - }) - vim-helm - (mkPlugin vim-lumen "vim-lumen") - ]; - opt = [ - telescope-nvim - harpoon2 - ]; - }; + noice-nvim + statuscol-nvim + + which-key-nvim + nvim-colorizer-lua + nvim-pqf + lualine-nvim + nvim-navic + virt-column-nvim + indent-blankline-nvim + + SchemaStore-nvim + blink-cmp + ts-comments-nvim + undotree + nvim-lint + (conform-nvim.overrideAttrs { + # clashes with oil + postPatch = "rm doc/recipes.md"; + }) + vim-helm + (mkPlugin vim-lumen "vim-lumen") + ]; + opt = [ + telescope-nvim + harpoon2 + ]; + }; extraPackages = with pkgs; [ # telescope helpers diff --git a/nvim/lua/plugins/theme.lua b/nvim/lua/plugins/theme.lua deleted file mode 100644 index 60d2811..0000000 --- a/nvim/lua/plugins/theme.lua +++ /dev/null @@ -1,75 +0,0 @@ -return { - { - "catppuccin-nvim", - colorscheme = "catppuccin", - lazy = false, - priority = 1000, - load = function() end, - opt = { - integrations = { - telescope = { - enabled = true, - style = "nvchad" - }, - blink_cmp = true, - harpoon = true, - nvim_surround = true, - which_key = true, - navic = true, - leap = true, - - fidget = false, - noice = false, - }, - }, - after = function(plug) - require("catppuccin").setup(plug.opt) - vim.cmd.colorscheme("catppuccin") - end, - }, - - { - "virt-column.nvim", - lazy = false, - load = function() end, - opts = { - char = "▕", - }, - after = function(plug) - require("virt-column").setup(plug.opts) - end, - }, - - { - "indent-blankline.nvim", - lazy = false, - load = function() end, - event = { "BufReadPost", "BufWritePost", "BufNewFile" }, - opts = { - indent = { - char = "▏", - tab_char = "▏", - }, - exclude = { - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "lazy", - "lspinfo", - "packer", - "checkhealth", - "help", - "man", - "", - } - }, - scope = { show_start = false, show_end = false, }, - }, - after = function(plug) - require("ibl").setup(plug.opts) - end, - }, -} diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua index 9f4b5d2..d2e6c7c 100644 --- a/nvim/lua/plugins/ui.lua +++ b/nvim/lua/plugins/ui.lua @@ -58,4 +58,49 @@ return { require("pqf").setup() end, }, + + { + "virt-column.nvim", + lazy = false, + load = function() end, + opts = { + char = "▕", + }, + after = function(plug) + require("virt-column").setup(plug.opts) + end, + }, + + { + "indent-blankline.nvim", + lazy = false, + load = function() end, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = { + indent = { + char = "▏", + tab_char = "▏", + }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "lazy", + "lspinfo", + "packer", + "checkhealth", + "help", + "man", + "", + } + }, + scope = { show_start = false, show_end = false, }, + }, + after = function(plug) + require("ibl").setup(plug.opts) + end, + }, } diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index db59142..2e04703 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -37,6 +37,8 @@ vim.opt.listchars = { precedes = "◢", nbsp = "○", } +vim.opt.completeopt = { "menuone", "popup", "noinsert", "fuzzy" } +vim.opt.pumheight = 15 -- for all modes except terminal vim.keymap.set({ "i", "n", "o", "x", "v", "s", "l", "c" }, "", "") @@ -101,4 +103,6 @@ vim.api.nvim_create_autocmd("TextYankPost", { end, }) +vim.cmd.colorscheme("catppuccin") + require("./lsp")