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

2 years ago
  1. vim.opt.number = true
  2. vim.opt.linebreak = true
  3. vim.opt.shiftwidth = 2
  4. vim.opt.tabstop = 2
  5. vim.opt.softtabstop = 2
  6. vim.opt.expandtab = true
  7. vim.opt.smarttab = true
  8. vim.opt.autoindent = true
  9. vim.opt.textwidth = 80
  10. vim.opt.colorcolumn = "80"
  11. vim.opt.list = true
  12. vim.g.airline_theme = "base16_chalk"
  13. --vim.g.airline_powerline_fonts = 1
  14. vim.api.nvim_create_autocmd("FileType", {
  15. pattern = "python",
  16. callback = function(args)
  17. vim.bo.textwidth = 0
  18. vim.bo.formatprg = "autopep8"
  19. vim.bo.shiftwidth = 4
  20. vim.bo.tabstop = 4
  21. vim.bo.softtabstop = 4
  22. end
  23. })
  24. vim.api.nvim_create_autocmd("FileType", {
  25. pattern = {"markdown", "tex", "text"},
  26. callback = function(args)
  27. vim.bo.expandtab = false
  28. vim.bo.autoindent = false
  29. end
  30. })
  31. vim.api.nvim_create_autocmd("FileType", {
  32. pattern = {"c", "cpp", "slang"},
  33. callback = function(args)
  34. vim.bo.cindent = true
  35. end
  36. })
  37. vim.api.nvim_create_autocmd("FileType", {
  38. pattern = "go",
  39. callback = function(args)
  40. vim.bo.shiftwidth = 4
  41. vim.bo.expandtab = false
  42. vim.bo.tabstop = 4
  43. vim.bo.softtabstop = 4
  44. vim.bo.preserveindent = true
  45. vim.bo.copyindent = true
  46. vim.api.nvim_set_keymap("n", "<F4>", ":w|:!cpgo test<CR>", {noremap = true})
  47. end
  48. })