~andrewzah/dotfiles

c815f30e5996a2a444e1209752c3d4371a099845 — Andrew Zah 2 years ago 272b076
make changes, use zpresto over ohmyzsh, update vimrc
M .chunkwmrc => .chunkwmrc +3 -2
@@ 19,7 19,7 @@ chunkc core::hotload 1
#

chunkc set global_desktop_mode           bsp
chunkc set 7_desktop_mode                float
chunkc set 8_desktop_mode                float

chunkc set 1_desktop_tree                ~/.chunkwm_layouts/dev_1



@@ 82,7 82,7 @@ chunkc set focused_border_skip_floating  0
#

chunkc core::load tiling.so
chunkc core::load ffm.so
# chunkc core::load ffm.so

# ways to switch
alt - f : chunkc tiling::window --toggle fullscreen


@@ 101,5 101,6 @@ chunkc tiling::rule --owner alacritty  --state tile
chunkc tiling::rule --owner Spotify --role AXWindow --subrole AXDialog --state tile
chunkc tiling::rule --owner Firefox --role AXWindow --subrole AXDialog --state tile
chunkc tiling::rule --owner Finder --name Copy --state float
chunkc tiling::rule --owner \"Azure Data Studio\"  --state tile
chunkc tiling::rule --owner \"App Store\" --state float
chunkc tiling::rule --owner \"FightCade\" --state float

M .khdrc => .khdrc +4 -0
@@ 132,3 132,7 @@ ctrl + alt - s : chunkc tiling::desktop --layout monocle
ctrl + alt - d : chunkc tiling::desktop --layout float

ctrl + alt - w : chunkc tiling::desktop --deserialize ~/.chunkwm_layouts/dev_1

# disable/enable ffm
cmd + ctrl + alt + shift - m : chunkc core::load ffm.so
cmd + ctrl + alt - m : chunkc core::unload ffm.so

M .zshrc => .zshrc +5 -7
@@ 1,17 1,15 @@

source ~/.zsh/aliases.zsh
source ~/.zsh/colors.zsh
source ~/.zsh/exports.zsh
source ~/.zsh/secret-exports.zsh
source ~/.zsh/functions.zsh
source ~/.zsh/history.zsh
source ~/.zsh/setopt.zsh
source ~/.zsh/zsh-path.zsh

ZSH_THEME="theunraveler"

export ZSH=/Users/andrei/.oh-my-zsh
plugins=(gitfast ruby wd colored-man-pages last-working-dir)
source $ZSH/oh-my-zsh.sh
source $ZSH/custom/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
source ~/.iterm2_shell_integration.zsh
#plugins=(gitfast ruby wd colored-man-pages last-working-dir)
#source ~/.oh-my-zsh/custom/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

M config/nvim/init.vim => config/nvim/init.vim +22 -14
@@ 7,16 7,22 @@ end
call plug#begin('~/.vim/plugged')

""" Language/Syntax
"Plug 'l04m33/vlime', {'rtp': 'vim/'}
Plug 'ElmCast/elm-vim', { 'for': 'elm' }
Plug 'cespare/vim-toml', { 'for': 'toml' }
Plug 'chrisbra/csv.vim', { 'for': 'csv' }
Plug 'elixir-editors/vim-elixir', { 'for': 'elixir' }
Plug 'elorest/vim-slang', { 'for': 'slang' }
Plug 'fatih/vim-go'
Plug 'isobit/vim-caddyfile', { 'for': 'caddyfile' }
Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' }
Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }
Plug 'ledger/vim-ledger'
Plug 'maxmellon/vim-jsx-pretty', { 'for': 'javascript' }
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
Plug 'rhysd/vim-crystal', { 'for': 'crystal' }
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }
Plug 'slim-template/vim-slim', { 'for': 'slim' }

""" Vim Behavior/Functionality
Plug 'bhurlow/vim-parinfer', {'for': 'clojure' }


