config_win.example.lua 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 lsp_document_diagnostics<cr>", "Diagnostics" },
  61. -- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
  62. -- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
  63. -- w = { "<cmd>Trouble lsp_workspace_diagnostics<cr>", "Diagnostics" },
  64. -- }
  65. -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
  66. lvim.builtin.dashboard.active = true
  67. lvim.builtin.notify.active = true
  68. lvim.builtin.terminal.active = false
  69. -- lvim.builtin.terminal.shell = "pwsh.exe -NoLogo"
  70. -- nvim-tree has some performance issues on windows, see kyazdani42/nvim-tree.lua#549
  71. lvim.builtin.nvimtree.setup.diagnostics.enable = false
  72. lvim.builtin.nvimtree.setup.filters.custom = false
  73. lvim.builtin.nvimtree.setup.git.enable = false
  74. lvim.builtin.nvimtree.setup.update_cwd = false
  75. lvim.builtin.nvimtree.setup.update_focused_file.update_cwd = false
  76. lvim.builtin.nvimtree.setup.view.side = "left"
  77. lvim.builtin.nvimtree.git_hl = false
  78. lvim.builtin.nvimtree.show_icons.git = 0
  79. -- if you don't want all the parsers change this to a table of the ones you want
  80. lvim.builtin.treesitter.ensure_installed = {
  81. "c",
  82. "lua",
  83. }
  84. lvim.builtin.treesitter.ignore_install = { "haskell" }
  85. lvim.builtin.treesitter.highlight.enabled = true
  86. -- generic LSP settings
  87. -- ---@usage disable automatic installation of servers
  88. -- lvim.lsp.automatic_servers_installation = false
  89. -- ---@usage Select which servers should be configured manually. Requires `:LvimCacheRest` to take effect.
  90. -- See the full default list `:lua print(vim.inspect(lvim.lsp.override))`
  91. -- vim.list_extend(lvim.lsp.override, { "pyright" })
  92. -- ---@usage setup a server -- see: https://www.lunarvim.org/languages/#overriding-the-default-configuration
  93. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  94. -- require("lvim.lsp.manager").setup("pylsp", opts)
  95. -- -- you can set a custom on_attach function that will be used for all the language servers
  96. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  97. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  98. -- local function buf_set_option(...)
  99. -- vim.api.nvim_buf_set_option(bufnr, ...)
  100. -- end
  101. -- --Enable completion triggered by <c-x><c-o>
  102. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  103. -- end
  104. -- -- set a formatter, this will override the language server formatting capabilities (if it exists)
  105. -- local formatters = require "lvim.lsp.null-ls.formatters"
  106. -- formatters.setup {
  107. -- { command = "black", filetypes = { "python" } },
  108. -- { command = "isort", filetypes = { "python" } },
  109. -- {
  110. -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  111. -- command = "prettier",
  112. -- ---@usage arguments to pass to the formatter
  113. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  114. -- extra_args = { "--print-with", "100" },
  115. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  116. -- filetypes = { "typescript", "typescriptreact" },
  117. -- },
  118. -- }
  119. -- -- set additional linters
  120. -- local linters = require "lvim.lsp.null-ls.linters"
  121. -- linters.setup {
  122. -- { command = "flake8", filetypes = { "python" } },
  123. -- {
  124. -- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
  125. -- command = "shellcheck",
  126. -- ---@usage arguments to pass to the formatter
  127. -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
  128. -- extra_args = { "--severity", "warning" },
  129. -- },
  130. -- {
  131. -- command = "codespell",
  132. -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
  133. -- filetypes = { "javascript", "python" },
  134. -- },
  135. -- }
  136. -- Additional Plugins
  137. -- lvim.plugins = {
  138. -- {"folke/tokyonight.nvim"},
  139. -- {
  140. -- "folke/trouble.nvim",
  141. -- cmd = "TroubleToggle",
  142. -- },
  143. -- }
  144. -- Autocommands (https://neovim.io/doc/user/autocmd.html)
  145. -- lvim.autocommands.custom_groups = {
  146. -- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
  147. -- }