dotfiles

Linux and macOS dotfiles
git clone https://github.com/michaelneuper/dotfiles.git
README | Files | Log | Refs

dotfiles/.config/nvim/lua/config/custom.lua (258B)


-- auto remove trailing whitespace
vim.api.nvim_create_autocmd("BufWritePre", {
    pattern = "*",
    callback = function()
        local save_cursor = vim.fn.getpos(".")
        vim.cmd([[%s/\s\+$//e]])
        vim.fn.setpos(".", save_cursor)
    end,
})