config_win.example.lua 7.7 KB

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