default-config.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. CONFIG_PATH = vim.fn.stdpath "config"
  2. DATA_PATH = vim.fn.stdpath "data"
  3. CACHE_PATH = vim.fn.stdpath "cache"
  4. TERMINAL = vim.fn.expand "$TERMINAL"
  5. O = {
  6. auto_close_tree = 0,
  7. auto_complete = true,
  8. colorscheme = "lunar",
  9. hidden_files = true,
  10. wrap_lines = false,
  11. number = true,
  12. relative_number = true,
  13. cursorline = true,
  14. shell = "bash",
  15. timeoutlen = 100,
  16. nvim_tree_disable_netrw = 0,
  17. ignore_case = true,
  18. smart_case = true,
  19. lushmode = false,
  20. hl_search = false,
  21. transparent_window = false,
  22. leader_key = "space",
  23. vnsip_dir = vim.fn.stdpath "config" .. "/snippets",
  24. -- @usage pass a table with your desired languages
  25. treesitter = {
  26. ensure_installed = "all",
  27. ignore_install = { "haskell" },
  28. highlight = { enabled = true },
  29. rainbow = { enabled = false },
  30. },
  31. lsp = {
  32. popup_border = "single"
  33. },
  34. database = { save_location = "~/.config/nvcode_db", auto_execute = 1 },
  35. plugin = {
  36. hop = { active = false },
  37. dial = { active = false },
  38. dashboard = { active = false },
  39. matchup = { active = false },
  40. colorizer = { active = false },
  41. numb = { active = false },
  42. zen = { active = false },
  43. ts_playground = { active = false },
  44. indent_line = { active = false },
  45. ts_context_commentstring = { active = false },
  46. symbol_outline = { active = false },
  47. debug = { active = false },
  48. bqf = { active = false },
  49. trouble = { active = false },
  50. floatterm = { active = false },
  51. spectre = { active = false },
  52. lsp_rooter = { active = false },
  53. markdown_preview = { active = false },
  54. codi = { active = false },
  55. telescope_fzy = { active = false },
  56. sanegx = { active = false },
  57. snap = { active = false },
  58. ranger = { active = false },
  59. todo_comments = { active = false },
  60. lsp_colors = { active = false },
  61. git_blame = { active = false },
  62. gist = { active = false },
  63. gitlinker = { active = false },
  64. lazygit = { active = false },
  65. octo = { active = false },
  66. lush = { active = false },
  67. diffview = { active = false },
  68. bracey = { active = false },
  69. telescope_project = { active = false },
  70. dap_install = { active = false },
  71. tabnine = { active = false },
  72. },
  73. lang = {
  74. python = {
  75. linter = "",
  76. -- @usage can be 'yapf', 'black'
  77. formatter = "",
  78. autoformat = false,
  79. isort = false,
  80. diagnostics = {
  81. virtual_text = { spacing = 0, prefix = "" },
  82. signs = true,
  83. underline = true,
  84. },
  85. analysis = {
  86. type_checking = "basic",
  87. auto_search_paths = true,
  88. use_library_code_types = true,
  89. },
  90. },
  91. dart = {
  92. sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
  93. },
  94. lua = {
  95. -- @usage can be 'lua-format'
  96. formatter = "",
  97. autoformat = false,
  98. diagnostics = {
  99. virtual_text = { spacing = 0, prefix = "" },
  100. signs = true,
  101. underline = true,
  102. },
  103. },
  104. sh = {
  105. -- @usage can be 'shellcheck'
  106. linter = "",
  107. -- @usage can be 'shfmt'
  108. formatter = "",
  109. autoformat = false,
  110. diagnostics = {
  111. virtual_text = { spacing = 0, prefix = "" },
  112. signs = true,
  113. underline = true,
  114. },
  115. },
  116. tsserver = {
  117. -- @usage can be 'eslint'
  118. linter = "",
  119. -- @usage can be 'prettier'
  120. formatter = "",
  121. autoformat = false,
  122. diagnostics = {
  123. virtual_text = { spacing = 0, prefix = "" },
  124. signs = true,
  125. underline = true,
  126. },
  127. },
  128. json = {
  129. -- @usage can be 'prettier'
  130. formatter = "",
  131. autoformat = false,
  132. diagnostics = {
  133. virtual_text = { spacing = 0, prefix = "" },
  134. signs = true,
  135. underline = true,
  136. },
  137. },
  138. tailwindcss = {
  139. filetypes = {
  140. "html",
  141. "css",
  142. "scss",
  143. "javascript",
  144. "javascriptreact",
  145. "typescript",
  146. "typescriptreact",
  147. },
  148. },
  149. clang = {
  150. diagnostics = {
  151. virtual_text = { spacing = 0, prefix = "" },
  152. signs = true,
  153. underline = true,
  154. },
  155. cross_file_rename = true,
  156. header_insertion = "never",
  157. autoformat = false, -- update this to true for enabling autoformat
  158. },
  159. ruby = {
  160. diagnostics = {
  161. virtualtext = { spacing = 0, prefix = "" },
  162. signs = true,
  163. underline = true,
  164. },
  165. filetypes = { "rb", "erb", "rakefile", "ruby" },
  166. },
  167. go = {},
  168. elixir = {},
  169. vim = {},
  170. yaml = {},
  171. terraform = {},
  172. rust = {
  173. rust_tools = {
  174. active = false,
  175. },
  176. linter = "",
  177. formatter = "",
  178. autoformat = false,
  179. diagnostics = {
  180. virtual_text = { spacing = 0, prefix = "" },
  181. signs = true,
  182. underline = true,
  183. },
  184. },
  185. svelte = {},
  186. php = {
  187. format = {
  188. braces = "psr12",
  189. },
  190. environment = {
  191. php_version = "7.4",
  192. },
  193. autoformat = false,
  194. diagnostics = {
  195. virtual_text = { spacing = 0, prefix = "" },
  196. signs = true,
  197. underline = true,
  198. },
  199. filetypes = { "php", "phtml" },
  200. },
  201. latex = {},
  202. kotlin = {},
  203. html = {},
  204. elm = {},
  205. emmet = { active = true },
  206. graphql = {},
  207. efm = {},
  208. docker = {},
  209. cmake = {},
  210. java = {},
  211. css = {
  212. formatter = "",
  213. autoformat = false,
  214. virtual_text = true,
  215. },
  216. },
  217. dashboard = {
  218. custom_header = {
  219. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  220. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  221. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  222. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  223. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  224. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  225. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  226. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  227. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  228. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  229. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  230. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  231. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  232. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  233. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  234. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  235. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  236. "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
  237. },
  238. footer = { "chrisatmachine.com" },
  239. },
  240. }
  241. -- TODO find a new home for these autocommands
  242. require("lv-utils").define_augroups {
  243. _general_settings = {
  244. {
  245. "TextYankPost",
  246. "*",
  247. "lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})",
  248. },
  249. {
  250. "BufWinEnter",
  251. "*",
  252. "setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
  253. },
  254. {
  255. "BufRead",
  256. "*",
  257. "setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
  258. },
  259. {
  260. "BufNewFile",
  261. "*",
  262. "setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
  263. },
  264. { "VimLeavePre", "*", "set title set titleold=" },
  265. { "FileType", "qf", "set nobuflisted" },
  266. },
  267. -- _solidity = {
  268. -- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'},
  269. -- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'}
  270. -- },
  271. -- _gemini = {
  272. -- {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'},
  273. -- {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'}
  274. -- },
  275. _markdown = {
  276. { "FileType", "markdown", "setlocal wrap" },
  277. { "FileType", "markdown", "setlocal spell" },
  278. },
  279. _buffer_bindings = {
  280. { "FileType", "floaterm", "nnoremap <silent> <buffer> q :q<CR>" },
  281. },
  282. _auto_resize = {
  283. -- will cause split windows to be resized evenly if main window is resized
  284. {'VimResized ', '*', 'wincmd ='},
  285. },
  286. _mode_switching = {
  287. -- will switch between absolute and relative line numbers depending on mode
  288. {'InsertEnter', '*', 'if &relativenumber | let g:ms_relativenumberoff = 1 | setlocal number norelativenumber | endif'},
  289. {'InsertLeave', '*', 'if exists("g:ms_relativenumberoff") | setlocal relativenumber | endif'},
  290. {'InsertEnter', '*', 'if &cursorline | let g:ms_cursorlineoff = 1 | setlocal nocursorline | endif'},
  291. {'InsertLeave', '*', 'if exists("g:ms_cursorlineoff") | setlocal cursorline | endif'},
  292. },
  293. }