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.

84 lines
1.8 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
  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("FileType", {
  41. pattern = { "tex", "text" },
  42. callback = function(args)
  43. vim.o.smarttab = false
  44. vim.bo.autoindent = false
  45. end
  46. })
  47. vim.api.nvim_create_autocmd("FileType", {
  48. pattern = { "c", "cpp", "slang" },
  49. callback = function(args)
  50. vim.bo.cindent = true
  51. end
  52. })
  53. vim.api.nvim_create_autocmd("FileType", {
  54. pattern = "markdown",
  55. callback = function(args)
  56. vim.bo.shiftwidth = 2
  57. vim.bo.tabstop = 2
  58. vim.bo.softtabstop = 2
  59. vim.bo.autoindent = true
  60. end
  61. })
  62. vim.api.nvim_create_autocmd("FileType", {
  63. pattern = "go",
  64. callback = function(args)
  65. vim.bo.shiftwidth = 4
  66. vim.bo.expandtab = false
  67. vim.bo.tabstop = 4
  68. vim.bo.softtabstop = 4
  69. vim.bo.preserveindent = true
  70. vim.bo.copyindent = true
  71. vim.api.nvim_set_keymap("n", "<F4>", ":w|:!cpgo test<CR>", { noremap = true })
  72. end
  73. })