Rearanging and merging aliases.env

This commit is contained in:
Lockszmith (@VAST) 2025-04-02 12:32:53 -04:00
parent 61b5f3f441
commit fa83394898
11 changed files with 91 additions and 165 deletions

View file

@ -0,0 +1,16 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
alias l='ls -lahF --color=auto '
alias lold='l -t '
alias lnew='l -tr '
alias lu='l -U '
alias ll='l -A'
alias sudo='sudo '
export VISUAL="nvim" EDITOR="nvim"
alias nvim='POSTFIX_BUITINS=1 command nvim -p '
alias vi='nvim '
alias vim='nvim '
alias nvimdiff='nvim -d '
alias vimdiff='nvimdiff '

View file

@ -1,14 +1,21 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
{{- if eq .chezmoi.os "darwin" }}
alias l='ls -lahF --color=auto '
alias lold='l -t '
alias lnew='l -tr '
{{ else }}
alias l='ls -lahF --color=auto --group-directories-first '
alias lu='l -U '
alias lold='l --sort=time '
alias lnew='l --sort=time --reverse '
{{- end }}
alias ll='l -A'
alias lu='l -U '
alias sudo='sudo '
is_cmd nvim \
&& export VISUAL="nvim" EDITOR="nvim" \
&& alias nvim='POSTFIX_BUITINS=1 command nvim -p ' \
|| alias nvim='POSTFIX_BUITINS=1 command vim -p '
alias vi='nvim '

View file

@ -8,7 +8,7 @@ if is_cmd 'chezmoi'; then
export CHEZMOI_GITHUB_ACCESS_TOKEN={{- .githubToken | quote }}
czcd() {
cd "$(chezmoi source-path "${@}")"
cd "$(chezmoi source-path "${@}")"
}
czedext() {
local CZ_EXT="$(find $(chezmoi source-path) -mindepth 1 -maxdepth 1 -name '.chezmoiexternal.*')"
@ -16,8 +16,16 @@ if is_cmd 'chezmoi'; then
"${VISUAL:-${EDITOR:-vi}}" "${CZ_EXT}"
}
czed() {
chezmoi edit "${@}" --apply --interactive
local EDITLIST=() f _f
for _f in "${@}"; do
[[ -e "$_f" ]] || f="$(which "$_f")"
[[ -z "$f" ]] && is_cmd tv && f="$(tv "$_f")" || f=$_f
EDITLIST=( "${EDITLIST[@]}" "$f" )
done
EDITLIST=("${@}")
chezmoi edit "${EDITLIST[@]}" --apply --interactive
}
alias czx="CZ_EXTR=1 chezmoi "
fi
# vim: set ft=bash sw=4 sts=4 et:

View file

@ -0,0 +1,30 @@
" Set custom Vim config directory
let s:vim_config_dir = '~/.config/vim'
let s:autoload_dir = s:vim_config_dir . '/autoload'
let s:plug_vim = s:autoload_dir . '/plug.vim'
" Install vim-plug if not found
if empty(glob(s:plug_vim))
silent execute '!curl -fLo ' . s:plug_vim . ' --create-dirs ' .
\ 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
endif
" Ensure Vim uses the custom runtime path
set runtimepath+=~/.config/vim
execute 'source ' . s:plug_vim
" Initialize vim-plug
call plug#begin('~/.config/vim/plugged')
" Define plugins here
"Plug 'junegunn/vim-plug' " Example, replace with actual plugins
call plug#end()
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
" vim: set ft=vim sw=4 sts=4 et: