[转载][IntelliJ IDEA]No Tabs in IntelliJ IDEA

 

原文地址:http://hadihariri.com/2014/06/24/no-tabs-in-intellij-idea/

 

I often come across people complaining about some odd behaviour when it comes to editor tabs in IntelliJ IDEA or any of the other sister products such as WebStorm or PhpStorm. Some expect a different kind of behavior from tabs. Others want the ability to have different colored tabs and some want them numbered.


My advice to all of them? Switch tabs off. You don’t need tabs. 

Here’s your typical layout with Tabs 

No Tabs

No more Tabs

That’s taking up realestate and it’s not providing you with much value other than confusing the hell out of you when you’re looking for that specific index.html file and there are a few of them open. And when you want to navigate to the different tabs, you either have some shortcut key assigned to loop through them or you’re using your mouse!


Bad. Don’t use the mouse. And here’s what you do with Tabs: 

Settings

But, how do I move back and forth?

Use the keyboard with a few different options (I’m using OSX 10.5+ layout):

Recent files

Navigate to the recent files you’ve just been looking at: Cmd+E 

Recent Files 

If you want to see the recent files you’ve just edited: Shift+Cmd+E 

Recent Edits 

And you can use the Switcher to do even faster switches: Ctrl+` 

Switcher

Find Types and Files

  • If you want to find a type, Cmd+O.

  • If you want to find a file, Shift+Cmd+O

  • If you want to look for a symbol, Alt+Cmd+O.

Or you can just press Shift twice and get Search Everywhere. 

Search Everywhere 

Noticed how Search Everywhere by default lists Recent Files? 

And remember, most of these dialogs admit patterns such as wildcards, CCC (CamelCaseCompletion), and even going to a specific line number: 

Line Number

Recent Positions

  • If you want to move back and forth between where you are and where you just were: Cmd+[ to go back and Cmd+] to go forward. Of course, if your current and previous position is in different files, it will also go back and forth between them.
  • If you want to go to the last edited position: Shift+Cmd+Backspace

Bookmarks

You can also toggle bookmarks using F3 (mark) and Alt+F3 (unmark), navigate between them and also display bookmarks:

Bookmarks

Project Structure

The Project Structure can help you easily locate files. First off, hide it and activate it using Cmd+1. Secondly, while having it open you can just start typing to quickly locate a file

Project Structure 

Once you locate the file, hit F4 or ESC to change to focus to the editor. Incidently, if you want to autoscroll to source (or from source), hit the Gear icon on the Project window and activate it: 

AutoScroll

Make sure you turn that off also. If you ever need it, invoke it using Alt+Fn+LeftArrow 

Navigation Bar 

And remember, you can even invoke the New File Command with Cmd+N (only way you should be creating files, packages and folders) on the Navigation bar. It’s context-aware. 

New File

Many ways to navigate

As you can see, there are many ways to navigate a project inside IntelliJ IDEA that doesn’t necessarily include having to look through a list of tabs and figure out where you have to click next.


 

posted on   tuohai666  阅读(489)  评论(0编辑  收藏  举报

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示