Skip to content

Commit

Permalink
major change in .zshrc
Browse files Browse the repository at this point in the history
  • Loading branch information
sudiplun committed Nov 15, 2024
1 parent 3397605 commit b1a9b55
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 27 deletions.
79 changes: 79 additions & 0 deletions ohmyposh/posh.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#source_file: https://github.com/dreamsofautonomy/zen-omp
console_title_template = '{{ .Shell }} in {{ .Folder }}'
version = 3
final_space = true

[secondary_prompt]
template = '❯❯ '
foreground = 'magenta'
background = 'transparent'

[transient_prompt]
template = ''
background = 'transparent'
foreground_templates = [
'{{if gt .Code 0}}red{{end}}',
'{{if eq .Code 0}}magenta{{end}}',
]

[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true

[[blocks.segments]]
template = '{{ .Path }}'
foreground = 'blue'
background = 'transparent'
type = 'path'
style = 'plain'

[blocks.segments.properties]
cache_duration = 'none'
style = 'full'

[[blocks.segments]]
template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} <cyan>{{ if gt .Behind 0 }}⇣{{ end }}{{ if gt .Ahead 0 }}⇡{{ end }}</>'
foreground = 'p:grey'
background = 'transparent'
type = 'git'
style = 'plain'

[blocks.segments.properties]
branch_icon = ''
cache_duration = 'none'
commit_icon = '@'
fetch_status = true

[[blocks]]
type = 'rprompt'
overflow = 'hidden'

[[blocks.segments]]
template = '{{ .FormattedMs }}'
foreground = 'yellow'
background = 'transparent'
type = 'executiontime'
style = 'plain'

[blocks.segments.properties]
cache_duration = 'none'
threshold = 5000

[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true

[[blocks.segments]]
template = ''
background = 'transparent'
type = 'text'
style = 'plain'
foreground_templates = [
'{{if gt .Code 0}}red{{end}}',
'{{if eq .Code 0}}magenta{{end}}',
]

[blocks.segments.properties]
cache_duration = 'none'
6 changes: 5 additions & 1 deletion zsh/.zsh_aliases
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# alias TOOLS
alias f="fzf"
alias fi='f --preview="cat {}"'
#systemd
alias systemctl-run='systemctl list-units --type=service --state=running'
#extra
alias lg="lazygit"
alias t="tmux"
Expand All @@ -16,10 +18,12 @@ alias egrep="grep -E"
alias mysql="mariadb"
alias javaSql="java -classpath /usr/share/java/mariadb-jdbc/mariadb-java-client.jar:."
# Example aliases
alias light="gsettings set org.gnome.desktop.interface gtk-theme "Adwaita""
alias light="gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'"
alias dark='gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"'
alias lampst="sudo systemctl start httpd && sudo systemctl start mariadb.service"
alias lampstat="sudo systemctl status httpd && sudo systemctl status mariadb.service"
alias lampsp="sudo systemctl stop httpd && sudo systemctl stop mariadb.service"
# laravel
alias pa="php artisan"
#
alias npm="deno"
46 changes: 20 additions & 26 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# export CLASSPATH=/usr/share/java/mariadb-jdbc/mariadb-java-client-3.3.2.jar:$CLASSPATH

# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"

plugins=(git zsh-syntax-highlighting zsh-autosuggestions)

source $ZSH/oh-my-zsh.sh

# User configuration
#History
export HISTFILE=~/.zsh_history
export HISTSIZE=10000
export SAVEHIST=10000
#zoxide
eval "$(zoxide init --cmd cd zsh)"

#ohmyposh
eval "$(oh-my-posh init zsh --config $HOME/dotfiles/ohmyposh/posh.toml)"
# autocompletion
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#A3B963"
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
#with color
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
# end of completion
#aliases
source ~/.zsh_aliases

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export EDITOR="vim"
#deno
. "/home/lun/.deno/env"

0 comments on commit b1a9b55

Please sign in to comment.