appear icon indicating copy to clipboard operation
appear copied to clipboard

Mac app based on platypus

Open justjake opened this issue 9 years ago • 0 comments

TmuxIde.app: open files in Nvim + Tmux

I've started a project based on Appear's libraries to open files in Nvim + Tmux. I prefer Tmux and terminal-based programs to GUI editors, so I've always wanted to set console Vim as my default application for many filetypes.

I've built a proof-of-concept scipt that intelligently opens clicked files in Nvim sessions inside Tmux windows. We use Platypus to turn the script into a Mac native app, and duti to assign our new app as the default editor.

This project will eventually be split into its own repo, but lives in Appear for now.

Set up Neovim:

  1. set up Neovim
  2. Set up Neovim Remote. Follow the nvr install instructions. Make sure the binary ends up in /usr/local/bin, /usr/bin, or /bin.
  3. make sure you've got tmux in /usr/local/bin, too. brew install tmux if not.
  4. stick this in your .bashrc or .zshrc so that each Neovim process gets it's own socket: bash mkdir -p "$HOME/.vim/sockets/" NVIM_LISTEN_ADDRESS="$HOME/.vim/sockets/vim-zsh-$$.sock" Without this snippet, we'll be unable to query or control existing nvim sessions.

Build the app:

  1. brew install platypus, which is the app builder
  2. bundle exec rake app builds into ./build/TmuxIde.app

Use it as the default for all of your source code files:

  1. Notify OS X that your app exits by running it once, you can find it in ./build/TmuxIde.app. It'll display a dialog and then exit.
  2. brew install duti, which is a tool we use to change default application for filetypes.
  3. bundle exec rake app_defaults will assign all source code extensions to open in TmuxIde by default.

If you have any issues with the app, you can tail -f /tmp/tmux-ide-*.log to view log messages.

Demo

appear-tmux-vim

justjake avatar Oct 10 '16 21:10 justjake