Skip to content

Commit

Permalink
Putting Neo vim, zim, etc on a diet (#19)
Browse files Browse the repository at this point in the history
* feat: From exa to eza

* fix: Some issues in the logs

* fix: The configuration file is con config/evironments/local/ansible.cfg

* fix: Pedantic YAML

* chore: Puthon interpreter configuration

* chore: Checkpoint

* chore: Sorted

* feat: Specific features for github

* feat: atuing support and zsh profiling

* feat: New plugins

* fix: The error in the help rule

* chore: Reduce the load of the prompt

* feat: git configuration to re-use Tower

* chore: Putting Neovim on a diet

* feat: Deletes the support for fzf on vim and zim

---------

Co-authored-by: javier.juarez <[email protected]>
  • Loading branch information
jjuarez and javier.juarez authored Feb 23, 2024
1 parent aa4a38e commit 59ea314
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 76 deletions.
2 changes: 0 additions & 2 deletions ansible.cfg

This file was deleted.

12 changes: 4 additions & 8 deletions backups/homebrew/Brewfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tap "acorn-io/cli"
tap "anchore/grype"
tap "datarootsio/tf-profile"
tap "derailed/popeye"
Expand Down Expand Up @@ -57,8 +56,8 @@ brew "docker-buildx"
brew "docker-compose"
brew "dos2unix"
brew "duf"
brew "exa"
brew "exercism"
brew "eza"
brew "figlet"
brew "findutils"
brew "flyctl"
Expand All @@ -83,7 +82,6 @@ brew "hadolint"
brew "hcl2json"
brew "helm"
brew "htop"
brew "httperf"
brew "hub"
brew "hyperkit"
brew "ipcalc"
Expand Down Expand Up @@ -123,6 +121,7 @@ brew "nmap"
brew "ntfy"
brew "opa"
brew "openshift-cli"
brew "opentofu"
brew "pandoc"
brew "pluto"
brew "postgresql@14"
Expand All @@ -143,7 +142,6 @@ brew "sloth"
brew "socat"
brew "sops"
brew "sqlite-utils"
brew "sshuttle"
brew "sslscan"
brew "stern"
brew "syft"
Expand Down Expand Up @@ -182,16 +180,13 @@ cask "dropbox"
cask "firefox"
cask "font-hack-nerd-font"
cask "font-meslo-lg-nerd-font"
cask "google-chrome"
cask "gpg-suite"
cask "istat-menus"
cask "iterm2-beta"
cask "kindle"
cask "launchbar"
cask "meetingbar"
cask "omnigraffle"
cask "rectangle"
cask "slack"
cask "spectacle"
cask "telegram"
cask "typora"
cask "vagrant"
Expand All @@ -200,6 +195,7 @@ cask "visual-studio-code"
cask "whatsapp"
mas "HP Smart", id: 1474276998
mas "Keynote", id: 409183694
mas "Kindle", id: 302584613
mas "Numbers", id: 409203825
mas "Pages", id: 409201541
mas "Tailscale", id: 1475387142
Expand Down
1 change: 1 addition & 0 deletions config/environments/local/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[defaults]
ansible_python_interpreter="/usr/bin/env python"
force_color = True
deprecation_warnings = True

Expand Down
1 change: 1 addition & 0 deletions config/environments/local/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
all:
hosts:
localhost
...
8 changes: 2 additions & 6 deletions roles/dotfiles/files/shell/rc/.aliasesrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ OS="$(uname)"

case "${OS}" in
Darwin*)
alias ls='ls -h -G'
alias netstat='netstat -an -p tcp -f inet'

[[ -x "${HOMEBREW_PREFIX}/bin/gtar" ]] && alias tar="${HOMEBREW_PREFIX}/bin/gtar"
[[ -x "${HOMEBREW_PREFIX}/bin/gfind" ]] && alias find="${HOMEBREW_PREFIX}/bin/gfind"
[[ -x "${HOMEBREW_PREFIX}/bin/gsed" ]] && alias sed="${HOMEBREW_PREFIX}/bin/gsed"
#[[ -x "${HOMEBREW_PREFIX}/bin/kubectl" ]] && alias k='kubectl'
[[ -x "${HOMEBREW_PREFIX}/bin/kubecolor" ]] && alias k='kubecolor' # Override
[[ -x "${HOMEBREW_PREFIX}/bin/exa" ]] && alias ls='exa' # Override
[[ -x "${HOMEBREW_PREFIX}/bin/jq" ]] && alias jsontidy='pbpaste|jq '.'|pbcopy'
[[ -x "${HOMEBREW_PREFIX}/bin/kubecolor" ]] && alias k='kubecolor'
[[ -x "${HOMEBREW_PREFIX}/bin/eza" ]] && alias ls='eza'
;;
esac

