Skip to content

bensinc/svim

Repository files navigation

svim - Neovim-Embedded MacOS Text Editor

I love vim, but also love quickly browsing a large codebase with a mouse, super fast rendering, and just Mac-like goodness. This doesn't really do any of that, but it's a start. My SwiftUI is a bit rusty, so there's plenty of Claude slop garbage in here after various attempts to make it work.

At first I tried using Neovim RPC and rendering everything myself, but writing a terminal emulator is hard enough as it is. I ended up using SwiftTerm to run actual neovim instances, so multiple tabs gets you more neovim and memory usage. This works, but I had to use hacks like setting a custom title in neovim and reading from that to determine tab names, unsaved state, etc. Mouse wheel scrolling is also a hack, but works.

I figure that some bloated Electron editor still uses more memory than running multiple instances of neovim!

Running

You should be able to open the Xcode project and build this.

Usage

It expects your neovim to be installed by homebrew, so the path is hard coded. You could change that in EditorView. Also note in EditorView all of the command line parameters it passes to neovim, as you might need to change some of that.

If you want to have your neovim config do something different in svim, note that it sets "lua vim.g.svim=1" on startup. Use that to do things like not run your own tab bar plugin.

When started you'll get a blank window showing your home directory in the file tree. You can click folders or files to open them, or use the + icon or command+n to open a blank editor.

Command+w will close a tab, and the entire window if no tabs are open.

Command+p gets you a basic file finder.

Right clicking a tab will let you send it to a split, either on the right or below.

If you hit command+o or use File->Open you can open a new window with the file tree set to that directory. It saves those in recents so you can easily open a previous project.

About

MacOS NeoVIM + SwiftUI Editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages