Skip to content

Commit

Permalink
feat(nvim): use lua for trailing space autocmds
Browse files Browse the repository at this point in the history
  • Loading branch information
KirkEasterson committed Oct 17, 2024
1 parent 6cc5de6 commit f24d5dc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nvim/.config/nvim/lua/kirk/core/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,21 @@ autocmd({ "InsertEnter" }, {
desc = "Remove trailing space character for insert mode",
group = trailing_space,
pattern = { "*" },
command = "set listchars-=trail:·", -- TODO: this for only current line
-- command = "set listchars-=trail:·",
callback = function()
vim.opt.listchars:remove("trail")
end,
})
autocmd({ "InsertLeave" }, {
desc = "Enable trailing space character for non-insert mode",
group = trailing_space,
pattern = { "*" },
command = "set listchars+=trail:·",
-- command = "set listchars+=trail:·",
callback = function()
vim.opt.listchars:append({
trail = "·",
})
end,
})

autocmd("TextYankPost", {
Expand Down

0 comments on commit f24d5dc

Please sign in to comment.