Questions tagged [key-bindings]

Anything related to key-bindings (a.k.a. "keyboard shortcuts", "hotkeys", etc.), i.e. the associations between key combinations and the corresponding actions triggered when the user presses such combinations.

Anything related to key-bindings (a.k.a. keyboard shortcuts, hotkeys, etc.), i.e. the associations between key combinations and the corresponding actions triggered when the user presses such combinations. For example, pressing alt + F4 closes an application on Windows, while ctrl + C copies the selected text into the clipboard for both Linux and Windows GUI applications.

See Wikipedia on keyboard shortcuts.

1731 questions
454
votes
10 answers

How to select all instances of a variable and edit variable name in Sublime

If I select a variable (not just any string) in my code, all other instances of that variable get a stroke (white outline) around them: Is there a keyboard shortcut that will let me select all of those instances of the variable and edit them all at…
Oskar Persson
  • 6,605
  • 15
  • 63
  • 124
439
votes
16 answers

Binding arrow keys in JS/jQuery

How do I go about binding a function to left and right arrow keys in Javascript and/or jQuery? I looked at the js-hotkey plugin for jQuery (wraps the built-in bind function to add an argument to recognize specific keys), but it doesn't seem to…
Alex S
  • 25,241
  • 18
  • 52
  • 63
163
votes
7 answers

How can I listen for keypress event on the whole page?

I'm looking for a way to bind a function to my whole page (when a user presses a key, I want it to trigger a function in my component.ts) It was easy in AngularJS with a ng-keypress but it does not work with (keypress)="handleInput($event)". I…
L.querter
  • 2,332
  • 2
  • 13
  • 23
155
votes
22 answers

Xcode duplicate line

There is a Duplicate command in the Edit Menu (with a default shortcut of ⌘D), but it is (as Halley pointed out) meant for duplication in the Interface Builder part of Xcode. So, how do you (easily) duplicate a line in Xcode 4? Related question…
Blaz
  • 3,548
  • 5
  • 26
  • 40
111
votes
7 answers

Detect if a key is bound to something in vim

I'd like to know if there is a way to figure out if a key does something in vim. I know that I can use :map to see user-defined mappings, but is there something for the built-in stuff? For example, I always had CTRL-W bound to close tab, because I…
K. Norbert
  • 10,494
  • 5
  • 49
  • 48
109
votes
7 answers

How to map Ctrl+A and Ctrl+Shift+A differently?

In a terminal, one cannot distinguish Ctrl+A and Ctrl+Shift+A as they both emit the same key code, so I can see why Vim can't do it. But gVim, being an X application, can differentiate Ctrl+A and Ctrl+Shift+A. Is there any way to map those two…
Kohsuke Kawaguchi
  • 3,567
  • 3
  • 19
  • 21
108
votes
2 answers

Emacs: print key binding for a command or list all key bindings

In Emacs (GNU 23.2, *nix), how can I: list the key sequences bound to a particular command? For example, how can we list all the key sequences that execute save-buffers-kill-emacs, with the output of key sequences bound to it? Assuming we can do…
Yktula
  • 14,179
  • 14
  • 48
  • 71
106
votes
13 answers

Emacs on Mac OS X Leopard key bindings

I'm a Mac user and I've decided to learn Emacs. I've read that to reduce hand strain and improve accuracy the CTRL and CAPS LOCK keys should be swapped. How do I do this in Leopard? Also, in Terminal I have to use the ESC key to invoke meta. Is…
Kyle Cronin
  • 77,653
  • 43
  • 148
  • 164
99
votes
3 answers

"Wrong type argument: commandp" error when binding a lambda to a key

I am getting a "Wrong type argument: commandp, (lambda nil (forward-line 5))" here. (global-set-key [?\M-n] (lambda () (forward-line 5))) What is the error? I'm fairly sure it's simple & I'm missing something obvious.
Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
94
votes
8 answers

Insert a newline without entering in insert mode, vim

I want insert newlines in normal mode in vim using Shift-Enter and Ctrl-Enter. I try some solutions and mixing solutions from Vim Wikia - Insert newline without entering insert mode but Shift-Enter and Ctrl-Enter didn't respond: " put a new line…
helq
  • 1,451
  • 1
  • 9
  • 12
93
votes
14 answers

How to reset Visual Studio Code key bindings?

After experimenting with my VSCode key bindings, I would like to reset them to the original settings. How do I do that? I am on Linux Mint 18. I tried removing all the records from the keybindings.json
hba
  • 7,406
  • 10
  • 63
  • 105
90
votes
2 answers

Make Visual Studio use VS code shortcut keys / key bindings

I've been using VSCode a lot lately and have gotten used to the keys-shortcuts/key-bindings (Ctrl+D, Ctrl+P, Alt+leftArrow, etc). However I've recently had some work where I needed to use regular Visual Studio (Microsoft Visual Studio Enterprise…
81
votes
7 answers

In Vim, why is 'j' used for down and 'k' for up?

I've been using Vim for many years and have never really thought about it. A friend of mine asked why that is, noting that in our culture, left would usually map to up while right would map to down, making the Vim keys backwards. I understand that…
geowa4
  • 40,390
  • 17
  • 88
  • 107
80
votes
5 answers

How can I scroll back in GDB's command window in the TUI mode?

Suppose that (gdb) print *this resulted in 20 lines of output. Yes, there would be Type to continue, or q to quit, but I'd like to scroll back to the top after I got to the bottom of the output. I don't think…
nodakai
  • 7,773
  • 3
  • 30
  • 60
69
votes
5 answers

How to capture Ctrl + Tab and Ctrl + Shift + Tab in WPF?

What would be some sample code that will trap the Ctrl+Tab and Ctrl+Shift+Tab for a WPF application? We have created KeyDown events and also tried adding command bindings with input gestures, but we were never able to trap these two shortcuts.
FarrEver
  • 2,951
  • 5
  • 29
  • 24
1
2 3
99 100