Skip to content

u/DeadLink404

In this archive from Mar 2018 to Jan 2022

4
posts
347
comments
0
media
1.3k
score

Top posts

Udev assign final := isn't final?

Following the wiki here I wrote the file /etc/udev/rules.d/pci_pm.rules: SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{device}=="0x1be1", ATTR{power/control}:="on" SUBSYSTEM=="pci", ATTR{power/control}="auto" To enable pci power management on everything except the dGPU. However this enabled pm for...

16 points3 comments
Open on Reddit

Backlight on Optimus laptop

Update: using only the nvidia card through bios with nvidia drivers does work. Can you still make this work with bumblebee? If so how? My Rig: A laptop with an i7-820HK and gtx 1070. My setup: bumblebee with the xf86-video-intel and nvidia drivers. My Problem: The keys modify /sys/class/backlight/in...

7 points19 comments
Open on Reddit

Top comments

press x with the cursor over the character.

###crash course on vi:

vi is a modal editor.
Normal mode is for movement as well as copying pasting and deleting. visual mode is for selecting and insert mode is for inserting.

Press i for insert mode or v for visual mode. Esc will get you back in normal mode.

####Normal mode commands:

The movement keys are hjkl, but cursor keys also work. I will use hjkl here for the sake of brevity.

h = left
j = down
k = up
l = right

$ = end of the line
^ = start of the line

To delete a single character press x. To delete 5 characters press 5 then x.

Most commands can combined with a number like that. Most commands also use a movement direction.

To delete the current line and the next three press d3j (delete 3 down)
To delete a single line press dd or dj. deleting the previous line would be dh.

y (yank) is for copying. p is for pasting. d is technically cut not just delete.

u is undo. ctrl+r is redo.

####To save and quit:

In normal mode press : (colon) this will make a little : appear at the bottom. this is where you can execute other commands such as

  • :help <topic>
  • :w (write)
  • :q (quit)
  • :wq (save and quit)
  • :x (save and exit)

Note: if there are unsafed changes q will not quit but q! will.

####visual mode:

the most useful visual commands are:

  • u selection to lower case
  • U selection to upper case

if you press : while text is selected a :'<,'> will appear. This is a range. A range is something like 5,8 for lines 5 through 8. '< is a shortcut for the start of the selection and '> is a shortcut for the end of the selection. so '<,'> is the range of the text that you selected. Commands you use after that will apply to this range

so the most general anatomy of vi commands is
(range)(command)(count)(movement).

Vi is pretty old but also a quite common tool. However I recommend vim for daily use. The commands are largely the same but vim has a lot less of the weirdness Vi has. For example that you can't backspace something in insert mode that was there before you entered insert mode.

I would recommend you use vimtutor to learn vim hands on.

42 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.