Git Product home page Git Product logo

rmate-python's Introduction

rmate

The rmate program enables editing files on a remote computer with TextMate 2 via an SSH connection. This is a port of the official Ruby version and was made for system that cannot (or just preferably do not) have Ruby installed. This version (very intentionally) has no dependencies beyond the Python standard library and has been tested with Python versions 2.4 - 3.5.

This port is probably compatible with Sublime Text, Atom, or other editors that use the rmate protocol, but it is not officially tested.

Install

Standalone

rmate is a single file script, so you can simply download it to a location in your PATH. For example, assuming /usr/local/bin is in the PATH

wget https://raw.githubusercontent.com/sclukey/rmate-python/master/bin/rmate
chmod +x ./rmate
mv ./rmate /usr/local/bin/rmate

PyPI

You can also install rmate with pip

pip install rmate

SSH Connection Settings

For rmate to be able to connect back to TextMate, a port must be tunneled through the ssh connection. By default, rmate uses port 52698, and the port can be tunneled for an individual connection on the command line :

ssh -R 52698:localhost:52698 [email protected]

or for all connections by adding a rule to your ~/.ssh/config

Host *
RemoteForward 52698 localhost:52698

Usage

You can use rmate --help to see the usage

usage: rmate [OPTION]... FILE...

      --host HOST  Connect to HOST. Use 'auto' to detect the host from
                   SSH. Defaults to localhost
  -p, --port PORT  Port number to use for connection. Defaults to 52698
  -w, --[no-]wait  Wait for file to be closed by TextMate
  -l, --line LINE  Place carat on line LINE after loading the file.
                   TextMate selection strings can be used
  -m, --name NAME  The display name shown in TextMate
  -t, --type TYPE  Treat file as having TYPE
  -f, --force      Open even if the file is not writable
  -v, --verbose    Verbose logging messages
  -h, --help       Show this help and exit
      --version    Show version and exit

When FILE is -, read standard input.

More information can be found in this blog post

rmate-python's People

Contributors

sclukey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rmate-python's Issues

KeyError: 'token'

Hi,
when Atom is closing the file, I get this error message:

Traceback (most recent call last):
File "/usr/bin/rmate", line 302, in
main()
File "/usr/bin/rmate", line 298, in main
handle_cmds(s, settings.host, settings.port, cmds)
File "/usr/bin/rmate", line 124, in handle_cmds
handle_cmd(textmate, dec(command).strip())
File "/usr/bin/rmate", line 86, in handle_cmd
elif cmd == 'close': handle_close(textmate, variables, data)
File "/usr/bin/rmate", line 61, in handle_close
path = variables['token']
KeyError: 'token'

Couldn't connect to TextMate!

I am using this on Ubuntu and meet this problem.
root@VM-42-3-ubuntu:~# rmate -p 52698 ping.c
Couldn't connect to TextMate!
It worked when I first used this yesterday, but the error appeared today.
Is there any way to solve this? Thank you!

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.