config_win.example.lua 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. lvim.builtin.alpha.active = true
  50. lvim.builtin.alpha.mode = "dashboard"
  51. lvim.builtin.terminal.active = true
  52. lvim.builtin.nvimtree.setup.view.side = "left"
  53. lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
  54. -- Automatically install missing parsers when entering buffer
  55. lvim.builtin.treesitter.auto_install = true
  56. -- lvim.builtin.treesitter.ignore_install = { "haskell" }
  57. -- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support>
  58. -- --- disable automatic installation of servers
  59. -- lvim.lsp.installer.setup.automatic_installation = false
  60. -- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
  61. -- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
  62. -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
  63. -- local opts = {} -- check the lspconfig documentation for a list of all possible options
  64. -- require("lvim.lsp.manager").setup("pyright", opts)
  65. -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
  66. -- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
  67. -- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
  68. -- return server ~= "emmet_ls"
  69. -- end, lvim.lsp.automatic_configuration.skipped_servers)
  70. -- -- you can set a custom on_attach function that will be used for all the language servers
  71. -- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
  72. -- lvim.lsp.on_attach_callback = function(client, bufnr)
  73. -- local function buf_set_option(...)
  74. -- vim.api.nvim_buf_set_option(bufnr, ...)
  75. -- end
  76. -- --Enable completion triggered by <c-x><c-o>
  77. -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
  78. -- end
  79. -- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting>
  80. -- local formatters = require "lvim.lsp.null-ls.formatters"
  81. -- formatters.setup {
  82. -- { command = "stylua" },
  83. -- {
  84. -- command = "prettier",
  85. -- extra_args = { "--print-width", "100" },
  86. -- filetypes = { "typescript", "typescriptreact" },
  87. -- },
  88. -- }
  89. -- local linters = require "lvim.lsp.null-ls.linters"
  90. -- linters.setup {
  91. -- { command = "flake8", filetypes = { "python" } },
  92. -- {
  93. -- command = "shellcheck",
  94. -- args = { "--severity", "warning" },
  95. -- },
  96. -- }
  97. -- -- Additional Plugins <https://www.lunarvim.org/docs/plugins#user-plugins>
  98. -- lvim.plugins = {
  99. -- {
  100. -- "folke/trouble.nvim",
  101. -- cmd = "TroubleToggle",
  102. -- },
  103. -- }
  104. -- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
  105. -- vim.api.nvim_create_autocmd("FileType", {
  106. -- pattern = "zsh",
  107. -- callback = function()
  108. -- -- let treesitter use bash highlight for zsh files as well
  109. -- require("nvim-treesitter.highlight").attach(0, "bash")
  110. -- end,
  111. -- })