config.example.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. --[[
  2. THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
  3. `lvim` is the global options object
  4. ]]
  5. -- vim options
  6. vim.opt.shiftwidth = 2
  7. vim.opt.tabstop = 2
  8. vim.opt.relativenumber = true
  9. -- general
  10. lvim.log.level = "info"
  11. lvim.format_on_save = {
  12. enabled = true,
  13. pattern = "*.lua",
  14. timeout = 1000,
  15. }
  16. -- to disable icons and use a minimalist setup, uncomment the following
  17. -- lvim.use_icons = false
  18. -- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
  19. lvim.leader = "space"
  20. -- add your own keymapping
  21. lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
  22. -- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
  23. -- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
  24. -- -- Use which-key to add extra bindings with the leader-key prefix
  25. -- lvim.builtin.which_key.mappings["W"] = { "<cmd>noautocmd w<cr>", "Save without formatting" }
  26. -- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
  27. -- -- Change theme settings
  28. -- lvim.colorscheme = "lunar"
  29. lvim.builtin.alpha.active = true
  30. lvim.builtin.alpha.mode = "dashboard"
  31. lvim.builtin.terminal.active = true
  32. lvim.builtin.nvimtree.setup.view.side = "left"
  33. lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
  34. -- Automatically install missing parsers when entering buffer
  35. lvim.builtin.treesitter.auto_install = true
  36. -- lvim.builtin.treesitter.ignore_install = { "haskell" }
  37. -- -- always installed on startup, useful for parsers without a strict filetype
  38. -- lvim.builtin.treesitter.ensure_installed = { "comment", "markdown_inline", "regex" }
  39. -- -- generic LSP settings <https://www.lunarvim.org/docs/configuration/language-features/language-servers>
  40. -- --- disable automatic installation of servers
  41. -- lvim.lsp.installer.setup.automatic_installation = false
  42. -- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
  43. -- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
  44. -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
  45. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  46. -- require("lvim.lsp.manager").setup("pyright", opts)
  47. -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
  48. -- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
  49. -- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
  50. -- return server ~= "emmet_ls"
  51. -- end, lvim.lsp.automatic_configuration.skipped_servers)
  52. -- -- you can set a custom on_attach function that will be used for all the language servers
  53. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  54. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  55. -- local function buf_set_option(...)
  56. -- vim.api.nvim_buf_set_option(bufnr, ...)
  57. -- end
  58. -- --Enable completion triggered by <c-x><c-o>
  59. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  60. -- end
  61. -- -- linters, formatters and code actions <https://www.lunarvim.org/docs/configuration/language-features/linting-and-formatting>
  62. -- local formatters = require "lvim.lsp.null-ls.formatters"
  63. -- formatters.setup {
  64. -- { command = "stylua" },
  65. -- {
  66. -- command = "prettier",
  67. -- extra_args = { "--print-width", "100" },
  68. -- filetypes = { "typescript", "typescriptreact" },
  69. -- },
  70. -- }
  71. -- local linters = require "lvim.lsp.null-ls.linters"
  72. -- linters.setup {
  73. -- { command = "flake8", filetypes = { "python" } },
  74. -- {
  75. -- command = "shellcheck",
  76. -- args = { "--severity", "warning" },
  77. -- },
  78. -- }
  79. -- local code_actions = require "lvim.lsp.null-ls.code_actions"
  80. -- code_actions.setup {
  81. -- {
  82. -- exe = "eslint",
  83. -- filetypes = { "typescript", "typescriptreact" },
  84. -- },
  85. -- }
  86. -- -- Additional Plugins <https://www.lunarvim.org/docs/configuration/plugins/user-plugins>
  87. -- lvim.plugins = {
  88. -- {
  89. -- "folke/trouble.nvim",
  90. -- cmd = "TroubleToggle",
  91. -- },
  92. -- }
  93. -- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
  94. -- vim.api.nvim_create_autocmd("FileType", {
  95. -- pattern = "zsh",
  96. -- callback = function()
  97. -- -- let treesitter use bash highlight for zsh files as well
  98. -- require("nvim-treesitter.highlight").attach(0, "bash")
  99. -- end,
  100. -- })