Skip to content

Commit

Permalink
add zig for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Pistonight committed Nov 1, 2024
1 parent 9892bcc commit 81c5df2
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
]
},
Expand Down Expand Up @@ -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" },
]
},
Expand Down
14 changes: 9 additions & 5 deletions src/tool/nvim.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
56 changes: 56 additions & 0 deletions src/tool/zig.md
Original file line number Diff line number Diff line change
@@ -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
```
29 changes: 0 additions & 29 deletions src/windows/zig.md

This file was deleted.

0 comments on commit 81c5df2

Please sign in to comment.