require("packer").startup(function()
    use 'wbthomason/packer.nvim'

    use 'tpope/vim-sensible'
end)

vim.cmd [[autocmd BufWritePre * :%s/\s\+$//e]]

vim.opt.fileencoding = "utf-8"
vim.opt.smartindent = true
vim.opt.swapfile = false; vim.opt.backup = false
vim.opt.tabstop = 4; vim.opt.sw = 4; vim.opt.sts = 4; vim.opt.expandtab= true

vim.cmd([[
augroup ft_git
    autocmd!
    autocmd BufNewFile,BufRead gitconfig setlocal filetype=gitconfig
    autocmd FileType gitcommit setlocal spell spelllang=en_us
augroup END
]])


require("packer").startup(function()
    use 'wbthomason/packer.nvim'

    use 'tpope/vim-sensible'
end)

vim.cmd [[autocmd BufWritePre * :%s/\s\+$//e]]

vim.opt.fileencoding = "utf-8"
vim.opt.smartindent = true
vim.opt.swapfile = false; vim.opt.backup = false
vim.opt.tabstop = 4; vim.opt.sw = 4; vim.opt.sts = 4; vim.opt.expandtab= true

vim.cmd([[
augroup ft_git
    autocmd!
    autocmd BufNewFile,BufRead gitconfig setlocal filetype=gitconfig
    autocmd FileType gitcommit setlocal spell spelllang=en_us
augroup END
]])

vim.cmd([[
augroup packer_auto_sync
    autocmd!
    autocmd BufWritePost init.lua source <afile> | PackerSync
augroup end
]])


Add autocmd to run PackerSync on save
nvim: Add autocmd to run PackerSync on save
