From 7de0c50a3af038af41b9dea118ee0c740ae2b618 Mon Sep 17 00:00:00 2001 From: Martin Pander Date: Mon, 28 Apr 2025 13:55:41 +0200 Subject: [PATCH] Update things --- nix/flake.lock | 18 +++++++++--------- nix/user/dev.nix | 4 ++++ nix/user/git.nix | 2 -- nix/user/nvim.nix | 2 ++ nix/user/sh.nix | 5 +++-- nix/user/task.nix | 2 -- nvim/base.lua | 39 +++++++++++++++++++++++++++++++++++++++ nvim/keymaps.lua | 2 +- nvim/plugins.lua | 24 +++++++++++++++++++++++- 9 files changed, 81 insertions(+), 17 deletions(-) diff --git a/nix/flake.lock b/nix/flake.lock index ec87c03..3b1cf39 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1740579671, - "narHash": "sha256-Dwt/3KknOQ4bgFG5YjqDT7oWRy27rPpDjAi2P0ok1zw=", + "lastModified": 1745810134, + "narHash": "sha256-WfnYH/i7DFzn4SESQfWviXiNUZjohZhzODqLwKYHIPI=", "owner": "nix-community", "repo": "home-manager", - "rev": "53c587d263f94aaf6a281745923c76bbec62bcf3", + "rev": "be7cf1709b469a2a2c62169172a167d1fed3509f", "type": "github" }, "original": { @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1740452771, - "narHash": "sha256-/tI1vFJ7/dXJqUmI+s0EV1F0DPe6dZvT444mrLUkrlU=", + "lastModified": 1745816321, + "narHash": "sha256-Gyh/fkCDqVNGM0BWvk+4UAS17w2UI6iwnbQQCmc1TDI=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "42be12b510253d750138ec90c66decc282298b44", + "rev": "4515dacafb0ccd42e5395aacc49fd58a43027e01", "type": "github" }, "original": { @@ -42,11 +42,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740367490, - "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", + "lastModified": 1745526057, + "narHash": "sha256-ITSpPDwvLBZBnPRS2bUcHY3gZSwis/uTe255QgMtTLA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05", + "rev": "f771eb401a46846c1aebd20552521b233dd7e18b", "type": "github" }, "original": { diff --git a/nix/user/dev.nix b/nix/user/dev.nix index 30e02c5..6edd511 100644 --- a/nix/user/dev.nix +++ b/nix/user/dev.nix @@ -8,4 +8,8 @@ }; programs.ripgrep.enable = true; + + home.packages = with pkgs; [ + harlequin + ]; } diff --git a/nix/user/git.nix b/nix/user/git.nix index 1050e94..366588f 100644 --- a/nix/user/git.nix +++ b/nix/user/git.nix @@ -54,8 +54,6 @@ merge.conflictstyle = "zdiff3"; core.editor = "nvim"; init.defaultBranch = "main"; - merge.conflicstyle = "zdiff3"; - fetch.prune = true; }; ignores = [ diff --git a/nix/user/nvim.nix b/nix/user/nvim.nix index 98b874b..4bc8d24 100644 --- a/nix/user/nvim.nix +++ b/nix/user/nvim.nix @@ -13,6 +13,7 @@ vim-commentary vim-repeat vim-surround + nvim-tree-lua targets-vim delimitMate # vim-startify @@ -42,6 +43,7 @@ img-clip-nvim markdown-preview-nvim vim-markdown + bullets-vim (nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ])) ]; diff --git a/nix/user/sh.nix b/nix/user/sh.nix index a90152a..577172f 100644 --- a/nix/user/sh.nix +++ b/nix/user/sh.nix @@ -60,7 +60,8 @@ programs.lsd = { enable = true; - enableAliases = true; + # enableAliases = true; + enableZshIntegration = true; }; programs.zoxide = { @@ -79,7 +80,7 @@ du-dust glow ripgrep-all - llm + (python3.withPackages (ps: [ ps.llm ps.llm-gemini])) ]; home.sessionVariables = lib.mkMerge [ { diff --git a/nix/user/task.nix b/nix/user/task.nix index ab0e89d..0bede22 100644 --- a/nix/user/task.nix +++ b/nix/user/task.nix @@ -39,8 +39,6 @@ report.low.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg"; report.low.sort="energy+,urgency-"; - context.today.read = "-deferred and (prio:H or +next)"; - context.today.write = "prio:H or +next"; context.deferred.read = "+deferred"; context.deferred.write = "+deferred"; context.customer.read = "+cust"; diff --git a/nvim/base.lua b/nvim/base.lua index fe83b24..62501f6 100644 --- a/nvim/base.lua +++ b/nvim/base.lua @@ -1,3 +1,6 @@ +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + ------------------------- -------- OPTIONS -------- ------------------------- @@ -46,6 +49,7 @@ vim.opt.autoread = true vim.opt.syntax = 'on' vim.opt.encoding = 'utf-8' vim.opt.completeopt = 'menu,menuone,noselect' +vim.opt.termguicolors = true ---------------------------- @@ -84,6 +88,40 @@ vim.api.nvim_create_autocmd('BufEnter', { command = 'silent! lcd %:p:h' }) +-- Open nvim-tree when starting Neovim in a specific directory or any of its subdirectories +vim.api.nvim_create_autocmd("VimEnter", { + callback = function() + local args = vim.fn.argv() + + if #args > 0 then + local current_dir = vim.fn.fnamemodify(args[1], ":p:h") + local dir_name = vim.fn.fnamemodify(current_dir, ":t") + + -- Check if in a "notes" directory or its subdirectory + local in_notes = dir_name == "notes" + if not in_notes then + -- Check if any parent directory is named "notes" + local path_parts = vim.split(current_dir, "/", {plain = true}) + for i, part in ipairs(path_parts) do + if part == "notes" then + in_notes = true + break + end + end + end + + -- If in a notes directory or subdirectory, open the tree + if in_notes then + require("nvim-tree.api").tree.open() + vim.defer_fn(function() + require("nvim-tree.api").tree.expand_all() + -- After expanding, return focus to the main window/buffer + vim.cmd("wincmd p") + end, 100) -- Small delay to ensure tree is fully loaded before expanding + end + end + end +}) --------------------------- -------- FUNCTIONS -------- @@ -92,3 +130,4 @@ vim.api.nvim_create_autocmd('BufEnter', { vim.api.nvim_create_user_command('TrimWhiteSpace', function() vim.cmd('%s/\\s\\+$//e') end, {}) + diff --git a/nvim/keymaps.lua b/nvim/keymaps.lua index 8621537..6d97167 100644 --- a/nvim/keymaps.lua +++ b/nvim/keymaps.lua @@ -15,7 +15,7 @@ vim.keymap.set('n', 's', ':call WindowSwap#EasyWindowSwap()', {}) -- Convenience vim.keymap.set('n', 'w', ':w', { silent = true }) -vim.keymap.set('n', 'F', ':e.', {}) +vim.keymap.set('n', 'F', ':NvimTreeToggle', { noremap = true, silent = true }) vim.keymap.set('n', 'Y', 'y$', {}) -- Telescope diff --git a/nvim/plugins.lua b/nvim/plugins.lua index 74cf673..0387b9e 100644 --- a/nvim/plugins.lua +++ b/nvim/plugins.lua @@ -97,7 +97,6 @@ lspconfig.dockerls.setup({ capabilities = capabilities }) lspconfig.docker_compose_language_service.setup({ capabilities = capabilities }) lspconfig.flow.setup({ capabilities = capabilities }) lspconfig.marksman.setup({ capabilities = capabilities }) -lspconfig.als.setup({ capabilities = capabilities }) lspconfig.sqls.setup({ capabilities = capabilities }) lspconfig.yamlls.setup({ capabilities = capabilities }) lspconfig.nil_ls.setup({ capabilities = capabilities }) @@ -188,3 +187,26 @@ require("copilot").setup({ panel = { enabled = false }, }) require("copilot_cmp").setup() + +vim.g.bullets_enabled_file_types = { + 'markdown', + 'text', + 'gitcommit', + 'scratch' +} + + +require("nvim-tree").setup({ + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + -- filters = { + -- dotfiles = true, + -- }, +})