added lazy plugin manager, catppuccin color scheme, lualine
This commit is contained in:
@@ -28,9 +28,30 @@
|
||||
Neovim 0.12 configuration
|
||||
(c) Frank Zechert 2026
|
||||
]]
|
||||
local create_group = vim.api.nvim_create_augroup
|
||||
local create_cmd = vim.api.nvim_create_autocmd
|
||||
local function contains(tbl, value)
|
||||
for _, v in ipairs(tbl) do
|
||||
if v == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- briefly highlithg text that is yanked
|
||||
create_cmd("TextYankPost", {
|
||||
desc = "Highlight yanked text",
|
||||
group = create_group("cmd-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- recognize all scripts with bash shebang as bash filetype
|
||||
vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
|
||||
create_cmd({"BufRead", "BufNewFile"}, {
|
||||
desc = "Recognize bash shebang as bash filetype",
|
||||
group = create_group("cmd-recognize-bash-filetype", { clear = true }),
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
local buf = args.buf
|
||||
@@ -40,3 +61,27 @@ vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- automatically remove trailing whitespace on save file
|
||||
create_cmd({"BufWritePre"}, {
|
||||
desc = "Remove trailing whitespace when saving",
|
||||
group = create_group("cmd-remove-trailing-whitespace", { clear = true }),
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
vim.api.nvim_buf_call(args.buf, function()
|
||||
vim.cmd([[%s/\s\+$//e]])
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
-- automatically set textwidth if not set otherwise
|
||||
create_cmd({"FileType"}, {
|
||||
desc = "Automatically set textwidth",
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
local buf = args.buf
|
||||
if vim.bo[buf].textwidth == 0 then
|
||||
vim.bo[buf].textwidth = vim.g.ui.textwidth[vim.bo[buf].filetype] or vim.g.ui.textwidth.default
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user