`
cyberpeng
  • 浏览: 726 次
  • 性别: Icon_minigender_1
  • 来自: 南京
最近访客 更多访客>>
社区版块
存档分类
最新评论

使用NetBeans开发Ruby的快捷键

阅读更多
转自SKORKS  The Most Handy NetBeans Shortcuts For Ruby Development

Code Editor-Related Shortcuts

    * Ctrl+Shift+Up – copy line under cursor up.
    * Ctrl+Shift+Down – copy line under cursor down.
    * Alt+Shift+Up – move line under cursor  up.
    * Alt+Shift+Down – move line under cursor  down.
    * Alt+Shift+Period – this one is used for selection, every time you press this one the selection widens to capture the next logical syntactic element. For example if you have your cursor over a word, pressing this ones would select the whole word, pressing again would select the whole line. If you’re inside a method definition, pressing it again would select the content of the method (between def .. end), once more would select the whole method. If you continue pressing it, you will eventually select the whole file. Very handy.
    * Alt+Shift+Comma – this one is the opposite of the one above, it will narrow the selection every time you press it.
    * Ctrl+/ – comment or uncomment line.
    * Ctrl+R – in-place rename entity under cursor. If it is a class, it will take you to the refactor dialog box. If it is a variable it will highlight all usages of that variable and attempt to change all of them to your new value (i.e. it is basically a rename refactor).
    * Ctrl+Q – go to last edited document/position. This will jump you to the last position you were editing before your current edit. If you were editing a different document before, it will jump you to that one. Keep pressing it to jump between positions you’ve been editing.
    * Ctrl+Shift+M – bookmark current line. This one is difficult to get used to, but if you want to remember a particular place for some reason, this is a handy one to know.
    * Ctrl+Shift+Period – cycle forward through bookmarks. Complements the one above.
    * Ctrl+Shift+Comma – cycle backwards through bookmarks. Complements the two above.
    * Alt+Enter – select quick fix. When the little light bulb appears offering a quick fix for a problem, you can use this one instead of clicking on it if your cursor is on the line.
    * Ctrl+B – go to declaration of symbol under caret. If it is a variable will jump to the first time the variable was declared. If it is a method name (i.e. method call) will jump to the definition of the method.
    * Alt+Shift+F – format code selection or file. If there is a selection, will format the selection, otherwise the whole file.
    * Ctrl+G – go to line. Will let you jump to a particular line number.
    * Ctrl+E – delete line under cursor. I love the ability to do this in Eclipse, so a really handy one to remember for NetBeans.
    * Ctrl+K – complete word by inserting word from buffer. This one is awesome! Start typing a word then press the shortcut – it will attempt to complete the word based on what else is currently in the file. If you press it repeatedly, it will cycle through all possible words in the file that might complete what you started typing. It does this very simply by scanning backwards through the file from your current position. It is usually correct the first time. Considering that IntelliSense is almost useless for Ruby development, this one is especially handy.
    * Ctrl+[ – jump to matching. This one is probably more useful for a language with brackets, but it can still be handy for Ruby to find a matching end for a do or an if.
    * Ctrl + Home – move cursor to start of file.
    * Ctrl + End – move cursor to end of file.
    * Alt + Shift + Right – move line one tab to the right. You can indent a line without having to move the cursor to the start of it.
    * Alt + Shift + Left – move line one tab to the left. Same as the one above, but lets you un-indent.
    * Shift + Enter – start new line below the current line and jump the cursor to the new line. Surprisingly handy.
    * do+Tab – insert do..end block. You just need to type do and then press TAB.
    * if+Tab – insert if..end block. Once again just type if and press TAB
    * ife+Tab – insert if..else..end block. Same story, type ife and press TAB.

IDE Related Shortcuts

    * Ctrl+Tab – scroll down through open files. If you have many files open in the IDE, this is a handy one to know. Pressing it once will pick the last open file you were in before the current one, keep pressing to scroll down through all the files currently open in the IDE.
    * Ctrl+Shift+Tab – scroll up through open files. The same as the one above but will let you scroll up through all the open files rather than scrolling down.
    * Ctrl+Shift+T – jump between tested file and test file. This one can be a little flaky but does work most of the time. If it doesn’t work for you, use one of the next two instead.
    * Ctrl+O – open a particular type. Search for a class by class name rather than file name.
    * Alt+Shift+O – open file by name. This one is complementary to the one above and will let you open a file rather than a type. Note that it is extremely slow if you have a large project (or several projects).
    * Ctrl+Shift+1 – select currently edited file in project view. I was so happy when I found this one, can be really annoying not to be able to jump to the file you’re editing (in project view).
    * Ctrl+Shift+2 – select currently edited file in files view. The brother of the one above, but lets you select the currently edited file in file view as opposed to project view.

If you have any other NetBeans shortcuts that would be particularly useful for Ruby development (i.e. I don’t just want any random ones, I know NetBeans has lots), please share and I’ll add them to the list.

Update: Here are some more handy shortcuts from the comments below (thanks to all the readers who shared their favorite ones)

    * Ctrl+1 – jump to files in project view
    * Ctrl+0 – jump back to editor (complements the one above)
    * Ctrl+Shift+V – pastes the code and formats it at the same time (very handy)
    * Ctrl+Shift+P – reformats/wraps comment lines to the designated right margin
    * Alt+Shift+F6 – run current test under cursor
分享到:
评论

相关推荐

    NetBeans IDE 6.1 快捷键和代码模板(中文版)

    NetBeans IDE 6.1 是一款广泛使用的集成开发环境,适用于多种编程语言,特别是Java。本文将详细介绍NetBeans IDE 6.1 中的快捷键和代码模板功能,帮助开发者提高工作效率。 #### 二、快捷键详解 ##### 1. 查找、...

    NetBeans Ruby and Rails IDE with JRuby 2009

    总结来说,《NetBeans Ruby and Rails IDE with JRuby 2009》是一本详尽介绍了如何使用NetBeans作为Ruby和Rails开发工具的指南。它不仅覆盖了从安装到日常开发的所有方面,还深入探讨了如何利用NetBeans的各种高级...

    JRuby+Netbeans开发攻略之用JRuby调用JFreeChart

    总的来说,使用JRuby和Netbeans开发时,调用JFreeChart可以让你在Ruby环境中创建出美观且功能丰富的图表。通过熟练掌握JRuby与Java库的交互,以及Netbeans的个性化设置,可以提升开发体验并解决实际问题。在实际项目...

    netbeans6.0快捷键

    本文将深入探讨NetBeans 6.0中的键盘快捷键,帮助用户快速掌握并利用这些快捷键来提升开发体验。 #### 寻找、搜索与替换功能 在编码过程中,高效地查找和替换代码是必不可少的能力。NetBeans 6.0提供了多种快捷键...

    netbeans快捷键大全

    NetBeans 是一款功能强大的开源集成开发环境(IDE),适用于多种编程语言,包括 Java、C/C++ 和 Ruby 等。为了提高开发效率,NetBeans 提供了大量的快捷键及代码模板功能。本文将详细介绍 NetBeans IDE 的快捷键以及...

    netbeans 快捷键大全

    ### NetBeans 快捷键大全 #### 一、查找、搜索与替换 - **Ctrl+F3**:在插入点处搜索单词。 - **F3 / Shift+F3**:在文件中查找下一个/上一个匹配项。 - **Ctrl+F / H**:在文件中查找/替换文本。 - **Alt+F7**:...

    ruby-debug-ide

    ruby-debug-ide正是这样一个强大的调试接口,它为Ruby开发环境提供了集成的调试支持,使得开发者能够在IDE(集成开发环境)中方便地进行源代码级的调试工作。本文将深入探讨ruby-debug-ide的功能、安装、使用方法...

    NetBeans IDE 6.5使用说明.pdf

    ### NetBeans IDE 6.5使用说明:快捷键与代码模板详解 NetBeans IDE 6.5是一款功能强大的集成开发环境(IDE),适用于多种编程语言,包括但不限于Java、C/C++、Ruby等。本文旨在详细介绍NetBeans IDE 6.5中的快捷键...

    JavaEye3.0开发手记

    NetBeans Ruby IDE 是一个强大的集成开发环境,专门为Ruby on Rails (RoR) 开发而设计。它提供了丰富的功能和快捷键,极大地提高了开发效率。 **2. 下载与安装** - **下载地址**:...

    连接MYSQL数据库归纳.pdf

    Web IDE指的是可以在浏览器中直接进行编程开发的IDE,Rails是Ruby语言的一个Web开发框架,Ruby on Rails是这个框架的简称,它在开发Web应用程序时,也常常会与数据库打交道。 综合以上内容,可以概括以下知识点: ...

    JAVA上百实例源码以及开源项目源代码

    EJB中JNDI的使用源码例子 1个目标文件,JNDI的使用例子,有源代码,可以下载参考,JNDI的使用,初始化Context,它是连接JNDI树的起始点,查找你要的对象,打印找到的对象,关闭Context…… ftp文件传输 2个目标文件...

    Java开源的下一代社区平台Symphony.zip

    简介 Symphony([ˈsɪmfəni],n.交响乐)是一个现代化... NetBeans:全宇宙暂时排名第三的 IDE IntelliJ IDEA:全宇宙暂时排名第二的 IDE 下一代的社区系统,为未来而构建 标签:java社区 symphony

Global site tag (gtag.js) - Google Analytics