Skip to content

Instantly share code, notes, and snippets.

View mendeza's full-sized avatar

Aaron Mendez mendeza

View GitHub Profile
@mendeza
mendeza / .zshrc
Created March 18, 2022 20:09
zshell config — first draft
# Z Shell Reference: https://zsh.sourceforge.io/Intro/intro_toc.html
# -----------------------------------------------------------------------------
# config location
XDG_CONFIG_HOME=~/.config
# Keep command history
# Search history with ctrl-R
# use !! to repeat last command
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
# limit how many commands are stored in the session and in the history file
SAVEHIST=5000
@mendeza
mendeza / git-completion-prompt-zsh.md
Last active March 18, 2022 20:02
git completion and prompt under zsh

git completion and prompt under zsh

curl scripts into config folder

mkdir $HOME/.config/zsh
cd $HOME/.config/zsh
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh -o _git
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -O
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -O

Scenario: "Git Backup"

You are using git as a backup tool and wish to both push and pull between two local repos, the second of which is a clone of the first.

For example, you may initialize a Markdown notes repo on your laptop's startup drive. You author, save (and version) your notes primarily in this repo, but also "backup" the content by cloning the repo to an external drive. At intervals, you pull changes from the first repo into the second (either manually, or as a cron job).

@mendeza
mendeza / vim-sort-regex.md
Last active October 4, 2022 11:36
Vim Sort with RegEx

Vim Sort with RegEx

Vim Manual

See :help :sort.

:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
@mendeza
mendeza / .vimrc
Last active November 29, 2023 05:09
Simple .vimrc or init.vim for nvim (neovim)
" (N)Vim Configuration File
" vim : place in $HOME/.vimrc
" nvim : place in $HOME/.config/nvim/init.vim
" $ ln -s $HOME/.config/nvim/init.vim $HOME/.vimrc
" General settings
" https://learnvimscriptthehardway.stevelosh.com/
" ---------------------------------------------------------------------------
" drop vi support - kept for vim compatibility but not needed for nvim
" Probably not needed with Vim 8+
"set nocompatible