default-config.lua 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. transparent_window = false,
  10. format_on_save = true,
  11. vnsip_dir = vim.fn.stdpath "config" .. "/snippets",
  12. default_options = {
  13. backup = false, -- creates a backup file
  14. clipboard = "unnamedplus", -- allows neovim to access the system clipboard
  15. cmdheight = 2, -- more space in the neovim command line for displaying messages
  16. colorcolumn = "99999", -- fixes indentline for now
  17. completeopt = { "menuone", "noselect" },
  18. conceallevel = 0, -- so that `` is visible in markdown files
  19. fileencoding = "utf-8", -- the encoding written to a file
  20. guifont = "monospace:h17", -- the font used in graphical neovim applications
  21. hidden = true, -- required to keep multiple buffers and open multiple buffers
  22. hlsearch = false, -- highlight all matches on previous search pattern
  23. ignorecase = true, -- ignore case in search patterns
  24. mouse = "a", -- allow the mouse to be used in neovim
  25. pumheight = 10, -- pop up menu height
  26. showmode = false, -- we don't need to see things like -- INSERT -- anymore
  27. showtabline = 2, -- always show tabs
  28. smartcase = true, -- smart case
  29. smartindent = true, -- make indenting smarter again
  30. splitbelow = true, -- force all horizontal splits to go below current window
  31. splitright = true, -- force all vertical splits to go to the right of current window
  32. swapfile = false, -- creates a swapfile
  33. termguicolors = true, -- set term gui colors (most terminals support this)
  34. timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
  35. title = true, -- set the title of window to the value of the titlestring
  36. -- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
  37. undodir = CACHE_PATH .. "/undo", -- set an undo directory
  38. undofile = true, -- enable persisten undo
  39. updatetime = 300, -- faster completion
  40. 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
  41. expandtab = true, -- convert tabs to spaces
  42. shiftwidth = 2, -- the number of spaces inserted for each indentation
  43. tabstop = 2, -- insert 2 spaces for a tab
  44. cursorline = true, -- highlight the current line
  45. number = true, -- set numbered lines
  46. relativenumber = false, -- set relative numbered lines
  47. numberwidth = 4, -- set number column width to 2 {default 4}
  48. signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
  49. wrap = false, -- display lines as one long line
  50. spell = false,
  51. spelllang = "en",
  52. scrolloff = 8, -- is one of my fav
  53. },
  54. -- TODO: refactor for tree
  55. auto_close_tree = 0,
  56. nvim_tree_disable_netrw = 0,
  57. lsp = {
  58. document_highlight = true,
  59. popup_border = "single",
  60. },
  61. database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
  62. plugin = {
  63. -- Builtins
  64. diffview = { active = false },
  65. ts_hintobjects = { active = false },
  66. ts_textobjects = { active = false },
  67. ts_textsubjects = { active = false },
  68. telescope_project = { active = false },
  69. indent_line = { active = false },
  70. lush = { active = false },
  71. },
  72. -- TODO: just using mappings (leader mappings)
  73. user_which_key = {},
  74. user_plugins = {
  75. -- use lv-config.lua for this not put here
  76. },
  77. user_autocommands = {
  78. { "FileType", "qf", "set nobuflisted" },
  79. },
  80. lang = {
  81. cmake = {
  82. formatter = {
  83. exe = "clang-format",
  84. args = {},
  85. },
  86. },
  87. clang = {
  88. diagnostics = {
  89. virtual_text = { spacing = 0, prefix = "" },
  90. signs = true,
  91. underline = true,
  92. },
  93. cross_file_rename = true,
  94. header_insertion = "never",
  95. filetypes = { "c", "cpp", "objc" },
  96. formatter = {
  97. exe = "clang-format",
  98. args = {},
  99. },
  100. },
  101. css = {
  102. virtual_text = true,
  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 = true },
  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. },
  129. json = {
  130. diagnostics = {
  131. virtual_text = { spacing = 0, prefix = "" },
  132. signs = true,
  133. underline = true,
  134. },
  135. formatter = {
  136. exe = "python",
  137. args = { "-m", "json.tool" },
  138. },
  139. },
  140. kotlin = {},
  141. latex = {},
  142. lua = {
  143. diagnostics = {
  144. virtual_text = { spacing = 0, prefix = "" },
  145. signs = true,
  146. underline = true,
  147. },
  148. formatter = {
  149. exe = "stylua",
  150. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
  151. stdin = false,
  152. },
  153. },
  154. php = {
  155. format = {
  156. format = {
  157. default = "psr12",
  158. },
  159. },
  160. environment = {
  161. php_version = "7.4",
  162. },
  163. diagnostics = {
  164. virtual_text = { spacing = 0, prefix = "" },
  165. signs = true,
  166. underline = true,
  167. },
  168. filetypes = { "php", "phtml" },
  169. formatter = {
  170. exe = "phpcbf",
  171. args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) },
  172. stdin = false,
  173. },
  174. },
  175. python = {
  176. linter = "",
  177. isort = false,
  178. diagnostics = {
  179. virtual_text = { spacing = 0, prefix = "" },
  180. signs = true,
  181. underline = true,
  182. },
  183. analysis = {
  184. type_checking = "basic",
  185. auto_search_paths = true,
  186. use_library_code_types = true,
  187. },
  188. formatter = {
  189. exe = "yapf",
  190. args = {},
  191. },
  192. },
  193. ruby = {
  194. diagnostics = {
  195. virtualtext = { spacing = 0, prefix = "" },
  196. signs = true,
  197. underline = true,
  198. },
  199. filetypes = { "rb", "erb", "rakefile", "ruby" },
  200. formatter = {
  201. exe = "rufo",
  202. args = { "-x" },
  203. },
  204. },
  205. rust = {
  206. rust_tools = {
  207. active = false,
  208. parameter_hints_prefix = "<-",
  209. other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining)
  210. },
  211. formatter = {
  212. exe = "rustfmt",
  213. args = { "--emit=stdout" },
  214. },
  215. linter = "",
  216. diagnostics = {
  217. virtual_text = { spacing = 0, prefix = "" },
  218. signs = true,
  219. underline = true,
  220. },
  221. },
  222. sh = {
  223. -- @usage can be 'shellcheck'
  224. linter = "",
  225. -- @usage can be 'shfmt'
  226. diagnostics = {
  227. virtual_text = { spacing = 0, prefix = "" },
  228. signs = true,
  229. underline = true,
  230. },
  231. formatter = {
  232. exe = "shfmt",
  233. args = { "-w" },
  234. stdin = false,
  235. },
  236. },
  237. svelte = {},
  238. tailwindcss = {
  239. active = false,
  240. filetypes = {
  241. "html",
  242. "css",
  243. "scss",
  244. "javascript",
  245. "javascriptreact",
  246. "typescript",
  247. "typescriptreact",
  248. },
  249. formatter = {
  250. exe = "prettier",
  251. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  252. },
  253. },
  254. terraform = {},
  255. tsserver = {
  256. -- @usage can be 'eslint'
  257. linter = "",
  258. diagnostics = {
  259. virtual_text = { spacing = 0, prefix = "" },
  260. signs = true,
  261. underline = true,
  262. },
  263. formatter = {
  264. exe = "prettier",
  265. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  266. },
  267. },
  268. vim = {},
  269. yaml = {
  270. formatter = {
  271. exe = "prettier",
  272. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  273. },
  274. },
  275. },
  276. }
  277. require "lv-zen.config"
  278. require "lv-compe.config"
  279. require "lv-dashboard.config"
  280. require "lv-floatterm.config"
  281. require "lv-galaxyline.config"
  282. require "lv-gitsigns.config"
  283. require "lv-telescope.config"
  284. require "lv-floatterm.config"
  285. require "lv-dap.config"
  286. require "lv-which-key.config"
  287. require "lv-treesitter.config"