config.example-no-ts.lua 4.2 KB

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