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.

94 lines
2.0 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
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("FileType", {
  50. pattern = { "tex", "text" },
  51. callback = function(args)
  52. vim.o.smarttab = false
  53. vim.bo.autoindent = false
  54. end
  55. })
  56. vim.api.nvim_create_autocmd("FileType", {
  57. pattern = { "c", "cpp", "slang" },
  58. callback = function(args)
  59. vim.bo.cindent = true
  60. end
  61. })
  62. vim.api.nvim_create_autocmd("FileType", {
  63. pattern = "markdown",
  64. callback = function(args)
  65. vim.bo.shiftwidth = 2
  66. vim.bo.tabstop = 2
  67. vim.bo.softtabstop = 2
  68. vim.bo.autoindent = true
  69. end
  70. })
  71. vim.api.nvim_create_autocmd("FileType", {
  72. pattern = "go",
  73. callback = function(args)
  74. vim.bo.shiftwidth = 4
  75. vim.bo.expandtab = false
  76. vim.bo.tabstop = 4
  77. vim.bo.softtabstop = 4
  78. vim.bo.preserveindent = true
  79. vim.bo.copyindent = true
  80. vim.api.nvim_set_keymap("n", "<F4>", ":w|:!cpgo test<CR>", { noremap = true })
  81. end
  82. })