From 3df44ee18a6c1b36278cbde8499f357e0a040411 Mon Sep 17 00:00:00 2001 From: triethyl Date: Sun, 6 Jul 2025 18:52:39 -0400 Subject: setting up lua config Former-commit-id: 6623b85be12ce3bf9411c35f50e4bc1f20dea186 --- pkgs/custom-neovim/config/lua/autocommands.lua | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/autocommands.lua (limited to 'pkgs/custom-neovim/config/lua/autocommands.lua') diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From 546752feb6576be92fe421be1998217aa7d657ff Mon Sep 17 00:00:00 2001 From: triethyl Date: Sun, 6 Jul 2025 22:21:45 -0400 Subject: working on nvim setup Former-commit-id: a43ab0499838d262445d8af9cb954a84e259bb35 --- pkgs/custom-neovim/config/lua/autocommands.lua | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'pkgs/custom-neovim/config/lua/autocommands.lua') diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua index e69de29..85a58c6 100644 --- a/pkgs/custom-neovim/config/lua/autocommands.lua +++ b/pkgs/custom-neovim/config/lua/autocommands.lua @@ -0,0 +1,36 @@ +-- Autocommands + +-- Use relative line number in normal mode and absolute in insert mode +vim.opt.number = true +local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {}) +vim.api.nvim_create_autocmd( + { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" }, + { + group = numbertoggle, + callback = function() + if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then + vim.opt.relativenumber = true + end + end, + } +) + +vim.api.nvim_create_autocmd( + { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" }, + { + group = numbertoggle, + callback = function() + if vim.opt.number then + vim.opt.relativenumber = false + vim.cmd("redraw") + end + end, + } +) + + -- start terminal in insert mode +vim.api.nvim_create_autocmd("TermOpen", { + callback = function() + vim.cmd "startinsert!" + end, +}) -- cgit v1.2.3 From 4afdfee5c1ce99a09fc70075ca674b961fd3faed Mon Sep 17 00:00:00 2001 From: triethyl Date: Wed, 9 Jul 2025 13:11:23 -0400 Subject: working on custom neovim Former-commit-id: 4baf1a9c64b861ce1a934487b93b36bdb1438cf3 --- pkgs/custom-neovim/config/lua/autocommands.lua | 50 +++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'pkgs/custom-neovim/config/lua/autocommands.lua') diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua index 85a58c6..48a976e 100644 --- a/pkgs/custom-neovim/config/lua/autocommands.lua +++ b/pkgs/custom-neovim/config/lua/autocommands.lua @@ -1,32 +1,32 @@ -- Autocommands -- Use relative line number in normal mode and absolute in insert mode -vim.opt.number = true -local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {}) -vim.api.nvim_create_autocmd( - { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" }, - { - group = numbertoggle, - callback = function() - if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then - vim.opt.relativenumber = true - end - end, - } -) +-- vim.opt.number = true +-- local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {}) +-- vim.api.nvim_create_autocmd( +-- { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" }, +-- { +-- group = numbertoggle, +-- callback = function() +-- if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then +-- vim.opt.relativenumber = true +-- end +-- end, +-- } +-- ) -vim.api.nvim_create_autocmd( - { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" }, - { - group = numbertoggle, - callback = function() - if vim.opt.number then - vim.opt.relativenumber = false - vim.cmd("redraw") - end - end, - } -) +-- vim.api.nvim_create_autocmd( +-- { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" }, +-- { +-- group = numbertoggle, +-- callback = function() +-- if vim.opt.number then +-- vim.opt.relativenumber = false +-- vim.cmd("redraw") +-- end +-- end, +-- } +-- ) -- start terminal in insert mode vim.api.nvim_create_autocmd("TermOpen", { -- cgit v1.2.3