Terminal Commands
|
ls | show folder conents |
mkdir Foo | creates folder named "Foo" |
cd Foo | enters folder "Foo" |
cd .. | exit folder |
cd ~ | go to home directory |
rm -r Foo | deletes "Foo" |
vim filename | opens "filename" in VIM |
VIM Basics
|
i |
enter insert mode |
Esc | enter command mode |
shift+a | go to end of line and enter insert mode |
0 | go to beginning of line |
dd | delete entire line |
yy | yank entire line |
p | paste on the line below cursor position |
u | undo |
Ctrl+r | redo |
x | remove character to the right of the cursor |
gg | jump to bottom of file |
Shift+g | jump to top of file |
?text | search for the phrase "text" |
:wq | save and quit |
:q! | force quit wihout saving |
:set nu | add line numbers |
:set nonu | remove line numbers |
:colorscheme (press tab to cycle) | changes colors |
:set cursorcolumn | adds vertical line over cursor position |
:set cursorline | adds horizontal line over cursor position |
Advanced |
v | enter visual mode (use to highlight blocks of text) |
< (shift+,) | indent left |
> (shift+.) | indent right |
:term | horizontal split in console |
:vert term | vertical split in console |
:set list | differentiate tabs and spaces |
:set expandtab | prepare to convert tabs |
:retab | convert tabs to spaces |
:%s/ /(press tab)/g | convert each sequence of four spaces to a tab |
Ctrl+w+w | jump between split window |
Ctrl+d | close split window terminal |
:30 winc < | move split border to the left by 30 characters |