Expand All @@ -22,7 +19,6 @@ if [[ "${HOMEBREW_PREFIX}/bin/nvim" ]]; then
alias vim="${HOMEBREW_PREFIX}/bin/nvim"
alias vi="${HOMEBREW_PREFIX}/bin/nvim"
elif [[ "${HOMEBREW_PREFIX}/bin/vim" ]]; then
alias vim="${HOMEBREW_PREFIX}/bin/vim"
alias vi="${HOMEBREW_PREFIX}/bin/vim"
fi

Expand Down
11 changes: 9 additions & 2 deletions roles/dotfiles/files/shell/rc/.featuresrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# vim: ft=zsh

features::fzf() {
utils::check_command "fzf" || return 1
utils::check_file "${HOME}/.fzf.zsh" || return 1
Expand Down Expand Up @@ -60,6 +62,11 @@ features::direnv() {
eval "$(direnv hook zsh)"
}

features::atuin() {
utils::check_command "autin" || return 1
eval "$(atuin init zsh)"
}

utils::check_file() {
local file="${1:-'none'}"

Expand Down Expand Up @@ -97,12 +104,12 @@ utils::log() {
}

main() {
utils::log "features: ["
utils::log "Features:[ "

for toggle activated in ${(kv)FEATURES_CONFIGURATION}; do
if [ "${activated}" = true ]; then
if typeset -f features::${toggle} >/dev/null; then
utils::log "${toggle} " && features::${toggle}
utils::log "${toggle}:" && features::${toggle}
if [[ ${?} -eq 0 ]]; then
utils::log ""
else
Expand Down
25 changes: 25 additions & 0 deletions roles/dotfiles/files/shell/zsh.d/github.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#set -u -o pipefail
#set -x


BROWSER=${BROWSER:-'Firefox'}
GIT_ORG=${GIT_ORG:-'IBM-Q-Software'}
GIT_REPO=${GIT_REPO:-'cloud-deployment'}


github::open_issue() {
local -r git_issues="https://github.ibm.com/${GIT_ORG}/${GIT_REPO}/issues"
local -r issue="${1}"

[[ -n "${issue}" ]] || return 0
case "${OSTYPE}" in
darwin*) open -a "${BROWSER}" "${git_issues}/${issue}" ;;
*) echo "There's no support for ${OSTYPE} yet..." ;;
esac
}

# autoloads
autoload github::open_issue

# aliases
alias goi='github::open_issue'
9 changes: 8 additions & 1 deletion roles/dotfiles/files/shell/zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ZSH Profiling BEGIN
# zmodload zsh/zprof

# SSH keys to load by the agent
zstyle ':zim:ssh' ids 'id_ed25519.github.com' \
'id_ed25519.github.ibm.com'
Expand Down Expand Up @@ -34,8 +37,9 @@ export PATH=/usr/local/sbin:${PATH}
# Custom configurations
FEATURES_VERBOSE=true
declare -A FEATURES_CONFIGURATION=(
[atuin]=true
[direnv]=true
[fzf]=true
[fzf]=false
[ghe]=true
[github]=true
[go]=true
Expand Down Expand Up @@ -65,3 +69,6 @@ done 2>/dev/null

# Utilities and aliases
[[ -f "${HOME}/.aliasesrc" ]] && source "${HOME}/.aliasesrc"

# ZSH Profiling END
#zprof
2 changes: 1 addition & 1 deletion roles/dotfiles/files/skeletons/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ endef

.PHONY: help
help: ## Shows this pretty help screen
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make <target>\n\nTargets:\n"} /^[a-zA-Z//_-]+:.*?##/ { printf " %-20s %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make <target>\n\nTargets:\n"} /^[a-zA-Z\/_-]+:.*?##/ { printf " %-20s %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

65 changes: 35 additions & 30 deletions roles/dotfiles/files/tools/.gitconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
[user]
name = javier.juarez
email = [email protected]

[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true

[alias]
ci = commit
co = checkout
Expand All @@ -23,43 +11,60 @@
ts = tag --sort=-committerdate
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=iso8601-strict

[github]
user = jjuarez
[branch]
# sort = -committerdate

[push]
default = matching
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true

[core]
excludesfile = ~/.gitignore_global
fileMode = false
eol = lf
autocrlf = input

[help]
autocorrect = 0

[colour]
ui = 1
[credential]
helper = cache

[diff]
tool = vimdiff

[difftool]
prompt = false

[credential]
helper = cache
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true

[format]
pretty = oneline

[user]
name = JJ
email = [email protected]

[github]
user = jjuarez

[help]
autocorrect = 0

[init]
defaultBranch = main

[pull]
rebase = true

[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[init]
defaultBranch = master
[push]
default = matching
[commit]
gpgsign = false
[gpg]
program = /usr/local/MacGPG2/bin/gpg2
22 changes: 3 additions & 19 deletions roles/dotfiles/files/vim/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@ filetype plugin on
" Plug plugin management
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
Plug 'tomtom/tcomment_vim'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'stsewd/fzf-checkout.vim'
Plug 'ervandew/supertab'
Plug 'tomasr/molokai'
Plug 'ryanoasis/vim-devicons'
Plug 'itchyny/lightline.vim'
Plug 'scrooloose/nerdtree'
Plug 'szw/vim-maximizer'
Plug 'w0rp/ale'
Plug 'tsandall/vim-rego'
Plug 'klen/python-mode'
Plug 'hashivim/vim-terraform'
Plug 'fatih/vim-go'
Plug 'leafgarland/typescript-vim'
Plug 'cespare/vim-toml'
Plug 'jjo/vim-cue'
Plug 'chase/vim-ansible-yaml'
Plug 'godlygeek/tabular'
call plug#end()

if has('autocmd')
Expand All @@ -37,9 +33,6 @@ let mapleader=","
"" This configuration helps with the slowliness of ruby plugin
set regexpengine=1

"" fzf
set rtp+=/usr/local/opt/fzf

" Assume that filetype=sh are posix and therefore will support proper `$(...)`
" See:
" * https://git.io/fjngy
Expand Down Expand Up @@ -162,17 +155,8 @@ endif
let g:lightline = { 'colorscheme': 'wombat' }

"" Ale
let g:ale_linters = { "python": ["ruff"], "ansible": ["ansible-lint"], }
let g:ale_fixers = { "*": ["remove_trailing_lines", "trim_whitespace"], "python": ["black", "ruff"], }

"" NERDTree
let NERDTreeShowHidden=1

"" Fix auto-indentation for YAML files
augroup yaml_fix
autocmd!
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>
augroup end
let g:ale_linters = { "python": ["ruff"] }
let g:ale_fixers = { "python": ["ruff"] }

"" Maximize current split or return to previous
noremap <C-w>m :MaximizerToggle<CR>
Expand Down
2 changes: 1 addition & 1 deletion roles/dotfiles/files/vim/.vimrc.local
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endfunction
nnoremap gx :call OpenURLUnderCursor()<CR>

" Skeletons for well-known files
autocmd BufNewFile README.md 0r ~/.skeletons/README.md
" autocmd BufNewFile README.md 0r ~/.skeletons/README.md
autocmd BufNewFile *.sh 0r ~/.skeletons/bash.sh
autocmd BufNewFile Makefile 0r ~/.skeletons/Makefile
autocmd BufNewFile *.py 0r ~/.skeletons/python.py
Expand Down
2 changes: 1 addition & 1 deletion roles/dotfiles/files/zimfw/.p10k.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if [[ "${ZSH_THEME}" == "powerlevel10k" ]]; then
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs kubecontext direnv nvm pyenv virtualenv goenv)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs kubecontext virtualenv)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time)
POWERLEVEL9K_MODE="nerdfont-complete"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
Expand Down
7 changes: 2 additions & 5 deletions roles/dotfiles/files/zimfw/.zimrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
# Sets sane Zsh built-in environment options.
zmodule input
zmodule environment
# Quick directory change
zmodule agkozak/zsh-z
# SSH agent helper
zmodule ssh
# Additional completion definitions for Zsh.
zmodule completion
zmodule fzf
zmodule zsh-users/zsh-completions
# zmodule fzf
zmodule zsh-users/zsh-completions
zmodule zsh-users/zsh-autosuggestions
zmodule zsh-users/zsh-syntax-highlighting
# Themes
Expand Down

0 comments on commit 59ea314

Please sign in to comment.