{"id":16585626,"url":"https://github.com/junegunn/vim-ruby-x","last_synced_at":"2025-07-25T02:39:30.102Z","repository":{"id":12179045,"uuid":"14779158","full_name":"junegunn/vim-ruby-x","owner":"junegunn","description":"if_ruby helper","archived":false,"fork":false,"pushed_at":"2014-04-27T14:08:39.000Z","size":156,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-16T17:53:53.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"VimL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junegunn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-28T14:33:26.000Z","updated_at":"2022-05-11T14:51:09.000Z","dependencies_parsed_at":"2022-08-20T10:00:47.694Z","dependency_job_id":null,"html_url":"https://github.com/junegunn/vim-ruby-x","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-ruby-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-ruby-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-ruby-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-ruby-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junegunn","download_url":"https://codeload.github.com/junegunn/vim-ruby-x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242159212,"owners_count":20081422,"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-10-11T22:48:43.521Z","updated_at":"2025-03-06T06:26:03.004Z","avatar_url":"https://github.com/junegunn.png","language":"VimL","funding_links":[],"categories":[],"sub_categories":[],"readme":"vim-ruby-x\n==========\n\n`:RubyX` command extends Ruby interface of Vim, making it (marginally) easier to use.\n\nInstallation\n------------\n\nUse your favorite plugin manager.\n\n- [vim-plug](https://github.com/junegunn/vim-plug)\n  1. Add `Plug 'junegunn/vim-ruby-x'` to .vimrc\n  2. Run `:PlugInstall`\n\nFeatures\n--------\n\n### Easier variable access\n\n- `VIM[]`\n- `VIM[]=`\n- `VIM.exists?(varname)`\n- `VIM.fetch(varname, default)`\n- `VIM.unlet(*varnames)`\n\n```ruby\nvar1 = VIM['g:var1']\nvar2 = VIM['g:var2'] || 0\n\nVIM['g:vars'] = { :vars =\u003e [var1, var2], :sum =\u003e var1 + var2 }\n\nVIM.unlet 'g:var1', 'g:var2'\n```\n\n### Shortcuts to VIM::command and VIM::evaluate\n\n- `String#vim!`\n- `String#vim?`\n\n```ruby\n'redraw!'.vim!\ncount = 'len(g:array)'.vim?\n```\n\n### Executing normal mode commands\n\n```ruby\nVIM.normal  'gqip'\nVIM.normal! 'gg=G'\n```\n\n### Vimscript representation of Ruby values\n\n- `Object#to_v`\n\n```ruby\n'hello world'.to_v\n  # \"hello world\"\n\n[1, 2, 3, %w[hello world], { 'hello' =\u003e { 'world' =\u003e '!' } }].to_v\n  # [1, 2, 3, [\"hello\", \"world\"], {\"hello\": {\"world\": \"!\"}}]\n```\n\n### Calling Vim functions\n\n- `VIM.call(name, *args)`\n\n```ruby\nVIM.call(:feedkeys, \"\\C-c\")\n```\n\n### Making Ruby code interruptible with CTRL-C\n\n```ruby\nVIM.interruptible do\n  begin\n    sleep\n  rescue Interrupt\n    puts 'Interrupted!'\n  end\nend\n```\n\n### Messages\n\n```ruby\nVIM.echo    'Welcome'\nVIM.echo    'Apples', :Identifier, ' are ', :Structure, 'red', :Error\nVIM.error   'Oops, try again'\nVIM.message 'This one is builtin'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunegunn%2Fvim-ruby-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunegunn%2Fvim-ruby-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunegunn%2Fvim-ruby-x/lists"}