Neovim configs for 2023. Hopefully they last.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

53 lines
1.2 KiB

vim.opt.number = true
vim.opt.linebreak = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.expandtab = true
vim.opt.smarttab = true
vim.opt.autoindent = true
vim.opt.textwidth = 80
vim.opt.colorcolumn = "80"
vim.opt.list = true
vim.g.airline_theme = "base16_chalk"
--vim.g.airline_powerline_fonts = 1
vim.api.nvim_create_autocmd("FileType", {
pattern = "python",
callback = function(args)
vim.bo.textwidth = 0
vim.bo.formatprg = "autopep8"
vim.bo.shiftwidth = 4
vim.bo.tabstop = 4
vim.bo.softtabstop = 4
end
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {"markdown", "tex", "text"},
callback = function(args)
vim.bo.expandtab = false
vim.bo.autoindent = false
end
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {"c", "cpp", "slang"},
callback = function(args)
vim.bo.cindent = true
end
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "go",
callback = function(args)
vim.bo.shiftwidth = 4
vim.bo.expandtab = false
vim.bo.tabstop = 4
vim.bo.softtabstop = 4
vim.bo.preserveindent = true
vim.bo.copyindent = true
vim.api.nvim_set_keymap("n", "<F4>", ":w|:!cpgo test<CR>", {noremap = true})
end
})