diff options
| author | triethyl <triethylammonium@pm.me> | 2025-07-13 14:51:46 -0400 |
|---|---|---|
| committer | triethyl <triethylammonium@pm.me> | 2025-07-13 14:51:46 -0400 |
| commit | fa2d77c6627e8715025dfba2c4814d2d24d0f6f7 (patch) | |
| tree | 2bfc175eca036bee498a168534a65ce0910040f2 /pkgs/custom-neovim/config/lua/autocommands.lua | |
| parent | dacca9aa76fc197c318305627a6dbf05f384519c (diff) | |
| parent | 9a06380449c98e374d2db1f9a477614d82f9ff91 (diff) | |
Merge branch 'pkgs/custom-neovim'
Diffstat (limited to 'pkgs/custom-neovim/config/lua/autocommands.lua')
| -rw-r--r-- | pkgs/custom-neovim/config/lua/autocommands.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua new file mode 100644 index 0000000..48a976e --- /dev/null +++ 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, +}) |
