diff --git a/home/.aliases b/home/.aliases index a424b8c..0640484 100644 --- a/home/.aliases +++ b/home/.aliases @@ -1,18 +1,7 @@ # aliases # https://zsh.sourceforge.io/Intro/intro_8.html -# Detect which `ls` flavor is in use -if ls --color > /dev/null 2>&1; then - colorflag='--color=always' # GNU ls -else - colorflag="-G" # OS X ls -fi - -# Vim aliases & helpers -alias vi='vim' # Ensure Vi IMproved -alias PluginInstall="vim +PluginInstall +qall" # Quick PluginInstall -alias PluginClean='vim +Pluginclean +qall' # Quick PluginClean - +# Commands # Canonical hex dump; some systems have this symlinked command -v hd > /dev/null || alias hd="hexdump -C" # macOS has no md5sum, so use md5 as a fallback @@ -20,40 +9,52 @@ command -v md5sum > /dev/null || alias md5sum="md5" # macOS has no sha1sum, so use shasum as a fallback command -v sha1sum > /dev/null || alias sha1sum="shasum" +# Functions +## f:hgrep, History with grep +hgrep () { fc -Dlim "*$@*" 1 } +## f:sshKeysum, Determine the ssh-keyscan checksum wtih a Base64 encoded padded output +sshKeysum () { local chksum="${2:-sha256sum}"; for key in $(ssh-keyscan "${1}" 2>/dev/null | awk '{print $3}'); do echo -n "${key}" | base64 -d | eval "${chksum}" -b | xxd -r -p | base64; done } +## f:pubip, Get pubiic IP address +## Info: https://checkip.amazonaws.com, https://ipapi.co/ip/ +publicip () { local ntwkhost="${1:-https://checkip.amazonaws.com}"; curl "${ntwkhost}" } +localip () { local ntwkint="${1:-en0}"; ipconfig getifaddr "${ntwkint}" } +allips () { ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }' } + +# Aliases +# Vim, Tmux & helpers +alias vi='vim' # Ensure Vi IMproved +alias PluginInstall="vim +PluginInstall +qall" # Quick PluginInstall +alias PluginClean='vim +Pluginclean +qall' # Quick PluginClean +alias tmuxa='tmux attach -d -t' + # General -alias sudo='sudo ' # Enable aliases to be sudo'ed -alias tree='tree -C' # Pretty color tree -alias path='echo -e ${PATH//:/\\n}' # Pretty path - -# directory listings -alias ls="command ls -hF ${colorflag}" # Always use color output for `ls` -alias l="ls -lF ${colorflag}" # List all files colorized in long format -alias l.="ls -d .* ${colorflag}" -alias ll="ls -aF ${colorflag}" -alias la="ls -laF ${colorflag}" # List all files colorized in long format, including dot files -alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" # List only directories -alias dir="ls ${colorflag}--format=vertical" -alias vdir="ls ${colorflag} --format=long" +alias sudo='sudo ' # Enable aliases to be sudo'ed +alias tree='tree -C' # Pretty color tree +alias paths="echo -e '${PATH//:/\\n}'" # Pretty paths + +# Listings +alias l="ls -lF" # List all files in long format +alias ll="ls -aF" # List all files in long format with dotfiles +alias la="ls -laF" # List all files in long format, including dot files +alias l.="ls -d .*" # List all dot directories and files +alias llsd="ls -lF | grep '^d'" # List only directories +alias llsf="ls -lF | grep '^-'" # List only files +alias ldirs="print -rl -- *(/)" # List directories +alias adirs="print -rl -- *(D/)" # List directories with hidden # Shortcuts -alias dl="cd ~/Downloads" -alias dt="cd ~/Desktop" +alias cdl="cd ~/Downloads" +alias cdt="cd ~/Desktop" alias hist="history" alias timer='echo "Timer started. Stop with Ctrl-C." && $(time cat)' -# Tmux aliases -alias tmuxa='tmux attach -d -t' - -# Git aliases +# Git alias githash='git rev-parse --verify HEAD | cut -b 1-8' -# IP addresses -alias pubip='curl https://checkip.amazonaws.com' -alias localip="ipconfig getifaddr en0" -alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" - -# Flush Directory Service cache -alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" +# IP addresses & DNS +alias pubip=publicip +alias locip=localip +alias ips=allips # View HTTP traffic #alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" @@ -61,21 +62,26 @@ alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" # One of @janmoesen ProTips for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do - alias "$method"="lwp-request -m '$method'" + alias "${method}"="lwp-request -m ${method}" done +# Alias scripting one-liners # URL-encode strings alias urlencode='python3 -c "import sys, urllib.parse as ul; print(ul.quote_plus(sys.argv[1]));"' -# MacOS Helpers +# OS, MacOS Helpers # Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages alias update='sudo softwareupdate -i -a && brew update && brew upgrade --quiet && brew cleanup' -# Delete `.DS_Store` files +# Delete .DS_Store files alias cleanupds="find . -type f -name '*.DS_Store' -ls -delete" # Remove system logs and empty the Trash on all mounted volumes -alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl" +#alias emptytrash="osascript -e 'if trashSize > \"0\" then tell application \"Finder\" to empty trash'" +alias emptytrash="osascript -e 'tell application \"Finder\" to empty trash'" + +# Flush Directory Service cache +alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" # Show/hide hidden files in Finder alias dotfilesshow="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" diff --git a/home/.dotnet/completion.zsh b/home/.dotnet/completion.zsh new file mode 100644 index 0000000..e050143 --- /dev/null +++ b/home/.dotnet/completion.zsh @@ -0,0 +1,17 @@ +# zsh parameter completion for the dotnet CLI +# https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#zsh +_dotnet_zsh_complete() { + local completions=("$(dotnet complete "${words}")") + + # If the completion list is empty, just continue with filename selection + if [ -z "${completions}" ] + then + _arguments '*::arguments: _normal' + return + fi + + # This is not a variable assigment, don't remove spaces! + _values = "${(ps:\n:)completions}" +} + +compdef _dotnet_zsh_complete dotnet diff --git a/home/.dotnet/path.zsh b/home/.dotnet/path.zsh new file mode 100644 index 0000000..9a35064 --- /dev/null +++ b/home/.dotnet/path.zsh @@ -0,0 +1 @@ +export PATH="${0:A:h}:${PATH}" diff --git a/home/.dotnet/readme.md b/home/.dotnet/readme.md new file mode 100644 index 0000000..2f514bf --- /dev/null +++ b/home/.dotnet/readme.md @@ -0,0 +1,85 @@ +# Dotnet + +## macOS + +[Dotnet - macOS (Download)](https://dotnet.microsoft.com/en-us/download) + +###### PATH + +``` +cat << EOF >> ~/.zshrc +# Dotnet +DOTNET_ROOT="${HOME}/.dotnet" +DOTNET_INSTALL_DIR="${HOME}/.dotnet" +PATH="\${PATH}:${DOTNET_ROOT}:${DOTNET_INSTALL_DIR}" +export DOTNET_ROOT DOTNET_INSTALL_DIR PATH +EOF +``` + +##### dotnet-install + +[Dotnet - additional-tools (dotnet-install)](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script) + +###### CLI + +``` +dotnet-install -h +``` + +``` +... +Install Location: + Location is chosen in following order: + - --install-dir option + - Environmental variable DOTNET_INSTALL_DIR + - ${HOME}/.dotnet +``` + +##### dotnet-core-uninstall + +[Dotnet - additional-tools ()](https://learn.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool?tabs=macos) + +###### CLI + +``` +dotnet-core-uninstall -h +``` + +``` +... +Commands: + list List .NET Core SDKs or Runtimes that can be removed with this tool. + dry-run, whatif Display .NET Core SDKs and Runtimes that will be removed. + remove Remove the specified .NET Core SDKs or Runtimes. +``` + +### Visual Studio Code (vscode) + +[Visual Studio Code - Download](https://code.visualstudio.com/download) + +##### CLI (code) + +[Dotnet - CLI (code)](https://learn.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool?tabs=macos) + +###### PATH + +``` +cat << EOF >> ~/.zprofile +# Add Visual Studio Code (code) +export PATH="\${PATH}:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" +EOF +``` + +## Helpful + +``` +code ~/.zshrc + +dotnet-install --channel LTS +dotnet-install --runtime dotnet --version 6.0.0 +dotnet-install --channel 6.0 --runtime aspnetcore + +dotnet-core-uninstall list +dotnet-core-uninstall remove --sdk 6.0.201 +dotnet-core-uninstall remove --runtime 6.0.3 +``` diff --git a/home/.git-template/hooks/readme.md b/home/.git-template/hooks/readme.md new file mode 100644 index 0000000..b5aa17e --- /dev/null +++ b/home/.git-template/hooks/readme.md @@ -0,0 +1,25 @@ +# Git Hooks + +[Git - Hooks](https://git-scm.com/docs/githooks) + +### pre-commit + +[pre-commit - Installation](https://pre-commit.com/#installation) +[pre-commit - Hooks](https://pre-commit.com/hooks.html) + +##### Install with Homebrew + +``` +brew install pre-commit +``` + +``` +pre-commit --version +``` + +## Helpful (CLI) + +``` +$ pre-commit install +pre-commit installed at .git/hooks/pre-commit +``` diff --git a/home/.sh/brew-helper.zsh b/home/.sh/brew-helper.zsh old mode 100644 new mode 100755 index 70b793d..93d96f4 --- a/home/.sh/brew-helper.zsh +++ b/home/.sh/brew-helper.zsh @@ -6,9 +6,10 @@ # Ask for the administrator password upfront. sudo -v -# export HOMEBREW_PREFIX=/usr/local -# export HOMEBREW_CELLAR=/usr/local/Cellar -# export HOMEBREW_REPOSITORY=/usr/local/Homebrew +# HOMEBREW_PREFIX=/usr/local +# HOMEBREW_CELLAR=/usr/local/Cellar +# HOMEBREW_REPOSITORY=/usr/local/Homebrew +# export HOMEBREW_PREFIX HOMEBREW_CELLAR HOMEBREW_REPOSITORY # Info # sudo xcode-select --install @@ -19,20 +20,22 @@ sudo -v ## Permission issues # sudo chown -R $(whoami) $(brew --prefix)/* -## Update & upgrade -brew update & upgrade +# Check for brew (Homebrew) +if command -v brew 1>/dev/null 2>&1; then + ## Update & upgrade + brew update && brew upgrade -# Install brew packages -brew install coreutils # Install GNU core utilities (those that come with OS X are outdated) -brew install wget --with-iri # Install standard `vim` with IRI support -brew install vim --override-system-vi # Install vim with vi override -brew install findutils # Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed. -brew install pre-commit # Install pre-commit package manager (https://pre-commit.com/#install) -brew install gnupg # Install gpg (GnuPG) -#brew install grep tmux tree # Install others + # Install brew packages + brew install -sq coreutils # Install GNU core utilities (those that come with OS X are outdated) + brew install -sq wget # Install standard `vim` with IRI support + brew install -sq findutils # Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed. + brew install -sq pre-commit # Install pre-commit package manager (https://pre-commit.com/#install) + brew install -sq gnupg # Install gpg (GnuPG) + brew install -sq tree # Install tree -## Create symlinks -#sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum + ## Create symlinks + #sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum -## Remove outdated versions -brew cleanup + ## Remove outdated versions + brew cleanup +fi diff --git a/home/.sh/colors-helper.zsh b/home/.sh/colors-helper.zsh old mode 100644 new mode 100755 index 68c297b..25ce3ce --- a/home/.sh/colors-helper.zsh +++ b/home/.sh/colors-helper.zsh @@ -9,7 +9,6 @@ # colors (default + 8 escapes). # T='gYw' # The test text to display - echo -e "\n 40m 41m 42m 43m\ 44m 45m 46m 47m"; diff --git a/home/.sh/dotnet.sh b/home/.sh/dotnet.sh new file mode 100755 index 0000000..54420f8 --- /dev/null +++ b/home/.sh/dotnet.sh @@ -0,0 +1,30 @@ +#!/bin/zsh +# shellcheck disable=all +# Install dotnet command-line tools (https://learn.microsoft.com/en-us/dotnet/core/install/) +[ -d "${HOME}/.dotnet" ] || mkdir -p "${HOME}/.dotnet" + +# dotnet-install +# https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#recommended-version +typeset -r vcli_lab_ifile='https://dot.net/v1/dotnet-install.sh' +(cd "${HOME}/.dotnet" && curl -sL -o 'dotnet-install' "${vcli_lab_ifile}") +(cd "${HOME}/.dotnet" && chmod 0750 'dotnet-install') + +# dotnet-uninstall +# https://github.com/dotnet/cli-lab/releases/latest +typeset -r vcli_lab='1.5.255402' +typeset -r vcli_lab_ufile='dotnet-core-uninstall.tar.gz' +(cd "${HOME}/.dotnet" && curl -sL -o "${vcli_lab_ufile}" "https://github.com/dotnet/cli-lab/releases/download/${vcli_lab}/${vcli_lab_ufile}") +(cd "${HOME}/.dotnet" && tar -zxf "${vcli_lab_ufile}" && rm "${vcli_lab_ufile}") + +# Adding Dotnet to .zshrc +typeset -r _ZSHRC="${HOME}/.zshrc" +if ! grep -i "\${HOME}/.dotnet" "${_ZSHRC}" 1>/dev/null 2>&1; then +(cat << EOF >> "${_ZSHRC}" +# Dotnet +DOTNET_ROOT="${HOME}/.dotnet" +DOTNET_INSTALL_DIR="${HOME}/.dotnet" +PATH="\${PATH}:${HOME}/.dotnet" +export DOTNET_ROOT DOTNET_INSTALL_DIR PATH +EOF +) +fi diff --git a/home/.sh/golang.zsh b/home/.sh/golang.zsh new file mode 100755 index 0000000..c44a2e5 --- /dev/null +++ b/home/.sh/golang.zsh @@ -0,0 +1,41 @@ +#!/bin/zsh +# shellcheck disable=all + +# Go +# https://go.dev/doc/install +# https://pkg.go.dev/cmd/go#section-directories + +# Go Environment (go env) +# https://github.com/golang/go/wiki/SettingGOPATH#zsh +# GOARCH="amd64" +# GOBIN="" +# GOFLAGS="" +# GOOS="darwin" +# GOPATH="" +# GOPROXY="https://proxy.golang.org,direct" +typeset -r GOPATH="${HOME}/go" +export GOPATH + +# Adding Golang to .zshrc +typeset -r _ZSHRC="${HOME}/.zshrc" +if ! grep -i "\${PATH}:${GOPATH}" "${_ZSHRC}" 1>/dev/null 2>&1; then +(cat << EOF >> "${_ZSHRC}" +# Golang +export PATH="\${PATH}:${GOPATH}" +EOF +) +fi + +# f: _chk_go, install golang and print version +_chk_go() { + # Install go via Homebrew (fastest) + if command -v brew 1>/dev/null 2>&1; then + brew install -sq go + fi +} +_chk_go + +# Check for golang +if command -v go 1>/dev/null 2>&1; then + [ -d "${GOPATH}" ] || mkdir -p "${GOPATH}/{bin,pkg,src}"; +fi diff --git a/home/.sh/oh-my-zsh-helper.zsh b/home/.sh/oh-my-zsh-helper.zsh old mode 100644 new mode 100755 index 32f8ea0..e7cbd4b --- a/home/.sh/oh-my-zsh-helper.zsh +++ b/home/.sh/oh-my-zsh-helper.zsh @@ -1,5 +1,7 @@ #!/bin/zsh # shellcheck disable=all # https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -export ZSH="${HOME}/.oh-my-zsh" -sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +typeset -r ZSH="${HOME}/.oh-my-zsh" +export ZSH + +sh -c "$(curl -fsSL 'https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh')" diff --git a/home/.sh/powerline.zsh b/home/.sh/powerline.zsh new file mode 100755 index 0000000..398363a --- /dev/null +++ b/home/.sh/powerline.zsh @@ -0,0 +1,5 @@ +#!/bin/zsh +# shellcheck disable=all +# https://github.com/powerline/fonts +# https://powerline.readthedocs.io/en/master/installation.html#pip-installation +pip3 install --user powerline-status \ No newline at end of file diff --git a/home/.sh/vscode-helper.zsh b/home/.sh/vscode-helper.zsh old mode 100644 new mode 100755 index da0c7f5..22a1e8f --- a/home/.sh/vscode-helper.zsh +++ b/home/.sh/vscode-helper.zsh @@ -3,12 +3,16 @@ # vscode # https://code.visualstudio.com/download # https://code.visualstudio.com/docs/setup/mac -ZPROFILE="${HOME}/.zprofile" -if ! grep -i 'Visual Studio Code.app' "${ZPROFILE}" 1>/dev/null 2>&1; then -cat << EOF >> "${ZPROFILE}" + +# Adding Visual Studio Code (code) to .zprofile +typeset -r ZPROFILE="${HOME}/.zprofile" +typeset -r vscode_app_path='/Applications/Visual Studio Code.app/Contents/Resources/app/bin' +if ! grep -i "${vscode_app_path}" "${ZPROFILE}" 1>/dev/null 2>&1; then +(cat << EOF >> "${ZPROFILE}" # Add Visual Studio Code (code) -export PATH="\${PATH}:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" +export PATH="\${PATH}:${vscode_app_path}" EOF +) source "${ZPROFILE}" fi diff --git a/home/.sh/xterm-true-color-helper.awk b/home/.sh/xterm-true-color-helper.awk old mode 100644 new mode 100755 index e34aab5..7170d12 --- a/home/.sh/xterm-true-color-helper.awk +++ b/home/.sh/xterm-true-color-helper.awk @@ -2,7 +2,7 @@ # shellcheck disable=all # https://jdhao.github.io/2018/10/19/tmux_nvim_true_color/ BEGIN{ - s="/\\/\\/\\/\\/\\"; s=s s s s s s s s; + s=sprintf("%100s","");gsub(/ /,"_",s); for (colnum = 0; colnum<77; colnum++) { r = 255-(colnum*255/76); g = (colnum*510/76); diff --git a/home/.vimrc b/home/.vimrc index 2b317d9..51bc637 100644 --- a/home/.vimrc +++ b/home/.vimrc @@ -11,7 +11,6 @@ call vundle#begin() Plugin 'VundleVim/Vundle.vim' " GitHub plugins -Plugin 'airblade/vim-gitgutter' Plugin 'dense-analysis/ale' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' diff --git a/home/.vimrc.settings b/home/.vimrc.settings index 744b63f..cae1d30 100644 --- a/home/.vimrc.settings +++ b/home/.vimrc.settings @@ -11,14 +11,8 @@ " Enable folding set foldenable - -" Open up to 10 folds by default set foldlevelstart=0 - -" Max nested folds set foldnestmax=10 - -" foldmethod, marker, Markers are used to specify folds. set foldmethod=marker " Space opens/closes folds @@ -60,12 +54,6 @@ function! Preserve(command) call cursor(l, c) endfunction -" GitStatus(), airblade/vim-gitgutter -function! GitStatus() - let [a,m,r] = GitGutterGetHunkSummary() - return printf('+%d ~%d -%d', a, m, r) -endfunction - " LinterStatus(), dense-analysis/ale function! LinterStatus() abort let l:counts = ale#statusline#Count(bufnr('')) @@ -78,6 +66,7 @@ function! LinterStatus() abort \ all_errors \) endfunction +set statusline+=%{LinterStatus()} " }}} " AUTOGROUPS {{{ @@ -100,43 +89,19 @@ augroup cfggroup autocmd BufReadPost * syntax match nonascii "[^\u0000-\u007F]" augroup end -" gzip, reading and writing compressed files -augroup gzip - autocmd! - autocmd BufReadPre,FileReadPre *.gz set bin - autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip - autocmd BufReadPost,FileReadPost *.gz set nobin - autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r") - autocmd BufWritePost,FileWritePost *.gz !mv :r - autocmd BufWritePost,FileWritePost *.gz !gzip :r - autocmd FileAppendPre *.gz !gunzip - autocmd FileAppendPre *.gz !mv :r - autocmd FileAppendPost *.gz !mv :r - autocmd FileAppendPost *.gz !gzip :r -augroup END - " }}} " COLORS & ENCODING {{{ -" Syntax reset -if exists("syntax_on") - syntax reset -endif +" Encoding +set encoding=utf-8 " Enable syntax highlighting syntax enable syntax on -" Encoding -set encoding=utf-8 - "}}} " PLUGIN OPTIONS {{{ -" Plugin: airblade/vim-gitgutter options -let g:gitgutter_set_sign_backgrounds = 1 -let g:gitgutter_terminal_reports_focus = 0 - " Plugin: dense-analysis/ale options let g:ale_fix_on_save = 0 let g:ale_open_list = 0 @@ -144,7 +109,6 @@ let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', ' let g:ale_echo_msg_format = '[%severity%] [%linter%] %s ' let g:ale_set_highlights = 0 let g:ale_change_sign_column_color = 0 -let g:ale_sign_column_always = 1 let g:ale_sign_error = 'E' let g:ale_sign_warning = 'W' let g:ale_pattern_options = {'\.min.js$': {'ale_enabled': 0}} @@ -162,29 +126,31 @@ let g:ale_linters_ignore = { let g:ale_fixers = {'javascript': ['eslint'], '*': ['prettier']} " Plugin: vim-airline/vim-airline options -let g:airline_highlighting_cache = 1 -let g:airline#extensions#tabline#buffer_nr_show = 1 +" Link: https://github.com/vim-airline/vim-airline let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#formatter = 'default' let g:airline#extensions#ale#enabled = 1 +let g:airline_powerline_fonts = 1 " MOVED TO THEME OPTIONS SECTION " Plugin: vim-airline/vim-airline-theme options -"let g:airline_theme='luna' -set statusline="" -set statusline=%{LinterStatus()} -set statusline+=%{GitStatus()} "}}} " THEME OPTIONS {{{ " Set colorscheme, overriden by plugins "colorscheme solarized -let g:airline_theme='distinguished' +"let g:airline_theme='luna' +let g:airline_theme='angr' " }}} " UI CONFIG {{{ +" Vim 7.4.2201 +"set signcolumn=yes + +" Show commands with +set showcmd + " Disable mouse set mouse= if has('mouse') @@ -197,13 +163,6 @@ set scrolloff=5 " Highlight current line set cursorline -" Number of lines that are checked for set commands -set modeline -set updatetime=100 - -" Vim 7.4.2201 -set signcolumn=yes - " Highlight column if exists('+colorcolumn') set colorcolumn=80 @@ -251,12 +210,12 @@ set incsearch set ignorecase set smartcase -" Turn off search highlight with -nnoremap :nohlsearch - " }}} " MAPPINGS & COMMANDS {{{ +" Leader +let mapleader = "," + " Move to beginning/end of line nnoremap B ^ nnoremap E $ @@ -264,6 +223,9 @@ nnoremap E $ " Highlight last inserted text nnoremap gV `[v`] +" Turn off search highlight with +nnoremap :nohlsearch + " Clear whitespace at end of line with '_$' nmap _$ :call Preserve("%s/\\s\\+$//e") diff --git a/home/.zshrc b/home/.zshrc index 3ddf68b..00a7b69 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -2,19 +2,6 @@ # shellcheck disable=all # https://zsh.sourceforge.io/Guide/zshguide02.html -## Completion -autoload -U compinit -compinit -COMPLETION_WAITING_DOTS="%F{blue}…%f" -export COMPLETION_WAITING_DOTS - -## History -# zstyle -L, zstyle :completion:history-words: -zstyle ':completion:*:history-words' menu yes # activate menu -zstyle ':completion:*:history-words' remove-all-dups yes # ignore duplicate entries -setopt EXTENDED_HISTORY -hgrep () { fc -Dlim "*$@*" 1 } - ## Colors # man ls | grep -A 50 'LSCOLORS' CLICOLOR=1 @@ -23,16 +10,22 @@ LSCOLORS=Gxfxcxdxbxegedabagacad zstyle ':completion:*' list-colors "${(s.:.)LSCOLORS}" export CLICOLOR COLORTERM LSCOLORS +## Completion +autoload -U compinit +compinit +COMPLETION_WAITING_DOTS="%F{blue}…%f" +export COMPLETION_WAITING_DOTS + ## ZSH w/.oh-my-zsh # https://github.com/ohmyzsh/ohmyzsh ZSH="${HOME}/.oh-my-zsh" -ZSH_THEME="agnoster" # Set theme to load. (agnoster, rkj-repos, ys) +ZSH_THEME="rkj-repos" # Set theme to load. (agnoster, rkj-repos, ys) zstyle ':omz:update' mode reminder # Set omz update reminder export ZSH ZSH_THEME ## Plugins # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -plugins=(git history-substring-search macos brew ssh-agent tmux) +plugins=(git macos brew ssh-agent tmux) # Load SSH identities # id_rsa gitlab_priv gitlab_work github_priv github_work @@ -44,26 +37,41 @@ source "${ZSH}/oh-my-zsh.sh" # Source other configs source "${HOME}/.aliases" -## Google -# The next line updates PATH for the Google Cloud SDK. -if [ -f "${HOME}/google-cloud-sdk/path.zsh.inc" ]; then . "${HOME}/google-cloud-sdk/path.zsh.inc"; fi -# The next line enables shell command completion for gcloud. -if [ -f "${HOME}/google-cloud-sdk/completion.zsh.inc" ]; then . "${HOME}/google-cloud-sdk/completion.zsh.inc"; fi +## History +# zstyle -L, zstyle :completion:history-words: +zstyle ':completion:*:history-words' menu yes # activate menu +zstyle ':completion:*:history-words' remove-all-dups yes # ignore duplicate entries +setopt EXTENDED_HISTORY # ## Python, pyenv # if command -v pyenv 1>/dev/null 2>&1; then -# export PYENV_ROOT="${HOME}/.pyenv" -# export PATH="${PYENV_ROOT}/bin:${PATH}" +# PYENV_ROOT="${HOME}/.pyenv" +# PATH="${PATH}:${PYENV_ROOT}/bin" +# export PYENV_ROOT PATH # eval "$(pyenv init -)" # fi # ## JAVA, jenv # if command -v jenv 1>/dev/null 2>&1; then -# export PATH="/usr/local/opt/openjdk/bin:${PATH}" -# export PATH="${HOME}/.jenv/bin:${PATH}" +# PATH="${PATH}:/usr/local/opt/openjdk/bin" +# PATH="${PATH}:${HOME}/.jenv/bin" +# export PATH # eval "$(jenv init -)" # fi +# ## Google +# # The next line updates PATH for the Google Cloud SDK. +# if [ -f "${HOME}/google-cloud-sdk/path.zsh.inc" ]; then . "${HOME}/google-cloud-sdk/path.zsh.inc"; fi +# # The next line enables shell command completion for gcloud. +# if [ -f "${HOME}/google-cloud-sdk/completion.zsh.inc" ]; then . "${HOME}/google-cloud-sdk/completion.zsh.inc"; fi + +## Dotnet +# Update PATH for Dotnet and enable shell command completion +# if [ -f "${HOME}/.dotnet/path.zsh" ]; then . "${HOME}/.dotnet/path.zsh"; fi +# if [ -f "${HOME}/.dotnet/completion.zsh" ]; then . "${HOME}/.dotnet/completion.zsh"; fi + # ## Setup others -# # Setup other services, /usr/local/opt/ -# export PATH="/usr/local/opt/openssl@1.1/bin:${PATH}" +# # Setup other services, /usr/local/sbin/, /usr/local/opt/ +# PATH="${PATH}:/usr/local/sbin" +# PATH="${PATH}:/usr/local/opt/openssl@1.1/bin" +# export PATH