diff --git a/README.md b/README.md index 650275a..f53487e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is my personal configuration for Neovim. It may not suit you, but I hope yo * Neovim v0.10+ * Git * make / CC (Linux) -* cmake / MSVC (Windows) +* make / gcc (Windows + [msys2](https://www.msys2.org/), see [PR#3](https://github.com/IronBlood/config.nvim/pull/3)) ## Config Locations @@ -18,27 +18,6 @@ This is my personal configuration for Neovim. It may not suit you, but I hope yo Clone into the target folder directly, or create a symlink: `ln -s /path/to/config.nvim ~/.config/nvim` on Linux/macOS, `New-Item -ItemType Junction -Path $env:LOCALAPPDATA\nvim -Target C:\path\to\config.nvim` in PowerShell, or `mklink /J "%LOCALAPPDATA%\nvim" "C:\path\to\config.nvim"` in `cmd.exe`. -## Building Treesitter on Windows - -See the archived [Windows support](https://web.archive.org/web/20250818122834/https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support) for full details. The short version: - -- Install the **Desktop development with C++** workload (or the standalone Build Tools) so `cl.exe` is available. -- Before running `:TSUpdate`, open a shell that has the MSVC environment loaded. - -`cmd.exe` - -```batch -call "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=x64 -``` - -PowerShell - -```pwsh -& "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -``` - -Once the environment variables are set, start Neovim from that shell and run `:TSUpdate`. - ## Plugins * [base16-nvim](https://github.com/RRethy/base16-nvim) - Theme diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 1fe3ef5..cd64047 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -244,7 +244,6 @@ M.setup = function() }, }, } - servers["copilot-language-server"] = {} -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. @@ -292,9 +291,7 @@ M.setup = function() ---@param server_name string ---@return string local function update_server_name(server_name) - local replacements = { - ["copilot-languag-server"] = "copilot", - } + local replacements = {} return replacements[server_name] or server_name end diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua index e39724d..9226fdd 100644 --- a/lua/config/treesitter.lua +++ b/lua/config/treesitter.lua @@ -1,12 +1,5 @@ local M = {} -if vim.fn.has("win32") == 1 and vim.fn.executable("cl") ~= 1 then - vim.notify( - "Tree-sitter build env not found (no cl.exe). Start from Developer PowerShell x64 before TSInstall/TSUpdate.", - vim.log.levels.WARN - ) -end - M.setup = function() vim.defer_fn(function() require("nvim-treesitter.configs").setup({ diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index 272532a..4c74977 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -9,6 +9,9 @@ return { "L3MON4D3/LuaSnip", version = "2.*", build = (function() + if vim.fn.has("win32") == 1 and vim.fn.executable("mingw32-make") then + return 'LUA_LDLIBS="-lluajit-5.1" mingw32-make install_jsregexp' + end if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then return end diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua index 7e58236..362ae8c 100644 --- a/lua/plugins/nvim-tree.lua +++ b/lua/plugins/nvim-tree.lua @@ -19,6 +19,7 @@ return { vim.keymap.set("n", "", api.tree.toggle, opts("Toggle nvim tree")) require("nvim-tree").setup({ git = { + enable = vim.fn.has("win32") == 0, timeout = 10000, }, }) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 45714dc..9ecbc55 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -14,17 +14,16 @@ return { build = function() if vim.fn.has("win32") == 1 then -- make sure CMake, and the Microsoft C++ Build Tools are installed on Windows - return 'cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64' - .. " && cmake --build build --config Release --target install" + return "mingw32-make" else -- for Linux and Linux-like systems return "make" end end, cond = function() - -- Windows + -- Windows + msys2 if vim.fn.has("win32") == 1 then - return vim.fn.executable("cmake") == 1 + return vim.fn.executable("mingw32-make") == 1 end -- Linux and Linux-like diff --git a/plugin/terminal.lua b/plugin/terminal.lua index ac83347..bb980c3 100644 --- a/plugin/terminal.lua +++ b/plugin/terminal.lua @@ -23,20 +23,6 @@ vim.api.nvim_create_autocmd("TermOpen", { end, }) -if vim.fn.has("win32") == 1 then - if vim.fn.executable("pwsh.exe") == 1 then - vim.opt.shell = "pwsh.exe" - vim.opt.shellcmdflag = "-NoLogo -ExecutionPolicy RemoteSigned -Command" - vim.opt.shellquote = "" - vim.opt.shellxquote = "" - elseif vim.fn.executable("powershell.exe") == 1 then - vim.opt.shell = "powershell.exe" - vim.opt.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command" - vim.opt.shellquote = "" - vim.opt.shellxquote = "" - end -end - local function create_bottom_window(opts) opts = opts or {}