From f849327889a354c7c32531a005f1e5b8abaaad5e Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 18 Dec 2015 16:10:41 -0500 Subject: [PATCH 01/39] change name --- git/.gitconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git/.gitconfig b/git/.gitconfig index 3ac77ff..1af763a 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -4,8 +4,8 @@ [hub] protocol = https [user] - name = Chris Seto - email = chriskseto@gmail.com + name = Fabian von Feilitzsch + email = fabian@fabianism.us [credential] helper = osxkeychain [alias] @@ -40,7 +40,7 @@ ui = true [core] excludesfile = ~/.gitignore_global - editor = vim + editor = vim [apply] whitespace = nowarn [mergetool] From 84bde69337163a8a0ecd59445255b3c95296fbc1 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 18 Dec 2015 16:11:28 -0500 Subject: [PATCH 02/39] fix mouse mode for new tmux --- tmux/.tmux.conf | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 8288c35..07896de 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -10,7 +10,7 @@ bind C-space select-pane -t :.+ set -g renumber-windows on # Use vim keybindings -setw -g mode-keys vi +# setw -g mode-keys vi # reload tmux config unbind r @@ -66,21 +66,15 @@ bind + select-layout main-horizontal ############ # Toggle mouse on +unbind m bind m \ - set -g mode-mouse on \;\ - set -g mouse-resize-pane on \;\ - set -g mouse-select-pane on \;\ - set -g mouse-select-window on \;\ + set-option -g -q mouse on \;\ + bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" \;\ + bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" \;\ + bind-key -t vi-copy WheelUpPane halfpage-up \;\ + bind-key -t vi-copy WheelDownPane halfpage-down \;\ display 'Mouse: ON' -# Toggle mouse off -bind M \ - set -g mode-mouse off \;\ - set -g mouse-resize-pane off \;\ - set -g mouse-select-pane off \;\ - set -g mouse-select-window off \;\ - display 'Mouse: OFF' - # Navigate panes ################ From 1aef86eeaa126605a1bfea72b20e397bb104f9ec Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 18 Dec 2015 16:12:57 -0500 Subject: [PATCH 03/39] add some crap --- zsh/.zshrc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index c8c7ea2..5ba0634 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -3,11 +3,22 @@ export ZSH=$HOME/.dotfiles export ANDROID_HOME=/usr/local/opt/android-sdk export ANSIBLE_NOCOWS=1 -export PATH=$PATH:~/scripts +export PATH=$PATH:~/scripts:~/.cabal/bin +export EDITOR='vim' +export OSF=~/code/cos/osf.io +export SCRAPI=~/code/cos/scrapi +export GOPATH=$HOME/go +export PATH=$PATH:$GOPATH/bin +export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python +alias ansalon='telnet ansalonmud.net 8679' + +source ~/dotfiles/tmux/tmuxinator.zsh alias g='git' alias gssh='SSH_AUTH_SOCK=~/.gnupg/S.gpg-agent.ssh && ssh' - +alias c='clear' +alias query_share='curl -XPOST localhost:9200/share/_search\?pretty -d @query.json' +alias mkpasswd='python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())"' # use .localrc for SUPER SECRET CRAP that you don't # want in your public, versioned repo. if [[ -a ~/.localrc ]] @@ -27,3 +38,39 @@ compinit # Make autoenv always work cd . # fortune -o -s -n 300 | cowsay -f dragon-and-cow | lolcat + +[[ -s $(brew --prefix)/etc/autojump.sh ]] && . $(brew --prefix)/etc/autojump.sh + + +export WORKON_HOME=~/Envs +source /usr/local/bin/virtualenvwrapper.sh +source /usr/local/opt/autoenv/activate.sh + +pyclean () { + ZSH_PYCLEAN_PLACES=${*:-'.'} + noglob find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete + noglob find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete +} + +# added by travis gem +[ -f /Users/fabian/.travis/travis.sh ] && source /Users/fabian/.travis/travis.sh + +# Show git branch +setopt prompt_subst +autoload -Uz vcs_info +zstyle ':vcs_info:*' actionformats \ + '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' +zstyle ':vcs_info:*' formats \ + '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f ' +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' + +zstyle ':vcs_info:*' enable git cvs svn + +# or use pre_cmd, see man zshcontrib +vcs_info_wrapper() { + vcs_info + if [ -n "$vcs_info_msg_0_" ]; then + echo "%{$fg[grey]%}${vcs_info_msg_0_}%{$reset_color%}$del" + fi +} +RPROMPT=$'$(vcs_info_wrapper)' From b070996ad75a7f17087cfaa65a795435b9f9c10d Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 10:48:16 -0500 Subject: [PATCH 04/39] Add relnum/num toggle with --- vim/.vimrc | 75 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 6d31d56..903a67b 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -9,6 +9,19 @@ autocmd bufwritepost .vimrc source $MYVIMRC call plug#begin() " ESSENTIALS +Plug 'alfredodeza/pytest.vim' +nmap tF :Pytest file verbose +nmap tc :Pytest class verbose +nmap tm :Pytest method verbose +nmap tf :Pytest function verbose +nmap tdF :Pytest file verbose doctest +nmap tdc :Pytest class verbose doctest +nmap tdm :Pytest method verbose doctest +nmap tdf :Pytest function verbose doctest + +Plug 'bling/vim-airline' +let g:airline#extensions#hunks#enabled = 0 +Plug 'christoomey/vim-tmux-navigator' Plug 'tpope/vim-sensible' Plug 'rstacruz/vim-opinion' @@ -70,16 +83,16 @@ Plug 'alfredodeza/khuno.vim' " NICE TO HAVE -Plug 'bling/vim-airline' -let g:airline_theme='tomorrow' +" Plug 'bling/vim-airline' +" let g:airline_theme='tomorrow' " Show buffers in tabline -let g:airline#extensions#tabline#enabled = 1 +" let g:airline#extensions#tabline#enabled = 1 " Disable stuff I don't need to see -let g:airline#extensions#hunks#enabled = 0 -let g:airline#extensions#bufferline#enabled = 1 -let g:airline#extensions#tagbar#enabled = 0 -let g:airline#extensions#virtualenv#enabled = 0 -let g:airline#extensions#csv#enabled = 0 +" let g:airline#extensions#hunks#enabled = 0 +" let g:airline#extensions#bufferline#enabled = 1 +" let g:airline#extensions#tagbar#enabled = 0 +" let g:airline#extensions#virtualenv#enabled = 0 +" let g:airline#extensions#csv#enabled = 0 Plug 'christoomey/vim-tmux-navigator' Plug 'SirVer/ultisnips' @@ -177,6 +190,33 @@ if executable('npm') " Rename with rr (also like in python-mode) autocmd Filetype javascript noremap r :TernRename endif +Plug 'sophacles/vim-bundle-mako' +Plug 'plasticboy/vim-markdown' +let g:vim_markdown_folding_disabled=1 + +" Idris stuff +Plug 'idris-hackers/idris-vim' + +Plug 'ZoomWin' +Plug 'terryma/vim-multiple-cursors' +" For previewing markdown, rst ,etc +Plug 'greyblake/vim-preview' +Plug 'matchit.zip' +Plug 'duff/vim-scratch' +" Open scratch buffer with space-tab +command! ScratchToggle call ScratchToggle() + +function! ScratchToggle() + if exists("w:is_scratch_window") + unlet w:is_scratch_window + exec "q" + else + exec "normal! :Sscratch\\L" + let w:is_scratch_window = 1 + endif +endfunction + +nnoremap :ScratchToggle call plug#end() filetype plugin indent on @@ -198,6 +238,7 @@ set softtabstop=4 " when hitting , pretend like a tab is removed, even if sp set shiftwidth=4 " number of spaces to use for autoindenting set shiftround " use multiple of shiftwidth when indenting with '<' and '>' + " No bells set noerrorbells visualbell t_vb= """ VISUAL SETTINGS """ @@ -205,6 +246,12 @@ set noerrorbells visualbell t_vb= set t_Co=256 " Must be 256 for many themes to display correctly " Favorites: hybrid iceberg Tomorrow hybrid-light silent! colorscheme hybrid +" May want to have different schemes for termvim vs gvim +" if has('gui_running') +" silent! colorscheme emacs +" else +" silent! colorscheme underwater +" endif " Show trailing whitespace set list listchars=tab:▸\ ,trail:▫ @@ -352,3 +399,15 @@ if has('gui_running') set go-=L endif endif + +function! NumberToggle() + if(&relativenumber == 1) + set norelativenumber + set number + else + set relativenumber + set number + endif +endfunc + +nnoremap :call NumberToggle() From 2298b9f53d9d0b8a953c0694bd31d6d8cd87bd9d Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 10:48:46 -0500 Subject: [PATCH 05/39] Change color and style for VC readout --- zsh/.zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 9b94186..a6b2459 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -60,7 +60,7 @@ autoload -Uz vcs_info zstyle ':vcs_info:*' actionformats \ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' zstyle ':vcs_info:*' formats \ - '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f ' + '%F{4}%s%F{3}%F{2}:%F{4}%F{2}%b%F{5}%f ' zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' zstyle ':vcs_info:*' enable git cvs svn @@ -107,7 +107,7 @@ DISABLE_CORRECTION="true" unsetopt correct unsetopt correct_all -. ~/.bin/z.sh +# . ~/.bin/z.sh alias py="python" alias py3="python3" From e6f6c8535e4e68aa0b2a89ee98f6116bf25623e9 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 10:49:34 -0500 Subject: [PATCH 06/39] remove broken git plugin from zprezto --- zsh/.zpreztorc | 1 - 1 file changed, 1 deletion(-) diff --git a/zsh/.zpreztorc b/zsh/.zpreztorc index 7e5d4af..7d59bdd 100644 --- a/zsh/.zpreztorc +++ b/zsh/.zpreztorc @@ -34,7 +34,6 @@ zstyle ':prezto:load' pmodule \ 'completion' \ 'prompt' \ 'osx' \ - 'git' \ 'python' # From 8ea92897f6523e1913321a21edfc7863e5a79f0d Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 10:55:42 -0500 Subject: [PATCH 07/39] point at doctest version of pytest --- vim/.vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/.vimrc b/vim/.vimrc index 903a67b..8bc1bbb 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -9,7 +9,7 @@ autocmd bufwritepost .vimrc source $MYVIMRC call plug#begin() " ESSENTIALS -Plug 'alfredodeza/pytest.vim' +Plug 'fabianvf/pytest.vim' nmap tF :Pytest file verbose nmap tc :Pytest class verbose nmap tm :Pytest method verbose From c617df3113a940547a55508562e4594455cd4ba2 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 11:48:14 -0500 Subject: [PATCH 08/39] add tmuxinator to setup --- packages.txt | 1 + setup.sh | 7 +++++++ zsh/.zshrc | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages.txt b/packages.txt index 039c489..0d24ad4 100644 --- a/packages.txt +++ b/packages.txt @@ -1,3 +1,4 @@ +ruby stow zsh tmux diff --git a/setup.sh b/setup.sh index d06e8c7..c439857 100755 --- a/setup.sh +++ b/setup.sh @@ -1,6 +1,13 @@ +echo "Initializing submodules" git submodule init git submodule update +echo "Linking zsh configuration" stow zsh +echo "Linking vim configuration" stow vim +echo "Linking git configuration" stow git +echo "Linking tmux configuration" stow tmux +echo "Installing tmuxinator" +gem install --user-install tmuxinator diff --git a/zsh/.zshrc b/zsh/.zshrc index a6b2459..fd946d3 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -132,9 +132,12 @@ function pyclean() { find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete } - setopt no_share_history unsetopt share_history bindkey '^R' history-incremental-search-backward bindkey '^E' end-of-line bindkey '^A' beginning-of-line + +if which ruby >/dev/null && which gem >/dev/null; then + PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH" +fi From 81c9cd32f985b9aeac56e9c92f8f57bdad7397a6 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 14:50:52 -0500 Subject: [PATCH 09/39] change mapping for vim to --- tmux/tmuxinator.zsh | 30 ++++++++++++++++++++++++++++++ vim/.vimrc | 6 ++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 tmux/tmuxinator.zsh diff --git a/tmux/tmuxinator.zsh b/tmux/tmuxinator.zsh new file mode 100644 index 0000000..4c76c94 --- /dev/null +++ b/tmux/tmuxinator.zsh @@ -0,0 +1,30 @@ +#compdef tmuxinator mux + +_tmuxinator() { + local commands projects + commands=(${(f)"$(tmuxinator commands zsh)"}) + projects=(${(f)"$(tmuxinator completions start)"}) + + if (( CURRENT == 2 )); then + _describe -t commands "tmuxinator subcommands" commands + _describe -t projects "tmuxinator projects" projects + elif (( CURRENT == 3)); then + case $words[2] in + copy|debug|delete|open|start) + _arguments '*:projects:($projects)' + ;; + esac + fi + + return +} + +_tmuxinator + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et diff --git a/vim/.vimrc b/vim/.vimrc index 8bc1bbb..b18c5f9 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -400,14 +400,16 @@ if has('gui_running') endif endif +set relativenumber function! NumberToggle() if(&relativenumber == 1) set norelativenumber set number + echo ':set number' else set relativenumber set number + echo ':set relativenumber' endif endfunc - -nnoremap :call NumberToggle() +nmap n :call NumberToggle() From 4945c1a632a4224abcab72bcfbcc5fd318d3610d Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 14:52:38 -0500 Subject: [PATCH 10/39] remake prompt to display virtual environment information --- zsh/.zshrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index fd946d3..b674186 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -72,9 +72,17 @@ vcs_info_wrapper() { echo "%{$fg[grey]%}${vcs_info_msg_0_}%{$reset_color%}$del" fi } + +venv_info_wrapper() { + if [ -n "$VIRTUAL_ENV" ]; then + _virtualenv_path=(${(s:/:)VIRTUAL_ENV}) + echo "($_virtualenv_path[-1])" + fi +} + +PROMPT='$(venv_info_wrapper)%F{6}${${(%):-%~}//\///}%f %F{9}❯%F{3}❯%F{2}❯%F{242} ' RPROMPT=$'$(vcs_info_wrapper)' -# cd . -# + function colours() { for i in {0..255} ; do printf "\x1b[38;5;${i}mcolour${i}\n" From f663dc2d56cf46aa1279329805b377b83ae5f6de Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 16:37:23 -0500 Subject: [PATCH 11/39] add better directory display --- zsh/.zshrc | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index b674186..d5212ac 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -75,12 +75,48 @@ vcs_info_wrapper() { venv_info_wrapper() { if [ -n "$VIRTUAL_ENV" ]; then + local _virtualenv_path _virtualenv_path=(${(s:/:)VIRTUAL_ENV}) echo "($_virtualenv_path[-1])" fi } -PROMPT='$(venv_info_wrapper)%F{6}${${(%):-%~}//\///}%f %F{9}❯%F{3}❯%F{2}❯%F{242} ' +dir_info_wrapper() { + local _cwd + local _dir + local _path + local _dirs + local _under_home + local _path_pieces + _path_pieces=() + _under_home=false + _cwd="$(pwd)" + + if [[ "$_cwd" =~ ^"$HOME"(/|$) ]]; then + _cwd="~${$(pwd)#$HOME}" + _under_home=true + fi + + _dirs=(${(s:/:)_cwd}) + + for _dir in $_dirs; do + _path_pieces+="$_dir[1]" + done + + _path_pieces[-1]=$_dirs[-1] + + for _piece in $_path_pieces; do + _path+="/$_piece" + done + + if [[ _under_home ]]; then + _path[1]="" + fi + + echo "$_path" +} + +PROMPT='$(venv_info_wrapper)%F{6}$(dir_info_wrapper)%f %F{9}❯%F{3}❯%F{2}❯%f ' RPROMPT=$'$(vcs_info_wrapper)' function colours() { From 59ade0ed9c1e4e561363d75feac81d2922d7ba9d Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 16:47:28 -0500 Subject: [PATCH 12/39] add space --- zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index d5212ac..6eb91d6 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -77,7 +77,7 @@ venv_info_wrapper() { if [ -n "$VIRTUAL_ENV" ]; then local _virtualenv_path _virtualenv_path=(${(s:/:)VIRTUAL_ENV}) - echo "($_virtualenv_path[-1])" + echo "($_virtualenv_path[-1]) " fi } From 871394cae3e109f64835cd71d00426a41392dd0a Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 16:54:55 -0500 Subject: [PATCH 13/39] never mind no space --- zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 6eb91d6..d5212ac 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -77,7 +77,7 @@ venv_info_wrapper() { if [ -n "$VIRTUAL_ENV" ]; then local _virtualenv_path _virtualenv_path=(${(s:/:)VIRTUAL_ENV}) - echo "($_virtualenv_path[-1]) " + echo "($_virtualenv_path[-1])" fi } From c669f859d0263d0d291dc7f88a12d66794eac200 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 17:12:10 -0500 Subject: [PATCH 14/39] make the current line have the correct number --- vim/.vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/.vimrc b/vim/.vimrc index b18c5f9..05baacb 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -401,6 +401,7 @@ if has('gui_running') endif set relativenumber +set number function! NumberToggle() if(&relativenumber == 1) set norelativenumber From 7c709286ca35159241873dce29424ab3037489b7 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 21 Dec 2015 17:12:32 -0500 Subject: [PATCH 15/39] fix some edge cases --- zsh/.zshrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index d5212ac..f7a2997 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -109,7 +109,11 @@ dir_info_wrapper() { _path+="/$_piece" done - if [[ _under_home ]]; then + if [ "$_path" = "" ]; then + _path='/' + fi + + if [ "$_under_home" = true ]; then _path[1]="" fi From a508e1cb860ff30e6feb73c974009b1e6d0a9d01 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 19 Jan 2016 22:07:58 -0500 Subject: [PATCH 16/39] Remove reattach to user namespace stuff (I'm not on OSX) --- tmux/.tmux.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index ec342f9..3afc8cf 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -157,10 +157,10 @@ bind tab choose-window # Setup 'v' to begin selection as in Vim bind-key -t vi-copy v begin-selection -bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" +# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" # Make vim yanking work with OSX system clipboard -set-option -g default-command "reattach-to-user-namespace -l zsh" +# set-option -g default-command "reattach-to-user-namespace -l zsh" # Remove lag from esc + key -> alt code # IE make neovim usable From 6dab77ebf9014a005d4e0a2e4528968c11486bb8 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 19 Jan 2016 22:08:18 -0500 Subject: [PATCH 17/39] remove all brew references (I'm not on OSX) --- zsh/.zshrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index f7a2997..b52d2dc 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -38,12 +38,12 @@ compinit cd . # fortune -o -s -n 300 | cowsay -f dragon-and-cow | lolcat -[[ -s $(brew --prefix)/etc/autojump.sh ]] && . $(brew --prefix)/etc/autojump.sh +# [[ -s $(brew --prefix)/etc/autojump.sh ]] && . $(brew --prefix)/etc/autojump.sh export WORKON_HOME=~/Envs -source /usr/local/bin/virtualenvwrapper.sh -source /usr/local/opt/autoenv/activate.sh +# source /usr/local/bin/virtualenvwrapper.sh +# source /usr/local/opt/autoenv/activate.sh pyclean () { ZSH_PYCLEAN_PLACES=${*:-'.'} @@ -136,8 +136,8 @@ export PATH=$PATH:~/.bin # Go Lang things export GOPATH=$HOME/Go export PATH=$PATH:$GOPATH/bin -export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6) -export GOROOT=$(brew --prefix)/Cellar/go/$GOVERSION/libexec +# export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6) +# export GOROOT=$(brew --prefix)/Cellar/go/$GOVERSION/libexec export EDITOR=vim # Screw nano From 0ec41cbe50d8c9b119530d8016d5cc74ce604722 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 22 Jan 2016 11:20:41 -0500 Subject: [PATCH 18/39] make tmux go to mouse mode <2.1 --- tmux/.tmux.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 3afc8cf..06a583e 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -94,6 +94,8 @@ bind + select-layout main-horizontal # Toggle mouse on unbind m bind m \ + set -g mode mouse on + set -g mouse-select-pane on set-option -g -q mouse on \;\ bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" \;\ bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" \;\ From f916c2779826c34e0bced219e25c4d0d47a75441 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 22 Jan 2016 11:21:06 -0500 Subject: [PATCH 19/39] make yanks work on system clipboard --- vim/.vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/.vimrc b/vim/.vimrc index 05baacb..94bf96b 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -228,7 +228,7 @@ set encoding=utf-8 set autoindent set autoread " reload files when changed on disk, i.e. via `git checkout` set backupcopy=yes -set clipboard=unnamed " Make "yanks" work with system clipboard +set clipboard=unnamedplus set wildmenu wildmode=longest,list,full " Indents From f183a09ce9575b1a4e9a43027f76508097b29619 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 28 Jan 2016 12:01:54 -0500 Subject: [PATCH 20/39] Make copy paste to system clipboard work on fedora --- tmux/.tmux.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 06a583e..58474ec 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -159,9 +159,10 @@ bind tab choose-window # Setup 'v' to begin selection as in Vim bind-key -t vi-copy v begin-selection -# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" +bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard' -# Make vim yanking work with OSX system clipboard +# Uncomment for OSX compatibility +# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" # set-option -g default-command "reattach-to-user-namespace -l zsh" # Remove lag from esc + key -> alt code From a18a8145125795353a2138e1f07fd07a991a09b8 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 28 Jan 2016 12:02:31 -0500 Subject: [PATCH 21/39] neat window swap plugin --- vim/.vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index 94bf96b..d8f8118 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -8,6 +8,9 @@ autocmd bufwritepost .vimrc source $MYVIMRC """"" PLUGINS """"" call plug#begin() +" Window swap +Plug 'wesQ3/vim-windowswap' + " ESSENTIALS Plug 'fabianvf/pytest.vim' nmap tF :Pytest file verbose From 88a7d339707af988272ee35745607501de36979f Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 5 Feb 2016 14:10:08 -0500 Subject: [PATCH 22/39] puppet linting --- vim/.vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index d8f8118..037eb1c 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -11,6 +11,9 @@ call plug#begin() " Window swap Plug 'wesQ3/vim-windowswap' +"Puppet +Plug 'rodjek/vim-puppet' + " ESSENTIALS Plug 'fabianvf/pytest.vim' nmap tF :Pytest file verbose From 9462c2a32b9230fc481c58804586133f97375b76 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 5 Feb 2016 14:10:39 -0500 Subject: [PATCH 23/39] Lots of useful things (inc disabling caps lock) --- zsh/.zshrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index b52d2dc..1249985 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -3,6 +3,7 @@ export ZSH=$HOME/.dotfiles export ANSIBLE_NOCOWS=1 export PATH=$PATH:~/scripts:~/.cabal/bin +export SHELL='/usr/bin/zsh' export EDITOR='vim' export OSF=~/code/cos/osf.io export SCRAPI=~/code/cos/scrapi @@ -11,12 +12,17 @@ export PATH=$PATH:$GOPATH/bin export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python alias ansalon='telnet ansalonmud.net 8679' +# Disable caps lock +setxkbmap -option caps:none + source ~/dotfiles/tmux/tmuxinator.zsh +[[ -s /etc/profile.d/autojump.zsh ]] && source /etc/profile.d/autojump.zsh + alias g='git' +[[ `command -v vimx` ]] && alias vim='vimx' alias gssh='SSH_AUTH_SOCK=~/.gnupg/S.gpg-agent.ssh && ssh' alias c='clear' -alias query_share='curl -XPOST localhost:9200/share/_search\?pretty -d @query.json' alias mkpasswd='python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())"' # use .localrc for SUPER SECRET CRAP that you don't # want in your public, versioned repo. @@ -189,3 +195,10 @@ bindkey '^A' beginning-of-line if which ruby >/dev/null && which gem >/dev/null; then PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH" fi + +export VAGRANT_DEFAULT_PROVIDER=libvirt +unset GREP_OPTIONS +alias npm-exec='PATH=$(npm bin):$PATH' +alias go-exec='PATH=$GOPATH/bin:$PATH' + +setopt clobber From df15e592706c3d7c579ed4fa1113e6072c8cc578 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 8 Apr 2016 14:08:57 -0400 Subject: [PATCH 24/39] add support for vimx --- tmux/.tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 58474ec..d0ae887 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -114,7 +114,7 @@ bind-key v split-window -h -c "#{pane_current_path}" bind-key s split-window -v -c "#{pane_current_path}" # smart pane switching with awareness of vim splits -is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' +is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"' bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" From 54ffdecf6576ac5a17643072024bfafb8c50d365 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 8 Apr 2016 14:09:42 -0400 Subject: [PATCH 25/39] add some useful plugins, fix some ruby stuff --- vim/.vimrc | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 037eb1c..d45bc5e 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -8,6 +8,13 @@ autocmd bufwritepost .vimrc source $MYVIMRC """"" PLUGINS """"" call plug#begin() +" Nice note taking plugin +Plug 'xolox/vim-misc' +Plug 'xolox/vim-notes' +:let g:notes_directories = ['~/Documents/Notes'] +:let g:notes_suffix = '.txt' + + " Window swap Plug 'wesQ3/vim-windowswap' @@ -75,10 +82,11 @@ let NERDTreeIgnore = ['\.pyc$', '__pycache__'] Plug 'scrooloose/syntastic' nnoremap s :SyntasticCheck " NOTE: Don't use syntastic with python; we use khuno for that -let g:syntastic_mode_map = { 'mode': 'active', - \ 'active_filetypes': [], - \ 'passive_filetypes': [ 'html', 'rst', 'md', 'python'] } +" let g:syntastic_mode_map = { 'mode': 'active', +" \ 'active_filetypes': ['ruby'], +" \ 'passive_filetypes': [ 'html', 'rst', 'md', 'python'] } let g:syntastic_python_checkers = ['flake8', 'python'] +let g:syntastic_ruby_checkers = ['rubylint', 'mri'] " let g:syntastic_javascript_checkers = ['jsxhint', 'jshint'] " autocmd! BufEnter *.jsx let b:syntastic_checkers=['jsxhint'] " Disable some features to make syntastic faster @@ -251,7 +259,21 @@ set noerrorbells visualbell t_vb= set t_Co=256 " Must be 256 for many themes to display correctly " Favorites: hybrid iceberg Tomorrow hybrid-light -silent! colorscheme hybrid +silent! colorscheme iceberg +command! TransparencyToggle call TransparencyToggle() + +function! TransparencyToggle() + if exists("w:is_transparent") + unlet w:is_transparent + " TODO: Programmatically get ctermbg + exec "hi Normal ctermbg=234" + else + exec "hi Normal ctermbg=none" + let w:is_transparent = 1 + endif +endfunction + +nnoremap t :TransparencyToggle " May want to have different schemes for termvim vs gvim " if has('gui_running') " silent! colorscheme emacs @@ -341,7 +363,7 @@ set pastetoggle=z " toggle paste mode cnoremap w!! %!sudo tee > /dev/null % " select last pasted text nnoremap gp `[v`] -" Easy syntax switching +" Easy syntax switchin g nnoremap Tp :set ft=python nnoremap Tj :set ft=javascript nnoremap Tr :set ft=rst From 7fcba045ea8192c4906b065bd5ac447510df34b7 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 8 Apr 2016 14:10:55 -0400 Subject: [PATCH 26/39] add some useful aliases --- zsh/.zshrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 1249985..b4757ac 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -48,7 +48,9 @@ cd . export WORKON_HOME=~/Envs -# source /usr/local/bin/virtualenvwrapper.sh +if [[ -s "/usr/bin/virtualenvwrapper.sh" ]]; then + source /usr/bin/virtualenvwrapper.sh +fi # source /usr/local/opt/autoenv/activate.sh pyclean () { @@ -202,3 +204,7 @@ alias npm-exec='PATH=$(npm bin):$PATH' alias go-exec='PATH=$GOPATH/bin:$PATH' setopt clobber +alias rhciag='ag -l --silent --ignore fusor/fusor-ember-cli --ignore fusor/ui --ignore \*.po' +alias spotify-online='ssh -N -D localhost:1080 localhost' +alias keep-trying='while [ $? -ne 0 ] ; do sleep 2 && $(fc -ln -1) ; done' +alias please='sudo $(fc -ln -1)' From 31920b8600a6c1804367edf9287e69cbfe2d2b8e Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Wed, 25 May 2016 14:04:49 -0400 Subject: [PATCH 27/39] Add some more handy aliases --- zsh/.zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zsh/.zshrc b/zsh/.zshrc index b4757ac..c73a1f3 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -208,3 +208,6 @@ alias rhciag='ag -l --silent --ignore fusor/fusor-ember-cli --ignore fusor/ui -- alias spotify-online='ssh -N -D localhost:1080 localhost' alias keep-trying='while [ $? -ne 0 ] ; do sleep 2 && $(fc -ln -1) ; done' alias please='sudo $(fc -ln -1)' +alias yum='sudo dnf' +alias sssh='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' +alias sscp='scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' From abce038bc10a9eb83869d89ba60113307ae6dfb5 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Wed, 25 May 2016 14:05:16 -0400 Subject: [PATCH 28/39] Programmatically get BG colors, reset them for transparency toggle --- vim/.vimrc | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index d45bc5e..196b91a 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -265,10 +265,42 @@ command! TransparencyToggle call TransparencyToggle() function! TransparencyToggle() if exists("w:is_transparent") unlet w:is_transparent - " TODO: Programmatically get ctermbg - exec "hi Normal ctermbg=234" + exec "hi Normal ctermbg=" . w:normal_bg + exec "hi NonText ctermbg=" . w:nontext_bg + exec "hi CursorLine ctermbg=" . w:cursorline_bg + exec "hi CursorLineNr ctermbg=" . w:cursornr_bg + exec "hi LineNr ctermbg=" . w:linenr_bg + exec "hi GitGutterAdd ctermbg=" . w:gitgutteradd_bg + exec "hi GitGutterAdd ctermfg=" . w:gitgutteradd_fg + exec "hi GitGutterChange ctermbg=" . w:gitgutterchange_bg + exec "hi GitGutterChange ctermfg=" . w:gitgutterchange_fg + exec "hi GitGutterDelete ctermbg=" . w:gitgutterdelete_bg + exec "hi GitGutterDelete ctermfg=" . w:gitgutterdelete_fg + else + let w:normal_bg = synIDattr(synIDtrans(hlID('Normal')), 'bg') + let w:nontext_bg = synIDattr(synIDtrans(hlID('NonText')), 'bg') + let w:cursorline_bg = synIDattr(synIDtrans(hlID('CursorLine')), 'bg') + let w:cursornr_bg = synIDattr(synIDtrans(hlID('CursorLineNr')), 'bg') + let w:linenr_bg = synIDattr(synIDtrans(hlID('LineNr')), 'bg') + let w:gitgutteradd_bg = synIDattr(synIDtrans(hlID('GitGutterAdd')), 'bg') + let w:gitgutteradd_fg = synIDattr(synIDtrans(hlID('GitGutterAdd')), 'fg') + let w:gitgutterchange_bg = synIDattr(synIDtrans(hlID('GitGutterChange')), 'bg') + let w:gitgutterchange_fg = synIDattr(synIDtrans(hlID('GitGutterChange')), 'fg') + let w:gitgutterdelete_bg = synIDattr(synIDtrans(hlID('GitGutterDelete')), 'bg') + let w:gitgutterdelete_fg = synIDattr(synIDtrans(hlID('GitGutterDelete')), 'fg') + exec "hi Normal ctermbg=none" + exec "hi NonText ctermbg=none" + exec "hi CursorLine ctermbg=none" + exec "hi CursorLineNr ctermbg=none" + exec "hi LineNr ctermbg=none" + exec "hi GitGutterAdd ctermbg=none" + exec "hi GitGutterAdd ctermfg=" . w:gitgutteradd_fg + exec "hi GitGutterChange ctermbg=none" + exec "hi GitGutterChange ctermfg=" . w:gitgutterchange_fg + exec "hi GitGutterDelete ctermbg=none" + exec "hi GitGutterDelete ctermfg=" . w:gitgutterdelete_fg let w:is_transparent = 1 endif endfunction From bf9bc7170032b02fbfcf129828d99fbc3f1a6f48 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 7 Nov 2016 10:14:42 -0500 Subject: [PATCH 29/39] update mouse mode commands --- tmux/.tmux.conf | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index d0ae887..8af5c68 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -15,12 +15,12 @@ set -g default-terminal "screen-256color" # Use vim keybindings setw -g mode-keys vi set -g status-keys vi -setw -g utf8 on +# setw -g utf8 on # use mouse in copy mode -setw -g mode-mouse on +setw -g mouse on # status line -set -g status-utf8 on +# set -g status-utf8 on set -g status-justify left set -g status-bg colour2 set -g status-fg colour0 @@ -94,14 +94,16 @@ bind + select-layout main-horizontal # Toggle mouse on unbind m bind m \ - set -g mode mouse on - set -g mouse-select-pane on - set-option -g -q mouse on \;\ - bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" \;\ - bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" \;\ - bind-key -t vi-copy WheelUpPane halfpage-up \;\ - bind-key -t vi-copy WheelDownPane halfpage-down \;\ - display 'Mouse: ON' + set -g mouse on + # set -g set-clipboard off + # set -g mouse-utf8 on + # set -g select-pane on + # set-option -g -q mouse on \;\ + # bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" \;\ + # bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" \;\ + # bind-key -t vi-copy WheelUpPane halfpage-up \;\ + # bind-key -t vi-copy WheelDownPane halfpage-down \;\ + # display 'Mouse: ON' # Navigate panes ################ From e632743a8e758af7c671775209e0dd515abbf957 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 19 Jan 2017 11:34:25 -0500 Subject: [PATCH 30/39] add fasd and fasd aliases --- packages.txt | 1 + zsh/.zshrc | 47 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/packages.txt b/packages.txt index 0d24ad4..a1f6242 100644 --- a/packages.txt +++ b/packages.txt @@ -3,3 +3,4 @@ stow zsh tmux vim +fasd diff --git a/zsh/.zshrc b/zsh/.zshrc index c73a1f3..ccefe3f 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -16,7 +16,6 @@ alias ansalon='telnet ansalonmud.net 8679' setxkbmap -option caps:none source ~/dotfiles/tmux/tmuxinator.zsh -[[ -s /etc/profile.d/autojump.zsh ]] && source /etc/profile.d/autojump.zsh alias g='git' @@ -44,14 +43,12 @@ compinit cd . # fortune -o -s -n 300 | cowsay -f dragon-and-cow | lolcat -# [[ -s $(brew --prefix)/etc/autojump.sh ]] && . $(brew --prefix)/etc/autojump.sh export WORKON_HOME=~/Envs if [[ -s "/usr/bin/virtualenvwrapper.sh" ]]; then source /usr/bin/virtualenvwrapper.sh fi -# source /usr/local/opt/autoenv/activate.sh pyclean () { ZSH_PYCLEAN_PLACES=${*:-'.'} @@ -205,9 +202,51 @@ alias go-exec='PATH=$GOPATH/bin:$PATH' setopt clobber alias rhciag='ag -l --silent --ignore fusor/fusor-ember-cli --ignore fusor/ui --ignore \*.po' -alias spotify-online='ssh -N -D localhost:1080 localhost' +alias spotify-online='ssh -f -N -D localhost:1080 localhost' alias keep-trying='while [ $? -ne 0 ] ; do sleep 2 && $(fc -ln -1) ; done' alias please='sudo $(fc -ln -1)' alias yum='sudo dnf' alias sssh='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' alias sscp='scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' + +function make_nfs_share { + _path="/nfs_data/$1" + if [ -d "$_path" ] + then + echo "$_path already exists" + grep -q -e "$_path \*(rw)" /etc/exports || (echo "$_path *(rw)" | sudo tee -a /etc/exports) + # skip + else + sudo mkdir -p $_path + sudo chmod -R +755 $_path + sudo chown -R 36:36 $_path + grep -q -e "$_path \*(rw)" /etc/exports || (echo "$_path *(rw)" | sudo tee -a /etc/exports) + echo "$_path share created" + fi + sudo exportfs -ra +} + +if [[ -s "$(which activate.sh)" ]]; then + source $(which activate.sh) +fi + +# added by travis gem +[ -f /home/fabian/.travis/travis.sh ] && source /home/fabian/.travis/travis.sh + +export NVM_DIR="/home/fabian/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm + +# FASD configuration +eval "$(fasd --init auto)" +# Aliases: +alias a='fasd -a' # any +alias s='fasd -si' # show / search / select +alias d='fasd -d' # directory +alias f='fasd -f' # file +alias sd='fasd -sid' # interactive directory selection +alias sf='fasd -sif' # interactive file selection +alias z='fasd_cd -d' # cd, same functionality as j in autojump +alias j='fasd_cd -d' # cd, same functionality as j in autojump +alias zz='fasd_cd -d -i' # cd with interactive selection +alias v='f -t -e vim -b viminfo' # open file most recently edited in vim +alias vv='f -i -t -e vim' # open file in vim From 94800751f0252295b0f626fe186163c60d239aa4 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 19 Jan 2017 11:40:55 -0500 Subject: [PATCH 31/39] fix vimx check --- zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index ccefe3f..56fc216 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -19,7 +19,7 @@ source ~/dotfiles/tmux/tmuxinator.zsh alias g='git' -[[ `command -v vimx` ]] && alias vim='vimx' +command -v vimx >/dev/null 2>&1 && alias vim='vimx' alias gssh='SSH_AUTH_SOCK=~/.gnupg/S.gpg-agent.ssh && ssh' alias c='clear' alias mkpasswd='python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.encrypt(getpass.getpass())"' From 3b1ba5a277beda2929c83b5bfd55d4fc471ec249 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 2 Nov 2017 12:37:15 -0400 Subject: [PATCH 32/39] push latest --- git/.gitconfig | 2 +- vim/.vimrc | 6 ++++++ zsh/.zshrc | 12 +++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/git/.gitconfig b/git/.gitconfig index ae5184f..9882759 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -7,7 +7,7 @@ name = Fabian von Feilitzsch email = fabian@fabianism.us [credential] - helper = osxkeychain + helper = cache [alias] st = status co = checkout diff --git a/vim/.vimrc b/vim/.vimrc index 196b91a..25ed083 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -2,6 +2,7 @@ set nocompatible " be iMproved " Spacebar is a much better leader than \ or , let mapleader = "\" +set modifiable " Automatically source the vimrc file after saving it autocmd bufwritepost .vimrc source $MYVIMRC @@ -232,6 +233,11 @@ endfunction nnoremap :ScratchToggle +""" Go configuration +Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } +let g:go_fmt_command = "goimports" + + call plug#end() filetype plugin indent on diff --git a/zsh/.zshrc b/zsh/.zshrc index 56fc216..23b0f96 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -12,8 +12,12 @@ export PATH=$PATH:$GOPATH/bin export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python alias ansalon='telnet ansalonmud.net 8679' + +# typeset -U fpath +fpath=(~/.zsh/oc $fpath) + # Disable caps lock -setxkbmap -option caps:none +# setxkbmap -option caps:swapescape source ~/dotfiles/tmux/tmuxinator.zsh @@ -250,3 +254,9 @@ alias j='fasd_cd -d' # cd, same functionality as j in autojump alias zz='fasd_cd -d -i' # cd with interactive selection alias v='f -t -e vim -b viminfo' # open file most recently edited in vim alias vv='f -i -t -e vim' # open file in vim +alias todo='todo -G' +export GOBIN=/home/fabian/Go/bin +export GOROOT=/usr/local/go +export PATH=$PATH:$GOROOT/bin + +# source ~/.screen_layout/default.sh From 161a6720b24b819dff4af69538f447eed3c72725 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 2 Nov 2017 12:46:02 -0400 Subject: [PATCH 33/39] fix activate.sh check --- zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 23b0f96..366ef12 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -230,7 +230,7 @@ function make_nfs_share { sudo exportfs -ra } -if [[ -s "$(which activate.sh)" ]]; then +if [[ -s "$(command -v activate.sh)" ]]; then source $(which activate.sh) fi From e1895a8a4250a1884313c44cc08b77eb311d3efc Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 2 Jul 2018 15:46:49 -0400 Subject: [PATCH 34/39] add tpm --- .gitmodules | 3 +++ tmux/.tmux.conf | 8 ++++++++ tmux/.tmux/plugins/tpm | 1 + 3 files changed, 12 insertions(+) create mode 160000 tmux/.tmux/plugins/tpm diff --git a/.gitmodules b/.gitmodules index 29b68b9..795adb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "vim/.vim/autoload"] path = vim/.vim/autoload url = https://github.com/junegunn/vim-plug +[submodule "tmux/.tmux/plugins/tpm"] + path = tmux/.tmux/plugins/tpm + url = https://github.com/tmux-plugins/tpm diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 8af5c68..2c49c45 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -170,3 +170,11 @@ bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard' # Remove lag from esc + key -> alt code # IE make neovim usable set -sg escape-time 0 + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/tmux/.tmux/plugins/tpm b/tmux/.tmux/plugins/tpm new file mode 160000 index 0000000..95f7833 --- /dev/null +++ b/tmux/.tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 95f78336c3972f3e6648b7b3db754f2224320a5e From fcdfc68da65edbab9a2c69b845155bc293ce0f0f Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Wed, 12 Jun 2019 12:10:54 -0400 Subject: [PATCH 35/39] autosave session --- tmux/.tmux.conf | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 2c49c45..f306c62 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -156,16 +156,9 @@ bind C-q confirm kill-server bind tab choose-window -# Make copy-n-paste work on OSX -############################### - # Setup 'v' to begin selection as in Vim -bind-key -t vi-copy v begin-selection -bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard' - -# Uncomment for OSX compatibility -# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" -# set-option -g default-command "reattach-to-user-namespace -l zsh" +bind-key -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' # Remove lag from esc + key -> alt code # IE make neovim usable @@ -175,6 +168,12 @@ set -sg escape-time 0 set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' + +# Resurrect/Continuum options +set -g @resurrect-capture-pane-contents 'on' +set -g @continuum-boot 'on' +set -g @continuum-restore 'on' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' From ffd942499302c958baad420abc20bb774dbc9591 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Wed, 12 Jun 2019 12:12:06 -0400 Subject: [PATCH 36/39] make vim work better in tmux --- vim/.vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vim/.vimrc b/vim/.vimrc index 25ed083..dffc2c0 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -79,6 +79,7 @@ let g:NERDTreeMouseMode = 3 let g:NERDTreeRespectWildIgnore = 1 let NERDTreeIgnore = ['\.pyc$', '__pycache__'] +Plug 'tpope/vim-obsession' Plug 'scrooloose/syntastic' nnoremap s :SyntasticCheck @@ -343,7 +344,8 @@ set wildignore+=*.swp,*~,._* set wildignore+=*.pyc,*__pycache__* " Enable basic mouse behavior such as resizing buffers. set mouse=a mousemodel=popup " Right-click pops up a menu -if exists('$TMUX') " Support resizing in tmux + +if exists('$TMUX') && !has('nvim') " Support resizing in tmux set ttymouse=xterm2 endif From 68a3945bc3267f9a3d9efdad32ef602b78cba3d3 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Wed, 12 Jun 2019 12:14:23 -0400 Subject: [PATCH 37/39] Add spotify commands + oc completions --- zsh/.zshrc | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 366ef12..78ff516 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -2,7 +2,7 @@ # shortcut to this dotfiles path is $ZSH export ZSH=$HOME/.dotfiles export ANSIBLE_NOCOWS=1 -export PATH=$PATH:~/scripts:~/.cabal/bin +export PATH=$PATH:~/scripts:~/.cabal/bin:~/bin export SHELL='/usr/bin/zsh' export EDITOR='vim' export OSF=~/code/cos/osf.io @@ -206,13 +206,68 @@ alias go-exec='PATH=$GOPATH/bin:$PATH' setopt clobber alias rhciag='ag -l --silent --ignore fusor/fusor-ember-cli --ignore fusor/ui --ignore \*.po' -alias spotify-online='ssh -f -N -D localhost:1080 localhost' alias keep-trying='while [ $? -ne 0 ] ; do sleep 2 && $(fc -ln -1) ; done' +alias try-forever='while [ true ] ; do sleep 2 && $(fc -ln -1) ; done' alias please='sudo $(fc -ln -1)' alias yum='sudo dnf' alias sssh='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' alias sscp='scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' +function kill-spotify { + local _processes=$(ps aux | grep com.spotify.Client | grep -v grep | awk '{print $2}') + while read -r _process; do + if [[ ! -z "${_process}" ]]; then + echo "Killing Spotify process (pid ${_process})" + while ((kill ${_process}) > /dev/null 2>&1); do + echo "Waiting for pid ${_process} to die..." + sleep 1 + done + fi + done <<< "${_processes}" +} + +function start-spotify { + local _processes=$(ps aux | grep com.spotify.Client | grep -v grep | awk '{print $2}') + if [[ ! -z "${_processes}" ]]; then + echo "Spotify is already running" + else + echo "Starting Spotify" + flatpak run com.spotify.Client > /var/log/spotify-script.log 2>&1 + fi +} + +function spotify { + local state=${1:-online} + local _proxy_pid="$(ps aux | grep 'ssh -f -N -D 0.0.0.0:1080 localhost' | grep -v grep | awk '{print $2}')" + case "${state}" in + "online") + if [[ -z "${_proxy_pid}" ]]; then + echo "Starting local socks proxy for Spotify" + ssh -f -N -D 0.0.0.0:1080 localhost + kill-spotify + fi + start-spotify + ;; + "offline") + if [[ ! -z "${_proxy_pid}" ]]; then + echo "Killing local socks proxy for Spotify running on pid ${_proxy_pid}" + kill ${_proxy_pid} + fi + start-spotify + ;; + "stop") + if [[ ! -z "${_proxy_pid}" ]]; then + echo "Killing local socks proxy for Spotify running on pid ${_proxy_pid}" + kill ${_proxy_pid} + fi + kill-spotify + ;; + "--help") + echo "USAGE: spotify online|offline|stop" + ;; + esac +} + function make_nfs_share { _path="/nfs_data/$1" if [ -d "$_path" ] @@ -259,4 +314,6 @@ export GOBIN=/home/fabian/Go/bin export GOROOT=/usr/local/go export PATH=$PATH:$GOROOT/bin -# source ~/.screen_layout/default.sh +if [[ -s "$(command -v oc)" ]]; then + source <(oc completion zsh) +fi From b1a4ac8bfe69a3d747532b1f5745fa34452d37c8 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Fri, 31 Jul 2020 15:20:32 -0400 Subject: [PATCH 38/39] add some helpful functions --- vim/.vimrc | 8 ++++---- zsh/.zshrc | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index dffc2c0..d9d2cdb 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -151,10 +151,10 @@ nnoremap :Scratch:set ft=python Plug 'airblade/vim-gitgutter' " Set gitgutter's bindings manually to avoid clashes let g:gitgutter_map_keys = 0 -nmap gh GitGutterStageHunk -nmap gH GitGutterRevertHunk -nmap [h GitGutterPrevHunk -nmap ]h GitGutterNextHunk +nmap gh (GitGutterStageHunk) +nmap gH (GitGutterRevertHunk) +nmap [h (GitGutterPrevHunk) +nmap ]h (GitGutterNextHunk) Plug 'tpope/vim-fugitive' map gs :Gstatus map gb :Gblame diff --git a/zsh/.zshrc b/zsh/.zshrc index 78ff516..877689a 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -50,8 +50,9 @@ cd . export WORKON_HOME=~/Envs -if [[ -s "/usr/bin/virtualenvwrapper.sh" ]]; then - source /usr/bin/virtualenvwrapper.sh +_virtualenvwrapper_script=$(command -v virtualenvwrapper.sh) +if [[ "$?" = 0 ]]; then + source ${_virtualenvwrapper_script} fi pyclean () { @@ -196,7 +197,7 @@ bindkey '^E' end-of-line bindkey '^A' beginning-of-line if which ruby >/dev/null && which gem >/dev/null; then - PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH" + PATH="$(ruby -rrubygems -e 'puts Gem.user_dir')/bin:$PATH" fi export VAGRANT_DEFAULT_PROVIDER=libvirt @@ -206,9 +207,9 @@ alias go-exec='PATH=$GOPATH/bin:$PATH' setopt clobber alias rhciag='ag -l --silent --ignore fusor/fusor-ember-cli --ignore fusor/ui --ignore \*.po' -alias keep-trying='while [ $? -ne 0 ] ; do sleep 2 && $(fc -ln -1) ; done' -alias try-forever='while [ true ] ; do sleep 2 && $(fc -ln -1) ; done' -alias please='sudo $(fc -ln -1)' +alias keep-trying='while [ $? -ne 0 ] ; do sleep 2 && bash -c "$(fc -ln -1)" ; done' +alias try-forever='while [ true ] ; do sleep 2 && bash -c "$(fc -ln -1)" ; done' +alias please='sudo bash -c "$(fc -ln -1)"' alias yum='sudo dnf' alias sssh='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' alias sscp='scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' @@ -317,3 +318,9 @@ export PATH=$PATH:$GOROOT/bin if [[ -s "$(command -v oc)" ]]; then source <(oc completion zsh) fi + +alias pbcopy='xclip -selection clipboard' +function kubesecret { + secret_name="${1}" + kubectl get secret ${secret_name} -o go-template='{{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}' +} From fc9966d9a1dd423e36e1596d6ae5f16366b4ac9f Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 17 Sep 2020 12:52:03 -0400 Subject: [PATCH 39/39] Fix tmux in fedora 3x --- tmux/.tmux.conf | 4 ++-- tmux/.tmux/plugins/tpm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index f306c62..5ec7c9f 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -29,8 +29,8 @@ set -g status-interval 2 set -g status-left-length 32 set -g status-right-length 150 -set -g pane-border-fg colour255 -set -g pane-active-border-fg colour2 +# set -g pane-border-fg colour255 +# set -g pane-active-border-fg colour2 set -g status-right "#(date +\"%c\")" set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(hostname -s) #[fg=colour238,bg=colour2,nobold]⮀' diff --git a/tmux/.tmux/plugins/tpm b/tmux/.tmux/plugins/tpm index 95f7833..59f7885 160000 --- a/tmux/.tmux/plugins/tpm +++ b/tmux/.tmux/plugins/tpm @@ -1 +1 @@ -Subproject commit 95f78336c3972f3e6648b7b3db754f2224320a5e +Subproject commit 59f78857f656afd462d7bc99b31cc8cc36c1872c