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.

104 lines
2.2 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
1 year 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.guicursor = ""
  3. vim.opt.number = true
  4. vim.opt.linebreak = true
  5. vim.opt.shiftwidth = 2
  6. vim.opt.tabstop = 2
  7. vim.opt.softtabstop = 2
  8. vim.opt.expandtab = true
  9. vim.opt.smarttab = true
  10. vim.opt.shiftround = true
  11. vim.opt.autoindent = true
  12. vim.opt.textwidth = 80
  13. vim.opt.colorcolumn = "80"
  14. vim.opt.list = true
  15. vim.opt.wrap = false
  16. vim.opt.conceallevel = 0
  17. vim.opt.splitbelow = false
  18. vim.opt.splitright = false
  19. vim.g.indentLine_fileTypeExclude = { 'text', 'tex' }
  20. vim.opt.undodir = vim.fn.stdpath('data') .. "/undodir"
  21. vim.opt.undofile = true
  22. vim.opt.hlsearch = false
  23. vim.opt.incsearch = true
  24. vim.opt.nu = true
  25. vim.opt.rnu = true
  26. vim.opt.termguicolors = true
  27. vim.opt.scrolloff = 7
  28. vim.cmd("filetype plugin indent on")
  29. vim.cmd("filetype on")
  30. vim.api.nvim_create_autocmd("FileType", {
  31. pattern = "python",
  32. callback = function(args)
  33. vim.bo.textwidth = 0
  34. vim.bo.formatprg = "autopep8"
  35. vim.bo.shiftwidth = 4
  36. vim.bo.tabstop = 4
  37. vim.bo.softtabstop = 4
  38. end
  39. })
  40. vim.api.nvim_create_autocmd(
  41. { "BufRead", "BufNewFile" },
  42. {
  43. pattern = { "*.ms", "*.me", "*.mom" },
  44. callback = function(args)
  45. vim.bo.filetype = "groff"
  46. end
  47. }
  48. )
  49. vim.api.nvim_create_autocmd(
  50. { "BufRead", "BufNewFile" },
  51. {
  52. pattern = { "*.mdx", "*.md" },
  53. callback = function(args)
  54. vim.bo.filetype = "markdown"
  55. end
  56. }
  57. )
  58. vim.api.nvim_create_autocmd("FileType", {
  59. pattern = { "tex", "text" },
  60. callback = function(args)
  61. vim.o.smarttab = false
  62. vim.bo.autoindent = false
  63. end
  64. })
  65. vim.api.nvim_create_autocmd("FileType", {
  66. pattern = { "c", "cpp", "slang" },
  67. callback = function(args)
  68. vim.bo.cindent = true
  69. end
  70. })
  71. vim.api.nvim_create_autocmd("FileType", {
  72. pattern = "markdown",
  73. callback = function(args)
  74. vim.bo.shiftwidth = 2
  75. vim.bo.tabstop = 2
  76. vim.bo.softtabstop = 2
  77. vim.bo.autoindent = true
  78. end
  79. })
  80. vim.api.nvim_create_autocmd("FileType", {
  81. pattern = "go",
  82. callback = function(args)
  83. vim.bo.shiftwidth = 4
  84. vim.bo.expandtab = false
  85. vim.bo.tabstop = 4
  86. vim.bo.softtabstop = 4
  87. vim.bo.preserveindent = true
  88. vim.bo.copyindent = true
  89. vim.api.nvim_set_keymap("n", "<F4>", ":w|:!cpgo test<CR>", { noremap = true })
  90. end
  91. })