Skip to content

Instantly share code, notes, and snippets.

@Rrrapture
Last active May 25, 2017 18:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rrrapture/24534158a67e2c5cc7454db84b10f554 to your computer and use it in GitHub Desktop.
Save Rrrapture/24534158a67e2c5cc7454db84b10f554 to your computer and use it in GitHub Desktop.
General Terminal Commands - Bash shell, vim - that I'm just learning or want to have as a reference.
The text M-k is read as `Meta-K, labeled ALT - the left one - on many keyboards
If you do not have a Meta or ALT key, or another key working as a Meta key, the identical keystroke can be generated by typing ESC first, and then typing k. Either process is known as metafying the k key.
UNDO!!! LAST COMMAND:
for my terminal at least: C-_ that's control and underscore
clear-screen (C-l)
Clear the screen and redraw the current line, leaving the current line at the top of the screen.
- use instead of $:clear
(C-a) beginning of line
move to beginning of line with control-a
from: http://tiswww.case.edu/php/chet/readline/rluserman.html
*********
********
********
bind -P
< run that in prompt (command line - bash) to get a list of commands for Vim or emacs, whatever is on your unix? bash cl
Killing text means to delete the text from the line, but to save it away for later use, usually by yanking (re-inserting) it back into the line. (`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
If the description for a command says that it `kills' text, then you can be sure that you can get the text back in a different (or the same) place later.
When you use a kill command, the text is saved in a kill-ring. Any number of consecutive kills save all of the killed text together, so that when you yank it back, you get it all. The kill ring is not line specific; the text that you killed on a previously typed line is available to be yanked back later, when you are typing another line.
Here is the list of commands for killing text.
C-k
Kill the text from the current cursor position to the end of the line.
C-y
Yank the most recently killed text back into the buffer at the cursor.
*********
*********
*********
********
in ESC mode (command mode)
You can use 'G' command to jump to the last line in the file and the 'gg' command to jump to the first line in the file.
You can use the following motion commands to jump to the beginning or end
of a sentence or a paragraph or a section:
motion position where
( beginning current sentence
) end current sentence
{ beginning current paragraph
} end current paragraph
[] end previous section
[[ beginning current section
][ end current section
]] beginning next section
from http://vimhelp.appspot.com/vim_faq.txt.html#faq-10.1
<<< Wow that FAQ has some amazing tricks in it. Who knew it was so powerful. I guess Adam told me. Still
$
In vim command mode, Move to end of line
C-O followed by $
In vim insert mode, Move to the end of the line
********
********
********
Vim quick reference: http://vimhelp.appspot.com/quickref.txt.html
Vim stands for Vi IMproved
In Vim Command mode,
run:
:set all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment