https://github.com/yanggujun/cookbook
manuals, helps, cheet sheets
https://github.com/yanggujun/cookbook
Last synced: 3 months ago
JSON representation
manuals, helps, cheet sheets
- Host: GitHub
- URL: https://github.com/yanggujun/cookbook
- Owner: yanggujun
- Created: 2017-10-17T01:35:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-07T03:49:18.000Z (almost 8 years ago)
- Last Synced: 2025-12-02T08:42:03.013Z (7 months ago)
- Language: Vim script
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### bash color
Black 0;30 Dark Gray 1;30
Red 0;31 Light Red 1;31
Green 0;32 Light Green 1;32
Brown/Orange 0;33 Yellow 1;33
Blue 0;34 Light Blue 1;34
Purple 0;35 Light Purple 1;35
Cyan 0;36 Light Cyan 1;36
Light Gray 0;37 White 1;37
no color
And then use them like this in your script:
```bash
echo -e "I \033[0;31mlove\033[0m github"
```
### vim
```
# run commands on each line
:,norm
# change case of the whole word
g~iw
# split horizontally
:split
# split vertically
:vsplit
# replace a with b in the file
:%s/a/b/g
# replace a with b in a range
:,s/a/b/g
#delete every line that contains pattern
:g//d
#delete every line that does not contain pattern
:v//d
#run command every line
:norm
```
### git
```
git checkout -b
git remote show origin
git branch -r
#push a local branch to remote, -u is the short-cut for --set-upstream
git push -u origin
#delete a local branch. -d is the short-cut for --delete
git branch -d
#delete a remote branch
git push origin -d
```