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.

80 lines
1.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. vim.opt.mouse:append('a')
  2. vim.opt.number = true
  3. vim.opt.linebreak = true
  4. vim.opt.shiftwidth = 2
  5. vim.opt.tabstop = 2
  6. vim.opt.softtabstop = 2
  7. vim.opt.expandtab = true
  8. vim.opt.smarttab = true
  9. vim.opt.shiftround = true
  10. vim.opt.autoindent = true
  11. vim.opt.textwidth = 80
  12. vim.opt.colorcolumn = "80"
  13. vim.opt.list = true
  14. vim.opt.wrap = false
  15. vim.opt.splitbelow = false
  16. vim.opt.splitright = false
  17. vim.opt.undodir = vim.fn.stdpath('data') .. "/undodir"
  18. vim.opt.undofile = true
  19. vim.opt.hlsearch = false
  20. vim.opt.incsearch = true
  21. vim.opt.nu = true
  22. vim.opt.rnu = true
  23. vim.opt.termguicolors = true
  24. vim.opt.scrolloff = 7
  25. vim.cmd("filetype plugin indent on")
  26. vim.cmd("filetype on")
  27. vim.api.nvim_create_autocmd("FileType", {
  28. pattern = "python",
  29. callback = function(args)
  30. vim.bo.textwidth = 0
  31. vim.bo.formatprg = "autopep8"
  32. vim.bo.shiftwidth = 4
  33. vim.bo.tabstop = 4
  34. vim.bo.softtabstop = 4
  35. end
  36. })
  37. vim.api.nvim_create_autocmd("FileType", {
  38. pattern = { "tex", "text" },
  39. callback = function(args)
  40. vim.o.smarttab = false
  41. vim.bo.autoindent = false
  42. end
  43. })
  44. vim.api.nvim_create_autocmd("FileType", {
  45. pattern = { "c", "cpp", "slang" },
  46. callback = function(args)
  47. vim.bo.cindent = true
  48. end
  49. })
  50. vim.api.nvim_create_autocmd("FileType", {
  51. pattern = "markdown",
  52. callback = function(args)
  53. vim.bo.shiftwidth = 4
  54. vim.bo.tabstop = 4
  55. vim.bo.softtabstop = 4
  56. vim.bo.autoindent = true
  57. end
  58. })
  59. vim.api.nvim_create_autocmd("FileType", {
  60. pattern = "go",
  61. callback = function(args)
  62. vim.bo.shiftwidth = 4
  63. vim.bo.expandtab = false
  64. vim.bo.tabstop = 4
  65. vim.bo.softtabstop = 4
  66. vim.bo.preserveindent = true
  67. vim.bo.copyindent = true
  68. vim.api.nvim_set_keymap("n", "<F4>", ":w|:!cpgo test<CR>", { noremap = true })
  69. end
  70. })