config_win.example.lua 6.7 KB

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