Open
Conversation
added 13 commits
October 9, 2016 12:47
this task outputs an app in ./build/TmuxIde.app which contains a copy of the current Appear gem. The entrypoint is in tools/app-entry.rb, which is slightly different from bin/appear: - use /usr/bin/ruby - use local copy of appear instead of some sort of gem thing this requires platypus, so `brew install platypus`
Sometimes you can't connect to a socket. This commit hacks away around that by ignoring Nvim sockets that we can't read pid() from.
Again, we pull the list of file extensions from MacVim. Thanks MacVim!
This makes it feel lighter-weight to open random files.
Also, build releaseable app by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
dutito assign our new app as the defaulteditor.
This project will eventually be split into its own repo, but lives in Appear
for now.
Set up Neovim:
Follow the
nvrinstall instructions. Make sure the binary ends up in/usr/local/bin, /usr/bin, or /bin.
tmuxin /usr/local/bin, too.brew install tmuxif not.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:
brew install platypus, which is the app builderbundle exec rake appbuilds into ./build/TmuxIde.appUse it as the default for all of your source code files:
./build/TmuxIde.app. It'll display a dialog and then exit.
brew install duti, which is a tool we use to change default application for filetypes.bundle exec rake app_defaultswill assign all source code extensions toopen in TmuxIde by default.
If you have any issues with the app, you can
tail -f /tmp/tmux-ide-*.logtoview log messages.
Demo