default-config.lua 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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. -- TODO refactor treesitter
  58. -- @usage pass a table with your desired languages
  59. treesitter = {
  60. ensure_installed = "all",
  61. ignore_install = { "haskell" },
  62. highlight = { enabled = true },
  63. -- The below are for treesitter-textobjects plugin
  64. textobj_prefixes = {
  65. goto_next = "]", -- Go to next
  66. goto_previous = "[", -- Go to previous
  67. inner = "i", -- Select inside
  68. outer = "a", -- Selct around
  69. swap = "<leader>a", -- Swap with next
  70. },
  71. textobj_suffixes = {
  72. -- Start and End respectively for the goto keys
  73. -- for other keys it only uses the first
  74. ["function"] = { "f", "F" },
  75. ["class"] = { "m", "M" },
  76. ["parameter"] = { "a", "A" },
  77. ["block"] = { "k", "K" },
  78. ["conditional"] = { "i", "I" },
  79. ["call"] = { "c", "C" },
  80. ["loop"] = { "l", "L" },
  81. ["statement"] = { "s", "S" },
  82. ["comment"] = { "/", "?" },
  83. },
  84. -- The below is for treesitter hint textobjects plugin
  85. hint_labels = { "h", "j", "f", "d", "n", "v", "s", "l", "a" },
  86. },
  87. lsp = {
  88. document_highlight = true,
  89. popup_border = "single",
  90. },
  91. database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
  92. plugin = {
  93. -- Builtins
  94. diffview = { active = false },
  95. ts_context_commentstring = { active = false },
  96. ts_hintobjects = { active = false },
  97. ts_textobjects = { active = false },
  98. ts_textsubjects = { active = false },
  99. telescope_project = { active = false },
  100. indent_line = { active = false },
  101. lush = { active = false },
  102. },
  103. -- TODO just using mappings (leader mappings)
  104. user_which_key = {},
  105. user_plugins = {
  106. -- use lv-config.lua for this not put here
  107. },
  108. user_autocommands = {
  109. { "FileType", "qf", "set nobuflisted" },
  110. },
  111. lang = {
  112. cmake = {},
  113. clang = {
  114. diagnostics = {
  115. virtual_text = { spacing = 0, prefix = "" },
  116. signs = true,
  117. underline = true,
  118. },
  119. cross_file_rename = true,
  120. header_insertion = "never",
  121. },
  122. css = {
  123. virtual_text = true,
  124. },
  125. dart = {
  126. sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
  127. },
  128. docker = {},
  129. efm = {},
  130. elm = {},
  131. emmet = { active = true },
  132. elixir = {},
  133. graphql = {},
  134. go = {},
  135. html = {},
  136. java = {
  137. java_tools = {
  138. active = false,
  139. },
  140. },
  141. json = {
  142. diagnostics = {
  143. virtual_text = { spacing = 0, prefix = "" },
  144. signs = true,
  145. underline = true,
  146. },
  147. },
  148. kotlin = {},
  149. latex = {},
  150. lua = {
  151. diagnostics = {
  152. virtual_text = { spacing = 0, prefix = "" },
  153. signs = true,
  154. underline = true,
  155. },
  156. },
  157. php = {
  158. format = {
  159. format = {
  160. default = "psr12",
  161. },
  162. },
  163. environment = {
  164. php_version = "7.4",
  165. },
  166. diagnostics = {
  167. virtual_text = { spacing = 0, prefix = "" },
  168. signs = true,
  169. underline = true,
  170. },
  171. filetypes = { "php", "phtml" },
  172. },
  173. python = {
  174. linter = "",
  175. isort = false,
  176. diagnostics = {
  177. virtual_text = { spacing = 0, prefix = "" },
  178. signs = true,
  179. underline = true,
  180. },
  181. analysis = {
  182. type_checking = "basic",
  183. auto_search_paths = true,
  184. use_library_code_types = true,
  185. },
  186. },
  187. ruby = {
  188. diagnostics = {
  189. virtualtext = { spacing = 0, prefix = "" },
  190. signs = true,
  191. underline = true,
  192. },
  193. filetypes = { "rb", "erb", "rakefile", "ruby" },
  194. },
  195. rust = {
  196. rust_tools = {
  197. active = false,
  198. parameter_hints_prefix = "<-",
  199. other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining)
  200. },
  201. linter = "",
  202. diagnostics = {
  203. virtual_text = { spacing = 0, prefix = "" },
  204. signs = true,
  205. underline = true,
  206. },
  207. },
  208. sh = {
  209. -- @usage can be 'shellcheck'
  210. linter = "",
  211. -- @usage can be 'shfmt'
  212. diagnostics = {
  213. virtual_text = { spacing = 0, prefix = "" },
  214. signs = true,
  215. underline = true,
  216. },
  217. },
  218. svelte = {},
  219. tailwindcss = {
  220. active = false,
  221. filetypes = {
  222. "html",
  223. "css",
  224. "scss",
  225. "javascript",
  226. "javascriptreact",
  227. "typescript",
  228. "typescriptreact",
  229. },
  230. },
  231. terraform = {},
  232. tsserver = {
  233. -- @usage can be 'eslint'
  234. linter = "",
  235. diagnostics = {
  236. virtual_text = { spacing = 0, prefix = "" },
  237. signs = true,
  238. underline = true,
  239. },
  240. },
  241. vim = {},
  242. yaml = {},
  243. },
  244. }
  245. require "lv-zen.config"
  246. require "lv-compe.config"
  247. require "lv-dashboard.config"
  248. require "lv-floatterm.config"
  249. require "lv-galaxyline.config"
  250. require "lv-gitsigns.config"
  251. require "lv-telescope.config"
  252. require "lv-dap.config"
  253. require "lv-which-key.config"