From ae43c82e5cdf02f91b2efad33c3bd2f9692a06ba Mon Sep 17 00:00:00 2001 From: Uttarayan Mondal Date: Thu, 4 Apr 2024 20:26:11 +0530 Subject: [PATCH] feat(nvim): Added neovim command to reload and sqlfmt --- common/home.nix | 23 ++++++++++++++++++++++- flake.lock | 2 +- neovim/nvim.nix | 14 +++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/common/home.nix b/common/home.nix index 51f98632..758f3833 100644 --- a/common/home.nix +++ b/common/home.nix @@ -66,7 +66,6 @@ in { alejandra pkg-config devenv - python312Packages.sqlparse sleek # Misc @@ -96,6 +95,7 @@ in { (pkgs.mpv-unwrapped.override {sixelSupport = true;}) {}) ] ++ lib.optionals device.isLinux [ + ferdium psst sony-headphones-client abaddon @@ -320,6 +320,27 @@ in { file = { ".config/fish/themes".source = pkgs.catppuccinThemes.fish + "/themes"; + ".cargo/config.toml".text = + /* + toml + */ + '' + [alias] + lldb = ["with", "rust-lldb", "--"] + + [net] + git-fetch-with-cli = true + + # [target.aarch64-apple-darwin] + # linker = "clang" + # rustflags = ["-C", "link-arg=-fuse-ld=${pkgs.mold}/bin/mold"] + + [registries.catscii] + index = "https://git.shipyard.rs/catscii/crate-index.git" + + [http] + user-agent = "shipyard J0/QFq2Sa5y6nTxJQAb8t+e/3qLSub1/sa3zn0leZv6LKG/zmQcoikT9U3xPwbzp8hQ=" + ''; }; sessionVariables = { diff --git a/flake.lock b/flake.lock index 6e2efda3..011a1dd3 100644 --- a/flake.lock +++ b/flake.lock @@ -1188,7 +1188,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-pflBfIdyFBeG+5Rq5Oq41zNu8w4eILzlj2tcjxal/Oo=", + "narHash": "sha256-tCS3U1V/RGNFT3FFr8NGpCDPkInN0AjVUYQIi2PlMOw=", "path": "./neovim", "type": "path" }, diff --git a/neovim/nvim.nix b/neovim/nvim.nix index 39488cb9..bc850217 100644 --- a/neovim/nvim.nix +++ b/neovim/nvim.nix @@ -306,7 +306,7 @@ in rec { # "ee" = "[[Rest run]]"; "ee" = "[[RestNvim]]"; "el" = "[[Rest run last]]"; - "hh" = "[[DevdocsOpenFloat]]"; + "hh" = "[[DevdocsOpen]]"; "hl" = "[[DevdocsToggle]]"; "" = "''"; "n" = "[[bnext]]"; @@ -532,6 +532,18 @@ in rec { }) end) vim.g.rustaceanvim["tools"] = { enable_clippy = false }; + + vim.api.nvim_create_user_command('Reso', + function() + pcall(vim.cmd'source ~/.config/nvim/init.lua') + end, + {}) + + vim.api.nvim_create_user_command('Sqlfmt', + function() + pcall(vim.cmd'%!${pkgs.sleek}/bin/sleek') + end, + {}) ''; package = pkgs.neovim-nightly; opts = {