{"id":13819879,"url":"https://github.com/grosser/ruco","last_synced_at":"2025-04-05T14:09:16.433Z","repository":{"id":1291611,"uuid":"1232744","full_name":"grosser/ruco","owner":"grosser","description":"Desktop-style, Intuitive, Commandline Editor in Ruby. \"Better than nano, simpler than vim.\"","archived":false,"fork":false,"pushed_at":"2023-05-25T22:26:08.000Z","size":973,"stargazers_count":130,"open_issues_count":7,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T13:11:18.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grosser.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2011-01-08T11:59:35.000Z","updated_at":"2025-02-28T21:33:47.000Z","dependencies_parsed_at":"2023-07-06T11:47:09.281Z","dependency_job_id":null,"html_url":"https://github.com/grosser/ruco","commit_stats":{"total_commits":689,"total_committers":4,"mean_commits":172.25,"dds":0.06386066763425258,"last_synced_commit":"6f1587e64183495432689dc2e1605423c1d0a1e3"},"previous_names":[],"tags_count":108,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grosser%2Fruco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grosser%2Fruco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grosser%2Fruco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grosser%2Fruco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grosser","download_url":"https://codeload.github.com/grosser/ruco/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345854,"owners_count":20924102,"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":[],"created_at":"2024-08-04T08:00:54.376Z","updated_at":"2025-04-05T14:09:16.406Z","avatar_url":"https://github.com/grosser.png","language":"Ruby","funding_links":[],"categories":["Happy Exploring 🤘"],"sub_categories":[],"readme":"Simple, extendable, test-driven commandline editor written in ruby, for Linux/Mac/Windows.\n\n### Features\n\n - **Desktop-like / intuitive interface**\n - TextMate Syntax and Theme support\n - selecting via Shift + arrow-keys (only Linux or iTerm) or 'select mode' Ctrl+b + arrow-keys\n - move line up/down (Alt+Ctrl+up/down)\n - Tab -\u003e indent / Shift+Tab -\u003e unindent\n - keeps indentation (+ paste-detection e.g. via Cmd+v)\n - change (*) + writable (!) indicators\n - find / go to line / delete line / search \u0026 replace\n - configuration via `~/.ruco.rb` in Ruby\n - Full clipboard support -\u003e Ctrl+x/c/v\n - undo / redo -\u003e Ctrl+z/y\n - stays at last position when reopening a file\n - opens file at line e.g. `ruco foo/bar.rb:32`\n - supports all newline formats\n - surrounds selection with quotes/braces (select abc + \" --\u003e \"abc\")\n - shortens long file names in the middle\n - (optional) remove trailing whitespace on save\n - (optional) blank line before eof on save\n - (optional) line numbers\n\n![ruco with railscasts theme](assets/example.png?raw=true)\u003cbr/\u003e\n\n\nInstall\n=======\n```Bash\ngem install ruco\n```\n\nUsage\n=====\n```Bash\nruco file.rb\nrvmsudo ruco /etc/hosts\n```\n\nCustomize\n=========\n\n```Ruby\n# ~/.ruco.rb\nRuco.configure do\n  # set options\n  options.window_line_scroll_offset = 5 # default 1\n  options.history_entries = 10          # default 100\n  options.editor_remove_trailing_whitespace_on_save = true  # default false\n  options.editor_blank_line_before_eof_on_save = true       # default false\n  options.editor_line_numbers = true                        # default false\n\n  # Use any Textmate theme e.g. from http://wiki.macromates.com/Themes/UserSubmittedThemes\n  # use a url that points directly to the theme, e.g. github 'raw' urls\n  options.color_theme = \"https://raw.github.com/deplorableword/textmate-solarized/master/Solarized%20%28dark%29.tmTheme\"\n  ...\n\n  # bind a key\n  # - you can use Integers and Symbols\n  # - use \"ruco --debug-keys foo\" to see which keys are possible\n  # - have a look at [keyboard.rb](https://github.com/grosser/dispel/blob/master/lib/dispel/keyboard.rb)\n  bind(:\"Ctrl+e\") do\n    ask('foo') do |response|\n      if response == 'bar'\n        editor.insert('baz')\n      else\n        editor.move(:to, 0,0)\n        editor.delete(99999)\n        editor.insert('FAIL!')\n      end\n    end\n  end\n\n  # bind an existing action\n  puts @actions.keys\n\n  bind :\"Ctrl+x\", :quit\n  bind :\"Ctrl+o\", :save\n  bind :\"Ctrl+k\", :delete_line\n  bind :\"Ctrl+a\", :move_to_bol\n\n  # create reusable actions\n  action(:first_line){ editor.move(:to_column, 0) }\n  bind :\"Ctrl+u\", :first_line\nend\n```\n\nTIPS\n====\n - [Mac] arow-keys + Shift/Alt does not work in default terminal (use iTerm)\n - [Tabs] Ruco does not like tabs. Existing tabs are displayed as single space and pressing tab inserts 2*space\n - [RVM] `alias r=\"rvm 1.9.2 exec ruco\"` and you only have to install ruco once\n - [Ruby1.9] Unicode support -\u003e install libncursesw5-dev before installing ruby\n - [ssh vs clipboard] access your desktops clipboard by installing `xauth` on the server and then using `ssh -X`\n - [Alt key] if Alt does not work try your Meta/Win/Cmd key\n - [Curses] `LoadError: cannot load such file -- curses` --\u003e `rvm install 1.9.3 ----with-libcurses`\n\nArchitecture\n============\nRuco is basically a lot of String manipulation separated in HTML style elements.\nThe only component dealing with the commandline interface are Screen and Keyboard. Therefore\neverything is very simple to build and test since it returns a string or a e.g. cursor position.\n\nWriting/reading is done in a TextArea or a TextField (a TextArea with 1 line)\nwhich are placed in Form`s.\n\nThe Application consists of a StatusBar, Editor, CommandBar and delegates actions to the currently active element.\n\nTo build the commandline output Editor/CommandBar return:\n\n - view -- text that should be displayed on the screen (complete content cropped via Window)\n - style_map -- a big Array with style infos, e.g. 'on line 1 chars 5 to 7 are red'\n - cursor -- where to draw the cursor\n\n\nTODO\n=====\n - Shift+up and Alt+up emit the same keycodes in iTerm\n - ctrl+right should jump to line end and then to the next line even if the line ends in a \"\n - only do syntax parsing for changed lines + selected lines \u003c-\u003e will not be redrawn anyhow\n - try to use complete file coloring as removed in 26d6da4\n - javascript syntax parsing is slow and often causes syntax-timeouts\n - some languages are still not mapped correctly to their syntax file\n   [languages](https://github.com/grosser/language_sniffer/blob/master/lib/language_sniffer/languages.yml) \u003c-\u003e\n   [syntaxes](https://github.com/grosser/ultraviolet/tree/master/syntax)\n - do not fall back to 0:0 after undoing the first change\n - check writable status every x seconds (e.g. in background) -\u003e faster while typing\n - search help e.g. 'Nothing found' '#4 of 6 hits' 'no more hits, start from beginning ?'\n - align soft-tabs\n - highlight tabs (e.g. strange character or reverse/underline/color)\n - big warning when editing a not-writable file\n - find next (Alt+n)\n - smart staying at column when changing line\n - syntax highlighting\n - raise when binding to a unsupported key\n - search history via up/down arrow\n - search options regex + case-sensitive\n - 1.8: unicode support \u003c-\u003e already finished but unusable due to Curses (see encoding branch)\n - add double quotes/braces when typing one + skip over quote/brace when its already typed at current position\n\n\nAuthors\n=======\n\n### [Contributors](http://github.com/grosser/ruco/contributors)\n - [AJ Palkovic](https://github.com/ajpalkovic)\n - [David Sachitano](https://github.com/dsachitano)\n\n[Michael Grosser](http://grosser.it)\u003cbr/\u003e\ngrosser.michael@gmail.com\u003cbr/\u003e\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrosser%2Fruco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrosser%2Fruco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrosser%2Fruco/lists"}