forked from cvg/glue-factory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshhowto.txt
120 lines (88 loc) · 2.07 KB
/
zshhowto.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Starting Zsh
zsh
# Exiting Zsh
exit
# Configuration Files
# Main configuration file
~/.zshrc
# Other configuration files
~/.zshenv # Sourced on all invocations of the shell
~/.zprofile # Sourced on login shells
~/.zshrc # Sourced on interactive shells
~/.zlogin # Sourced on login shells after .zprofile
~/.zlogout # Sourced when login shell exits
# History
# Set history size
HISTSIZE=5000
SAVEHIST=5000
# History file location
HISTFILE=~/.zsh_history
# Search command history
# Reverse search through history
# Press: Ctrl-R
# Forward search through history (disable with stty -ixon if it doesn't work)
# Press: Ctrl-S
# Aliases
# Creating aliases
alias gs='git status'
alias gp='git push'
alias ga='git add .'
alias ga-='git add -u'
alias gc='git commit -m'
alias gl='git log'
# Directory Navigation
# Go to home directory
cd ~
# Go to previous directory
cd -
# List directory contents
ls
# List all files, including hidden files
ls -a
# Enhanced Globbing
# Match all .txt files in the current directory
ls *.txt
# Match all .txt files recursively
ls **/*.txt
# Zsh Options
# Enable autocd (change directory without typing 'cd')
setopt autocd
# Enable case-insensitive globbing
setopt nocaseglob
# Disable beep sound
setopt no_beep
# Key Bindings
# Clear the screen
# Press: Ctrl-L
# Move to the beginning of the line
# Press: Ctrl-A
# Move to the end of the line
# Press: Ctrl-E
# Cut text from cursor to the end of the line
# Press: Ctrl-K
# Paste text
# Press: Ctrl-Y
# Zsh Features
# Enable spell correction
setopt correct
# Enable extended globbing
setopt extended_glob
# Prompt Customization
# Set a simple prompt
PROMPT='%n@%m %1~ %# '
# Using Oh My Zsh
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Enable plugins in ~/.zshrc
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
# Change theme in ~/.zshrc
ZSH_THEME="agnoster"
# Reload Zsh configuration
source ~/.zshrc
# Job Control
# List jobs
jobs
# Send job to background
bg %jobnumber
# Bring job to foreground
fg %jobnumber