default-config.lua 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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. vnsip_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. -- TODO: refactor for tree
  56. auto_close_tree = 0,
  57. nvim_tree_disable_netrw = 0,
  58. lsp = {
  59. document_highlight = true,
  60. popup_border = "single",
  61. },
  62. database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
  63. plugin = {
  64. -- Builtins
  65. diffview = { active = false },
  66. ts_hintobjects = { active = false },
  67. ts_textobjects = { active = false },
  68. ts_textsubjects = { active = false },
  69. telescope_project = { active = false },
  70. indent_line = { active = false },
  71. lush = { active = false },
  72. },
  73. -- TODO: just using mappings (leader mappings)
  74. user_which_key = {},
  75. user_plugins = {
  76. -- use lv-config.lua for this not put here
  77. },
  78. user_autocommands = {
  79. { "FileType", "qf", "set nobuflisted" },
  80. },
  81. lang = {
  82. cmake = {
  83. formatter = {
  84. exe = "clang-format",
  85. args = {},
  86. },
  87. },
  88. clang = {
  89. diagnostics = {
  90. virtual_text = { spacing = 0, prefix = "" },
  91. signs = true,
  92. underline = true,
  93. },
  94. cross_file_rename = true,
  95. header_insertion = "never",
  96. filetypes = { "c", "cpp", "objc" },
  97. formatter = {
  98. exe = "clang-format",
  99. args = {},
  100. },
  101. },
  102. css = {
  103. virtual_text = true,
  104. },
  105. dart = {
  106. sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
  107. formatter = {
  108. exe = "dart",
  109. args = { "format" },
  110. },
  111. },
  112. docker = {},
  113. efm = {},
  114. elm = {},
  115. emmet = { active = true },
  116. elixir = {},
  117. graphql = {},
  118. go = {
  119. formatter = {
  120. exe = "gofmt",
  121. args = {},
  122. },
  123. },
  124. html = {},
  125. java = {
  126. java_tools = {
  127. active = false,
  128. },
  129. },
  130. json = {
  131. diagnostics = {
  132. virtual_text = { spacing = 0, prefix = "" },
  133. signs = true,
  134. underline = true,
  135. },
  136. formatter = {
  137. exe = "python",
  138. args = { "-m", "json.tool" },
  139. },
  140. },
  141. kotlin = {},
  142. latex = {
  143. auto_save = false,
  144. ignore_errors = { },
  145. },
  146. lua = {
  147. diagnostics = {
  148. virtual_text = { spacing = 0, prefix = "" },
  149. signs = true,
  150. underline = true,
  151. },
  152. formatter = {
  153. exe = "stylua",
  154. args = {},
  155. stdin = false,
  156. },
  157. },
  158. php = {
  159. format = {
  160. format = {
  161. default = "psr12",
  162. },
  163. },
  164. environment = {
  165. php_version = "7.4",
  166. },
  167. diagnostics = {
  168. virtual_text = { spacing = 0, prefix = "" },
  169. signs = true,
  170. underline = true,
  171. },
  172. filetypes = { "php", "phtml" },
  173. formatter = {
  174. exe = "phpcbf",
  175. args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) },
  176. stdin = false,
  177. },
  178. },
  179. python = {
  180. -- @usage can be flake8 or yapf
  181. linter = "",
  182. isort = false,
  183. diagnostics = {
  184. virtual_text = { spacing = 0, prefix = "" },
  185. signs = true,
  186. underline = true,
  187. },
  188. analysis = {
  189. type_checking = "basic",
  190. auto_search_paths = true,
  191. use_library_code_types = true,
  192. },
  193. formatter = {
  194. exe = "yapf",
  195. args = {},
  196. },
  197. },
  198. ruby = {
  199. diagnostics = {
  200. virtualtext = { spacing = 0, prefix = "" },
  201. signs = true,
  202. underline = true,
  203. },
  204. filetypes = { "rb", "erb", "rakefile", "ruby" },
  205. formatter = {
  206. exe = "rufo",
  207. args = { "-x" },
  208. },
  209. },
  210. rust = {
  211. rust_tools = {
  212. active = false,
  213. parameter_hints_prefix = "<-",
  214. other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining)
  215. },
  216. -- @usage can be clippy
  217. formatter = {
  218. exe = "rustfmt",
  219. args = { "--emit=stdout", "--edition=2018" },
  220. },
  221. linter = "",
  222. diagnostics = {
  223. virtual_text = { spacing = 0, prefix = "" },
  224. signs = true,
  225. underline = true,
  226. },
  227. },
  228. sh = {
  229. -- @usage can be 'shellcheck'
  230. linter = "",
  231. -- @usage can be 'shfmt'
  232. diagnostics = {
  233. virtual_text = { spacing = 0, prefix = "" },
  234. signs = true,
  235. underline = true,
  236. },
  237. formatter = {
  238. exe = "shfmt",
  239. args = { "-w" },
  240. stdin = false,
  241. },
  242. },
  243. svelte = {},
  244. tailwindcss = {
  245. active = false,
  246. filetypes = {
  247. "html",
  248. "css",
  249. "scss",
  250. "javascript",
  251. "javascriptreact",
  252. "typescript",
  253. "typescriptreact",
  254. },
  255. formatter = {
  256. exe = "prettier",
  257. args = { "--write", "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  258. stdin = false,
  259. },
  260. },
  261. terraform = {},
  262. tsserver = {
  263. -- @usage can be 'eslint' or 'eslint_d'
  264. linter = "",
  265. diagnostics = {
  266. virtual_text = { spacing = 0, prefix = "" },
  267. signs = true,
  268. underline = true,
  269. },
  270. formatter = {
  271. exe = "prettier",
  272. args = { "--write", "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  273. stdin = false,
  274. },
  275. },
  276. vim = {},
  277. yaml = {
  278. formatter = {
  279. exe = "prettier",
  280. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  281. },
  282. },
  283. },
  284. }
  285. require "lv-zen.config"
  286. require "lv-compe.config"
  287. require "lv-dashboard.config"
  288. require "lv-floatterm.config"
  289. require "lv-galaxyline.config"
  290. require "lv-gitsigns.config"
  291. require "lv-telescope.config"
  292. require "lv-floatterm.config"
  293. require "lv-dap.config"
  294. require "lv-which-key.config"
  295. require "lv-treesitter.config"