-
-
Save mattknox/ccb9b7071d2c384297b6 to your computer and use it in GitHub Desktop.
Revisions
-
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,21 +21,21 @@ vim ## Moving | command | description | |-----------------|-------------| | b | Move to the BEGINNING of the word | e | Move to the END of the word | ge | Move to the END of the PREVIOUS word | gg | Move to START of buffer | G | Move to END of buffer | h | Move cursor LEFT | j | Move cursor DOWN | k | Move cursor UP | l | Move cursor RIGHT | *n* gg OR *n* G | Move to n line (n represents a digit) | w | Move to the start of the next word | ctrl+b | Move BACK one page | ctrl+f | Move FORWARD one page ## Inserting Text -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ vim | j | Move cursor DOWN | k | Move cursor UP | l | Move cursor RIGHT | *n* gg OR nG | Move to n line (n represents a digit) | w | Move to the start of the next word | ctrl+b | Move BACK one page | ctrl+f | Move FORWARD one page -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ vim | j | Move cursor DOWN | k | Move cursor UP | l | Move cursor RIGHT | _n_gg OR _n_G | Move to n line (n represents a digit) | w | Move to the start of the next word | ctrl+b | Move BACK one page | ctrl+f | Move FORWARD one page -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,21 +21,21 @@ vim ## Moving | command | description | |---------------|-------------| | b | Move to the BEGINNING of the word | e | Move to the END of the word | ge | Move to the END of the PREVIOUS word | gg | Move to START of buffer | G | Move to END of buffer | h | Move cursor LEFT | j | Move cursor DOWN | k | Move cursor UP | l | Move cursor RIGHT | *n*gg OR *n*G | Move to n line (n represents a digit) | w | Move to the start of the next word | ctrl+b | Move BACK one page | ctrl+f | Move FORWARD one page ## Inserting Text -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 88 additions and 66 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,79 +11,95 @@ vim ## Exiting | command | description | |---------|-------------| | :q | Quit | :wq | Write and Quit | :q! | Quit without saving | ZZ | Write and quit | ZQ | Quit without saving ## Moving | command | description | |-----------|-------------| | b | Move to the BEGINNING of the word | e | Move to the END of the word | ge | Move to the END of the PREVIOUS word | gg | Move to START of buffer | G | Move to END of buffer | h | Move cursor LEFT | j | Move cursor DOWN | k | Move cursor UP | l | Move cursor RIGHT | ngg OR nG | Move to n line (n represents a digit) | w | Move to the start of the next word | ctrl+b | Move BACK one page | ctrl+f | Move FORWARD one page ## Inserting Text | command | description | |---------|-------------| | a | append after the cursor | A | append at end of line | i | Insert before cursor | I | Insert before line | o | Create new line below and start editing | O | Create new line above and start editing | gi | Place cursor where you were last editing (Useful for when you exit Insert mode and then need to go back where you once were) ## Other Commands | command | description | |----------|-------------| | u | undo | ctrl + R | redo ## Buffers | command | description | |---------|-------------| | :ls | List current buffers | :bn | Next buffer | :bp | Previous Buffer | :bd | Close Buffer ## Tabs | command | description | |---------|-------------| | :tabnew | create new tab | :tabn | move to NEXT tab | :tabp | move to PREVIOUS tab | :tabfir | goto FIRST tab | :tablas | goto LAST tab ## Windows | command | description | |------------|-------------| | ctrl + w s | Split window horizontally | ctrl + w v | Split window vertically | ctrl + w q | Close current window, if last window then exit vim | ctrl + w c | Close current window, will not exit vim | ctrl + w o | Make window the only window on the screen ## Spell Checking ```vimrc " ~/.vimrc " Enable spell checking set spell ``` ### Commands | command | description | |---------|-------------| | ]s | Move to next misspelled word | [s | Move to previous misspelled word | z= | Show list of possible replacements words ## Marcos @@ -95,29 +111,35 @@ ctrl+f Move FORWARD one page ## Code Folding | command | description | |---------|-------------| | zo | OPEN code fold under cursor | zc | CLOSE code fold under cursor | zR | OPEN ALL code folds | zM | CLOSE ALL code folds ## Auto complete | command | description | |-------------------|-------------| | ctrl + x ctrl + o | Autocomplete current word | ctrl + x ctrl + n | word completion next | ctrl + x ctrl + p | word completion previous | ctrl + x ctrl + f | Complete filename | ctrl + x ctrl + l | Whole line completion ### Enable ```vimrc " ~/.vimrc autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType c set omnifunc=ccomplete#Complete ``` ## Multi Liners -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ bookmark on my list for quick and easy access. I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer. > **NOTE**: I have this page as my first bookmark in my address bar so that I am > able to easily come back here. I edit this page often and when I find gems of > knowledge, I will often place them in here. -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 82 additions and 66 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,76 +1,92 @@ tmux ==== `ctrl + b` is default to enter before you enter the commands. `M` = Left Alt key or ESC key ## Windows | command | description | |---------|-------------| | c | Create a new window. | & | Kill the current window. | n | Change to the next window. | p | Change to the previous window. | , | Rename the current window. | l | Move to the previously selected window. | w | Choose the current window interactively. | M-n | Move to the next window with a bell or activity marker. | M-p | Move to the previous window with a bell or activity marker. ## Panes | command | description | |---------|------------ | | " | Split the current pane into two, top and bottom. | % | Split the current pane into two, left and right. | x | Kill the current pane. | ; | Move to the previously active pane. | o | Select the next pane in the current window. | ! | Break the current pane out of the window. | q | Briefly display pane indexes. ## Other | command | description | |---------|-------------| | d | Detach the current client. | $ | Rename the current session. | [ | Enter copy mode to copy text or view the history. | f | Prompt to search for text in open windows. | r | Force redraw of the attached client. | L | Switch the attached client back to the last session. | $ | Rename Current Session | : | Enter the tmux command prompt | ? | List all key bindings | f | Search window titles and goto that window | i | Briefly display window information | r | Force redraw of the attached client. | s | Select a new session for the attached client interactively. | t | Show the time. | = | Choose which buffer to paste interactively from a list. | ] | Paste the most recently copied buffer of text. ## Create a new session Any of these will work. ```bash tmux tmux new tmux new-session ``` ## Reattach to a session Any of these commands will work. ```bash tmux at tmux attach tmux attach-session ``` ## List sessions Any of these commands will work. ```bash tmux ls tmux list-sessions ``` ## How to copy and paste 1. Enter copy-mode `C-b [` 2. Move to text, press `Space` to select text, move cursor to highlight text 3. Press `Enter` 4. Back at the command prompt, press `C-b ]` and the text you selected is pasted ## References * http://www.openbsd.org/cgi-bin/man.cgi?query=tmux&sektion=1#KEY+BINDINGS -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 53 additions and 53 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,13 +17,13 @@ These key bindings will work on almost any menu you are in. | ? | Help | ; | Apply next function to tagged messages only | ! | Invoke command in subshell | return | Select the current entry | esc + / | Search up | / | Search down | H | Move to top of page | j | Move to next entry | k | Move to previous entry | ctrl + l | Redraw screen | L | Move to bottom of page | M | Move to middle of page | n | Move to next match of search @@ -45,64 +45,64 @@ When you first open mutt you are in the index menu. | $ | Save changes to mailbox | @ | Display full address of sender | | | Pipe message to a shell command | esc + tab | Jump to previous new or unread message | return | Display message | tab | Jump to next new or unread message | a | Create alias from message sender | b | Remail message to another user | esc + c | Open a different folder (Read Only) | c | Open a different folder | esc + C | Make text/plain copy | C | Copy message to another file/mailbox | esc + d | Delete all messages in subthread | d | Delete current message | ctrl + D | Delete all messages in thread | D | Delete messages matching a pattern | esc + e | Use the current message as a template for a new one | e | Edit the raw message | ctrl + E | Edit attachment content type | f | Forward message with comments | ctrl + F | Wipe passphrase from memory | F | Toggle the important flag for message | g | Reply to all | G | Retrive mail from POP server | h | Display message and toggle header weeding | j | Move to next undeleted message | esc + k | Mail a PGP key | k | Move to previous undeleted message | ctrl + K | Extract supported public keys | esc + l | Show current limit pattern | l | Only show messages matching a pattern | L | Reply to specific mailing list | m | Compose new message | esc + n | Jump to next subthread | ctrl + N | Jump to next thread | N | Toggle new flag | o | Sort messages | O | Sort messages in reverse order | Q | Query external program for addresses | q | Save changes to mailbox and quit | r | Reply to message | ctrl + P | Jump to previous thread | esc + p | Jump to previous subthread | p | Print current message | esc + P | Check for classic PGP | P | Jump to parent message in thread | ctrl + R | Mark current thread as read | R | Recall a postponed message | esc + r | Mark current subthread as read | esc + s | Save text/plain copy and delete | s | Save message/attachment to mailbox/file | esc + t | Tag current thread | ctrl + T | Untag messages matching a pattern | T | Tag messages matching pattern | esc + u | Undelete all messages in subthread | u | Undelete current entry | ctrl + U | Undelete all messages in thread | U | Undelete messages matching pattern | esc + v | Collapse/uncollapse current thread | v | Show mime attachments | esc + V | Collapse/uncollapse all threads | V | Show mutt version number and date | w | Set a status flag | W | Clear status flags from message @@ -115,16 +115,16 @@ When you first open mutt you are in the index menu. | a | | | b | | | c | | | esc + c | | | C | | | esc + C | | | d | | | ctrl + D | | | esc + d | | | w | | | W | | | e | | | ctrl + E | | | f | | | F | | | g | | @@ -135,53 +135,53 @@ When you first open mutt you are in the index menu. | K | | | & | | | L | | | ctrl + L | | | m | | | n | | | N | | | ctrl + N | | | esc + n | | | o | | | O | | | p | | | ctrl + P | | | esc + p | | | Q | | | q | | | r | | | R | | | ctrl + R | | | esc + r | | | esc + e | | | s | | | S | | | esc + s | | | t | | | T | | | u | | | esc + u | | | ctrl + U | | | v | | | V | | | \\ | | | @ | | | | | | | ? | | | space | | | - | | | ^ | | | $ | | | ! | | | : | | | . | | | / | | | esc + / | | | return | | | P | | | esc + P | | | esc + k | | | ctrl + K | | | ctrl + F | | ## Useful key remaps -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 168 additions and 168 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Mutt ==== ## General These key bindings will work on almost any menu you are in. @@ -32,158 +32,158 @@ These key bindings will work on almost any menu you are in. | z | Move to next page | Z | Move to previous page ## Index Menu When you first open mutt you are in the index menu. | command | description | |---------------|-------------| | & | Link tagged message to current one | # | Break the thread in two | % | Toggle whether mailbox will be rewritten | . | List mailboxes with new mail | $ | Save changes to mailbox | @ | Display full address of sender | | | Pipe message to a shell command | <esc> + <tab> | Jump to previous new or unread message | <return> | Display message | <tab> | Jump to next new or unread message | a | Create alias from message sender | b | Remail message to another user | <esc> + c | Open a different folder (Read Only) | c | Open a different folder | <esc> + C | Make text/plain copy | C | Copy message to another file/mailbox | <esc> + d | Delete all messages in subthread | d | Delete current message | <ctrl> + D | Delete all messages in thread | D | Delete messages matching a pattern | <esc> + e | Use the current message as a template for a new one | e | Edit the raw message | <ctrl> + E | Edit attachment content type | f | Forward message with comments | <ctrl> + F | Wipe passphrase from memory | F | Toggle the important flag for message | g | Reply to all | G | Retrive mail from POP server | h | Display message and toggle header weeding | j | Move to next undeleted message | <esc> + k | Mail a PGP key | k | Move to previous undeleted message | <ctrl> + K | Extract supported public keys | <esc> + l | Show current limit pattern | l | Only show messages matching a pattern | L | Reply to specific mailing list | m | Compose new message | <esc> + n | Jump to next subthread | <ctrl> + N | Jump to next thread | N | Toggle new flag | o | Sort messages | O | Sort messages in reverse order | Q | Query external program for addresses | q | Save changes to mailbox and quit | r | Reply to message | <ctrl> + P | Jump to previous thread | <esc> + p | Jump to previous subthread | p | Print current message | <esc> + P | Check for classic PGP | P | Jump to parent message in thread | <ctrl> + R | Mark current thread as read | R | Recall a postponed message | <esc> + r | Mark current subthread as read | <esc> + s | Save text/plain copy and delete | s | Save message/attachment to mailbox/file | <esc> + t | Tag current thread | <ctrl> + T | Untag messages matching a pattern | T | Tag messages matching pattern | <esc> + u | Undelete all messages in subthread | u | Undelete current entry | <ctrl> + U | Undelete all messages in thread | U | Undelete messages matching pattern | <esc> + v | Collapse/uncollapse current thread | v | Show mime attachments | <esc> + V | Collapse/uncollapse all threads | V | Show mutt version number and date | w | Set a status flag | W | Clear status flags from message ## Pager Menu | command | description | |---------|-------------| | # | | | a | | | b | | | c | | | <esc> + c | | | C | | | <esc> + C | | | d | | | <ctrl> + D | | | <esc> + d | | | w | | | W | | | e | | | <ctrl> + E | | | f | | | F | | | g | | | h | | | j | | | J | | | k | | | K | | | & | | | L | | | <ctrl> + L | | | m | | | n | | | N | | | <ctrl> + N | | | <esc> + n | | | o | | | O | | | p | | | <ctrl> + P | | | <esc> + p | | | Q | | | q | | | r | | | R | | | <ctrl> + R | | | <esc> + r | | | <esc> + e | | | s | | | S | | | <esc> + s | | | t | | | T | | | u | | | <esc> + u | | | <ctrl> + U | | | v | | | V | | | \\ | | | @ | | | | | | | ? | | | <space> | | | - | | | ^ | | | $ | | | ! | | | : | | | . | | | / | | | <esc> + / | | | <return> | | | P | | | <esc> + P | | | <esc> + k | | | <ctrl> + K | | | <ctrl> + F | | ## Useful key remaps These need to be placed in your `muttrc` file. I use vim and so I want to use some of the same commands to manage my mail. @@ -198,29 +198,29 @@ bind index gg first-entry bind index G last-entry ``` ## Flags When viewing messages in the index menu, you will see various flags such as `N` which mean the messages is new and `D` which means that the message is to be deleted. This is a short list of those flags. | flag | description | |------|-------------| | ! | Message is flagged | * | Message is tagged | + | Message is To: you and only you | C | Message is Cc: to you | d | Message has attachments marked for deletion | D | Marked for deletion | F | Message is From: you | K | Contains PGP key | L | Message is sent to a subscribed mailing list | n | Thread contains new messages (Only when thread is collapsed) | N | Message is new | o | Thread contains old messages (Only when thread is collapsed) | O | Message is old | P | Message is PGP encrypted | r | Message has been replied to | s | Message is signed | S | Message is signed and verified | T | Message is to you and has others in To: or Cc: -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 27 additions and 27 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,32 +5,32 @@ Mutt These key bindings will work on almost any menu you are in. | command | description | |------------|-------------| | * | Move to last entry | = | Move to first entry | : | Enter muttrc command | > | Scroll down one line | < | Scroll up one line | [ | Scroll up half a page | ] | Scroll down half a page | ? | Help | ; | Apply next function to tagged messages only | ! | Invoke command in subshell | <return> | Select the current entry | <esc> + / | Search up | / | Search down | H | Move to top of page | j | Move to next entry | k | Move to previous entry | <ctrl> + l | Redraw screen | L | Move to bottom of page | M | Move to middle of page | n | Move to next match of search | q | Exit menu | t | Tag current entry | z | Move to next page | Z | Move to previous page # Index Menu @@ -223,4 +223,4 @@ r Message has been replied to s Message is signed S Message is signed and verified T Message is to you and has others in To: or Cc: ``` -
JoshuaEstes renamed this gist
Apr 3, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
JoshuaEstes revised this gist
Apr 3, 2015 . 7 changed files with 78 additions and 91 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,17 @@ Developer Cheat Sheets ====================== This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access. I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer. > *NOTE*: I have this page as my first bookmark in my address bar so that I am > able to easily come back here. I edit this page often and when I find gems of > knowledge, I will often place them in here. ## Table of Contents This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,37 +1,42 @@ Git === ## Subtree Example ### Add sub-project as remote ```bash git remote add -f RemoteName RemoteUrl ``` ### Run `git subtree` command ```bash git subtree add --prefix Path/To/Put/Code NameOfRemote master --squash ``` #### Pull subtree as needed ```bash git fetch NameOfRemote master git subtree pull --prefix Path/To/Put/Code NameOfRemote master --squash ``` ### Reference * http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree ## Create a branch without a parent Very useful when you are updating a project that you are rewriting. For example, say you are using semantic versioning and are wanting to start a new major version. ```bash git checkout --orphan BRANCH ``` ## Delete All Branches that have been merged Great for cleaning up local branches that aren't being used any more. @@ -40,21 +45,21 @@ git checkout master git branch --merged | grep -v "\*" | xargs -n 1 git branch -d ``` ## Ignore changes to a file that is being tracked ### Ignore ```bash git update-index --assume-unchanged [directory|file] ``` ### Unignore ```bash git update-index --no-assume-unchanged [directory|file] ``` ## How to ignore dirty submodules Edit your ``.git/config`` and add ``ignore = dirty``. @@ -65,18 +70,18 @@ Edit your ``.git/config`` and add ``ignore = dirty``. ignore = dirty ``` ## Clone a repo and give name other than origin ```bash git clone -o upstream https://repo.git ``` ## Ignore Files for Repository without using `.gitignore` Add the file `.git/info/exclude` and fill it with the contents you want to ignore. This will ONLY apply to the repository and will not be tracked by git. ## Squash Commits ```bash git log @@ -91,7 +96,7 @@ git rebase -i HEAD~5 The first commit leave as `pick` the rest will need to be changed to `squash`. After that you will be able to leave a new commit message or just leave as is to keep the commit messages from all previous commits. ## Search for a specific line of code/file in the history ```bash git log -S[search term] @@ -103,7 +108,7 @@ Example: git log -SThatOneFile.php ``` ## Copy file from one branch to current branch Copy a file from `branch` and put into staging. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ GnuPG ===== ## Listing Key Pairs ```bash gpg --list-keys @@ -13,13 +13,13 @@ For listing keys with the fingerprint, run gpg --fingerprint ``` ## Generate New Key Pair ```bash gpg --gen-key ``` ## Encrypt a message on command line ```bash echo "Put message here" | gpg --armor --encrypt --recipient Joshua > FILE.gpg @@ -28,36 +28,36 @@ echo "Put message here" | gpg --armor --encrypt --recipient Joshua > FILE.gpg This will put the encrypted text into `FILE.gpg` which you can send to someone or keep for later use. For decrypting the message, see the next section. ## Decrypt a message from the command line ```bash cat FILE.gpg | gpg ``` Displays the decrypted text on the command line. ## Only display user X's key information ```bash gpg --fingerprint Joshua ``` ## Signing Messages ```bash echo "This is a top secret message" | gpg --clearsign ``` ## Signing Text Files ```bash gpg --clearsign example.txt ``` This will create `example.txt.asc` file. ## Verify Signatures ```bash gpg --verifiy example.txt.asc ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,9 @@ irssi M = Meta Key, meta key is either the left alt or esc key. | command | description | |----------|-------------| | M + p | Scroll up in window | M + n | Scroll down in window | ctrl + p | Previous window | ctrl + n | Next window This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ nmap ==== ## Scan a Port ```bash nmap -p 80 google.com ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ openssl ======= ## Generate Self-Signed Certificate and Private Key ```bash openssl req -newkey rsa:2048 -nodes -keyout server.key -x509 -days 365 -out server.crt ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,23 @@ vim === ## Open a file | command | description | |---------------------|-------------| | vim + file.ext | Open file at last line | vim +42 file.ext | Open file at line 42 | vim +/^include_path | Open the file at the line that starts with include_path ## Exiting :q Quit :wq Write and Quit :q! Quit without saving ZZ Write and quit ZQ Quit without saving ## Moving ``` b Move to the BEGINNING of the word @@ -36,8 +35,7 @@ ctrl+b Move BACK one page ctrl+f Move FORWARD one page ``` ## Inserting Text a append after the cursor A append at end of line @@ -47,40 +45,35 @@ Inserting Text O Create new line above and start editing gi Place cursor where you were last editing (Useful for when you exit Insert mode and then need to go back where you once were) ## Other Commands u undo ctrl + R redo ## Buffers :ls List current buffers :bn Next buffer :bp Previous Buffer :bd Close Buffer ## Tabs :tabnew create new tab :tabn move to NEXT tab :tabp move to PREVIOUS tab :tabfir goto FIRST tab :tablas goto LAST tab ## Windows ctrl + w s Split window horizontally ctrl + w v Split window vertically ctrl + w q Close current window, if last window then exit vim ctrl + w c Close current window, will not exit vim ctrl + w o Make window the only window on the screen ## Spell Checking " ~/.vimrc " Enable spell checking @@ -92,25 +85,22 @@ Spell Checking [s Move to previous misspelled word z= Show list of possible replacements words ## Marcos 1. Press `q` then press another key that you want to assign it to. Example: `qq` 1. Enter commands 1. Press `q` when finished 1. To run the macro, press `@` and then the key that it is assigned to. Example `@q` 1. NOTE: Can be ran multiple times. Enter the number of times you want it to run then the macro. Example `10@q` will run the macro 10 times. ## Code Folding zo OPEN code fold under cursor zc CLOSE code fold under cursor zR OPEN ALL code folds zM CLOSE ALL code folds ## Auto complete ctrl + x ctrl + o Autocomplete current word ctrl + x ctrl + n word completion next @@ -129,8 +119,7 @@ Autocomplete autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType c set omnifunc=ccomplete#Complete ## Multi Liners :set tw=80 Sets text width to 80 characters gg Goto first line -
JoshuaEstes revised this gist
Apr 3, 2015 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
JoshuaEstes revised this gist
Apr 3, 2015 . 2 changed files with 45 additions and 43 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ super helpful in allowing me to retain the information longer. ## Documentation Style For documenting keys to be pressed, they should use markdowns back tick. Some keys will be wrapped in alligator mouths such as `<ctrl>`, `<return>`, etc. If there is a key combination there will be a + such as `<ctrl> + l` which means to hold down the `<ctrl>` key and then press the `l` key. Generally keys should be in alphabetical order from symbols, numbers, and then alpha. The alpha characters come in order of lower and then upper. For example `a` @@ -30,4 +30,4 @@ As example is: `<ctrl> + a`, `<esc> + a`, `a`, `A` - [OpenSSL](#openssl) - [Tmux](#tmux) - [Vim](#vim) - [zsh](#zsh) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,47 +12,49 @@ Bash | alt + f | move cursor FORWARD one word | | alt + b | move cursor BACK one word | ## Other | command | description | |----------|--------------------------------| | ctrl + d | Delete the character under the cursor | | ctrl + l | Clear the screen (same as clear command) | | ctrl + p | Fetch the previous command from the history list, moving back in the list (same as up arrow) | | ctrl + n | Fetch the next command from the history list, moving forward in the list (same as down arrow) | | ctrl + u | Clear all BEFORE cursor | | ctrl + k | Clear all AFTER cursor | | ctrl + r | Search backward starting at the current line and moving 'up' through the history as necessary | | crtl + s | Search forward starting at the current line and moving 'down' through the history as necessary | | ctrl + c | kill whatever is running | | ctrl + d | Exit shell (same as exit command) | | ctrl + w | delete the word BEFORE the cursor | | ctrl + t | swap the last two characters before the cursor | | ctrl + y | paste (if you used a previous command to delete) | | ctrl + z | Place current process in background | | ctrl + _ | undo | | esc + t | Swap last two words before the cursor | | esc + . | | | esc + _ | | | alt + [Backspace] | delete PREVIOUS word | | alt + < | Move to the first line in the history | | alt + > | Move to the end of the input history, i.e., the line currently being entered | | alt + ? | | | alt + * | | | alt + . | print the LAST ARGUMENT (ie "vim file1.txt file2.txt" will yield "file2.txt") | | alt + c | | | alt + d | | | alt + l | | | alt + n | | | alt + p | | | alt + r | | | alt + t | | | alt + u | | | ~[TAB][TAB] | List all users | | $[TAB][TAB] | List all system variables | | @[TAB][TAB] | List all entries in your /etc/hosts file | | [TAB] | Auto complete | | !! | Run PREVIOUS command (ie `sudo !!`) | | !vi | Run PREVIOUS command that BEGINS with vi | | cd - | change to PREVIOUS working directory | # Kill a job @@ -68,6 +70,6 @@ Example: kill %1 ``` ## References 1. http://cnswww.cns.cwru.edu/php/chet/readline/readline.html -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 10 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,16 @@ Bash ==== ## Moving | command | description | |----------|--------------------------------| | ctrl + a | Goto BEGINNING of command line | | ctrl + e | Goto END of command line | | ctrl + b | move back one character | | ctrl + f | move forward one character | | alt + f | move cursor FORWARD one word | | alt + b | move cursor BACK one word | Other ----- @@ -69,4 +70,4 @@ kill %1 ### References 1. http://cnswww.cns.cwru.edu/php/chet/readline/readline.html -
JoshuaEstes renamed this gist
Apr 3, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,4 +29,5 @@ As example is: `<ctrl> + a`, `<esc> + a`, `a`, `A` - [nmap](#nmap) - [OpenSSL](#openssl) - [Tmux](#tmux) - [Vim](#vim) - [zsh](#zsh) -
JoshuaEstes revised this gist
Apr 3, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ zsh === -
JoshuaEstes revised this gist
Mar 20, 2015 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -101,4 +101,12 @@ Example: ```bash git log -SThatOneFile.php ``` # Copy file from one branch to current branch Copy a file from `branch` and put into staging. ```bash git checkout branch file.ext ``` -
JoshuaEstes revised this gist
Mar 12, 2015 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,6 +52,20 @@ Other !! Run PREVIOUS command (ie "sudo !!") !vi Run PREVIOUS command that BEGINS with vi cd - change to PREVIOUS working directory # Kill a job n = job number, to list jobs, run `jobs` ```bash kill %n ``` Example: ```bash kill %1 ``` ### References -
JoshuaEstes revised this gist
Mar 11, 2015 . 1 changed file with 13 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -89,4 +89,16 @@ git rebase -i HEAD~5 ``` The first commit leave as `pick` the rest will need to be changed to `squash`. After that you will be able to leave a new commit message or just leave as is to keep the commit messages from all previous commits. # Search for a specific line of code/file in the history ```bash git log -S[search term] ``` Example: ```bash git log -SThatOneFile.php ``` -
JoshuaEstes revised this gist
Mar 2, 2015 . 1 changed file with 16 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -74,4 +74,19 @@ git clone -o upstream https://repo.git # Ingore Files for Repository without using `.gitignore` Add the file `.git/info/exclude` and fill it with the contents you want to ignore. This will ONLY apply to the repository and will not be tracked by git. # Squash Commits ```bash git log ``` Count the number of commits that you have made, let's say the previous 5 are your commits. ```bash git rebase -i HEAD~5 ``` The first commit leave as `pick` the rest will need to be changed to `squash`. After that you will be able to leave a new commit message or just leave as is to keep the commit messages from all previous commits. -
JoshuaEstes revised this gist
Feb 24, 2015 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -69,4 +69,9 @@ Edit your ``.git/config`` and add ``ignore = dirty``. ```bash git clone -o upstream https://repo.git ``` # Ingore Files for Repository without using `.gitignore` Add the file `.git/info/exclude` and fill it with the contents you want to ignore. This will ONLY apply to the repository and will not be tracked by git. -
JoshuaEstes revised this gist
Jan 1, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,7 @@ As example is: `<ctrl> + a`, `<esc> + a`, `a`, `A` - [GnuPG](#gnupg) - [irssi](#irssi) - [mutt](#mutt) - [nmap](#nmap) - [OpenSSL](#openssl) - [Tmux](#tmux) - [Vim](#vim) -
JoshuaEstes revised this gist
Jan 1, 2015 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ nmap ==== # Scan a Port ```bash nmap -p 80 google.com ``` -
JoshuaEstes revised this gist
Dec 11, 2014 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,11 +21,11 @@ As example is: `<ctrl> + a`, `<esc> + a`, `a`, `A` ## Table of Contents - [Bash](#bash) - [Git](#git) - [GnuPG](#gnupg) - [irssi](#irssi) - [mutt](#mutt) - [OpenSSL](#openssl) - [Tmux](#tmux) - [Vim](#vim) -
JoshuaEstes revised this gist
Dec 11, 2014 . 2 changed files with 14 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,15 @@ press the `l` key. Generally keys should be in alphabetical order from symbols, and then alpha. The alpha characters come in order of lower and then upper. For example `a` comes before `A`, then `b`, then `C`. Note the case. If a key is paired with another such as `<ctrl> + a` then follow the default ordering and then order the first key that's pressed. As example is: `<ctrl> + a`, `<esc> + a`, `a`, `A` ## Table of Contents - (Bash)[#bash] - (Git)[#git] - (GnuPG)[#gnupg] - (irssi)[#irssi] - (mutt)[#mutt] - (OpenSSL)[#openssl] - (Tmux)[#tmux] - (Vim)[#vim] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ Bash ==== Moving ------ -
JoshuaEstes revised this gist
Dec 11, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ openssl ======= # Generate Self-Signed Certifacte and Private Key ```bash -
JoshuaEstes revised this gist
Dec 11, 2014 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # Generate Self-Signed Certifacte and Private Key ```bash openssl req -newkey rsa:2048 -nodes -keyout server.key -x509 -days 365 -out server.crt ``` -
JoshuaEstes revised this gist
Dec 5, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -63,4 +63,10 @@ Edit your ``.git/config`` and add ``ignore = dirty``. path = path/to/submodule url = git://github.com/username/repo.git ignore = dirty ``` # Clone a repo and give name other than origin ```bash git clone -o upstream https://repo.git ```
NewerOlder