config_win.example.lua 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 = false
  75. lvim.builtin.nvimtree.setup.filters.custom = false
  76. lvim.builtin.nvimtree.setup.git.enable = false
  77. lvim.builtin.nvimtree.setup.update_cwd = false
  78. lvim.builtin.nvimtree.setup.update_focused_file.update_cwd = false
  79. lvim.builtin.nvimtree.setup.view.side = "left"
  80. lvim.builtin.nvimtree.git_hl = false
  81. lvim.builtin.nvimtree.show_icons.git = 0
  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. -- ---@usage disable automatic installation of servers
  91. -- lvim.lsp.automatic_servers_installation = false
  92. -- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!!
  93. -- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))`
  94. -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
  95. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  96. -- require("lvim.lsp.manager").setup("pyright", opts)
  97. -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
  98. -- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype
  99. -- vim.tbl_map(function(server)
  100. -- return server ~= "emmet_ls"
  101. -- end, lvim.lsp.automatic_configuration.skipped_servers)
  102. -- -- you can set a custom on_attach function that will be used for all the language servers
  103. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  104. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  105. -- local function buf_set_option(...)
  106. -- vim.api.nvim_buf_set_option(bufnr, ...)
  107. -- end
  108. -- --Enable completion triggered by <c-x><c-o>
  109. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  110. -- end
  111. -- -- set a formatter, this will override the language server formatting capabilities (if it exists)
  112. -- local formatters = require "lvim.lsp.null-ls.formatters"
  113. -- formatters.setup {
  114. -- { command = "black", filetypes = { "python" } },
  115. -- { command = "isort", filetypes = { "python" } },
  116. -- {
  117. -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  118. -- command = "prettier",
  119. -- ---@usage arguments to pass to the formatter
  120. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  121. -- extra_args = { "--print-with", "100" },
  122. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  123. -- filetypes = { "typescript", "typescriptreact" },
  124. -- },
  125. -- }
  126. -- -- set additional linters
  127. -- local linters = require "lvim.lsp.null-ls.linters"
  128. -- linters.setup {
  129. -- { command = "flake8", filetypes = { "python" } },
  130. -- {
  131. -- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  132. -- command = "shellcheck",
  133. -- ---@usage arguments to pass to the formatter
  134. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  135. -- extra_args = { "--severity", "warning" },
  136. -- },
  137. -- {
  138. -- command = "codespell",
  139. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  140. -- filetypes = { "javascript", "python" },
  141. -- },
  142. -- }
  143. -- Additional Plugins
  144. -- lvim.plugins = {
  145. -- {"folke/tokyonight.nvim"},
  146. -- {
  147. -- "folke/trouble.nvim",
  148. -- cmd = "TroubleToggle",
  149. -- },
  150. -- }
  151. -- Autocommands (https://neovim.io/doc/user/autocmd.html)
  152. -- vim.api.nvim_create_autocmd("BufEnter", {
  153. -- pattern = { "*.json", "*.jsonc" },
  154. -- -- enable wrap mode for json files only
  155. -- command = "setlocal wrap",
  156. -- })
  157. -- vim.api.nvim_create_autocmd("FileType", {
  158. -- pattern = "zsh",
  159. -- callback = function()
  160. -- -- let treesitter use bash highlight for zsh files as well
  161. -- require("nvim-treesitter.highlight").attach(0, "bash")
  162. -- end,
  163. -- })