From beb019f6fad8aa05cc73e8d7d971013000e693c8 Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Wed, 8 May 2024 00:55:52 +0200 Subject: [PATCH 01/10] update neotree, theme, add dashboard and auto command --- config/auto_cmds.nix | 11 +++ config/default.nix | 2 + config/plugins/editor/neo-tree.nix | 2 +- config/plugins/themes/default.nix | 2 + config/plugins/ui/dashboard.nix | 25 +++++++ flake.lock | 106 +++++++++++++++++++---------- 6 files changed, 110 insertions(+), 38 deletions(-) create mode 100644 config/auto_cmds.nix create mode 100644 config/plugins/ui/dashboard.nix diff --git a/config/auto_cmds.nix b/config/auto_cmds.nix new file mode 100644 index 0000000..5b3b1af --- /dev/null +++ b/config/auto_cmds.nix @@ -0,0 +1,11 @@ +{ + autoCmd = [ + { + group = "highlight_yank"; + callback = '' + function() + vim.highlight.on_yank() + ''; + } + ]; +} diff --git a/config/default.nix b/config/default.nix index 6f6a6f7..ffa084f 100644 --- a/config/default.nix +++ b/config/default.nix @@ -3,6 +3,7 @@ _: { # General Configuration ./settings.nix ./keymaps.nix + ./auto_cmds.nix # Themes ./plugins/themes/default.nix @@ -25,6 +26,7 @@ _: { # UI plugins ./plugins/ui/bufferline.nix ./plugins/ui/lualine.nix + ./plugins/ui/dashboard.nix # LSP ./plugins/lsp/lsp.nix diff --git a/config/plugins/editor/neo-tree.nix b/config/plugins/editor/neo-tree.nix index 8a53163..cb7589e 100644 --- a/config/plugins/editor/neo-tree.nix +++ b/config/plugins/editor/neo-tree.nix @@ -21,7 +21,7 @@ keymaps = [ { mode = ["n"]; - key = ""; + key = "e"; action = "Neotree toggle"; options = {desc = "Open/Close Neotree";}; } diff --git a/config/plugins/themes/default.nix b/config/plugins/themes/default.nix index 87a8df4..8df5472 100644 --- a/config/plugins/themes/default.nix +++ b/config/plugins/themes/default.nix @@ -16,6 +16,8 @@ cmp = true; notify = true; gitsigns = true; + dashboard = true; + lualine = true; which_key = true; illuminate = { enabled = true; diff --git a/config/plugins/ui/dashboard.nix b/config/plugins/ui/dashboard.nix new file mode 100644 index 0000000..d5423c4 --- /dev/null +++ b/config/plugins/ui/dashboard.nix @@ -0,0 +1,25 @@ +{ + plugins.dashboard = { + enable = true; + + header = [ + '' + ██████╗░███████╗░█████╗░░█████╗░██████╗░████████╗░░░████████╗███████╗░█████╗░██╗░░██╗ + ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝░░░╚══██╔══╝██╔════╝██╔══██╗██║░░██║ + ██║░░██║█████╗░░██║░░╚═╝██║░░██║██████╔╝░░░██║░░░░░░░░░██║░░░█████╗░░██║░░╚═╝███████║ + ██║░░██║██╔══╝░░██║░░██╗██║░░██║██╔══██╗░░░██║░░░░░░░░░██║░░░██╔══╝░░██║░░██╗██╔══██║ + ██████╔╝███████╗╚█████╔╝╚█████╔╝██║░░██║░░░██║░░░██╗░░░██║░░░███████╗╚█████╔╝██║░░██║ + ╚═════╝░╚══════╝░╚════╝░░╚════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░░╚═╝░░░╚══════╝░╚════╝░╚═╝░░╚═╝ + '' + ]; + + center = [ + { + action = "Telescope find_files"; + desc = " Find File"; + icon = " "; + shortcut = "f"; + } + ]; + }; +} diff --git a/flake.lock b/flake.lock index 18fd3e0..cc4dcf4 100644 --- a/flake.lock +++ b/flake.lock @@ -73,11 +73,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1714641030, + "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", "type": "github" }, "original": { @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1714641030, + "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", "type": "github" }, "original": { @@ -107,6 +107,21 @@ "type": "github" } }, + "flake-root": { + "locked": { + "lastModified": 1713493429, + "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", + "owner": "srid", + "repo": "flake-root", + "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -212,11 +227,11 @@ ] }, "locked": { - "lastModified": 1713732794, - "narHash": "sha256-AYCofb8Zu4Mbc1lHDtju/uxeARawRijmOueAqEMEfMU=", + "lastModified": 1715077503, + "narHash": "sha256-AfHQshzLQfUqk/efMtdebHaQHqVntCMjhymQzVFLes0=", "owner": "nix-community", "repo": "home-manager", - "rev": "670d9ecc3e46a6e3265c203c2d136031a3d3548e", + "rev": "6e277d9566de9976f47228dd8c580b97488734d4", "type": "github" }, "original": { @@ -233,11 +248,11 @@ ] }, "locked": { - "lastModified": 1713543876, - "narHash": "sha256-olEWxacm1xZhAtpq+ZkEyQgR4zgfE7ddpNtZNvubi3g=", + "lastModified": 1713946171, + "narHash": "sha256-lc75rgRQLdp4Dzogv5cfqOg6qYc5Rp83oedF2t0kDp8=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "9e7c20ffd056e406ddd0276ee9d89f09c5e5f4ed", + "rev": "230a197063de9287128e2c68a7a4b0cd7d0b50a7", "type": "github" }, "original": { @@ -248,11 +263,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713714899, - "narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=", + "lastModified": 1714906307, + "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6143fc5eeb9c4f00163267708e26191d1e918932", + "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588", "type": "github" }, "original": { @@ -264,20 +279,14 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", - "type": "github" + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" } }, "nixpkgs-stable": { @@ -301,19 +310,21 @@ "devshell": "devshell", "flake-compat": "flake-compat", "flake-parts": "flake-parts_2", + "flake-root": "flake-root", "home-manager": "home-manager", "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], - "pre-commit-hooks": "pre-commit-hooks" + "pre-commit-hooks": "pre-commit-hooks", + "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1713856119, - "narHash": "sha256-TfNc8vxF7IaRhTlMgOeUN01y7QoBx50MYmGU1sSU6Vw=", + "lastModified": 1715115147, + "narHash": "sha256-oREqXPEtuYbOdBKbsDQzr2V01EzK4kD8MTdwO9ljTnU=", "owner": "nix-community", "repo": "nixvim", - "rev": "c826d146c65bfa8164f31931cf54278b99f5a3a0", + "rev": "f7f255afe22fcca0c07177c3707fd61fa0c85835", "type": "github" }, "original": { @@ -337,11 +348,11 @@ ] }, "locked": { - "lastModified": 1713775815, - "narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=", + "lastModified": 1714478972, + "narHash": "sha256-q//cgb52vv81uOuwz1LaXElp3XAe1TqrABXODAEF6Sk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4", + "rev": "2849da033884f54822af194400f8dff435ada242", "type": "github" }, "original": { @@ -361,11 +372,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1713775815, - "narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=", + "lastModified": 1714478972, + "narHash": "sha256-q//cgb52vv81uOuwz1LaXElp3XAe1TqrABXODAEF6Sk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4", + "rev": "2849da033884f54822af194400f8dff435ada242", "type": "github" }, "original": { @@ -426,6 +437,27 @@ "repo": "default", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714058656, + "narHash": "sha256-Qv4RBm4LKuO4fNOfx9wl40W2rBbv5u5m+whxRYUMiaA=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "c6aaf729f34a36c445618580a9f95a48f5e4e03f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", From ec962abd1a7a7b57ba92225b07f606fd87a5e2e4 Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:25:49 +0200 Subject: [PATCH 02/10] remove comment --- config/plugins/snippets/luasnip.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/config/plugins/snippets/luasnip.nix b/config/plugins/snippets/luasnip.nix index 402bb51..3a3c41a 100644 --- a/config/plugins/snippets/luasnip.nix +++ b/config/plugins/snippets/luasnip.nix @@ -1,4 +1,3 @@ -#TODO: Find out why we get an error when we have luasnip enabled, disabled for now! {pkgs, ...}: { plugins.luasnip = { enable = true; From 1bbe208e9f836a63437747807720d6f33c94e54f Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:06 +0200 Subject: [PATCH 03/10] update theme --- config/plugins/themes/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/plugins/themes/default.nix b/config/plugins/themes/default.nix index 8df5472..2a5ecde 100644 --- a/config/plugins/themes/default.nix +++ b/config/plugins/themes/default.nix @@ -16,8 +16,7 @@ cmp = true; notify = true; gitsigns = true; - dashboard = true; - lualine = true; + neotree = true; which_key = true; illuminate = { enabled = true; From 160cff40f381b175ccf0e3d91ab2eed2a6499adf Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:18 +0200 Subject: [PATCH 04/10] delete dashboard --- config/plugins/ui/dashboard.nix | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 config/plugins/ui/dashboard.nix diff --git a/config/plugins/ui/dashboard.nix b/config/plugins/ui/dashboard.nix deleted file mode 100644 index d5423c4..0000000 --- a/config/plugins/ui/dashboard.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - plugins.dashboard = { - enable = true; - - header = [ - '' - ██████╗░███████╗░█████╗░░█████╗░██████╗░████████╗░░░████████╗███████╗░█████╗░██╗░░██╗ - ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝░░░╚══██╔══╝██╔════╝██╔══██╗██║░░██║ - ██║░░██║█████╗░░██║░░╚═╝██║░░██║██████╔╝░░░██║░░░░░░░░░██║░░░█████╗░░██║░░╚═╝███████║ - ██║░░██║██╔══╝░░██║░░██╗██║░░██║██╔══██╗░░░██║░░░░░░░░░██║░░░██╔══╝░░██║░░██╗██╔══██║ - ██████╔╝███████╗╚█████╔╝╚█████╔╝██║░░██║░░░██║░░░██╗░░░██║░░░███████╗╚█████╔╝██║░░██║ - ╚═════╝░╚══════╝░╚════╝░░╚════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░░╚═╝░░░╚══════╝░╚════╝░╚═╝░░╚═╝ - '' - ]; - - center = [ - { - action = "Telescope find_files"; - desc = " Find File"; - icon = " "; - shortcut = "f"; - } - ]; - }; -} From 2b46577f1f2f10f580c2c6b1c8d4b860f0b87725 Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:26 +0200 Subject: [PATCH 05/10] add catppuccin theme --- config/plugins/ui/lualine.nix | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/config/plugins/ui/lualine.nix b/config/plugins/ui/lualine.nix index bfcef27..592231c 100644 --- a/config/plugins/ui/lualine.nix +++ b/config/plugins/ui/lualine.nix @@ -5,26 +5,7 @@ _: { disabledFiletypes = { statusline = ["dashboard" "alpha"]; }; - theme = { - normal = { - a = { - bg = "#b4befe"; - fg = "#1c1d21"; - }; - b = { - bg = "nil"; - }; - c = { - bg = "nil"; - }; - z = { - bg = "nil"; - }; - y = { - bg = "nil"; - }; - }; - }; + theme = "catppuccin"; sections = { lualine_a = [ { From 47a18ff34c593dec6deb86f624894285aa272635 Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:33 +0200 Subject: [PATCH 06/10] add startup dashboard --- config/plugins/ui/startup.nix | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 config/plugins/ui/startup.nix diff --git a/config/plugins/ui/startup.nix b/config/plugins/ui/startup.nix new file mode 100644 index 0000000..b6529ef --- /dev/null +++ b/config/plugins/ui/startup.nix @@ -0,0 +1,75 @@ +{ + plugins.startup = { + enable = true; + + colors = { + background = "#ffffff"; + foldedSection = "#ffffff"; + }; + + sections = { + header = { + type = "text"; + oldfilesDirectory = false; + align = "center"; + foldSection = false; + title = "Header"; + margin = 5; + content = [ + " ██████╗░███████╗░█████╗░░█████╗░██████╗░████████╗░░░████████╗███████╗░█████╗░██╗░░██╗" + " ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝░░░╚══██╔══╝██╔════╝██╔══██╗██║░░██║" + " ██║░░██║█████╗░░██║░░╚═╝██║░░██║██████╔╝░░░██║░░░░░░░░░██║░░░█████╗░░██║░░╚═╝███████║" + " ██║░░██║██╔══╝░░██║░░██╗██║░░██║██╔══██╗░░░██║░░░░░░░░░██║░░░██╔══╝░░██║░░██╗██╔══██║" + " ██████╔╝███████╗╚█████╔╝╚█████╔╝██║░░██║░░░██║░░░██╗░░░██║░░░███████╗╚█████╔╝██║░░██║" + " ╚═════╝░╚══════╝░╚════╝░░╚════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░░╚═╝░░░╚══════╝░╚════╝░╚═╝░░╚═╝" + ]; + highlight = "Statement"; + defaultColor = ""; + oldfilesAmount = 0; + }; + + body = { + type = "mapping"; + oldfilesDirectory = false; + align = "center"; + foldSection = false; + title = "Menu"; + margin = 5; + content = [ + [ + " Find File" + "Telescope find_files" + "ff" + ] + [ + "󰍉 Find Word" + "Telescope live_grep" + "fr" + ] + [ + " Recent Files" + "Telescope oldfiles" + "fg" + ] + [ + " File Browser" + "Telescope file_browser" + "fe" + ] + ]; + highlight = "string"; + defaultColor = ""; + oldfilesAmount = 0; + }; + }; + + options = { + paddings = [1 3]; + }; + + parts = [ + "header" + "body" + ]; + }; +} From cd883078473091e78393f683b964d61b4bb53925 Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:39 +0200 Subject: [PATCH 07/10] add autoCmd's --- config/auto_cmds.nix | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/config/auto_cmds.nix b/config/auto_cmds.nix index 5b3b1af..a78f0d1 100644 --- a/config/auto_cmds.nix +++ b/config/auto_cmds.nix @@ -1,11 +1,33 @@ { + autoGroups = { + highlight_yank = {}; + vim_enter = {}; + }; + autoCmd = [ { group = "highlight_yank"; - callback = '' - function() - vim.highlight.on_yank() - ''; + event = ["TextYankPost"]; + pattern = "*"; + callback = { + __raw = '' + function() + vim.highlight.on_yank() + end + ''; + }; + } + { + group = "vim_enter"; + event = ["VimEnter"]; + pattern = "*"; + callback = { + __raw = '' + function() + vim.cmd('Startup') + end + ''; + }; } ]; } From 995fdc8b2416739f2530b6b12599b87d8b54df22 Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:45 +0200 Subject: [PATCH 08/10] import startup --- config/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.nix b/config/default.nix index ffa084f..b862321 100644 --- a/config/default.nix +++ b/config/default.nix @@ -26,7 +26,7 @@ _: { # UI plugins ./plugins/ui/bufferline.nix ./plugins/ui/lualine.nix - ./plugins/ui/dashboard.nix + ./plugins/ui/startup.nix # LSP ./plugins/lsp/lsp.nix From 8700f4eec15dd23b67495c687d067e10aa1b3ebd Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:51 +0200 Subject: [PATCH 09/10] add some settings --- config/settings.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/settings.nix b/config/settings.nix index 9efaaba..f51542c 100644 --- a/config/settings.nix +++ b/config/settings.nix @@ -19,6 +19,8 @@ foldenable = false; linebreak = true; spell = false; + swapfile = false; + timeoutlen = 300; }; }; } From 1c54ea865bc8ca9e0c6581c17c42cbb6ddb4d9e9 Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Thu, 9 May 2024 01:34:54 +0200 Subject: [PATCH 10/10] update flake --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index cc4dcf4..b9d2d74 100644 --- a/flake.lock +++ b/flake.lock @@ -263,11 +263,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1714906307, - "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", + "lastModified": 1715087517, + "narHash": "sha256-CLU5Tsg24Ke4+7sH8azHWXKd0CFd4mhLWfhYgUiDBpQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588", + "rev": "b211b392b8486ee79df6cdfb1157ad2133427a29", "type": "github" }, "original": {