From ba904a2bd63606578e97aa95ad0d2482be94988d Mon Sep 17 00:00:00 2001 From: ABorgna Date: Tue, 10 Sep 2013 23:19:48 -0300 Subject: [PATCH 1/4] Update vim Using same format as 7z and emacs --- cheatsheets/vim | 67 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/cheatsheets/vim b/cheatsheets/vim index 22b8bf5..fca5bbd 100644 --- a/cheatsheets/vim +++ b/cheatsheets/vim @@ -1,14 +1,55 @@ -# Insertion -a - enters insertion mode, append after the cursor. -A - enters insertion mode, at the end of the line. -i - enters insertion mode, insert before the cursor. -I - enters insertion mode, at the beginning of the line. -o - enters insertion mode, creating a new line under the cursor. -O - enters insertion mode, creating a mew line above the cursor. -C - enters insertion mode, cut the end of the line. - # File management -:w - writes (saves) file -:x - writes (saves) file ans exit -:q - quits -:q! - quits without saving changes + +:e reload file +:q quit +:q! quit without saving changes +:w write file +:w {file} write new file +:x write file and exit + +# Movement + + k + h l basic motion + j + +w next start of word +w next start of whitespace-delimited word +e next end of word +E next end of whitespace-delimited word +b previous start of word +B previous start of whitespace-delimited word +0 start of line +$ end of line + +# Insertion +# To exit from insert mode use Esc or Ctrl-C +# Enter insertion mode and: + +a append after the cursor +A append at the end of the line +i insert before the cursor +I insert at the beginning of the line +o create a new line under the cursor +O create a new line above the cursor +R enter insert mode but replace instead of inserting chars +:r {file} insert from file + +# Editing + +u undo +yy yank (copy) a line +y{motion} yank text that {motion} moves over +p paste after cursor +P paste before cursor + or x delete a character +dd delete a line +d{motion} delete text that {motion} moves over + + +# Preceding a motion or edition with a number repeats it n times +# Examples: + + 50k moves 50 lines up + 2dw deletes 2 words + 5yy copies 5 lines From a44c824f59b1f6c90c2cb9239acb4553640b4f45 Mon Sep 17 00:00:00 2001 From: ABorgna Date: Wed, 11 Sep 2013 00:21:44 -0300 Subject: [PATCH 2/4] Added at cheatsheet --- cheatsheets/at | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cheatsheets/at diff --git a/cheatsheets/at b/cheatsheets/at new file mode 100644 index 0000000..2827a45 --- /dev/null +++ b/cheatsheets/at @@ -0,0 +1,17 @@ +# To schedule a one time task +at {time} +{command 0} +{command 1} +Ctrl-d + +# {time} can be either +now | midnight | noon | teatime (4pm) +HH:MM +now + N {minutes | hours | days | weeks} +MM/DD/YY + +# To list pending jobs +atq + +# To remove a job (use id from atq) +atrm {id} From 60e2e66014d0272b5fe90d2707deb732aa59ef71 Mon Sep 17 00:00:00 2001 From: ABorgna Date: Wed, 11 Sep 2013 00:33:55 -0300 Subject: [PATCH 3/4] Added chown cheatsheet --- cheatsheets/chown | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cheatsheets/chown diff --git a/cheatsheets/chown b/cheatsheets/chown new file mode 100644 index 0000000..811a864 --- /dev/null +++ b/cheatsheets/chown @@ -0,0 +1,8 @@ +# Change file owner +chown user file + +# Change file owner and group +chown user:group file + +# Change owner recursively +chown -R user directory From acbd8632778cd70d9a3b68692d3b9a6efd1e60bb Mon Sep 17 00:00:00 2001 From: ABorgna Date: Wed, 11 Sep 2013 01:00:59 -0300 Subject: [PATCH 4/4] Added ifconfig cheatsheet --- cheatsheets/ifconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 cheatsheets/ifconfig diff --git a/cheatsheets/ifconfig b/cheatsheets/ifconfig new file mode 100644 index 0000000..ca0b9d1 --- /dev/null +++ b/cheatsheets/ifconfig @@ -0,0 +1,13 @@ +# Display network settings of the first ethernet adapter +ifconfig wlan0 + +# Display all interfaces, even if down +ifconfig -a + +# Take down / up the wireless adapter +ifconfig {up|down} wlan0 + +# Set a static IP and netmask +ifconfig eth0 192.168.1.100 netmask 255.255.255.0 +# You may also need to add a gateway IP +route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1