config_win.example.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. -- vim options
  26. vim.opt.shiftwidth = 2
  27. vim.opt.tabstop = 2
  28. vim.opt.relativenumber = true
  29. -- general
  30. lvim.log.level = "info"
  31. lvim.format_on_save = {
  32. enabled = true,
  33. pattern = "*.lua",
  34. timeout = 1000,
  35. }
  36. -- to disable icons and use a minimalist setup, uncomment the following
  37. -- lvim.use_icons = false
  38. -- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
  39. lvim.leader = "space"
  40. -- add your own keymapping
  41. lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
  42. -- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
  43. -- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
  44. -- -- Use which-key to add extra bindings with the leader-key prefix
  45. -- lvim.builtin.which_key.mappings["W"] = { "<cmd>noautocmd w<cr>", "Save without formatting" }
  46. -- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
  47. -- -- Change theme settings
  48. -- lvim.colorscheme = "lunar"
  49. -- After changing plugin config exit and reopen LunarVim, Run :PackerSync
  50. lvim.builtin.alpha.active = true
  51. lvim.builtin.alpha.mode = "dashboard"
  52. lvim.builtin.terminal.active = true
  53. lvim.builtin.nvimtree.setup.view.side = "left"
  54. lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
  55. -- Automatically install missing parsers when entering buffer
  56. lvim.builtin.treesitter.auto_install = true
  57. -- lvim.builtin.treesitter.ignore_install = { "haskell" }
  58. -- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support>
  59. -- --- disable automatic installation of servers
  60. -- lvim.lsp.installer.setup.automatic_installation = false
  61. -- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
  62. -- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
  63. -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
  64. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  65. -- require("lvim.lsp.manager").setup("pyright", opts)
  66. -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
  67. -- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
  68. -- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
  69. -- return server ~= "emmet_ls"
  70. -- end, lvim.lsp.automatic_configuration.skipped_servers)
  71. -- -- you can set a custom on_attach function that will be used for all the language servers
  72. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  73. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  74. -- local function buf_set_option(...)
  75. -- vim.api.nvim_buf_set_option(bufnr, ...)
  76. -- end
  77. -- --Enable completion triggered by <c-x><c-o>
  78. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  79. -- end
  80. -- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting>
  81. -- local formatters = require "lvim.lsp.null-ls.formatters"
  82. -- formatters.setup {
  83. -- { command = "stylua" },
  84. -- {
  85. -- command = "prettier",
  86. -- extra_args = { "--print-width", "100" },
  87. -- filetypes = { "typescript", "typescriptreact" },
  88. -- },
  89. -- }
  90. -- local linters = require "lvim.lsp.null-ls.linters"
  91. -- linters.setup {
  92. -- { command = "flake8", filetypes = { "python" } },
  93. -- {
  94. -- command = "shellcheck",
  95. -- args = { "--severity", "warning" },
  96. -- },
  97. -- }
  98. -- -- Additional Plugins <https://www.lunarvim.org/docs/plugins#user-plugins>
  99. -- lvim.plugins = {
  100. -- {
  101. -- "folke/trouble.nvim",
  102. -- cmd = "TroubleToggle",
  103. -- },
  104. -- }
  105. -- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
  106. -- vim.api.nvim_create_autocmd("FileType", {
  107. -- pattern = "zsh",
  108. -- callback = function()
  109. -- -- let treesitter use bash highlight for zsh files as well
  110. -- require("nvim-treesitter.highlight").attach(0, "bash")
  111. -- end,
  112. -- })