In Bash, when I am typing a command, I press Ctrl+U, all characters from the beginning of the line to the cursor are going to be removed. However, in zsh,
It sounds like you'd like for Ctrl+U to be bound to backward-kill-line rather than kill-whole-line, so add this to your .zshrc:
backward-kill-line
kill-whole-line
.zshrc
bindkey \^U backward-kill-line
The bindkey builtin and the available editing commands (“widgets”) are documented in the zshzle man page.
bindkey
zshzle