diff --git a/src/.vitepress/config.mts b/src/.vitepress/config.mts index a902cf8..e432cfe 100644 --- a/src/.vitepress/config.mts +++ b/src/.vitepress/config.mts @@ -19,7 +19,6 @@ const windowsSidebar = [ { text: "VS Code", link: "/windows/vscode" }, { text: "Notepad", link: "/windows/notepad" }, { text: "Utilities", link: "/windows/utilities" }, - { text: "Zig", link: "/windows/zig" }, { text: "Next Steps", link: "/windows/next"}, ] }, @@ -103,6 +102,7 @@ const toolSidebar = [ { text: "Python", link: "/tool/python" }, { text: "Node + Deno", link: "/tool/node" }, { text: "Go", link: "/tool/go" }, + { text: "Zig", link: "/tool/zig" }, // { text: "NX", link: "/tool/nx" }, ] }, diff --git a/src/tool/nvim.md b/src/tool/nvim.md index 38ece47..07f2ad1 100644 --- a/src/tool/nvim.md +++ b/src/tool/nvim.md @@ -8,6 +8,11 @@ cargo install ripgrep websocat fd-find ``` ## Install +:::warning +[`zig`](./zig.md) is strongly strongly recommended for Windows for compiling treesitter, +as it is a C-compatible compiler. Otherwise you need to figure out how +to make MSVC available through the command line, which is not convenient. +::: Arch Linux: 1. `nvim` should be bootstrapped during the full install. If not, you can install with ```bash @@ -19,18 +24,17 @@ Arch Linux: dotbin-link ``` Windows: - 1. Make sure you have [`zig`](../windows/zig.md) installed for compiling tree-sitter - 2. Download the latest stable release from https://github.com/neovim/neovim/releases. + 1. Download the latest stable release from https://github.com/neovim/neovim/releases. Save `nvim-win64.zip` to the `Downloads` directory - 3. Extract it + 2. Extract it ```powershell 7z x -y ~/Downloads/nvim-win64.zip "-o$HOME/dotbin/extra/portable" - 4. Configure link + 3. Configure link ```powershell Add-Content -Path ~/dotbin/extra/portable/link -Value "alias=vi,vim:shim:nvim-win64/bin/nvim.exe`nshim:nvim-win64/bin/win32yank.exe`nshim:nvim-win64/bin/xxd.exe" sudo dotbin-link ``` - 5. Exclude `nvim` from Windows Defender. + 4. Exclude `nvim` from Windows Defender. ```powershell Add-MpPreference -ExclusionPath ~/dotbin Add-MpPreference -ExclusionProcess nvim diff --git a/src/tool/zig.md b/src/tool/zig.md new file mode 100644 index 0000000..3433864 --- /dev/null +++ b/src/tool/zig.md @@ -0,0 +1,56 @@ +# Zig +Zig is a programming language that tries to be a modern C. +Thanks to being a C-compatible compiler, it is a really good option +for compiling C on Windows + +:::warning +Zig is still not stable yet. Therefore we are installing the latest +dev version from the website instead of through package managers +::: + +## Install +- Windows: + 1. Download ZIP from https://ziglang.org/download/ and put it in `Downloads` + 2. Set version for scripts + ```powershell + $version="0.14.0-dev.2079+ba2d00663" + 3. Extract it + ```powershell + 7z x -y ~/Downloads/zig-windows-x86_64-$version.zip "-o$HOME/dotbin/extra/portable" + 3. Configure link + ```powershell + Add-Content -Path ~\dotbin\extra\portable\link -Value "zig-*/zig.exe" + sudo dotbin-link + ``` + 4. Verify installation + ```powershell + zig version + ``` + 5. Exclude `zig` from Windows Defender so compilation is faster + ```powershell + Add-MpPreference -ExclusionPath ~/dotbin + Add-MpPreference -ExclusionProcess zig + ``` + :::warning + Run as admin! + ::: +- Linux + 1. Set version for scripts + ```bash + VERSION="0.14.0-dev.2079+ba2d00663" + ``` + 2. Download and extract + ```bash + wget https://ziglang.org/builds/zig-linux-x86_64-$VERSION.tar.xz -O ~/zig-$VERSION.tar.xz + 7z x -y ~/zig-$VERSION.tar.xz -so | 7z x -y -si -ttar "-o$HOME/dotbin/extra/portable" + chmod +x ~/dotbin/extra/portable/zig-*/zig + ``` + 3. Configure link + ```bash + echo "zig-*/zig" >> ~/dotbin/extra/portable/link + dotbin-link + ``` + 4. Verify installation + ```bash + zig version + ``` diff --git a/src/windows/zig.md b/src/windows/zig.md deleted file mode 100644 index e33cb34..0000000 --- a/src/windows/zig.md +++ /dev/null @@ -1,29 +0,0 @@ -# Zig -Zig is a programming language and its compiler can also compile C. -It's here to compile tree-sitter parsers for neovim - -## Install -1. Download ZIP from https://ziglang.org/download/ and put it in `Downloads` -2. Set version for scripts - ```powershell - $version="0.14.0-dev.1951+857383689" -3. Extract it - ```powershell - 7z x -y ~/Downloads/zig-windows-x86_64-$version.zip "-o$HOME/dotbin/extra/portable" -3. Configure link - ```powershell - Add-Content -Path ~\dotbin\extra\portable\link -Value "zig-*/zig.exe" - sudo dotbin-link - ``` -4. Verify installation - ```powershell - zig version - ``` -5. Exclude `zig` from Windows Defender so compilation is faster - ```powershell - Add-MpPreference -ExclusionPath ~/dotbin - Add-MpPreference -ExclusionProcess zig - ``` - :::warning - Run as admin! - :::