default-config.lua 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. clang = {
  84. diagnostics = {
  85. virtual_text = { spacing = 0, prefix = "" },
  86. signs = true,
  87. underline = true,
  88. },
  89. cross_file_rename = true,
  90. header_insertion = "never",
  91. filetypes = { "c", "cpp", "objc" },
  92. formatter = {
  93. exe = "clang-format",
  94. args = {},
  95. },
  96. },
  97. css = {
  98. virtual_text = true,
  99. formatter = {
  100. exe = "prettier",
  101. args = {},
  102. },
  103. },
  104. dart = {
  105. sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
  106. formatter = {
  107. exe = "dart",
  108. args = { "format" },
  109. },
  110. },
  111. docker = {},
  112. efm = {},
  113. elm = {},
  114. emmet = { active = false },
  115. elixir = {},
  116. graphql = {},
  117. go = {
  118. formatter = {
  119. exe = "gofmt",
  120. args = {},
  121. },
  122. },
  123. html = {},
  124. java = {
  125. java_tools = {
  126. active = false,
  127. },
  128. formatter = {
  129. exe = "prettier",
  130. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  131. },
  132. },
  133. json = {
  134. diagnostics = {
  135. virtual_text = { spacing = 0, prefix = "" },
  136. signs = true,
  137. underline = true,
  138. },
  139. formatter = {
  140. exe = "python",
  141. args = { "-m", "json.tool" },
  142. },
  143. },
  144. kotlin = {},
  145. latex = {
  146. filetypes = { "tex", "bib"},
  147. aux_directory = nil,
  148. bibtex_formatter = "texlab",
  149. diagnostics_delay = 300,
  150. formatter_line_length = 80,
  151. latex_formatter = "latexindent",
  152. build = {
  153. executable = "latexmk",
  154. args = {'-pdf', '-interaction=nonstopmode', '-synctex=1', '%f'},
  155. on_save = false,
  156. forward_search_after = false,
  157. },
  158. chktex = {
  159. on_open_and_save = false,
  160. on_edit = false,
  161. },
  162. forward_search = {
  163. executable = nil,
  164. args = {}
  165. },
  166. latexindent = {
  167. ["local"] = nil,
  168. modify_line_breaks = false
  169. },
  170. diagnostics = {
  171. virtual_text = {spacing = 0, prefix = ""},
  172. signs = true,
  173. underline = true,
  174. },
  175. auto_save = false,
  176. ignore_errors = {},
  177. },
  178. lua = {
  179. diagnostics = {
  180. virtual_text = { spacing = 0, prefix = "" },
  181. signs = true,
  182. underline = true,
  183. },
  184. formatter = {
  185. exe = "stylua",
  186. args = {},
  187. stdin = false,
  188. },
  189. },
  190. php = {
  191. format = {
  192. format = {
  193. default = "psr12",
  194. },
  195. },
  196. environment = {
  197. php_version = "7.4",
  198. },
  199. diagnostics = {
  200. virtual_text = { spacing = 0, prefix = "" },
  201. signs = true,
  202. underline = true,
  203. },
  204. filetypes = { "php", "phtml" },
  205. formatter = {
  206. exe = "phpcbf",
  207. args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) },
  208. stdin = false,
  209. },
  210. },
  211. python = {
  212. -- @usage can be flake8 or yapf
  213. linter = "",
  214. isort = false,
  215. diagnostics = {
  216. virtual_text = { spacing = 0, prefix = "" },
  217. signs = true,
  218. underline = true,
  219. },
  220. analysis = {
  221. type_checking = "basic",
  222. auto_search_paths = true,
  223. use_library_code_types = true,
  224. },
  225. formatter = {
  226. exe = "yapf",
  227. args = {},
  228. },
  229. },
  230. ruby = {
  231. diagnostics = {
  232. virtualtext = { spacing = 0, prefix = "" },
  233. signs = true,
  234. underline = true,
  235. },
  236. filetypes = { "rb", "erb", "rakefile", "ruby" },
  237. formatter = {
  238. exe = "rufo",
  239. args = { "-x" },
  240. },
  241. },
  242. rust = {
  243. rust_tools = {
  244. active = false,
  245. parameter_hints_prefix = "<-",
  246. other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining)
  247. },
  248. -- @usage can be clippy
  249. formatter = {
  250. exe = "rustfmt",
  251. args = { "--emit=stdout", "--edition=2018" },
  252. },
  253. linter = "",
  254. diagnostics = {
  255. virtual_text = { spacing = 0, prefix = "" },
  256. signs = true,
  257. underline = true,
  258. },
  259. },
  260. sh = {
  261. -- @usage can be 'shellcheck'
  262. linter = "",
  263. -- @usage can be 'shfmt'
  264. diagnostics = {
  265. virtual_text = { spacing = 0, prefix = "" },
  266. signs = true,
  267. underline = true,
  268. },
  269. formatter = {
  270. exe = "shfmt",
  271. args = { "-w" },
  272. stdin = false,
  273. },
  274. },
  275. svelte = {},
  276. tailwindcss = {
  277. active = false,
  278. filetypes = {
  279. "html",
  280. "css",
  281. "scss",
  282. "javascript",
  283. "javascriptreact",
  284. "typescript",
  285. "typescriptreact",
  286. },
  287. },
  288. terraform = {
  289. formatter = {
  290. exe = "terraform",
  291. args = { "fmt" },
  292. stdin = false,
  293. },
  294. },
  295. tsserver = {
  296. -- @usage can be 'eslint' or 'eslint_d'
  297. linter = "",
  298. diagnostics = {
  299. virtual_text = { spacing = 0, prefix = "" },
  300. signs = true,
  301. underline = true,
  302. },
  303. formatter = {
  304. exe = "prettier",
  305. args = {},
  306. },
  307. },
  308. vim = {},
  309. yaml = {
  310. formatter = {
  311. exe = "prettier",
  312. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  313. },
  314. },
  315. },
  316. }
  317. require "core.status_colors"
  318. require("core.gitsigns").config()
  319. require("core.compe").config()
  320. require("core.dashboard").config()
  321. require("core.dap").config()
  322. require("core.floatterm").config()
  323. require("core.zen").config()
  324. require("core.telescope").config()
  325. require("core.treesitter").config()
  326. require("core.which-key").config()