The curious history the invention of the CMD+K quick switcher
摘要
问题讨论同一个快捷键(⌘/Ctrl + K)为何被广泛用于两种不同操作:富文本中的插入超链接,以及现代软件里的 command palette / quick switcher。最高票回答来自自称当事人的用户:他在 2014 年利用 Slack 的一个 XSS 漏洞做黑客日演示,为了解决 Slack 当时切换聊天不便的问题临时实现了 quick switcher,并仓促选择 Cmd + K 作为触发键;后来将演示发给 Slack,Slack 正式实现该功能并保留了这一快捷键,随后被大量产品模仿。另一则回答补充了相关历史脉络:Sublime Text 的 Command Palette 使用 Ctrl/Cmd + Shift + P;Firefox、Visual Studio 等更早产品也有 Ctrl + K 相关用法;而 Ctrl + K 作为 “插入超链接” 在 Microsoft Word 等办公软件中已沿用多年。对于新产品如何处理冲突,回答认为目前 Ctrl/Cmd + K 在命令面板场景已占据主流,可以根据上下文区分行为(如 Jira),或将插入链接迁移到其他交互方式。
荐读理由
没有命中任何寻求结果:内容是用户对键盘快捷键历史的好奇提问(无真实技术变化、无创业信号、无洞见或直接可用方法/工具),本质为纯当日快讯/标题党/蹭热点
原文
⌘+K (or CTRL+K on Windows) is the standard keyboard shortcut for two extremely different actions, even in tools that necessitate both actions.
Adding a hyperlink
Highlighting text and then hitting ⌘+K is the standard keyboard shortcut to add a hyperlink to the highlighted text in nearly every email platform, word processor, presentation software, most rich text editors (notably excluding Stack Exchange's, where it inexplicably formats the highlighted text as code), and much more. I'm not sure when this became common practice, but I have memories of using it for well over a decade.
More recently, various tools have introduced the pattern of highlighting text and then hitting ⌘+V to add a hyperlink using a URL from the user's clipboard. As far as I know Slack has been doing this the longest, but you can also see it in Notion, Figma, and many others. I quite like this pattern and am glad it's becoming more common, but I wouldn't necessarily refer to it as "standard practice" yet.
Opening a command palette
Many tools use ⌘+K as the shortcut to open a command palette. Examples include Discord, Slack, Todoist, Github, Webflow, Spotify, Figma, Linear, and more. This pattern is so common that these command palettes are often referred to as "kbars" or "kmenus."
This interaction hasn't been around as long, and before ⌘+K became common, there were other contenders. My favorite shortcut to open a command palette was ⌘+/, but it seems that's more or less died out.
Sometimes it's both
A predictable consequence of the same keyboard shortcut being commonly used to trigger two different interactions is that users who switch between multiple applications throughout their day (which is likely most people) get confused and frustrated. Some tools even support both interactions, which is also confusing.
In Jira for example, ⌘+K brings up the command palette unless a text input is focused, in which case it inserts a hyperlink.
How did we get here, and what's the best way forward?
When the first few teams to implement a command palette brainstormed different options for what specific keyboard shortcut should do this, how did they come to settle on ⌘+K? Since it's been so widely used to insert a hyperlink for over a decade, you'd think they would've quickly ruled that out. We know there were other options, so I assume they might've had a good reason for choosing ⌘+K that I'm just overlooking.
And if a product is about to release a command palette but currently uses ⌘+K to insert a hyperlink, what should they do?
1,3481414 silver badges1919 bronze badges
asked Feb 22, 2025 at 15:33
59533 silver badges1717 bronze badges
2 Answers 2
Wow, I never expected to see a question on UX SE that I can actually answer...
Short answer: In 2014, a random Slack user (me) picked Cmd-K (and Ctrl-K) arbitrarily as the shortcut for a demo quick-switcher, and shared it with Slack. Slack then built it, and popularised the shortcut.
Longer answer:
In 2014 the company I worked for was hosting a "hack day". The intention was to create something from scratch - but I thought it would be fun to take the term literally and try to hack (into) something instead. For my target, I picked Slack.
It took less time than I'd expected to find a relatively mild XSS exploit (you can see the exploit in action here) - meaning that, in theory, I could make Slack run any code I wanted on another user's device.
So now I had an exploit, but what to do with it? I still had hours remaining in the day - and at that time my biggest UX gripe with Slack was how long it used to take to switch between chats. Back in 2014 you had to scroll the list of users on the left and manually click on the chat you wanted to switch to, which drove me up the wall daily. So - with the rest of my hack day I chose to build a "quick switch" function for the Slack Mac app, using the code-execution exploit above.
After slapping together some code and getting a working version running... my hack-day demo was minutes away and I desperately needed a shortcut to pop up the switcher.. the first one or two I tried were already taken and in a panic I looked at my keyboard for letters that I didn't use as shortcuts... "K" stuck out to me immediately (it felt like a "Kill" button that nobody would touch).. I tried it.. it worked - quick, demo time(!).
At the end of the day, I messaged Slack to let them know that they had a small security vulnerability, and included the full video + code of the quick switcher as a fun gesture.
Not that long afterwards (June 2014), Slack posted to their blog about their new omnibox - with a link to the video above! They built it (properly) .. and kept the original shortcuts.
From there, lots of other companies started to copy the shortcut - despite the prevalence of T and P as prior alternatives. My guess is that T and P tended to be used by developer tools, whereas Slack had really wide reach, especially into startups.
Hope this helps, and .. sorry for any lasting inconvenience caused! I'd honestly never used the ctrl-k (create link) shortcut before. Suffice to say - this question doesn't come up at pub quizzes often.
answered Aug 27, 2025 at 18:00
5422 bronze badges
(I don't think this really answers the question, but I don't have the reputation to comment)
I recently wrote a blog post about Sublime Text's choice of Ctrl-Shift-P which has a bunch of relevant info here.
How was ⌘+K chosen for the command palette?
About this question, I believe the modern command palette is most directly inspired by Sublime Text. There, it uses Ctrl-Shift-P instead:
The key binding (Ctrl+Shift+P / Cmd+Shift+P) exists though because Sublime Text didn't have the ability to Print for a long time. That freed up Ctrl+P to search through the files in the project, and the Command Palette was a logical extension of that functionality.
-- Jon Skinner, creator of Sublime Text
Then as far as I can tell, Slack popularized the usage of Ctrl-K with the Quick Switcher in 2014. Prior to that, I found that Firefox had used Ctrl-K in a similar context for "Jump to searchbar" at least by 2011:
Ctrl+K brings the focus to the search when the Navigation Toolbar with the search bar on it is on display.
Or maybe the origin is borrowed from applications like Visual Studio or HTML Kit, where Ctrl-K was used to enter a chording mode where you could run more commands:
We call these "chords" - one key sequence, followed by another, to invoke a single command.
This greatly expands the number of possible key bindings you can create.
The trade-off is the first half of the chord becomes unusable for command binding on its own - because VS must see what follows before it can execute the correct command.
As such, we don't want to bind too many characters in chords. Ctrl-K was chosen at some point long ago as a chord to preface a large set of useful, but uncommon Editor/Debugger functions.
In the other direction, this cheatsheet for Microsoft Word 2000 shows it already uses Ctrl-K for inserting a hyperlink. But, this wasn't universal at the time; for example, WordPerfect in 2001 used Ctrl-K to change selected text to upper/lowercase.
Other applications originally had other shortcuts for hyperlinking - Thunderbird used Ctrl-L until 2017 when it was changed to Ctrl-K "to align with Office applications". Of course, in browsers, Ctrl-L also conflicted with "jump to navigation bar", so no one was happy.
About StackOverflow specifically, this was an interesting meta discussion in 2010. Multiple commenters mentioned they preferred to avoid Ctrl-K to avoid conflicting with the Emacs/GNU readline command to clear the text to the end of the line.
If a product is about to release a command palette but currently uses ⌘+K to insert a hyperlink, what should they do?
Chris Coyier makes a good point about in his writeup of command bars:
I’m a little surprised that more apps don’t have more prominent UI for activating and using Command Bars, relegating it to a keyboard command only. If the app has a Search Bar, be bold! Turn it into a multi-capable Command Bar! Or some kind of icon button to activate it.
Besides that, I personally think the Jira suggestion is a reasonable evil - hyperlink if it makes sense in the context, and only open the command palette if it doesn't make sense to hyperlink.
At this point, I think Ctrl-K has won for command palettes, and if you had to choose one or the other, it would be easier to migrate hyperlinking to a different shortcut entirely (or interaction, like the Ctrl-V overpaste you mention), or Markdown-style [display text](link URL) formatting.
answered Jun 29, 2025 at 23:22
1122 bronze badges
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
这条对你有帮助吗?