From e42a6ceacf66f06ecb66d7504909fbfa15ff8ade Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Mon, 28 Oct 2024 13:09:52 +0100 Subject: [PATCH] Git ignore .pre-commit-config.yaml Add fish abbreviation for git commit --amend Don't autoformat when writing commit message in neovim --- .gitignore | 1 + .pre-commit-config.yaml | 1 - home-manager/default.nix | 1 + home-manager/neovim/lspconfig.lua | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) delete mode 120000 .pre-commit-config.yaml diff --git a/.gitignore b/.gitignore index 726d2d6..0d3fe25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ result .direnv +.pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 120000 index f84b99a..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1 +0,0 @@ -/nix/store/8f0hn1ibbqhjnmmpjq235wqp3id2cvi1-pre-commit-config.json \ No newline at end of file diff --git a/home-manager/default.nix b/home-manager/default.nix index 1fb635f..94a9725 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -179,6 +179,7 @@ gco = "git checkout"; gd = "git diff"; gc = "git commit"; + gca = "git commit --amend"; gpl = "git pull"; gb = "git branch"; ga = "git add"; diff --git a/home-manager/neovim/lspconfig.lua b/home-manager/neovim/lspconfig.lua index c043d61..523ec86 100644 --- a/home-manager/neovim/lspconfig.lua +++ b/home-manager/neovim/lspconfig.lua @@ -57,7 +57,7 @@ end vim.api.nvim_create_autocmd("BufWritePost", { pattern = "*", callback = function() - if has_treefmt() then + if vim.fn.expand("%:p") ~= vim.fn.getcwd() .. "/.git/COMMIT_EDITMSG" and has_treefmt() then vim.cmd("silent !treefmt > /dev/null 2>&1") end end,