default-config.lua 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. USER = vim.fn.expand "$USER"
  6. O = {
  7. leader_key = "space",
  8. colorscheme = "spacegray",
  9. line_wrap_cursor_movement = true,
  10. transparent_window = false,
  11. format_on_save = true,
  12. vsnip_dir = vim.fn.stdpath "config" .. "/snippets",
  13. default_options = {
  14. backup = false, -- creates a backup file
  15. clipboard = "unnamedplus", -- allows neovim to access the system clipboard
  16. cmdheight = 2, -- more space in the neovim command line for displaying messages
  17. colorcolumn = "99999", -- fixes indentline for now
  18. completeopt = { "menuone", "noselect" },
  19. conceallevel = 0, -- so that `` is visible in markdown files
  20. fileencoding = "utf-8", -- the encoding written to a file
  21. guifont = "monospace:h17", -- the font used in graphical neovim applications
  22. hidden = true, -- required to keep multiple buffers and open multiple buffers
  23. hlsearch = false, -- highlight all matches on previous search pattern
  24. ignorecase = true, -- ignore case in search patterns
  25. mouse = "a", -- allow the mouse to be used in neovim
  26. pumheight = 10, -- pop up menu height
  27. showmode = false, -- we don't need to see things like -- INSERT -- anymore
  28. showtabline = 2, -- always show tabs
  29. smartcase = true, -- smart case
  30. smartindent = true, -- make indenting smarter again
  31. splitbelow = true, -- force all horizontal splits to go below current window
  32. splitright = true, -- force all vertical splits to go to the right of current window
  33. swapfile = false, -- creates a swapfile
  34. termguicolors = true, -- set term gui colors (most terminals support this)
  35. timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
  36. title = true, -- set the title of window to the value of the titlestring
  37. -- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
  38. undodir = CACHE_PATH .. "/undo", -- set an undo directory
  39. undofile = true, -- enable persisten undo
  40. updatetime = 300, -- faster completion
  41. writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
  42. expandtab = true, -- convert tabs to spaces
  43. shiftwidth = 2, -- the number of spaces inserted for each indentation
  44. tabstop = 2, -- insert 2 spaces for a tab
  45. cursorline = true, -- highlight the current line
  46. number = true, -- set numbered lines
  47. relativenumber = false, -- set relative numbered lines
  48. numberwidth = 4, -- set number column width to 2 {default 4}
  49. signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
  50. wrap = false, -- display lines as one long line
  51. spell = false,
  52. spelllang = "en",
  53. scrolloff = 8, -- is one of my fav
  54. },
  55. plugin = {},
  56. -- TODO: refactor for tree
  57. auto_close_tree = 0,
  58. nvim_tree_disable_netrw = 0,
  59. lsp = {
  60. document_highlight = true,
  61. popup_border = "single",
  62. },
  63. database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
  64. -- TODO: just using mappings (leader mappings)
  65. user_which_key = {},
  66. user_plugins = {
  67. -- use lv-config.lua for this not put here
  68. },
  69. user_autocommands = {
  70. { "FileType", "qf", "set nobuflisted" },
  71. },
  72. formatters = {
  73. filetype = {},
  74. },
  75. -- TODO move all of this into lang specific files, only require when using
  76. lang = {
  77. cmake = {
  78. formatter = {
  79. exe = "clang-format",
  80. args = {},
  81. },
  82. },
  83. css = {
  84. virtual_text = true,
  85. formatter = {
  86. exe = "prettier",
  87. args = {},
  88. },
  89. },
  90. dart = {
  91. sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
  92. formatter = {
  93. exe = "dart",
  94. args = { "format" },
  95. },
  96. },
  97. docker = {},
  98. efm = {},
  99. elm = {},
  100. emmet = { active = false },
  101. elixir = {
  102. formatter = {
  103. exe = "mix",
  104. args = { "format" },
  105. stdin = true,
  106. },
  107. },
  108. graphql = {},
  109. go = {
  110. formatter = {
  111. exe = "gofmt",
  112. args = {},
  113. },
  114. },
  115. html = {},
  116. java = {
  117. java_tools = {
  118. active = false,
  119. },
  120. formatter = {
  121. exe = "prettier",
  122. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  123. },
  124. },
  125. json = {
  126. diagnostics = {
  127. virtual_text = { spacing = 0, prefix = "" },
  128. signs = true,
  129. underline = true,
  130. },
  131. formatter = {
  132. exe = "python",
  133. args = { "-m", "json.tool" },
  134. },
  135. },
  136. kotlin = {},
  137. latex = {
  138. filetypes = { "tex", "bib"},
  139. aux_directory = nil,
  140. bibtex_formatter = "texlab",
  141. diagnostics_delay = 300,
  142. formatter_line_length = 80,
  143. latex_formatter = "latexindent",
  144. build = {
  145. executable = "latexmk",
  146. args = {'-pdf', '-interaction=nonstopmode', '-synctex=1', '%f'},
  147. on_save = false,
  148. forward_search_after = false,
  149. },
  150. chktex = {
  151. on_open_and_save = false,
  152. on_edit = false,
  153. },
  154. forward_search = {
  155. executable = nil,
  156. args = {}
  157. },
  158. latexindent = {
  159. ["local"] = nil,
  160. modify_line_breaks = false
  161. },
  162. diagnostics = {
  163. virtual_text = {spacing = 0, prefix = ""},
  164. signs = true,
  165. underline = true,
  166. },
  167. auto_save = false,
  168. ignore_errors = {},
  169. },
  170. lua = {
  171. diagnostics = {
  172. virtual_text = { spacing = 0, prefix = "" },
  173. signs = true,
  174. underline = true,
  175. },
  176. formatter = {
  177. exe = "stylua",
  178. args = {},
  179. stdin = false,
  180. },
  181. },
  182. php = {
  183. format = {
  184. format = {
  185. default = "psr12",
  186. },
  187. },
  188. environment = {
  189. php_version = "7.4",
  190. },
  191. diagnostics = {
  192. virtual_text = { spacing = 0, prefix = "" },
  193. signs = true,
  194. underline = true,
  195. },
  196. filetypes = { "php", "phtml" },
  197. formatter = {
  198. exe = "phpcbf",
  199. args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) },
  200. stdin = false,
  201. },
  202. },
  203. python = {
  204. -- @usage can be flake8 or yapf
  205. linter = "",
  206. isort = false,
  207. diagnostics = {
  208. virtual_text = { spacing = 0, prefix = "" },
  209. signs = true,
  210. underline = true,
  211. },
  212. analysis = {
  213. type_checking = "basic",
  214. auto_search_paths = true,
  215. use_library_code_types = true,
  216. },
  217. formatter = {
  218. exe = "yapf",
  219. args = {},
  220. },
  221. },
  222. ruby = {
  223. diagnostics = {
  224. virtualtext = { spacing = 0, prefix = "" },
  225. signs = true,
  226. underline = true,
  227. },
  228. filetypes = { "rb", "erb", "rakefile", "ruby" },
  229. formatter = {
  230. exe = "rufo",
  231. args = { "-x" },
  232. },
  233. },
  234. rust = {
  235. rust_tools = {
  236. active = false,
  237. parameter_hints_prefix = "<-",
  238. other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining)
  239. },
  240. -- @usage can be clippy
  241. formatter = {
  242. exe = "rustfmt",
  243. args = { "--emit=stdout", "--edition=2018" },
  244. },
  245. linter = "",
  246. diagnostics = {
  247. virtual_text = { spacing = 0, prefix = "" },
  248. signs = true,
  249. underline = true,
  250. },
  251. },
  252. sh = {
  253. -- @usage can be 'shellcheck'
  254. linter = "",
  255. -- @usage can be 'shfmt'
  256. diagnostics = {
  257. virtual_text = { spacing = 0, prefix = "" },
  258. signs = true,
  259. underline = true,
  260. },
  261. formatter = {
  262. exe = "shfmt",
  263. args = { "-w" },
  264. stdin = false,
  265. },
  266. },
  267. svelte = {},
  268. tailwindcss = {
  269. active = false,
  270. filetypes = {
  271. "html",
  272. "css",
  273. "scss",
  274. "javascript",
  275. "javascriptreact",
  276. "typescript",
  277. "typescriptreact",
  278. },
  279. },
  280. terraform = {
  281. formatter = {
  282. exe = "terraform",
  283. args = { "fmt" },
  284. stdin = false,
  285. },
  286. },
  287. tsserver = {
  288. -- @usage can be 'eslint' or 'eslint_d'
  289. linter = "",
  290. diagnostics = {
  291. virtual_text = { spacing = 0, prefix = "" },
  292. signs = true,
  293. underline = true,
  294. },
  295. formatter = {
  296. exe = "prettier",
  297. args = {},
  298. },
  299. },
  300. vim = {},
  301. yaml = {
  302. formatter = {
  303. exe = "prettier",
  304. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  305. },
  306. },
  307. },
  308. }
  309. require "core.status_colors"
  310. require("core.gitsigns").config()
  311. require("core.compe").config()
  312. require("core.dashboard").config()
  313. require("core.dap").config()
  314. require("core.floatterm").config()
  315. require("core.zen").config()
  316. require("core.telescope").config()
  317. require("core.treesitter").config()
  318. require("core.which-key").config()
  319. require("lang.clang").config()