summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgs/custom-neovim/config/lua/colorscheme.lua16
-rw-r--r--pkgs/custom-neovim/config/lua/mappings.lua1
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/alpha.lua9
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/lspconfig.lua4
-rw-r--r--pkgs/custom-neovim/default.nix98
-rw-r--r--pkgs/custom-neovim/flake.lock6
6 files changed, 82 insertions, 52 deletions
diff --git a/pkgs/custom-neovim/config/lua/colorscheme.lua b/pkgs/custom-neovim/config/lua/colorscheme.lua
new file mode 100644
index 0000000..59cb970
--- /dev/null
+++ b/pkgs/custom-neovim/config/lua/colorscheme.lua
@@ -0,0 +1,16 @@
+-- Set colorscheme.
+vim.cmd.colorscheme("oxocarbon")
+
+-- Set boolean to use patches.
+local correct_borderless_windows = true
+
+-- Patches.
+local link_highlight = function(first_highlight, second_highlight)
+ vim.cmd.highlight {bang = true, "link", first_highlight, second_highlight}
+end
+
+if correct_borderless_windows then
+ link_highlight("TelescopeBorder", "Comment")
+ link_highlight("TelescopeResultsTitle", "Comment")
+ link_highlight("TelescopePreviewTitle", "Comment")
+end
diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua
index 1ffbadb..15a28e5 100644
--- a/pkgs/custom-neovim/config/lua/mappings.lua
+++ b/pkgs/custom-neovim/config/lua/mappings.lua
@@ -27,3 +27,4 @@ vim.keymap.set("c", "<cr>", function()
if vim.fn.pumvisible() == 1 then return '<c-y>' end
return '<cr>'
end, { expr = true }) -- Make enter complete command.
+mapkey("n", "<esc>", "Clear highlights", ":noh<cr>") -- Make esc clear highlights
diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua
index 6599bdb..e0fa7e9 100644
--- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua
@@ -6,10 +6,11 @@ dashboard.section.header.val = art.misc.hydra
-- Set menu
dashboard.section.buttons.val = {
- dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files<CR>"),
- dashboard.button( "r", " > Find recent file", ":Telescope oldfiles<CR>"),
- dashboard.button( "s", " > Load session", ":Telescope persisted<cr>"),
- dashboard.button( "q", " > Quit", ":qa<CR>"),
+ dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files<CR>" ),
+ dashboard.button( "r", " > Find recent file", ":Telescope oldfiles<CR>" ),
+ dashboard.button( "s", " > Load session", ":Telescope persisted<cr>" ),
+ dashboard.button( "l", " > Load last session", ":SessionLoadLast<cr>" ),
+ dashboard.button( "q", " > Quit", ":qa<CR>" ),
}
-- Send config to alpha
diff --git a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua
index 98b34f2..445caee 100644
--- a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua
@@ -38,8 +38,8 @@ vim.api.nvim_create_autocmd('LspAttach', {
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end)
keymap('n', '<space>r', "Rename Symbol", vim.lsp.buf.rename)
- keymap("n", "<leader>s", "Open symbol picker", [[:Pick lsp scope="document_symbol"<cr>]])
- keymap("n", "<leader>S", "Open workspace symbol picker", [[:Pick lsp scope="workspace_symbol"<cr>]])
+ keymap("n", "<leader>s", "Open symbol picker", ":Telescope lsp_document_symbols<cr>")
+ keymap("n", "<leader>S", "Open workspace symbol picker", ":Telescope lsp_workspace_symbols<cr>")
-- LSP Pickers
keymap({'n', 'v'}, "<leader>a", "Perform code action", require("actions-preview").code_actions)
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 423fdf9..820aba1 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -1,53 +1,65 @@
{
pkgs,
inputs,
-}:
-inputs.mnw.lib.wrap pkgs {
- neovim = pkgs.neovim-unwrapped;
-
- plugins = with pkgs.vimPlugins; {
- dev.config = {
- pure = ./config;
+}: let
+ plenary-nvim-git = pkgs.vimPlugins.plenary-nvim.overrideAttrs (old: {
+ version = "git";
+ src = pkgs.fetchFromGitHub {
+ owner = "emmanueltouzery";
+ repo = "plenary.nvim";
+ rev = "7750bc895a1f06aa7a940f5aea43671a74143be0";
+ sha256 = "sha256-9Un7ekhBxcnmFE1xjCCFTZ7eqIbmXvQexpnhduAg4M0=";
};
- start = [
- # Core Plugins
- mini-nvim # Ton of small modules.
- nvim-lspconfig # Adds lsp presets.
- actions-preview-nvim # Adds a selector for LSP actions.
- nvim-treesitter.withAllGrammars # All treesitter grammars.
- tabby-nvim # Tab bar.
- lualine-nvim # Status line.
- telescope-nvim # Picker.
- plenary-nvim # General Library.
- alpha-nvim # Dashboard.
- persisted-nvim # Session manager.
+ }); # go back to regular plenary when this commit is merged: https://github.com/nvim-lua/plenary.nvim/pull/649
+in
+ inputs.mnw.lib.wrap pkgs {
+ neovim = pkgs.neovim-unwrapped;
- # Colorschemes
- oxocarbon-nvim # IBM Carbon themes.
- rose-pine # Rose Pine themes.
- kanagawa-nvim # Kanagawa themes.
- everforest # Green themes.
- nordic-nvim # Warm dark nordic theme.
+ plugins = with pkgs.vimPlugins; {
+ dev.config = {
+ pure = ./config;
+ };
+ start = [
+ # Core Plugins
+ mini-nvim # Ton of small modules.
+ nvim-lspconfig # Adds lsp presets.
+ actions-preview-nvim # Adds a selector for LSP actions.
+ nvim-treesitter.withAllGrammars # All treesitter grammars.
+ tabby-nvim # Tab bar.
+ lualine-nvim # Status line.
+ telescope-nvim # Picker.
+ # plenary-nvim # General Library.
+ plenary-nvim-git
+ alpha-nvim # Dashboard.
+ persisted-nvim # Session manager.
- # Miscellaneous Plugins
- presence-nvim # Discord RPC for nvim.
- cellular-automaton-nvim # Fun useless plugin.
- ];
- opt = [];
- };
+ # Colorschemes
+ oxocarbon-nvim # IBM Carbon themes.
+ rose-pine # Rose Pine themes.
+ kanagawa-nvim # Kanagawa themes.
+ everforest # Green themes.
+ nordic-nvim # Warm dark nordic theme.
- luaFiles = [./config/init.lua];
+ # Miscellaneous Plugins
+ presence-nvim # Discord RPC for nvim.
+ cellular-automaton-nvim # Fun useless plugin.
+ ];
+ opt = [];
+ };
- extraBinPath = with pkgs; [
- # LSP Servers
- lua-language-server # Lua LS
- nixd # Nix LS
- marksman # Markdown LS
+ luaFiles = [./config/init.lua];
- # Formatters
- alejandra # Nix Formatter
+ extraBinPath = with pkgs; [
+ # LSP Servers
+ lua-language-server # Lua LS
+ nixd # Nix LS
+ marksman # Markdown LS
- # Extra Tools
- ripgrep
- ];
-}
+ # Formatters
+ alejandra # Nix Formatter
+
+ # Extra Tools
+ ripgrep
+ fd
+ ];
+ }
diff --git a/pkgs/custom-neovim/flake.lock b/pkgs/custom-neovim/flake.lock
index 73396ff..2750e17 100644
--- a/pkgs/custom-neovim/flake.lock
+++ b/pkgs/custom-neovim/flake.lock
@@ -37,11 +37,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1749401433,
- "narHash": "sha256-HXIQzULIG/MEUW2Q/Ss47oE3QrjxvpUX7gUl4Xp6lnc=",
+ "lastModified": 1751949589,
+ "narHash": "sha256-mgFxAPLWw0Kq+C8P3dRrZrOYEQXOtKuYVlo9xvPntt8=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "08fcb0dcb59df0344652b38ea6326a2d8271baff",
+ "rev": "9b008d60392981ad674e04016d25619281550a9d",
"type": "github"
},
"original": {