# this file shortcuts customized by me, so if you wanna use it, please specific your keymap, or download my rubymine settings in github # default shortcuts # guake: # show/hide guake: f10 # new tab: ctrl+t # close tab: ctrl+w # rename tab: f10 # rubymine: # move to opposite group: ctrl+alt+shift+p # move to next splitter: ctrl+alt+shift+t # Test: ctrl+shift+t # ln -s $rubymine_path /usr/bin/rubymine require "ro_commands/helpers/bash" module RoCommands class Shortcuts < Base desc usage("work"), '' def work action("zeus start") bx "rake sunspot:solr:run" bx "spork" bx "guard" end desc usage("lib_spec"), "show lib file in rubymine one splitter and show spec file in rubymine another splitter" def lib_spec hide_guake push_to_opposite next_splitter sleep 0.1 switch_btw_lib_and_spec end desc usage("action"), "" desc usage("open_ro_commands"), "" def open_ro_commands open_project("ro_commands") end desc usage("open_ro_support"), "" def open_ro_support open_project("ro_support") end private def open_guard cmd("bundle exec guard") end def open_project(name) new_tab cd_project(bashc "ro_client navigate get_project #{name}") open_guard new_tab change_tab_name(name) rubymine end def rubymine cmd("rubymine .") end def cd_project(name) cmd("cd #{name}") end def hide_guake key "f10" end def switch_btw_lib_and_spec key "ctrl+shift+t" end def push_to_opposite key "ctrl+shift+alt+p" end def next_splitter key "ctrl+shift+alt+t" end def bx(cmd) action "bundle exec #{cmd}" end def action(cmd, postpone=0.012) cmd(cmd, postpone) change_tab_name(cmd) new_tab end def cmd(name, postpone=0.012) type name enter sleep 0.012 end def change_tab_name(name) key 'f2' type name enter end def enter key 'KP_Enter' end def new_tab bash 'xdotool key ctrl+t' end def key(name) if name.match(%r{(f|F)\d{1,2}}) name.capitalize! end bash "xdotool key #{name}" end def translate(name) end def dict { enter: "KP_Enter" } end def type(str) bash "xdotool type '#{str}'" end end end