config.example.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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>"] = ""
  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. -- lvim.builtin.telescope.on_config_done = function()
  23. -- local actions = require "telescope.actions"
  24. -- -- for input mode
  25. -- lvim.builtin.telescope.defaults.mappings.i["<C-j>"] = actions.move_selection_next
  26. -- lvim.builtin.telescope.defaults.mappings.i["<C-k>"] = actions.move_selection_previous
  27. -- lvim.builtin.telescope.defaults.mappings.i["<C-n>"] = actions.cycle_history_next
  28. -- lvim.builtin.telescope.defaults.mappings.i["<C-p>"] = actions.cycle_history_prev
  29. -- -- for normal mode
  30. -- lvim.builtin.telescope.defaults.mappings.n["<C-j>"] = actions.move_selection_next
  31. -- lvim.builtin.telescope.defaults.mappings.n["<C-k>"] = actions.move_selection_previous
  32. -- end
  33. -- Use which-key to add extra bindings with the leader-key prefix
  34. -- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
  35. -- lvim.builtin.which_key.mappings["t"] = {
  36. -- name = "+Trouble",
  37. -- r = { "<cmd>Trouble lsp_references<cr>", "References" },
  38. -- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
  39. -- d = { "<cmd>Trouble lsp_document_diagnostics<cr>", "Diagnostics" },
  40. -- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
  41. -- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
  42. -- w = { "<cmd>Trouble lsp_workspace_diagnostics<cr>", "Diagnostics" },
  43. -- }
  44. -- TODO: User Config for predefined plugins
  45. -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
  46. lvim.builtin.dashboard.active = true
  47. lvim.builtin.terminal.active = true
  48. lvim.builtin.nvimtree.setup.view.side = "left"
  49. lvim.builtin.nvimtree.show_icons.git = 0
  50. -- if you don't want all the parsers change this to a table of the ones you want
  51. lvim.builtin.treesitter.ensure_installed = {
  52. "bash",
  53. "c",
  54. "javascript",
  55. "json",
  56. "lua",
  57. "python",
  58. "typescript",
  59. "css",
  60. "rust",
  61. "java",
  62. "yaml",
  63. }
  64. lvim.builtin.treesitter.ignore_install = { "haskell" }
  65. lvim.builtin.treesitter.highlight.enabled = true
  66. -- generic LSP settings
  67. -- you can set a custom on_attach function that will be used for all the language servers
  68. -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  69. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  70. -- local function buf_set_option(...)
  71. -- vim.api.nvim_buf_set_option(bufnr, ...)
  72. -- end
  73. -- --Enable completion triggered by <c-x><c-o>
  74. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  75. -- end
  76. -- you can overwrite the null_ls setup table (useful for setting the root_dir function)
  77. -- lvim.lsp.null_ls.setup = {
  78. -- root_dir = require("lspconfig").util.root_pattern("Makefile", ".git", "node_modules"),
  79. -- }
  80. -- or if you need something more advanced
  81. -- lvim.lsp.null_ls.setup.root_dir = function(fname)
  82. -- if vim.bo.filetype == "javascript" then
  83. -- return require("lspconfig/util").root_pattern("Makefile", ".git", "node_modules")(fname)
  84. -- or require("lspconfig/util").path.dirname(fname)
  85. -- elseif vim.bo.filetype == "php" then
  86. -- return require("lspconfig/util").root_pattern("Makefile", ".git", "composer.json")(fname) or vim.fn.getcwd()
  87. -- else
  88. -- return require("lspconfig/util").root_pattern("Makefile", ".git")(fname) or require("lspconfig/util").path.dirname(fname)
  89. -- end
  90. -- end
  91. -- set a formatter if you want to override the default lsp one (if it exists)
  92. -- lvim.lang.python.formatters = {
  93. -- {
  94. -- exe = "black",
  95. -- }
  96. -- }
  97. -- set an additional linter
  98. -- lvim.lang.python.linters = {
  99. -- {
  100. -- exe = "flake8",
  101. -- }
  102. -- }
  103. -- Additional Plugins
  104. -- lvim.plugins = {
  105. -- {"folke/tokyonight.nvim"},
  106. -- {
  107. -- "folke/trouble.nvim",
  108. -- cmd = "TroubleToggle",
  109. -- },
  110. -- }
  111. -- Autocommands (https://neovim.io/doc/user/autocmd.html)
  112. -- lvim.autocommands.custom_groups = {
  113. -- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
  114. -- }