Code Monkey home page Code Monkey logo

sketchyvim's Introduction

SketchyVim

This small project turns accessible(!) input fields on macOS into full vim buffers. It should behave and feel like native vim, because, under the hood I synchronize the text field with a real vim buffer.

demo

You can use all modes (even commandline etc.) and all commands included in vim.

It is also possible to load a custom svimrc file, which can contain custom vim configurations, e.g. remappings (see the examples folder).

Additionally, you can edit the blacklist file in the ~/.config/svim/ folder to manually exclude applications from being handled by svim. You will likely want to blacklist your terminal emulator and gvim, such that there is no conflict.

Every time the vim mode changes, or a commandline update is issued, the script svim.sh in the folder ~/.config/svim/ is executed where you can handle how you want to process this information. I have a small popup in my SketchyBar which shows me the command line output on demand for example.

(!): Accessible means, that the input field needs to conform to the accessibility standards for text input fields, else there is nothing we can do.

Installation

You can install this using brew from my tap:

brew tap FelixKratz/formulae
brew install svim

and then you can start the brew service using:

brew services start svim

where you will be asked to grant accessibility permissions.

You can change the macOS selection color to anything you like with this command (which is my green):

defaults write NSGlobalDomain AppleHighlightColor -string "0.615686 0.823529 0.454902"

Issues

Please tell me if you encounter issues.

Known Issues:

  • Multikey remappings are not recognized (e.g. jk for esc)
  • Some text fields break the accessibility api and this leads to bugs, be sure to blacklist all apps that are affected by this. Sometimes it helps to switch to a "raw" or "markdown" editing mode on websites, such that there is no interference. Generally, Safari seems to make most text fields available, while Firefox does not.
  • Comments in svimrc break the config (#18)

Contributions

Pull requests are welcome. If you improve the code for your own use, consider creating a pull request, such that all people (including me) can enjoy those improvements.

Credits

  • I use the libvim library which is a compact and minimal c library for the vim core.
  • Many prior projects tried to accomplish a similar vision by rebuilding the vim movements by hand, those have inspired me to create this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.