config.example.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 = true
  12. lvim.colorscheme = "onedarker"
  13. -- keymappings [view all the defaults by pressing <leader>Lk]
  14. lvim.leader = "space"
  15. -- add your own keymapping
  16. lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
  17. -- unmap a default keymapping
  18. -- lvim.keys.normal_mode["<C-Up>"] = false
  19. -- edit a default keymapping
  20. -- lvim.keys.normal_mode["<C-q>"] = ":q<cr>"
  21. -- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
  22. -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
  23. -- local _, actions = pcall(require, "telescope.actions")
  24. -- lvim.builtin.telescope.defaults.mappings = {
  25. -- -- for input mode
  26. -- i = {
  27. -- ["<C-j>"] = actions.move_selection_next,
  28. -- ["<C-k>"] = actions.move_selection_previous,
  29. -- ["<C-n>"] = actions.cycle_history_next,
  30. -- ["<C-p>"] = actions.cycle_history_prev,
  31. -- },
  32. -- -- for normal mode
  33. -- n = {
  34. -- ["<C-j>"] = actions.move_selection_next,
  35. -- ["<C-k>"] = actions.move_selection_previous,
  36. -- },
  37. -- }
  38. -- Use which-key to add extra bindings with the leader-key prefix
  39. -- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
  40. -- lvim.builtin.which_key.mappings["t"] = {
  41. -- name = "+Trouble",
  42. -- r = { "<cmd>Trouble lsp_references<cr>", "References" },
  43. -- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
  44. -- d = { "<cmd>Trouble lsp_document_diagnostics<cr>", "Diagnostics" },
  45. -- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
  46. -- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
  47. -- w = { "<cmd>Trouble lsp_workspace_diagnostics<cr>", "Diagnostics" },
  48. -- }
  49. -- TODO: User Config for predefined plugins
  50. -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
  51. lvim.builtin.dashboard.active = true
  52. lvim.builtin.notify.active = true
  53. lvim.builtin.terminal.active = true
  54. lvim.builtin.nvimtree.setup.view.side = "left"
  55. lvim.builtin.nvimtree.show_icons.git = 0
  56. -- if you don't want all the parsers change this to a table of the ones you want
  57. lvim.builtin.treesitter.ensure_installed = {
  58. "bash",
  59. "c",
  60. "javascript",
  61. "json",
  62. "lua",
  63. "python",
  64. "typescript",
  65. "tsx",
  66. "css",
  67. "rust",
  68. "java",
  69. "yaml",
  70. }
  71. lvim.builtin.treesitter.ignore_install = { "haskell" }
  72. lvim.builtin.treesitter.highlight.enabled = true
  73. -- generic LSP settings
  74. -- ---@usage disable automatic installation of servers
  75. -- lvim.lsp.automatic_servers_installation = false
  76. -- ---@usage Select which servers should be configured manually. Requires `:LvimCacheRest` to take effect.
  77. -- See the full default list `:lua print(vim.inspect(lvim.lsp.override))`
  78. -- vim.list_extend(lvim.lsp.override, { "pyright" })
  79. -- ---@usage setup a server -- see: https://www.lunarvim.org/languages/#overriding-the-default-configuration
  80. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  81. -- require("lvim.lsp.manager").setup("pylsp", opts)
  82. -- -- you can set a custom on_attach function that will be used for all the language servers
  83. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  84. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  85. -- local function buf_set_option(...)
  86. -- vim.api.nvim_buf_set_option(bufnr, ...)
  87. -- end
  88. -- --Enable completion triggered by <c-x><c-o>
  89. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  90. -- end
  91. -- -- set a formatter, this will override the language server formatting capabilities (if it exists)
  92. -- local formatters = require "lvim.lsp.null-ls.formatters"
  93. -- formatters.setup {
  94. -- { command = "black", filetypes = { "python" } },
  95. -- { command = "isort", filetypes = { "python" } },
  96. -- {
  97. -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  98. -- command = "prettier",
  99. -- ---@usage arguments to pass to the formatter
  100. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  101. -- extra_args = { "--print-with", "100" },
  102. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  103. -- filetypes = { "typescript", "typescriptreact" },
  104. -- },
  105. -- }
  106. -- -- set additional linters
  107. -- local linters = require "lvim.lsp.null-ls.linters"
  108. -- linters.setup {
  109. -- { command = "flake8", filetypes = { "python" } },
  110. -- {
  111. -- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  112. -- command = "shellcheck",
  113. -- ---@usage arguments to pass to the formatter
  114. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  115. -- extra_args = { "--severity", "warning" },
  116. -- },
  117. -- {
  118. -- command = "codespell",
  119. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  120. -- filetypes = { "javascript", "python" },
  121. -- },
  122. -- }
  123. -- Additional Plugins
  124. -- lvim.plugins = {
  125. -- {"folke/tokyonight.nvim"},
  126. -- {
  127. -- "folke/trouble.nvim",
  128. -- cmd = "TroubleToggle",
  129. -- },
  130. -- }
  131. -- Autocommands (https://neovim.io/doc/user/autocmd.html)
  132. -- lvim.autocommands.custom_groups = {
  133. -- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
  134. -- }