config_win.example.lua 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. --[[
  2. THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
  3. `lvim` is the global options object
  4. ]]
  5. -- Enable powershell as your default shell
  6. vim.opt.shell = "pwsh.exe -NoLogo"
  7. vim.opt.shellcmdflag =
  8. "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
  9. vim.cmd [[
  10. let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
  11. let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
  12. set shellquote= shellxquote=
  13. ]]
  14. -- Set a compatible clipboard manager
  15. vim.g.clipboard = {
  16. copy = {
  17. ["+"] = "win32yank.exe -i --crlf",
  18. ["*"] = "win32yank.exe -i --crlf",
  19. },
  20. paste = {
  21. ["+"] = "win32yank.exe -o --lf",
  22. ["*"] = "win32yank.exe -o --lf",
  23. },
  24. }
  25. -- general
  26. lvim.log.level = "warn"
  27. lvim.format_on_save = true
  28. lvim.colorscheme = "tokyonight"
  29. -- to disable icons and use a minimalist setup, uncomment the following
  30. -- lvim.use_icons = false
  31. -- keymappings [view all the defaults by pressing <leader>Lk]
  32. lvim.leader = "space"
  33. -- add your own keymapping
  34. lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
  35. -- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
  36. -- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
  37. -- unmap a default keymapping
  38. -- vim.keymap.del("n", "<C-Up>")
  39. -- override a default keymapping
  40. -- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" -- or vim.keymap.set("n", "<C-q>", ":q<cr>" )
  41. -- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
  42. -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
  43. -- local _, actions = pcall(require, "telescope.actions")
  44. -- lvim.builtin.telescope.defaults.mappings = {
  45. -- -- for input mode
  46. -- i = {
  47. -- ["<C-j>"] = actions.move_selection_next,
  48. -- ["<C-k>"] = actions.move_selection_previous,
  49. -- ["<C-n>"] = actions.cycle_history_next,
  50. -- ["<C-p>"] = actions.cycle_history_prev,
  51. -- },
  52. -- -- for normal mode
  53. -- n = {
  54. -- ["<C-j>"] = actions.move_selection_next,
  55. -- ["<C-k>"] = actions.move_selection_previous,
  56. -- },
  57. -- }
  58. -- Change theme settings
  59. -- lvim.builtin.theme.options.dim_inactive = true
  60. -- lvim.builtin.theme.options.style = "storm"
  61. -- Use which-key to add extra bindings with the leader-key prefix
  62. -- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
  63. -- lvim.builtin.which_key.mappings["t"] = {
  64. -- name = "+Trouble",
  65. -- r = { "<cmd>Trouble lsp_references<cr>", "References" },
  66. -- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
  67. -- d = { "<cmd>Trouble document_diagnostics<cr>", "Diagnostics" },
  68. -- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
  69. -- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
  70. -- w = { "<cmd>Trouble workspace_diagnostics<cr>", "Workspace Diagnostics" },
  71. -- }
  72. -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
  73. lvim.builtin.alpha.active = true
  74. lvim.builtin.alpha.mode = "dashboard"
  75. lvim.builtin.notify.active = true
  76. lvim.builtin.terminal.active = false
  77. -- lvim.builtin.terminal.shell = "pwsh.exe -NoLogo"
  78. -- nvim-tree has some performance issues on windows, see kyazdani42/nvim-tree.lua#549
  79. lvim.builtin.nvimtree.setup.diagnostics.enable = nil
  80. lvim.builtin.nvimtree.setup.filters.custom = nil
  81. lvim.builtin.nvimtree.setup.git.enable = nil
  82. lvim.builtin.nvimtree.setup.update_cwd = nil
  83. lvim.builtin.nvimtree.setup.update_focused_file.update_cwd = nil
  84. lvim.builtin.nvimtree.setup.view.side = "left"
  85. lvim.builtin.nvimtree.setup.renderer.highlight_git = nil
  86. lvim.builtin.nvimtree.setup.renderer.icons.show.git = nil
  87. -- if you don't want all the parsers change this to a table of the ones you want
  88. lvim.builtin.treesitter.ensure_installed = {
  89. "c",
  90. "lua",
  91. }
  92. lvim.builtin.treesitter.ignore_install = { "haskell" }
  93. lvim.builtin.treesitter.highlight.enable = true
  94. -- generic LSP settings
  95. -- -- make sure server will always be installed even if the server is in skipped_servers list
  96. -- lvim.lsp.installer.setup.ensure_installed = {
  97. -- "sumeko_lua",
  98. -- "jsonls",
  99. -- }
  100. -- -- change UI setting of `LspInstallInfo`
  101. -- -- see <https://github.com/williamboman/nvim-lsp-installer#default-configuration>
  102. -- lvim.lsp.installer.setup.ui.check_outdated_servers_on_open = false
  103. -- lvim.lsp.installer.setup.ui.border = "rounded"
  104. -- lvim.lsp.installer.setup.ui.keymaps = {
  105. -- uninstall_server = "d",
  106. -- toggle_server_expand = "o",
  107. -- }
  108. -- ---@usage disable automatic installation of servers
  109. -- lvim.lsp.installer.setup.automatic_installation = false
  110. -- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!!
  111. -- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))`
  112. -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
  113. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  114. -- require("lvim.lsp.manager").setup("pyright", opts)
  115. -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
  116. -- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
  117. -- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
  118. -- return server ~= "emmet_ls"
  119. -- end, lvim.lsp.automatic_configuration.skipped_servers)
  120. -- -- you can set a custom on_attach function that will be used for all the language servers
  121. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  122. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  123. -- local function buf_set_option(...)
  124. -- vim.api.nvim_buf_set_option(bufnr, ...)
  125. -- end
  126. -- --Enable completion triggered by <c-x><c-o>
  127. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  128. -- end
  129. -- -- set a formatter, this will override the language server formatting capabilities (if it exists)
  130. -- local formatters = require "lvim.lsp.null-ls.formatters"
  131. -- formatters.setup {
  132. -- { command = "black", filetypes = { "python" } },
  133. -- { command = "isort", filetypes = { "python" } },
  134. -- {
  135. -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  136. -- command = "prettier",
  137. -- ---@usage arguments to pass to the formatter
  138. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  139. -- extra_args = { "--print-with", "100" },
  140. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  141. -- filetypes = { "typescript", "typescriptreact" },
  142. -- },
  143. -- }
  144. -- -- set additional linters
  145. -- local linters = require "lvim.lsp.null-ls.linters"
  146. -- linters.setup {
  147. -- { command = "flake8", filetypes = { "python" } },
  148. -- {
  149. -- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  150. -- command = "shellcheck",
  151. -- ---@usage arguments to pass to the formatter
  152. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  153. -- extra_args = { "--severity", "warning" },
  154. -- },
  155. -- {
  156. -- command = "codespell",
  157. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  158. -- filetypes = { "javascript", "python" },
  159. -- },
  160. -- }
  161. -- Additional Plugins
  162. -- lvim.plugins = {
  163. -- {
  164. -- "folke/trouble.nvim",
  165. -- cmd = "TroubleToggle",
  166. -- },
  167. -- }
  168. -- Autocommands (https://neovim.io/doc/user/autocmd.html)
  169. -- vim.api.nvim_create_autocmd("BufEnter", {
  170. -- pattern = { "*.json", "*.jsonc" },
  171. -- -- enable wrap mode for json files only
  172. -- command = "setlocal wrap",
  173. -- })
  174. -- vim.api.nvim_create_autocmd("FileType", {
  175. -- pattern = "zsh",
  176. -- callback = function()
  177. -- -- let treesitter use bash highlight for zsh files as well
  178. -- require("nvim-treesitter.highlight").attach(0, "bash")
  179. -- end,
  180. -- })