@@ 30,7 36,6 @@ Plug 'luochen1990/rainbow'
Plug 'machakann/vim-sandwich'
Plug 'mattn/emmet-vim'
Plug 'mhinz/vim-grepper', { 'on': ['Grepper', '<plug>(GrepperOperator)'] }
Plug 'morhetz/gruvbox'
Plug 'nathanaelkane/vim-indent-guides', { 'for': ['yaml', 'python', 'haml', 'slim', 'slang'] }
Plug 'radenling/vim-dispatch-neovim'
Plug 'scrooloose/nerdcommenter'


@@ 39,20 44,23 @@ Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-fugitive'
Plug 'w0rp/ale'

""" Want to use in theory, need to look into
" Plug 'gcmt/wildfire.vim'
"" og theme
Plug 'morhetz/gruvbox'
"" new themes to try
Plug 'KKPMW/moonshine-vim'

call plug#end()
filetype plugin indent on
runtime macros/matchit.vim

syntax enable 
syntax enable
set hidden
set title
set history=1000

" theme / colors
set background=dark
"colorscheme hybrid
colorscheme gruvbox
set termguicolors



@@ 143,7 151,7 @@ let g:clojure_conceal_extras = 1
" Rainbow brackets/parens
let g:rainbow_active = 1

let g:fzf_tags_command = 'ctags --extra=+f -R'
let g:fzf_tags_command = 'ctags --extra=+f -R .git/tags'

" gruvbox coloring for fzf
let g:fzf_colors =


@@ 186,7 194,9 @@ let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 0
let g:ale_lint_on_save = 1
let g:ale_linters = {
  \ '*': ['remove_trailing_lines', 'trim_whitespace'],
  \ 'javascript': ['eslint'],
  \ 'go': ['go fmt'],
\ }

let g:grepper = {}


@@ 226,25 236,23 @@ nmap <c-p> :Files<cr>
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>

" cut without yanking
nnoremap <leader>d "_d
xnoremap <leader>d "_d
vnoremap <leader>d "_d

" clear search highlight
nnoremap <Leader>co :nohl<CR><C-l>

vnoremap <Tab> >gv
vnoremap <S-Tab> <gv

" Tabularize
nnoremap <Leader>a= :Tabularize /=<CR>
vnoremap <Leader>a= :Tabularize /=<CR>
nnoremap <Leader>a: :Tabularize /:\zs<CR>
vnoremap <Leader>a: :Tabularize /:\zs<CR>

" Save 1 keystroke on vim splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>


" Allow copy/paste
nnoremap <C-x> "+p
vnoremap <C-c> "+y


@@ 338,7 346,7 @@ autocmd BufReadPost *
autocmd filetype crontab setlocal nobackup nowritebackup

" FZF :Find
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!node_modules/" --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)

" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.

M zsh/aliases.zsh => zsh/aliases.zsh +3 -2
@@ 10,5 10,6 @@ alias dcb="docker-compose build"
# ctags
alias ctags="`brew --prefix`/bin/ctags -f ./.git/tags"

# alacritty
alias a="open -n /Applications/Alacritty.app"
# directories
alias cdr="cd ~/Documents/repos"
alias cdp="cd ~/Desktop/Sync/programming"

M zsh/exports.zsh => zsh/exports.zsh +14 -20
@@ 45,25 45,19 @@ export CPPFLAGS="-I/usr/local/opt/openssl/include"
# Apps
#########

# local db testing
export MAIN_SITE_DB_URL="postgres://kemalyst:kemalyst@localhost:5432/main_site_dev"
# taskwarrior
export TASKRC=~/.config/task/config

export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# Vim FZF
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'

# NVM & Brew workaround
# Defer initialization of nvm until nvm, node or a node-dependent command is
# run. Ensure this block is only run once if .bashrc gets sourced multiple times
# by checking whether __init_nvm is a function.
if [ -s "$HOME/.nvm/nvm.sh" ] && [ ! "$(whence -w __init_nvm)" = function ]; then
  export NVM_DIR="$HOME/.nvm"
  [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
  declare -a __node_commands=('nvm' 'node' 'npm' 'yarn' 'gulp' 'grunt' 'webpack')
  function __init_nvm() {
    for i in "${__node_commands[@]}"; do unalias $i; done
    . "$NVM_DIR"/nvm.sh
    unset __node_commands
    unset -f __init_nvm
  }
  for i in "${__node_commands[@]}"; do alias $i='__init_nvm && '$i; done
fi
export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!.git/*"'

# GOLANG

#export GOPATH="${HOME}/.go"
#export GOROOT="$(brew --prefix golang)/libexec"
#export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
#test -d "${GOPATH}" || mkdir "${GOPATH}"
#test -d "${GOPATH}/src/github.com" || mkdir -p "${GOPATH}/src/github.com"

M zsh/functions.zsh => zsh/functions.zsh +22 -39
@@ 1,42 1,3 @@
function extract {
  echo Extracting $1 ...
  if [ -f $1 ] ; then
      case $1 in
          *.tar.bz2)   tar xjf $1  ;;
          *.tar.gz)    tar xzf $1  ;;
          *.bz2)       bunzip2 $1  ;;
          *.rar)       unrar x $1    ;;
          *.gz)        gunzip $1   ;;
          *.tar)       tar xf $1   ;;
          *.tbz2)      tar xjf $1  ;;
          *.tgz)       tar xzf $1  ;;
          *.zip)       unzip $1   ;;
          *.Z)         uncompress $1  ;;
          *.7z)        7z x $1  ;;
          *)        echo "'$1' cannot be extracted via extract()" ;;
      esac
  else
      echo "'$1' is not a valid file"
  fi
}

# move files to trash instead of rm
function trash () {
  local path
  for path in "$@"; do
    # ignore any arguments
    if [[ "$path" = -* ]]; then :
    else
      local dst=${path##*/}
      # append the time if necessary
      while [ -e ~/.Trash/"$dst" ]; do
        dst="$dst "$(date +%H-%M-%S)
      done
      /bin/mv "$path" ~/.Trash/"$dst"
    fi
  done
}

function mkd() {
	mkdir -p "$@";
}


@@ 65,6 26,28 @@ function v() {
	fi;
}

function m() {
	if [ $# -eq 0 ]; then
		make;
	else
		make "$@";
	fi;
}

function t() {
	if [ $# -eq 0 ]; then
		task;
	else
		task "$@";
	fi;
}

function run_msql() {
  docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=DereApittyI99I' \
    -p 1433:1433 --name sql1 \
    -d mcr.microsoft.com/mssql/server:2017-latest
}

# SOURCES
# https://github.com/mathiasbynens/dotfiles/blob/master/.functions


M zsh/setopt.zsh => zsh/setopt.zsh +2 -0
@@ 41,6 41,8 @@ setopt COMPLETE_IN_WORD
# When completing from the middle of a word, move the cursor to the end of the word
setopt ALWAYS_TO_END            

unsetopt CORRECT

# ===== Prompt

# Enable parameter expansion, command substitution, and arithmetic expansion in the prompt

M zsh/zsh-path.zsh => zsh/zsh-path.zsh +9 -3
@@ 1,19 1,25 @@
# Mac OS X uses path_helper and /etc/paths.d to preload PATH, clear it out first
if [ -x /usr/libexec/path_helper ]; then
#if [ -x /usr/libexec/path_helper ]; then
    #PATH=''
    #eval `/usr/libexec/path_helper -s`
fi
#fi

export PATH=$PATH:/usr/local/kubebuilder/bin
export GOPATH=$HOME/go

# nvm
export NVM_DIR="$HOME/.nvm"
#export NVM_DIR="$HOME/.nvm"
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# python
export PATH=/usr/local/share/python:$PATH

# anaconda
#export PATH=/usr/local/anaconda3/bin:"$PATH"

# ruby
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

# sdl2
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"