[转载][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 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:
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
If you want to see the recent files you’ve just edited: Shift+Cmd+E
And you can use the Switcher to do even faster switches: Ctrl+`
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.
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:
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:
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
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:
Navigation Bar
Make sure you turn that off also. If you ever need it, invoke it using Alt+Fn+LeftArrow
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.
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.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?