summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-20 20:14:14 +0200
committerKyren223 <Kyren223@proton.me>2024-11-20 20:14:14 +0200
commita9e2614bc18196fd713795b63ff9f2c6c3ef83c6 (patch)
tree4cb02764a4d96fc4b5a616b825ac192675b54d6b
parent8ec18a224fa7a9a2a7f3233c0b0be43917e9eed6 (diff)
2 space indents fixed, added watchexec
-rw-r--r--.config/nvim/after/ftplugin/nix.lua5
-rw-r--r--.config/nvim/lazy-lock.json1
-rw-r--r--.config/nvim/lua/custom/plugins/auto-save.lua62
-rw-r--r--hosts/laptop-nixos/home.nix1
4 files changed, 38 insertions, 31 deletions
diff --git a/.config/nvim/after/ftplugin/nix.lua b/.config/nvim/after/ftplugin/nix.lua
new file mode 100644
index 0000000..e20fbe1
--- /dev/null
+++ b/.config/nvim/after/ftplugin/nix.lua
@@ -0,0 +1,5 @@
+Event = 'VeryLazy'
+
+vim.opt_local.tabstop = 2 -- number of visual spaces per TAB
+vim.opt_local.softtabstop = 2 -- number of idfk tab when editing
+vim.opt_local.shiftwidth = 2 -- number of spaces to insert on tab
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json
index 67df559..0e31fca 100644
--- a/.config/nvim/lazy-lock.json
+++ b/.config/nvim/lazy-lock.json
@@ -2,6 +2,7 @@
"Comment.nvim": { "branch": "fix-inline-visual-linewise-comment", "commit": "01019c2889fa6c63a80a223c55c1d28999b5c959" },
"LuaSnip": { "branch": "master", "commit": "4bf40748f6fe939bdcb69325918535b1c5edea51" },
"alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" },
+ "auto-save.nvim": { "branch": "main", "commit": "5fbcaac0a2698c87a9a1bd2083cb6949505cca12" },
"auto-session": { "branch": "main", "commit": "542d338ec5ee027638c8e076110b188a465b45d2" },
"buffer-vacuum": { "branch": "main", "commit": "9ec0ea4ee93bb1faa0419d6890daf9e45c436ea6" },
"buffer_manager.nvim": { "branch": "main", "commit": "fd36131b2b3e0f03fd6353ae2ffc88cf920b3bbb" },
diff --git a/.config/nvim/lua/custom/plugins/auto-save.lua b/.config/nvim/lua/custom/plugins/auto-save.lua
index 1fac72f..5da836b 100644
--- a/.config/nvim/lua/custom/plugins/auto-save.lua
+++ b/.config/nvim/lua/custom/plugins/auto-save.lua
@@ -1,33 +1,33 @@
return {
- -- 'okuuva/auto-save.nvim',
- -- cmd = 'ASToggle',
- -- event = { 'InsertLeave', 'TextChanged' },
- -- opts = function()
- -- -- Disable autoformat between automatic saves
- -- vim.api.nvim_create_autocmd('User', {
- -- pattern = 'AutoSaveWritePre',
- -- group = vim.api.nvim_create_augroup('autosave-pre', { clear = true }),
- -- callback = function(opts)
- -- local bufnr = opts.data.saved_buffer
- -- vim.b[bufnr].disable_autoformat = true
- -- end,
- -- })
- --
- -- vim.api.nvim_create_autocmd('User', {
- -- pattern = 'AutoSaveWritePost',
- -- group = vim.api.nvim_create_augroup('autosave-post', { clear = true }),
- -- callback = function(opts)
- -- local bufnr = opts.data.saved_buffer
- -- vim.b[bufnr].disable_autoformat = false
- -- end,
- -- })
- --
- -- return {
- -- -- execution_message = { enabled = false }, removed
- -- condition = function(buf)
- -- -- Save only if the buffer is not a "special buffer"
- -- return vim.fn.getbufvar(buf, '&buftype') == ''
- -- end,
- -- }
- -- end,
+ 'okuuva/auto-save.nvim',
+ cmd = 'ASToggle',
+ event = { 'InsertLeave', 'TextChanged' },
+ opts = function()
+ -- Disable autoformat between automatic saves
+ vim.api.nvim_create_autocmd('User', {
+ pattern = 'AutoSaveWritePre',
+ group = vim.api.nvim_create_augroup('autosave-pre', { clear = true }),
+ callback = function(opts)
+ local bufnr = opts.data.saved_buffer
+ vim.b[bufnr].disable_autoformat = true
+ end,
+ })
+
+ vim.api.nvim_create_autocmd('User', {
+ pattern = 'AutoSaveWritePost',
+ group = vim.api.nvim_create_augroup('autosave-post', { clear = true }),
+ callback = function(opts)
+ local bufnr = opts.data.saved_buffer
+ vim.b[bufnr].disable_autoformat = false
+ end,
+ })
+
+ return {
+ -- execution_message = { enabled = false }, removed
+ condition = function(buf)
+ -- Save only if the buffer is not a "special buffer"
+ return vim.fn.getbufvar(buf, '&buftype') == ''
+ end,
+ }
+ end,
}
diff --git a/hosts/laptop-nixos/home.nix b/hosts/laptop-nixos/home.nix
index f406f18..e2673bd 100644
--- a/hosts/laptop-nixos/home.nix
+++ b/hosts/laptop-nixos/home.nix
@@ -46,6 +46,7 @@
pnpm
nodejs_23
python3Full
+ watchexec
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage