From d0e01e9f73df8407965cb34134556b3e96b17c4f Mon Sep 17 00:00:00 2001 From: Vivian Date: Tue, 19 Mar 2024 17:26:28 +0100 Subject: [PATCH] even more nvim config --- common/hm-modules/nvim/dashboard.lua | 75 +++++++++++++++++++++++++++ common/hm-modules/nvim/default.nix | 32 ++++++++++++ hosts/thalassa/aoife/home/default.nix | 1 + 3 files changed, 108 insertions(+) create mode 100644 common/hm-modules/nvim/dashboard.lua diff --git a/common/hm-modules/nvim/dashboard.lua b/common/hm-modules/nvim/dashboard.lua new file mode 100644 index 0000000..3950113 --- /dev/null +++ b/common/hm-modules/nvim/dashboard.lua @@ -0,0 +1,75 @@ +local settings = { + -- every line should be same width without escaped \ + header = { + type = "text", + oldfiles_directory = false, + align = "center", + fold_section = false, + title = "Header", + margin = 5, + content = { + " ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗", + " ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║", + " ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║", + " ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║", + " ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝", + }, + highlight = "Statement", + default_color = "", + oldfiles_amount = 0, + }, + -- name which will be displayed and command + body = { + type = "mapping", + oldfiles_directory = false, + align = "center", + fold_section = false, + title = "Basic Commands", + margin = 5, + content = { + { " Find File", "Telescope find_files", "ff"}, + { "󰍉 Find Word ", "Telescope live_grep", "fg"}, + { " Recent Files", "Telescope oldfiles", "fo"}, + { " File Browser", "Telescope file_browser", "fs"}, + { " New File", "lua require'startup'.new_file()", "nf"}, + }, + highlight = "String", + default_color = "", + oldfiles_amount = 0, + }, + footer = { + type = "text", + oldfiles_directory = false, + align = "center", + fold_section = false, + title = "Footer", + margin = 5, + content = { "bottom text" }, + highlight = "Number", + default_color = "", + oldfiles_amount = 0, + }, + + options = { + mapping_keys = true, + cursor_column = 0.5, + empty_lines_between_mappings = true, + disable_statuslines = true, + paddings = { 1, 3, 3, 0 }, + }, + mappings = { + execute_command = "", + open_file = "o", + open_file_split = "", + open_section = "", + open_help = "?", + }, + colors = { + background = "#1f2227", + folded_section = "#56b6c2", + }, + parts = { "header", "body", "footer" }, +} +return settings + diff --git a/common/hm-modules/nvim/default.nix b/common/hm-modules/nvim/default.nix index bf08e9f..c517497 100644 --- a/common/hm-modules/nvim/default.nix +++ b/common/hm-modules/nvim/default.nix @@ -4,6 +4,9 @@ in with lib; { options.programs.v.nvim = { enable = mkEnableOption "nvim"; }; config = mkIf cfg.enable { home.packages = with pkgs; [ fd ]; + home.file.".config/nvim/lua/startup/themes/my_theme.lua" = { + source = ./dashboard.lua; + }; programs.nixvim = { enable = true; package = pkgs.neovim-unwrapped; @@ -24,6 +27,11 @@ in with lib; { { mode = "n"; key = "ff"; + action = ":Telescope find_files"; + } + { + mode = "n"; + key = "fs"; action = ":Telescope file_browser"; } { @@ -42,6 +50,11 @@ in with lib; { key = "fo"; action = ":Telescope oldfiles"; } + { + mode = "n"; + key = "fr"; + action = ":Telescope frecency"; + } # Commenting { mode = "n"; @@ -128,6 +141,12 @@ in with lib; { action = "function() require('neotest').run.run(vim.fn.expand('%')) end"; } + # LSP + { + mode = "n"; + key = ""; + action = ":Lspsaga code_action"; + } ]; extraPlugins = with pkgs.vimPlugins; [ @@ -147,6 +166,11 @@ in with lib; { nix.enable = true; luasnip.enable = true; typst-vim.enable = true; + startup = { + enable = true; + theme = "my_theme"; + }; + none-ls.enable = false; obsidian = { enable = true; settings = { @@ -159,6 +183,10 @@ in with lib; { name = "notes"; path = "~/src/notes"; } + { + name = "uni"; + path = "~/cloud/Documents/CESE/notes"; + } ]; completion = { min_chars = 2; @@ -267,6 +295,10 @@ in with lib; { }; trouble.enable = true; lspkind.enable = true; + lspsaga = { + enable = true; + lightbulb.virtualText = false; + }; vimtex.enable = true; floaterm.enable = true; diff --git a/hosts/thalassa/aoife/home/default.nix b/hosts/thalassa/aoife/home/default.nix index 18c9c42..367fbd7 100644 --- a/hosts/thalassa/aoife/home/default.nix +++ b/hosts/thalassa/aoife/home/default.nix @@ -15,5 +15,6 @@ eduvpn-client localsend obsidian + typst ]; }