config.example.lua 4.5 KB

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