config.example-no-ts.lua 4.3 KB

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