config.example.lua 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. --[[
  2. lvim is the global options object
  3. Linters should be
  4. filled in as strings with either
  5. a global executable or a path to
  6. an executable
  7. ]]
  8. -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
  9. -- general
  10. lvim.log.level = "warn"
  11. lvim.format_on_save = false
  12. lvim.colorscheme = "lunar"
  13. -- to disable icons and use a minimalist setup, uncomment the following
  14. -- lvim.use_icons = false
  15. -- keymappings [view all the defaults by pressing <leader>Lk]
  16. lvim.leader = "space"
  17. -- add your own keymapping
  18. lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
  19. -- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
  20. -- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
  21. -- unmap a default keymapping
  22. -- vim.keymap.del("n", "<C-Up>")
  23. -- override a default keymapping
  24. -- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" -- or vim.keymap.set("n", "<C-q>", ":q<cr>" )
  25. -- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
  26. -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
  27. -- local _, actions = pcall(require, "telescope.actions")
  28. -- lvim.builtin.telescope.defaults.mappings = {
  29. -- -- for input mode
  30. -- i = {
  31. -- ["<C-j>"] = actions.move_selection_next,
  32. -- ["<C-k>"] = actions.move_selection_previous,
  33. -- ["<C-n>"] = actions.cycle_history_next,
  34. -- ["<C-p>"] = actions.cycle_history_prev,
  35. -- },
  36. -- -- for normal mode
  37. -- n = {
  38. -- ["<C-j>"] = actions.move_selection_next,
  39. -- ["<C-k>"] = actions.move_selection_previous,
  40. -- },
  41. -- }
  42. -- Change theme settings
  43. -- lvim.builtin.theme.options.dim_inactive = true
  44. -- lvim.builtin.theme.options.style = "storm"
  45. -- Use which-key to add extra bindings with the leader-key prefix
  46. -- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
  47. -- lvim.builtin.which_key.mappings["t"] = {
  48. -- name = "+Trouble",
  49. -- r = { "<cmd>Trouble lsp_references<cr>", "References" },
  50. -- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
  51. -- d = { "<cmd>Trouble document_diagnostics<cr>", "Diagnostics" },
  52. -- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
  53. -- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
  54. -- w = { "<cmd>Trouble workspace_diagnostics<cr>", "Workspace Diagnostics" },
  55. -- }
  56. -- TODO: User Config for predefined plugins
  57. -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
  58. lvim.builtin.alpha.active = true
  59. lvim.builtin.alpha.mode = "dashboard"
  60. lvim.builtin.terminal.active = true
  61. lvim.builtin.nvimtree.setup.view.side = "left"
  62. lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
  63. -- if you don't want all the parsers change this to a table of the ones you want
  64. lvim.builtin.treesitter.ensure_installed = {
  65. "bash",
  66. "c",
  67. "javascript",
  68. "json",
  69. "lua",
  70. "python",
  71. "typescript",
  72. "tsx",
  73. "css",
  74. "rust",
  75. "java",
  76. "yaml",
  77. }
  78. lvim.builtin.treesitter.ignore_install = { "haskell" }
  79. lvim.builtin.treesitter.highlight.enable = true
  80. -- generic LSP settings
  81. -- -- make sure server will always be installed even if the server is in skipped_servers list
  82. -- lvim.lsp.installer.setup.ensure_installed = {
  83. -- "sumneko_lua",
  84. -- "jsonls",
  85. -- }
  86. -- -- change UI setting of `LspInstallInfo`
  87. -- -- see <https://github.com/williamboman/nvim-lsp-installer#default-configuration>
  88. -- lvim.lsp.installer.setup.ui.check_outdated_servers_on_open = false
  89. -- lvim.lsp.installer.setup.ui.border = "rounded"
  90. -- lvim.lsp.installer.setup.ui.keymaps = {
  91. -- uninstall_server = "d",
  92. -- toggle_server_expand = "o",
  93. -- }
  94. -- ---@usage disable automatic installation of servers
  95. -- lvim.lsp.installer.setup.automatic_installation = false
  96. -- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!!
  97. -- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))`
  98. -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
  99. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  100. -- require("lvim.lsp.manager").setup("pyright", opts)
  101. -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
  102. -- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
  103. -- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
  104. -- return server ~= "emmet_ls"
  105. -- end, lvim.lsp.automatic_configuration.skipped_servers)
  106. -- -- you can set a custom on_attach function that will be used for all the language servers
  107. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  108. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  109. -- local function buf_set_option(...)
  110. -- vim.api.nvim_buf_set_option(bufnr, ...)
  111. -- end
  112. -- --Enable completion triggered by <c-x><c-o>
  113. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  114. -- end
  115. -- -- set a formatter, this will override the language server formatting capabilities (if it exists)
  116. -- local formatters = require "lvim.lsp.null-ls.formatters"
  117. -- formatters.setup {
  118. -- { command = "black", filetypes = { "python" } },
  119. -- { command = "isort", filetypes = { "python" } },
  120. -- {
  121. -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  122. -- command = "prettier",
  123. -- ---@usage arguments to pass to the formatter
  124. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  125. -- extra_args = { "--print-with", "100" },
  126. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  127. -- filetypes = { "typescript", "typescriptreact" },
  128. -- },
  129. -- }
  130. -- -- set additional linters
  131. -- local linters = require "lvim.lsp.null-ls.linters"
  132. -- linters.setup {
  133. -- { command = "flake8", filetypes = { "python" } },
  134. -- {
  135. -- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  136. -- command = "shellcheck",
  137. -- ---@usage arguments to pass to the formatter
  138. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  139. -- extra_args = { "--severity", "warning" },
  140. -- },
  141. -- {
  142. -- command = "codespell",
  143. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  144. -- filetypes = { "javascript", "python" },
  145. -- },
  146. -- }
  147. -- Additional Plugins
  148. -- lvim.plugins = {
  149. -- {
  150. -- "folke/trouble.nvim",
  151. -- cmd = "TroubleToggle",
  152. -- },
  153. -- }
  154. -- Autocommands (https://neovim.io/doc/user/autocmd.html)
  155. -- vim.api.nvim_create_autocmd("BufEnter", {
  156. -- pattern = { "*.json", "*.jsonc" },
  157. -- -- enable wrap mode for json files only
  158. -- command = "setlocal wrap",
  159. -- })
  160. -- vim.api.nvim_create_autocmd("FileType", {
  161. -- pattern = "zsh",
  162. -- callback = function()
  163. -- -- let treesitter use bash highlight for zsh files as well
  164. -- require("nvim-treesitter.highlight").attach(0, "bash")
  165. -- end,
  166. -- })