From 906719cd3bd9e4258bfffb15aa334f5c7a3f37fa Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Fri, 1 Mar 2024 08:23:28 +0100 Subject: [PATCH] Update formating. --- home-manager/modules/nvim.nix | 119 ++++++++++++++++------------------ 1 file changed, 57 insertions(+), 62 deletions(-) diff --git a/home-manager/modules/nvim.nix b/home-manager/modules/nvim.nix index a2999d6..4b04b6b 100644 --- a/home-manager/modules/nvim.nix +++ b/home-manager/modules/nvim.nix @@ -1,8 +1,5 @@ -{ inputs, pkgs, ... }: -{ - imports = [ - inputs.nixvim.homeManagerModules.nixvim - ]; +{ inputs, pkgs, ... }: { + imports = [ inputs.nixvim.homeManagerModules.nixvim ]; # Nixvim programs.nixvim = { @@ -10,15 +7,11 @@ viAlias = true; vimAlias = true; - keymaps = [ - { - action = "Oil"; - key = "e"; - options = { - silent = true; - }; - } - ]; + keymaps = [{ + action = "Oil"; + key = "e"; + options = { silent = true; }; + }]; options = { hlsearch = false; @@ -47,21 +40,30 @@ splitright = true; }; - globals = { + globals = { mapleader = " "; maplocalleader = ";"; }; + extraConfigLuaPre = '' + vim.loader.enable() + ''; + extraConfigLuaPost = '' vim.notify = require("mini.notify").make_notify() - ''; + ''; plugins = { - harpoon = { + harpoon = { enable = true; keymaps = { addFile = "a"; toggleQuickMenu = ""; - navFile = { "1" = ""; "2" = ""; "3" = ""; "4" = ""; }; + navFile = { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + }; }; }; @@ -77,11 +79,11 @@ enable = true; signs = { add.text = "▎"; - change.text = "▎"; - changedelete.text = "▎"; - delete.text = "▎"; - topdelete.text = "▎"; - untracked.text = "▎"; + change.text = "▎"; + changedelete.text = "▎"; + delete.text = "▎"; + topdelete.text = "▎"; + untracked.text = "▎"; }; onAttach.function = '' function(buffer) @@ -95,32 +97,30 @@ map("n", "]g", gs.next_hunk, "Next git hunk") map("n", "[g", gs.prev_hunk, "Previous git hunk") end - ''; + ''; }; mini = { enable = true; - modules = { - statusline = { - set_vim_settings = false; - }; - comment = {}; - notify = {}; - }; + modules = { + statusline = { set_vim_settings = false; }; + comment = { }; + notify = { }; + }; }; - telescope = { + telescope = { enable = true; - extensions = { - fzf-native = { + extensions = { + fzf-native = { enable = true; fuzzy = true; overrideGenericSorter = true; overrideFileSorter = true; caseMode = "smart_case"; }; - ui-select.enable = true; - }; + ui-select.enable = true; + }; keymaps = { "pf" = "find_files"; "" = "git_files"; @@ -161,46 +161,43 @@ numhl = "", }) end - + sign_define({ name = "DiagnosticSignError", text = "E" }) sign_define({ name = "DiagnosticSignWarn", text = "W" }) sign_define({ name = "DiagnosticSignHint", text = "H" }) sign_define({ name = "DiagnosticSignInfo", text = "I" }) - ''; + ''; }; nvim-cmp = { enable = true; - autoEnableSources = true; - sources = [ - {name = "nvim_lsp";} - {name = "path";} - {name = "snippy";} - ]; + autoEnableSources = true; + sources = + [ { name = "nvim_lsp"; } { name = "path"; } { name = "snippy"; } ]; snippet.expand = "snippy"; - mapping = { + mapping = { "" = "cmp.mapping.confirm({ select = false })"; "" = { action = '' - function(fallback) - if cmp.visible then - cmp.select_next_item() - else - fallback() - end - end + function(fallback) + if cmp.visible then + cmp.select_next_item() + else + fallback() + end + end ''; modes = [ "i" "s" ]; }; "" = { action = '' - function(fallback) - if cmp.visible then - cmp.select_prev_item() - else - fallback() - end - end + function(fallback) + if cmp.visible then + cmp.select_prev_item() + else + fallback() + end + end ''; modes = [ "i" "s" ]; }; @@ -216,8 +213,6 @@ keywords = [ "bold" ]; }; }; - extraPlugins = with pkgs.vimPlugins; [ - vim-snippets - ]; + extraPlugins = with pkgs.vimPlugins; [ vim-snippets ]; }; }