当前位置:网站首页>Do you know the five GoLand shortcuts to improve efficiency?

Do you know the five GoLand shortcuts to improve efficiency?

2022-06-10 16:51:00 JetBrains China


GoLand For you can IDE The actions performed in provide a number of shortcut keys . however , You don't have to know all of these shortcuts for efficiency . today , We will Share some predefined key mappings for you to choose from , And introduce the usage of several necessary shortcut keys . Just remember this 5 Basic shortcut key operations , You can get twice the result with half the effort .


besides , This Thursday 6 month 9 Friday night 8 spot , We will also work together GoCN Community , Bring about 《Go Linguistic netpoll Abstractions and FAQs 》 Of Special live broadcast Introduction to stamping activities ). Want to Go The network model design and principle of language have further exploration Gopher People , Remember to make an appointment in advance !



How to select key mappings (Keymap)


We first select the correct key mapping , To ensure that you can adapt more quickly .  By default ,GoLand There are several predefined key mappings to choose from :

  • Based on your environment (macOS or Windows/Linux) Key mapping for .

  • For in IntelliJ IDEA Or anything else based on JetBrains IntelliJ Platform IDE Have experience in the field and are IDE Used in IntelliJ/macOS Key mapped users , Recommended IntelliJ IDEA Classic Key mapping .

  • For users migrating from other code editors , Recommended Emacs、Sublime Text and Sublime Text (macOS)  Key mapping .

  • Last but not least , You can always be at  Preferences/Settings | Keymap( preferences / Set up | Key mapping ) Click... At the top of the window  Get more keymaps( Get more key mappings ) To search for alternate key mappings .


In this paper , We will introduce some necessary shortcuts . Although all key combinations used here are from macOS and Windows/Linux Default key mapping for , But you can still  Preferences/Settings | Keymap( preferences / Set up | Key mapping ) Customize your key mapping configuration in .



Search Everywhere( search everywhere ):

⇧⇧ / Shift+Shift


Search Everywhere( search everywhere ) It is a multi tool operation , Can help you find any text content !  Any entry in the source code 、 database 、 operation 、 User interface elements 、 plug-in unit 、 Set up 、Git Branch 、 Submit 、 Mark 、 News, etc. .


To narrow the search , Please press  ⇥/Tab  Navigate between tabs , Or click the filter icon on the window toolbar and select the appropriate option .


Last but not least , You can go to  Find Tool Window( Find tool window ) Open the current search results and run another query in a separate tab of the .  Just click  Search Everywhere( search everywhere ) On the right side of the  Open in Find Window( Open... In the find window ) Icon .



Show Context Actions

( Show context operations ):

⌥↵ / Alt+Enter


When working in the editor ,GoLand Will continuously analyze your code , Find ways to optimize and detect potential problems .  It covers a wide variety of situations , From errors and warnings to direct access to  Alt+Enter  Applied optimization recommendations .


To view a complete list of available intent actions , Please open the IDE Set and select  Editor | Intentions( Editor | Intention ).  Just clear the check box next to the action , You can disable any operations that are not currently required .  Besides , You can do this at any time as follows : Place the text cursor over the code , Press  ⌥↵/Alt+Enter, Select the action to disable , Click the right arrow next to , And then click  Disable<intention action name>( Ban  < Intended operation name > ).



Refactor This( Refactor this ):

⌃T/Ctrl+Alt+Shift+T


Refactor This( Refactor this ) yes GoLand The key to a refactoring composition in , from  Rename( rename ) To  Move( Move )、ChangeSignature( Change signature )、Exract( extract ) and  Introducemethod/type/interface( Introduce methods / type / Interface )、Inline( inline ), And for safely removing files from source code  Safe Delete( Safe deletion ) restructure .


This means that you only need to remember one shortcut key to perform all refactoring .  Press  ⌃T / Ctrl+Alt+Shift+T  You can quickly access the list of available refactorings for the selected code .



Generate( Generate ):

⌘N/Alt+Insert


This hotkey opens various options for creating common code structures and repeating elements .  Generate a function , This function creates the value of the structure type 、getter and setter、 Empty test file , And documents 、 software package 、 Function and copyright testing .  Besides , It can implement all the methods listed in the interface in a few seconds .



Smart Code Completion

( Intelligent code completion ):

⌃⇧Space/Ctrl+Shift+Space


Code completion can reduce what you need to remember , And help you avoid spelling mistakes and other common mistakes .  When you start in GoLand When entering the code in ,Basic Code Completion( Basic code completion ) Will pop up and work automatically in most cases , and  Smart Code Completion( Intelligent code completion ) You need to press  ⌃⇧Space/Ctrl+Shift+Space  To explicitly call .GoLand Provides you with a list of the most relevant symbols for the current context .



Further more


In order to improve the operation speed , You can also download  Key Promoter X  plug-in unit https://plugins.jetbrains.com/plugin/9792-key-promoter-x


With this plug-in , Every time you are in IDE When you place the mouse over a button ,Key Promoter X Will show you the keyboard shortcuts you can use . It can help you Learn about various shortcut keys while working , And use keystrokes instead of tedious mouse movements . 


The original author of this blog in English :Ekaterina Zharova


live / dynamic / pre / Sue

「JetBrains Code on track 」Go Special live broadcast

  • Live theme :

    Go Linguistic netpoll Abstractions and FAQs

  • Live time :

    2022 year 6 month 9 Japan 20:00

  • Live guests :

    Cao Chunhui (Xargin)、 Xie Mengjun (Asta)、 Fan Shengyou

There is also a lottery in the live broadcast GoLand link , Remember to make an appointment quickly !


About GoLand

GoLand It's right JavaScript、TypeScript  And the database Cross platform support Go IDE.

GoLand It provides a series of intelligent functions , Such as intelligent code completion 、 One step undo security refactoring 、 Powerful built-in debugger and real-time error detection with fast repair .

  • Scan the code to understand GoLand

    Turn on 30 Day free trial »»»

stamp 「 Read the original 」 Learn more about

This article is from WeChat official account. - JetBrains(JetBrainsChina).
If there is any infringement , Please contact the [email protected] Delete .
Participation of this paper “OSC Source creation plan ”, You are welcome to join us , share .

原网站

版权声明
本文为[JetBrains China]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101550381499.html