A rewrite of CodeWizard. CodeWizard2 is probably not a useful project to anybody besides myself.
However it is much faster than some IDEs, particularly on laptops (maintaining 60fps until it transitions to 'sleep' mode).
And CodeWizard maintains under 100 Mb ram while running. Usually idles around 60-70 Mb (with several files open).
- CodeWizard2 now has custom rendering without a UI framework like Qt. CodeWizard2 uses OpenGL, and GLFW.
- CodeWizard2 makes use of the Syntect project for fast highlighting. (With a lot of my signature glue keeping it attached)
- It contains a custom LSP implementation originally written for CodeWizard.
- CodeWizard2 is not for the average person, there are a lot of undocumented features and key bindings. Which I am not changing right now.
- We use a 'panel' such that you can have whatever arrangement of elements you want.
- Native SSH connection to cwremote on windows and linux
Ever seen Asteroids inside a code editor, with no plugins? I didn't think so.
CodeWizard2 uses widgets, of which we have:
- Editor View (code, images, hex viewer)
- File Tree
- Settings Menu
- File Compare (compairs two files)
- AI Chat
- LSP Debug Window
- Terminal
- Math Window
- Asteroids
- Graph Window
- Status Bar
CodeWizard2 builds for Windows and Linux. Emoji rendering is not implemented on Linux. There is a modal option (which I quite enjoy but doesn't match any other editors) available in the settings.
The build is pinned to Zig 0.15.2, the version required by the selected Ghostty
revision. The wrapper downloads and verifies that Zig release into
zig-version/ on first use. Zig builds CodeWizard, Ghostty, GLFW, FreeType,
libgrapheme, curl on Windows, and the other native libraries. Cargo builds the
small Syntect bridge.
Windows requires PowerShell and a Rust toolchain installed with rustup:
.\build.ps1The release is installed into build/windows-release. Use
.\build.ps1 -Run to build and launch it. The resulting executable uses the
GNU Windows ABI and does not require the Visual C++ Redistributable.
The Windows build also generates
build/windows-release/compile_commands.json for clangd. Configure clangd with:
clangd.exe --compile-commands-dir=<CodeWizard2>/build/windows-release
The database contains the Windows target, compile definitions, pinned
dependency paths, and Zig libc/libc++ configuration used by the real build. It
is refreshed automatically whenever build.ps1 runs.
Linux requires GCC, curl, Rust/rustup, and development packages for X11, OpenGL, curl, and OpenSSL:
bash build.shThe release is installed into build/linux-release. From Windows, the same
build can be run through WSL with:
.\build.ps1 -Target linux-releaseAfter bootstrapping, the equivalent direct Zig commands are:
.\zig-version\windows-x86_64\zig.exe build -Dtarget=x86_64-windows-gnu --release=fast --prefix build/windows-release./zig-version/linux-x86_64/zig build -Dtarget=x86_64-linux-gnu --libc /tmp/codewizard-zig-libc-$UID.conf --release=fast --prefix build/linux-release- Ctrl+Shift+P focus the command palette.
- Ctrl+Shift+O change project folder.
- Ctrl+O open file.
- Ctrl+Shift+U run project search through command palette.
- Ctrl+> or Ctrl+< to jump brackets.
- F5 run programs
Out of the box, CodeWizard comes with a beautiful UI, Cascadia Code font, highlighting for almost any language, and pypls. Pypls is my LSP originally designed for python, but does pretty well in general.
- Download and run installer (in the releases section)
- To add new languages for CodeWizard, open the file
C:\Users\<username>\AppData\Local\CodeWizard\languages.json(an example file is below), or inside of CodeWizard's command palette type":Open `languages.json` file"and it will open it in CodeWizard (remember to restart CodeWizard after making changes). - Project specific settings can be created via opening the settings panel and pressing 'Project Specific' which will create a json file and give you the path. This can be used to set specific LSPs and the project build command.
Example languages.json
{
"languages": [
{
"name": "c++",
"line_comment": "//",
"filetypes": ["cpp", "h", "hpp", "c"],
"lsp_command": "C:\\Users\\adamj\\Documents\\LanguageServers\\clangd_19.1.2\\bin\\clangd.exe",
"build_command": "cd /d %FILE_LOCATION% && call \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat\" x64 && cl.exe %FILE_NAME% && %FILE_NAME_NO_EXT%.exe"
},
{
"name": "python",
"line_comment": "#",
"filetypes": ["py", "pyw"],
"lsp_command": "jedi-language-server",
"build_command": "cd /d %FILE_LOCATION% && python %FILE_NAME%"
},
{
"name": "go",
"line_comment": "//",
"filetypes": ["go"],
"lsp_command": "gopls",
"build_command": "cd /d %FILE_LOCATION% && go run ."
},
{
"name": "r",
"line_comment": "#",
"filetypes": ["R", "R~"],
"lsp_command": "%INSTALL_DIR%\\pypls.exe",
"build_command": ""
}
]
}First, download the executable for the host machine.
- Move the exe file to a sutable location
- Edit your path to include that folder location
- Done! (I assume you can figure out ssh)
- Download the cwremote for linux
- Run
chmod +x cwremote - Run
./cwremote --install - You can now safely delete the downloaded file
Step 3 just coppies the file to a folder on your pc so that it's accessable. To find it you can use which cwremote