Keyboard tips n' tricks thread!

keyboard tips n' tricks thread!
>you can escape vim w/ C-[ or C-c
>to swap your caps for control, use "setxbmap -options ctrl:nocaps", place in .profile to stay after session ends

Attached: XEV.png (286x323, 26K)

Other urls found in this thread:

en.wikipedia.org/wiki/GNU_Readline#Emacs_keyboard_shortcuts
twitter.com/SFWRedditVideos

How to remap caps-lock to dot in Vim or just on entire OS?

>vim

Sorry I'm not autistic and no impressed by others memorizing 100s of keybinds when they could be learning actual CS or even APIs.

>or even APIs
Why would one learn APIs?

On any OSX text box, or your typical linux terminal you can use:
- "CTRL a" to move to the start of a line
- "CTRL e" to move to the end of a line
- "CTRL k" to delete everything after the cursor
- "CTRL t" to transpose characters on either side of the cursor
- "ALT [left]" to move back a word
- "ALT [right]" to move forward a word

...and many other useful shortcuts are available, look them up!

>memorizing keybinds

Sure. People memorize all possible keybinds of most programs they use instead of just the ones they need to work.

On windows you can do this with Autohotkey really easily.

This is really useful. Thank you

in shell
ctrl-d to exit
ctrl-b 1 letter backward
ctrl-f 1 letter forward
alt-b 1 world backward
alt-f 1 letter forward
ctl-p same as up key
ctl-n same as down key

It's not even any effort at all to learn vim's bindings. Each letter means something

dw delete word
ci( change inside ()
fa find a


And the time savings are huge.

Press Win+B in Windows to focus the tray icon area of the task bar.
Use Win+Number to start a program pinned to your task bar, or focus it if it's already open.
Use Win+UpArrow to maximize, down to minimize, left or right to snap your currently focused window.
Win+X opens the right-click menu of the start button, afterwards press one of the underlined letters to select the associated option.
Win+Shift+N creates a new folder in explorer.
F2 is edit in many context, for example the currently highlighted folder in explorer.
Shift+F10 opens the context menu of a highlighted option.
Esc cancels many things, like open context menus.

Like 90% of keyboard stuff in Windows GUI has no equivalent in any Linux GUI because they are all either tiled window managers, Windows shell clones or MacOS shell clones that just copy the visuals without bothering with the finer details that make those UIs actually usable.

Also, you can use quick record in vim to get a macro to comment out or uncomment an arbitrary amount of lines.

In any shell
ctrl+u clear current line
ctrl+l (L) clear screen

Don't tell me that v, y or p mean anything to someone who doesn't know vispeak.
Or the fact that d also works as cut.

I'm also not sure how $ is in any way associated with the end of a line.

I like the vi keybindings, but don't pretend like they are intuitive or quick to learn. You need a bit of routine to use them effectively, even if you do know the keybindings.

Also, some of them may be suboptimal depending on your keyboard layout.

>I'm also not sure how $ is in any way associated with the end of a line.
It's exactly the same as regex in every language. ^ for beginning, $ for end. Anyone who codes for a living would already know these identifiers.

Where exactly are these the standard?
I know that only like half of Linux commands use the same regex standard. In terms of programming, it's a coin toss as to how each language's implementation of regex actually works.

f2 works in most file explorers
win+number is supplemented w/ defining a program to launch w/ win+
most window managers can minimize, just need to define the action. Bonus, all Gnome-like distros have corner tiling and left+right tiling (I like to use win+hl for left and right, and uijk for corner pieces)
win+shift+n works in most file browsers (alt+shift+n or alt+n can make a new file in pcmanfm)
I'm pretty sure context menu (right click) can be defined in most DE

Not be combative, its just Linux has come a long way. I switched from win10 to XFCE and like XFCE a lot more once I spent 30min on the keyboard
here's a bonus windows tip just to prove I switched, win+m minimizes all windows, win+r enters run menu and to launch a run in admin type in the command and press Ctrl+shift+enter
try xfce windows fren :)

>It's not even any effort at all to learn vim's bindings.

how do people ever become so delusional?

Ctrl+l doesn't work in ksh

en.wikipedia.org/wiki/GNU_Readline#Emacs_keyboard_shortcuts

>C-l
Doesn't work well with my terminal
alias cls='printf "\n%.0s" {1..2000}'

Fun fact: Bash can be set to work in vi mode instead. Emacs shortcuts are just the default.

^$ is standard in literally every regex implementation ever. Find me one that it isn't. I've never seen one.

woah thx user

another useful one: CTRL u to delete everything before the cursor

You should really look into the /usr/share/xkb/rules directory.

Press alt+F[x] to change TTY. If you got a x-server running on the current one, you need ctrl+alt+F[x] instead. F1 or F7 tends to be the x-server.
There are often multiple TTYs by default. If you use a GUI-based distribution and get a blank screen, you might very well troubleshoot the issue by switching to another TTY.

I want it on Linux