Disorganized Notes
Written by: ArgentumCation1 min read
Last Changed:
NixOS/Nix
- Show channels:
sudo nix-channel --list
- add unstable channel:
sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable
- update repos:
sudo nix-channel --update; sudo nix search -u
Vim
- Sort selected lines:
:sort
- Open man page:
:man [command]
or\K
- Open URL:
gx
- Move between splits:
ctrl+w [direction]
- vim-commentary:
gc [motion]
to comment out - Case switching:
gU
to uppercasegu
to lowercase -g~
to toggle
- Substitute:
/g
global - sub all in line:%s/
- substitute in all lines:5,12s/
substitute from lines 5 to 12:.,+2s/
substitute this line (.
) and the next 2:g/^foo/s/bar/baz/g
substitute all instances of bar with baz on lines beginning with foo/c
- ask for confirmation
- Windows
:sp [filename]
horizontal split, optionally open filevsp
vertical splitctrl+w w
move between windowsctrl+w =
resize windows to be equalctrl+w q
close windowctrl+w <direction>
move window
McFly
SSH
- Set up port forwarding in existing connection:
$ ~C
ssh> -D [port number]
[Enter]
[Enter]
$
Shell
!!:s/foo/bar/
, replace first instance offoo
withbar
in the previous command^foo^bar
same thing but shorter and less flexible!foo
rerun last command containingfoo