1
Fork 0

zsh stuff

This commit is contained in:
Hadeed 2024-12-11 23:45:06 +05:00
parent 1a3e5945f4
commit f34710c943
3 changed files with 29 additions and 31 deletions

View file

@ -1,8 +1,3 @@
export ZDOTDIR="$HOME/.config/zsh" export ZDOTDIR="$HOME/.config/zsh"
typeset -U path
path+="$HOME/bin"
export DOTS="$HOME/docs/repos/dots"
# vim: filetype=zsh # vim: filetype=zsh

View file

@ -24,7 +24,7 @@ vim.api.nvim_create_autocmd("Filetype", {
vim.api.nvim_create_autocmd("Filetype", { vim.api.nvim_create_autocmd("Filetype", {
group = vim.api.nvim_create_augroup("webDev", {}), group = vim.api.nvim_create_augroup("webDev", {}),
pattern = { "html", "css", "javascript", "javascriptreact", "json" }, pattern = { "html", "css", "javascript", "svelte", "javascriptreact", "json" },
callback = function() callback = function()
vim.cmd [[setlocal tabstop=2 softtabstop=2 shiftwidth=2]] vim.cmd [[setlocal tabstop=2 softtabstop=2 shiftwidth=2]]
vim.bo.formatprg = "prettier --stdin-filepath " .. vim.fn.expand("%:p") vim.bo.formatprg = "prettier --stdin-filepath " .. vim.fn.expand("%:p")

View file

@ -10,6 +10,31 @@ function zsh_add_plugin() {
safe_source "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh" safe_source "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh"
} }
export DOTS="$HOME/docs/repos/dots"
export VISUAL="nvim"
export EDITOR="nvim"
typeset -U path
path+="$HOME/bin"
if (( $+commands[npm] )); then
export npm_config_prefix="$HOME/.local/npm"
path+="$HOME/.local/npm/bin"
fi
if (( $+commands[go] )); then
path+="$HOME/go/bin"
fi
if (( $+commands[pyenv] )); then
source <(pyenv init -)
fi
if (( $+commands[fzf] )); then
source <(fzf --zsh)
fi
if (( $+commands[starship] )); then if (( $+commands[starship] )); then
source <(starship init zsh) source <(starship init zsh)
else else
@ -21,7 +46,6 @@ else
fi fi
zsh_add_plugin "mattmc3/ez-compinit" zsh_add_plugin "mattmc3/ez-compinit"
zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS} zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS}
zstyle ":completion:*" matcher-list "m:{a-z}={A-Za-z}" zstyle ":completion:*" matcher-list "m:{a-z}={A-Za-z}"
zstyle ":completion:*" menu no zstyle ":completion:*" menu no
@ -30,7 +54,6 @@ zstyle ":completion:*:git-checkout:*" sort false
zstyle ":fzf-tab:complete:cd:*" fzf-preview 'eza -1 --group-directories-first --color=always --icons=always $realpath' zstyle ":fzf-tab:complete:cd:*" fzf-preview 'eza -1 --group-directories-first --color=always --icons=always $realpath'
create_dir "$HOME/.local/state/zsh" create_dir "$HOME/.local/state/zsh"
HISTFILE="$HOME/.local/state/zsh/history" HISTFILE="$HOME/.local/state/zsh/history"
HISTSIZE=65536 HISTSIZE=65536
SAVEHIST=$HISTSIZE SAVEHIST=$HISTSIZE
@ -57,35 +80,12 @@ zsh_add_plugin "jeffreytse/zsh-vi-mode"
ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM
export VISUAL="nvim"
export EDITOR="nvim"
if (( $+commands[npm] )); then
export npm_config_prefix="$HOME/.local/npm"
path+="$HOME/.local/npm/bin"
fi
if (( $+commands[pyenv] )); then
source <(pyenv init -)
fi
if (( $+commands[fzf] )); then
source <(fzf --zsh)
fi
autoload -z edit-command-line autoload -z edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey "^V" edit-command-line bindkey "^V" edit-command-line
bindkey "^Y" autosuggest-execute bindkey "^Y" autosuggest-execute
bindkey "^F" fzf-cd-widget bindkey "^F" fzf-cd-widget
###############################################################################
# FUNCTIONS #
###############################################################################
function cc() python -c "from math import *; print($*)"
alias cc="noglob cc"
############################################################################### ###############################################################################
# ALIASES # # ALIASES #
############################################################################### ###############################################################################
@ -102,6 +102,9 @@ if [[ -f /etc/os-release ]]; then
fi fi
fi fi
function cc() python -c "from math import *; print($*)"
alias cc="noglob cc"
alias vi="nvim" alias vi="nvim"
alias l="eza -x --group-directories-first --icons always" alias l="eza -x --group-directories-first --icons always"