cool vim features

guu
make the whole line lowercase
gUU
make the whole line uppercase
‘.
jump to the last line you edited
ma
creates a bookmark at the current position
a
jumps to the bookmark

You can make as many bookmarks as you like!

ga – gives you the ascii value of the char

B – goes back one space-delimited word

W – goes forward one space-delimted word

z<return> – adjusts line to be at the top

M – jumps to the middle of the visible file

P – pastes above current line

ISA

An instruction set, or instruction set architecture, describes the aspects of a computer architecture visible to a programmer, including the native datatypes, instructions, registers, addressing modes, memory architecture, interrupt and exception handling, and external I/O (if any).

what POSIX stands for (I keep forgetting)

The term POSIX was suggested by Richard Stallman (not as a compliment) in response to an IEEE request for a memorable name; before that the standards effort was called IEEE-IX. (Piece Of ShittIX?) POSIX has been backronymed to Portable Operating System Interface, with the X signifying the Unix heritage of the API.

editing past commands in Vim

Credit to Jimmy Kittiyachavalit for figuring this one out. That boy hasn’t been updating his blog, so I took the liberty of documenting this discovery.

He wanted to search and replace some text that was coming out funky because of UTF encoding quirks, except he couldn’t type it out into the search query because it was outside the range of ASCII. Instead of typing it out, he yanked the text into the buffer and…

Bring up a history of the commands you previously entered with q: or ^f in the command prompt. What’s cool about this is that, using Vim, you can edit past commands because they are basically stored in this file. So what he did was yank the offending text into the buffer and pasted it where he needed that text:

%s/[paste buffer contents here]/foo/gc

locate/find/whereis

locate – Lists files with the argument in the filename.

find – Searches for files in a directory hierarchy.

whereis – Locates the binary, source, and manual pages for a command.

As always, refer to the man pages to refine/optimize your queries (I’ll probably end up doing this later on when I actually use these commands).

pushd/popd

pushd is the same as cd except that it pushes the absolute path of the current directory onto a virtual stack. Subsequent calls to pushd pushes additional paths onto the stack. popd pops the path frame off of the top of the stack and cds into it.

“cd -” does a similar operation, but it only remembers your last directory.

screen

What screen does is multiplex a physical terminal between multiple virtual terminals. screen makes it possible to let processes run even when you terminate a physical terminal by detatching the virtual terminals beforehand. screen also detaches upon hang up, allowing you to reattach when you log back in.

-r pid
Reattach screen with pid
-ls
LiSt the running screen processes.
-S sessionname
Session name. This name is now synonymous with the pid.

While running screen:

^a c
Create a new window.
^a d
Detatch the current screen.
^a “
Presents a list of all windows for selection.
^a A
Allows you to rename the current window.
^a k
Kill the current window.
^a n
Switch to Next window.
^a p
Switch to Previous window.