{"id":13588208,"url":"https://github.com/aurora/rmate","last_synced_at":"2025-04-08T02:35:07.998Z","repository":{"id":2063316,"uuid":"3001794","full_name":"aurora/rmate","owner":"aurora","description":"Remote TextMate 2 implemented as shell script","archived":false,"fork":false,"pushed_at":"2023-02-28T19:22:26.000Z","size":177,"stargazers_count":887,"open_issues_count":6,"forks_count":123,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-11-06T07:40:27.814Z","etag":null,"topics":["bash","rmate","rsub","shell","sublime-text","textmate","unix"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Dogfalo/materialize","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aurora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2011-12-17T16:04:29.000Z","updated_at":"2024-10-30T01:15:26.000Z","dependencies_parsed_at":"2023-01-11T16:07:37.726Z","dependency_job_id":"ec07e6b4-9be8-4f92-9295-34b4b6d7d249","html_url":"https://github.com/aurora/rmate","commit_stats":{"total_commits":153,"total_committers":35,"mean_commits":4.371428571428571,"dds":0.7058823529411764,"last_synced_commit":"96d5a7cebd4a52a5f02a7a879491071a1d1780b4"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aurora%2Frmate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aurora%2Frmate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aurora%2Frmate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aurora%2Frmate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aurora","download_url":"https://codeload.github.com/aurora/rmate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247765210,"owners_count":20992263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","rmate","rsub","shell","sublime-text","textmate","unix"],"created_at":"2024-08-01T15:06:34.264Z","updated_at":"2025-04-08T02:35:07.734Z","avatar_url":"https://github.com/aurora.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# rmate\n\n## Description\n\nTextMate 2 adds a nice feature, where it is possible to edit files on a remote server\nusing a helper script. The original helper script provided with TM2 is implemented in\nruby. Here is my attempt to replace this ruby script with a shell script, because in\nsome cases a ruby installation might just be too much overhead for just editing remote\nfiles.\n\nThis script can be used with some other editors (e.g. Sublime Text) via available plug-ins.\n\nThe shell script needs to be copied to the server, you want to remote edit files, on.\nAfter that, you should set-up your editor to communicate with rmate.\n\n### Quick install\n\n```bash\nsudo wget -O /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate\nsudo chmod a+x /usr/local/bin/rmate\n```\n\nor with [bpkg](https://github.com/bpkg/bpkg)\n\n```bash\nbpkg install aurora/rmate\n```\n\n### Set-up editor\n\n#### TextMate 2\n\nOpen your TM2 preferences and enable \"Allow rmate connections\" setting in\nthe \"Terminal\" settings and adjust the setting \"Access for\" according to your needs:\n\n![TM2_terminal_preferences](https://macromates.com/wp-content/uploads/2011/12/terminal_preferences.png)\n\n##### Local clients\n\nIt's a good idea to allow access only for local clients. In this case you need to open\na SSH connection to the system you want to edit a file on and specify a remote tunnel in\naddition:\n```bash\nssh -R 52698:localhost:52698 user@example.com\n```\n\nOr put the following lines in your local `~/.ssh/config`:\n```ssh-conf\nHost example.com\n    RemoteForward 52698 127.0.0.1:52698\n```\n\nIf you are logged in on the remote system, you can now just execute\n```bash\nrmate test.txt\n```\n\n##### Remote clients\n\nOn some machines, where port forwarding is not possible, for example due to a missing ssh\ndaemon, you can allow access for \"remote clients\". Just ssh or telnet to the remote machine\nand execute:\n```bash\nrmate -H textmate-host test.txt\n```\n\n#### Sublime Text\n\nTo use rmate with Sublime Text, you need to install a plug-in, e.g.\n[rsub](https://github.com/henrikpersson/rsub)\nor [RemoteSubl](https://github.com/randy3k/RemoteSubl).\n\nYou can install plug-ins via [Package Control](https://packagecontrol.io/).\n[Install Package Control](https://packagecontrol.io/installation),\npress `Cmd + Shift + P` for Mac and `Ctrl + Shift + P` for Linux/Windows,\nselect `Package Control: Install Package`,\nand, finally, select `rsub` for rsub or `RemoteSubl` for RemoteSubl.\n\nAlso, you can install plug-ins manually.\n\n* Linux\n```bash\ngit clone https://github.com/henrikpersson/rsub ~/.config/sublime-text-3/Packages/rsub\ngit clone https://github.com/randy3k/RemoteSubl ~/.config/sublime-text-3/Packages/RemoteSubl\n```\n\n* Windows\n```batch\ngit clone https://github.com/henrikpersson/rsub %APPDATA%/Sublime\\ Text\\ 3/Packages/rsub\ngit clone https://github.com/randy3k/RemoteSubl %APPDATA%/Sublime\\ Text\\ 3/Packages/RemoteSubl\n```\n\n* OS X\n```bash\ngit clone https://github.com/henrikpersson/rsub ~/Library/Application\\ Support/Sublime\\ Text\\ 3/Packages/rsub\ngit clone https://github.com/randy3k/RemoteSubl ~/Library/Application\\ Support/Sublime\\ Text\\ 3/Packages/RemoteSubl\n```\n\nThen do the same things as described in [Local clients](#local-clients) part of this document.\n\n#### VS Code\n\nTo use rmate with VS Code, you need to install an extension, e.g.\n[Remote VSCode](https://marketplace.visualstudio.com/items?itemName=rafaelmaiolla.remote-vscode)\n\n![vscode](https://github.com/fanrenng/rmate/blob/master/screenshot/vscode.png?raw=true)\n\n```json\n//-------- Remote VSCode configuration --------\n\n// Port number to use for connection.\n\"remote.port\": 52698\n\n// Launch the server on start up.\n\"remote.onstartup\": true\n\n// Address to listen on.\n\"remote.host\": \"127.0.0.1\"\n\n// If set to true, error for remote.port already in use won't be shown anymore.\n\"remote.dontShowPortAlreadyInUseError\": false\n```\n\nThen do the same things as described in [Local clients](#local-clients) part of this document.\n\n### Example\n\nExample session: Editing html file located on an SGI o2: \u003chttps://github.com/aurora/rmate/wiki/Screens\u003e\n\n## Requirements\n\nA bash with compiled support for `/dev/tcp` is required. This is not the case on some\nolder linux distributions, like Ubuntu 9.x.\n\n## Usage\n\nEdit specified file\n```console\n$ ./rmate [arguments] [--] file-path\n```\n\nRead text from stdin\n```console\n$ echo \"hello TextMate\" | ./rmate [arguments] -\n```\n\n### Arguments\n\n    -H, --host HOST  Connect to HOST. Use 'auto' to detect the host from SSH.\n    -p, --port PORT  Port number to use for connection.\n    -w, --[no-]wait  Wait for file to be closed by TextMate.\n    -l, --line LINE  Place caret on line number after loading file.\n    +N               Alias for --line, if N is a number (eg.: +5).\n    -m, --name NAME  The display name shown in TextMate.\n    -t, --type TYPE  Treat file as having specified type.\n    -n, --new        Open in a new window (Sublime Text).\n    -f, --force      Open even if file is not writable.\n    -v, --verbose    Verbose logging messages.\n    -h, --help       Display this usage information.\n        --version    Show version and exit.\n\n\n### Default parameter configuration\n\nSome default parameters (`host` and `port`) can be configured by defining them\nas the environment variables `RMATE_HOST` and `RMATE_PORT` or by putting them\nin a configuration file. The configuration files loaded are `/etc/rmate.rc`\nand `~/.rmate.rc`, e.g.:\n```ini\nhost: auto  # prefer host from SSH_CONNECTION over localhost\nport: 52698\n```\n\nAlternative notation for configuration file is:\n```ini\nhost=auto\nport=52698\n```\n\nThe precedence for setting the configuration is (higher precedence counts):\n\n1. default (`localhost`, `52698`)\n2. `/etc/rmate.rc`\n3. `~/.rmate/rmate.rc`\n4. `~/.rmate.rc`\n5. environment variables (`RMATE\\_HOST`, `RMATE\\_PORT`)\n\n## Disclaimer\n\nUse with caution. This software may contain serious bugs. I can not be made responsible for\nany damage the software may cause to your system or files.\n\n## [License](COPYING.txt)\n\nrmate\n\nCopyright (C) 2011-present by Harald Lapp \u003charald@octris.org\u003e\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faurora%2Frmate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faurora%2Frmate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faurora%2Frmate/lists"}