diff --git a/common/hm-modules/nvim/default.nix b/common/hm-modules/nvim/default.nix index 3a9ddbec..bf08e9f5 100644 --- a/common/hm-modules/nvim/default.nix +++ b/common/hm-modules/nvim/default.nix @@ -12,11 +12,15 @@ in with lib; { globals.mapleader = " "; - options.number = true; + options = { + number = true; + conceallevel = 2; + }; clipboard.providers.wl-copy.enable = true; keymaps = [ + # Telescope { mode = "n"; key = "ff"; @@ -31,8 +35,14 @@ in with lib; { { mode = "n"; key = "fb"; - action = ":Telescope file_browser"; + action = ":Telescope buffers"; } + { + mode = "n"; + key = "fo"; + action = ":Telescope oldfiles"; + } + # Commenting { mode = "n"; key = ""; @@ -53,6 +63,7 @@ in with lib; { ''; lua = true; } + # Float Term { mode = "n"; key = "t"; @@ -64,14 +75,15 @@ in with lib; { action = "function() vim.cmd(':FloatermToggle myfloat') end"; lua = true; } + # Switch buffers { mode = "n"; - key = ""; + key = "s"; action = ":bn"; } { mode = "n"; - key = ""; + key = "a"; action = ":bp"; } # Change Indenting @@ -113,7 +125,8 @@ in with lib; { mode = "n"; key = "nf"; lua = true; - action = "function() require('neotest').run.run(vim.fn.expand('%')) end"; + action = + "function() require('neotest').run.run(vim.fn.expand('%')) end"; } ]; @@ -134,16 +147,51 @@ in with lib; { nix.enable = true; luasnip.enable = true; typst-vim.enable = true; + obsidian = { + enable = true; + settings = { + new_notes_location = "notes_subdir"; + daily_notes = { + folder = "daily"; + }; + workspaces = [ + { + name = "notes"; + path = "~/src/notes"; + } + ]; + completion = { + min_chars = 2; + nvim_cmp = true; + }; + picker.name = "telescope.nvim"; + note_id_func = '' + function(title) + -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. + -- In this case a note with the title 'My new note' will be given an ID that looks + -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' + local suffix = "" + if title ~= nil then + -- If title is given, transform it into valid file name. + suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() + else + -- If title is nil, just add 4 random uppercase letters to the suffix. + for _ = 1, 4 do + suffix = suffix .. string.char(math.random(65, 90)) + end + end + return tostring(os.time()) .. "-" .. suffix + end + ''; + }; + }; fidget = { enable = true; progress = { ignoreDoneAlready = true; ignore = [ "ltex" ]; }; - notification = { - overrideVimNotify = true; - # group_seperator = ""; - }; + notification = { overrideVimNotify = true; }; }; neotest = { enable = true; @@ -167,15 +215,17 @@ in with lib; { }; telescope = { enable = true; + defaults.preview.ls_short = true; extensions.file_browser = { enable = true; hijackNetrw = true; - + dirIcon = ""; }; extensions.fzf-native.enable = true; extensions.fzf-native.fuzzy = true; + extensions.frecency.enable = true; }; - comment-nvim = { enable = true; }; + comment-nvim.enable = true; lsp = { enable = true; keymaps = { diff --git a/hosts/thalassa/aoife/home/default.nix b/hosts/thalassa/aoife/home/default.nix index c568d80d..18c9c425 100644 --- a/hosts/thalassa/aoife/home/default.nix +++ b/hosts/thalassa/aoife/home/default.nix @@ -14,5 +14,6 @@ jetbrains.rust-rover eduvpn-client localsend + obsidian ]; }