default-config.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. 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. lang = {
  73. cmake = {
  74. formatter = {
  75. exe = "clang-format",
  76. args = {},
  77. },
  78. },
  79. clang = {
  80. diagnostics = {
  81. virtual_text = { spacing = 0, prefix = "" },
  82. signs = true,
  83. underline = true,
  84. },
  85. cross_file_rename = true,
  86. header_insertion = "never",
  87. filetypes = { "c", "cpp", "objc" },
  88. formatter = {
  89. exe = "clang-format",
  90. args = {},
  91. },
  92. },
  93. css = {
  94. virtual_text = true,
  95. },
  96. dart = {
  97. sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
  98. formatter = {
  99. exe = "dart",
  100. args = { "format" },
  101. },
  102. },
  103. docker = {},
  104. efm = {},
  105. elm = {},
  106. emmet = { active = true },
  107. elixir = {},
  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. },
  121. json = {
  122. diagnostics = {
  123. virtual_text = { spacing = 0, prefix = "" },
  124. signs = true,
  125. underline = true,
  126. },
  127. formatter = {
  128. exe = "python",
  129. args = { "-m", "json.tool" },
  130. },
  131. },
  132. kotlin = {},
  133. latex = {
  134. auto_save = false,
  135. ignore_errors = {},
  136. },
  137. lua = {
  138. diagnostics = {
  139. virtual_text = { spacing = 0, prefix = "" },
  140. signs = true,
  141. underline = true,
  142. },
  143. formatter = {
  144. exe = "stylua",
  145. args = {},
  146. stdin = false,
  147. },
  148. },
  149. php = {
  150. format = {
  151. format = {
  152. default = "psr12",
  153. },
  154. },
  155. environment = {
  156. php_version = "7.4",
  157. },
  158. diagnostics = {
  159. virtual_text = { spacing = 0, prefix = "" },
  160. signs = true,
  161. underline = true,
  162. },
  163. filetypes = { "php", "phtml" },
  164. formatter = {
  165. exe = "phpcbf",
  166. args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) },
  167. stdin = false,
  168. },
  169. },
  170. python = {
  171. -- @usage can be flake8 or yapf
  172. linter = "",
  173. isort = false,
  174. diagnostics = {
  175. virtual_text = { spacing = 0, prefix = "" },
  176. signs = true,
  177. underline = true,
  178. },
  179. analysis = {
  180. type_checking = "basic",
  181. auto_search_paths = true,
  182. use_library_code_types = true,
  183. },
  184. formatter = {
  185. exe = "yapf",
  186. args = {},
  187. },
  188. },
  189. ruby = {
  190. diagnostics = {
  191. virtualtext = { spacing = 0, prefix = "" },
  192. signs = true,
  193. underline = true,
  194. },
  195. filetypes = { "rb", "erb", "rakefile", "ruby" },
  196. formatter = {
  197. exe = "rufo",
  198. args = { "-x" },
  199. },
  200. },
  201. rust = {
  202. rust_tools = {
  203. active = false,
  204. parameter_hints_prefix = "<-",
  205. other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining)
  206. },
  207. -- @usage can be clippy
  208. formatter = {
  209. exe = "rustfmt",
  210. args = { "--emit=stdout", "--edition=2018" },
  211. },
  212. linter = "",
  213. diagnostics = {
  214. virtual_text = { spacing = 0, prefix = "" },
  215. signs = true,
  216. underline = true,
  217. },
  218. },
  219. sh = {
  220. -- @usage can be 'shellcheck'
  221. linter = "",
  222. -- @usage can be 'shfmt'
  223. diagnostics = {
  224. virtual_text = { spacing = 0, prefix = "" },
  225. signs = true,
  226. underline = true,
  227. },
  228. formatter = {
  229. exe = "shfmt",
  230. args = { "-w" },
  231. stdin = false,
  232. },
  233. },
  234. svelte = {},
  235. tailwindcss = {
  236. active = false,
  237. filetypes = {
  238. "html",
  239. "css",
  240. "scss",
  241. "javascript",
  242. "javascriptreact",
  243. "typescript",
  244. "typescriptreact",
  245. },
  246. formatter = {
  247. exe = "prettier",
  248. args = { "--write", "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  249. stdin = false,
  250. },
  251. },
  252. terraform = {},
  253. tsserver = {
  254. -- @usage can be 'eslint' or 'eslint_d'
  255. linter = "",
  256. diagnostics = {
  257. virtual_text = { spacing = 0, prefix = "" },
  258. signs = true,
  259. underline = true,
  260. },
  261. formatter = {
  262. exe = "prettier",
  263. args = { "--write", "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  264. stdin = false,
  265. },
  266. },
  267. vim = {},
  268. yaml = {
  269. formatter = {
  270. exe = "prettier",
  271. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
  272. },
  273. },
  274. },
  275. }
  276. require "core.status_colors"
  277. require("core.gitsigns").config()
  278. require("core.compe").config()
  279. require("core.dashboard").config()
  280. require("core.dap").config()
  281. require("core.floatterm").config()
  282. require("core.zen").config()
  283. require("core.telescope").config()
  284. require("core.treesitter").config()
  285. require("core.which-key").config()