Skip to content

Instantly share code, notes, and snippets.

@mohitmun
Last active March 28, 2025 16:44
Show Gist options
  • Select an option

  • Save mohitmun/963f95aaf61d50e512511ac4eb097e50 to your computer and use it in GitHub Desktop.

Select an option

Save mohitmun/963f95aaf61d50e512511ac4eb097e50 to your computer and use it in GitHub Desktop.
Art of command line, all things related to command line and dotfiles
# GistID:963f95aaf61d50e512511ac4eb097e50
function add_alias() {
if [[ -z $1 || -z $2 || $# -gt 2 ]]; then
echo usage:
echo "\t\$$0 ll 'ls -l'"
else
echo "alias $1='$2'" >> $ALIASFILE
echo "alias ADDED to $ALIASFILE"
alias $1="$2"
fi
}
alias ts='tmux -CC new-session -s'
alias ta='tmux -CC attach -t'
alias brew="brew -v"
alias mux=tmuxinator
alias zshrc="vi ~/.zshrc"
alias battrylogs="pmset -g log|grep -e ' Sleep ' -e ' Wake '"
alias gist_vimrc="gist -r 963f95aaf61d50e512511ac4eb097e50 .vimrc"
alias gist_zshrc="gist -r 963f95aaf61d50e512511ac4eb097e50 .zshrc"
alias gistdiffzshrc="gist_zshrc > ~/.zshrc.latest && vimdiff ~/.zshrc.latest ~/.zshrc"
alias gistdiffvimrc="gist_vimrc > ~/.vimrc.latest && vimdiff ~/.vimrc.latest ~/.vimrc"
alias rgl="rg -l" # show only files names
alias lss="ls -S" # sort by size
alias lst="ls -t" # recent first
alias lstr="ls -tr" # recent last
alias s="l -S" # sort by size
alias rmrf="rm -rf"
# https://github.com/mathiasbynens/dotfiles/blob/master/.aliases
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
alias stfu="osascript -e 'set volume output muted true'"
alias pumpitup="osascript -e 'set volume output volume 100'"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias tochromedata="cd ~/Library/Application\ Support/Google/Chrome/Default/"
alias dater="date -r" # timestamp to date
alias ts="date +'%s'" # date to timestamp
#alias cat=bat
alias vim=vi
alias cpr="cp -r"
alias kill9="kill -9"
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
alias sz='source ~/.zshrc'
alias cgd='config diff'
alias cgdca='cgd --cached'
alias cqc='config commit -m "quick commit"'
alias cqcp='cqc && config push'
alias cgcmsg='config commit -m'
alias cgst='config status'
alias cga='config add'
alias cgaa='config add -u'
alias cddesk='cd ~/Desktop'
# https://github.com/search?q=%22alias+-s%22+filename%3A.zshrc
alias -s gz='tar -xzvf'
alias -s tgz='tar -xzvf'
alias -s zip='unzip'
alias -s bz2='tar -xjvf'
alias -s php=vi
#alias -s py=vi
alias -s rb=vi
alias -s html=vi
alias tn='tmux -CC new -s'
alias aliasgrep='alias | grep '
alias npmig='npm install -g '
#https://gist.github.com/igrigorik/6666860
alias gh="open \`git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
alias ctig='GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.dotfiles tig'
alias time12='date +"%I:%M:%S %p"'
alias m='man'
alias chmodx='chmod +x'
alias watch='watch '
alias mansearch='man -wK '
alias tg='~/telegram-send/telegram_send.py'
alias tgf='tg -f'
alias chx='chmod +x'
alias top5='ps -Ao pid,pcpu,comm -r | head -n 6'
alias cqac='cgaa && cqc'
alias crdiff='config fetch origin master:master_remote && config diff master_remote..master'
#https://github.com/xero/dotfiles/blob/master/zsh/.zsh/colored-man-pages.zsh
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;38;5;74m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[38;33;246m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[04;38;5;146m'
# yes, there is thing called curlrc
# update later 8 hours, ok never use it. it fuckedup other programs using curl
# GistID:963f95aaf61d50e512511ac4eb097e50
# global gitignore
# https://stackoverflow.com/a/40043793/2577465
# git config --global core.excludesfile ~/.gitignore
cscope*
.plan
.DS_Store
tags
.session.vim
#!/usr/bin/env zsh
#~/.spotify.zsh
autoload -Uz myspotify && myspotify
pid=$(< ~/.global_worker.pid)
#state=[[ -n $pid ]] && ps -p $pid > /dev/null
if [[ -n $pid ]] && ps -p $pid > /dev/null
then
echo "$pid is running"
# Do something knowing the pid exists, i.e. the process with $PID is running
else
echo $$ > ~/.global_worker.pid
while true;do
sleep 3
~/.spotify.osascript > ~/.export_osascript_system_status
#volume_level=`osascript -e "output volume of (get volume settings)"`
done
fi
# GistID:963f95aaf61d50e512511ac4eb097e50
# https://github.com/BurntSushi/ripgrep/issues/673
cscope.out
build/*
bin/*
require 'irb/completion'
require 'irb/ext/save-history'
#History configuration
IRB.conf[:SAVE_HISTORY] = 100000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
#!/usr/bin/env bash
for parameter in "$@"
do
if [ "$parameter" == '--help' ]
then
echo "Proxy server. Usage: ./proxy.sh [listening_port]"
exit
fi
done
if [ $# -ne 1 ]
then
port=1234
else
port=$1
fi
mkfifo response_fifo request_fifo request_fifo_copy
( cat < response_fifo | nc -k -l $port | tee request_log | tee request_fifo_copy | tee request_fifo ) &
pid=$!
(
echo started_resing
while read s; do
echo "inside while s"
host=`echo $s | grep "Host: " | tr -d '\r' | sed "s/Host: //"`
echo "inside after host read $host s"
if [[ "$host" != "" ]]
then
echo "host is $host"
nc $host 80 < request_fifo | tee response_log | tee response_fifo
break
fi
done
) < request_fifo_copy
wait $pid
trap 'rm response_fifo request_fifo request_fifo_copy' EXIT
# all hail https://news.ycombinator.com/item?id=11071754
gcl --bare [email protected]:963f95aaf61d50e512511ac4eb097e50.git .dotfiles
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
config config status.showUntrackedFiles no
# set upstream
config push --set-upstream origin master
ln -s ~/.spotify.zsh /usr/local/share/zsh/site-functions/myspotify
#!/usr/bin/env osascript
# Returns the current playing song in Spotify for OSX
tell application "Spotify"
set spotify_info to ""
if it is running then
if player state is playing then
set track_name to name of current track
set artist_name to artist of current track
set albumname to album of current track
set duration_of_track to (duration of current track / 1000)
set position_of_track to player position
set durSec to (duration of current track / 1000) as text
set tM to (round (durSec / 60) rounding down) as text
if length of ((durSec mod 60 div 1) as text) is greater than 1 then
set tS to (durSec mod 60 div 1) as text
else
set tS to ("0" & (durSec mod 60 div 1)) as text
end if
set myTime to tM as text & ":" & tS as text
set pos to player position
set nM to (round (pos / 60) rounding down) as text
if length of ((round (pos mod 60) rounding down) as text) is greater than 1 then
set nS to (round (pos mod 60) rounding down) as text
else
set nS to ("0" & (round (pos mod 60) rounding down)) as text
end if
set nowAt to nM as text & ":" & nS as text
set percentage to ( position_of_track * 100 / duration_of_track)
#tell application "Spotify" to (duration of current track / 1000) as string'`;
#export spotify_position_raw=`osascript -e 'tell application "Spotify" to player position as string'`;
if artist_name > 0
# If the track has an artist set and is therefore most likely a song rather than an advert
set spotify_info to ("spotify_artist=" & artist_name & "\n" & "spotify_album=" & albumname & "\n" & "spotify_track=" & track_name & "\n" & "spotify_percent_progress=" & percentage & "\n" & "spotify_position=" & nowAt & "\n" & "spotify_duration=" & myTime)
else
# If the track doesn't have an artist set and is therefore most likely an advert rather than a song
end if
end if
end if
set vol to (output volume of (get volume settings))
#spotify_info & "\n" output volume of (get volume settings)
spotify_info & "\n" & "volume_level=" & vol
end tell
#!/usr/bin/env zsh
export-spotify-status () {
export spotify_state=`osascript -e 'tell application "Spotify" to player state as string'`;
export spotify_artist=`osascript -e 'tell application "Spotify" to artist of current track as string'`;
export spotify_album=`osascript -e 'tell application "Spotify" to album of current track as string'`;
export spotify_track=`osascript -e 'tell application "Spotify" to name of current track as string'`;
export spotify_duration=`osascript -e 'tell application "Spotify"
set durSec to (duration of current track / 1000) as text
set tM to (round (durSec / 60) rounding down) as text
if length of ((durSec mod 60 div 1) as text) is greater than 1 then
set tS to (durSec mod 60 div 1) as text
else
set tS to ("0" & (durSec mod 60 div 1)) as text
end if
set myTime to tM as text & ":" & tS as text
end tell
return myTime'`;
export spotify_position=`osascript -e 'tell application "Spotify"
set pos to player position
set nM to (round (pos / 60) rounding down) as text
if length of ((round (pos mod 60) rounding down) as text) is greater than 1 then
set nS to (round (pos mod 60) rounding down) as text
else
set nS to ("0" & (round (pos mod 60) rounding down)) as text
end if
set nowAt to nM as text & ":" & nS as text
end tell
return nowAt'`;
spotify_duration_raw=`osascript -e 'tell application "Spotify" to (duration of current track / 1000) as string'`;
export spotify_position_raw=`osascript -e 'tell application "Spotify" to player position as string'`;
export spotify_percent_progress=$(($spotify_position_raw * 100 / $spotify_duration_raw))
echo "$spotify_artist\n$spotify_album\n$spotify_track\n$spotify_percent_progress\n$spotify_position\n$spotify_duration" | tee ~/.debug_async
}
##tracks
#storm="spotify:track:1HfJV18PHF2UQqh4TuySBJ"
#
##playlists
#this_is_dmst="spotify:user:mohitmun:playlist:036d9YTeH4rzGIJTbylzPG"
#
#spotify_play(){
# osascript -e "tell application \"Spotify\" to play track \"$1\""
#}
#
#alias storm="spotify_play $storm"
myspotify(){
}
myspotify "$@"
#export-spotify-status
# GistID:963f95aaf61d50e512511ac4eb097e50
# https://blog.bugsnag.com/tmux-and-vim/
# Cheatsheets
# https://gist.github.com/henrik/1967800
# https://gist.github.com/MohamedAlaa/2961058
# Must have
# https://github.com/tmuxinator/tmuxinator
# Important links
# https://blogs.technet.microsoft.com/jessicadeen/linux/macos-ohmyzsh-tmux-vim-iterm2-powerlevel9k-badass-terminal/
# install tpm
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g default-terminal "xterm-256color"
#setw -g aggressive-resize on
set -g status-position bottom
set -g status-bg colour237
set -g status-fg colour137
set -g status-attr dim
set -g status-left '#[fg=colour197]#(~/.bin/internet_info.sh) #{tasks_status} '
set -g status-right '#[fg=colour81]♪ #(~/.bin/now_playing.sh) #(~/.bin/battery.sh) #[fg=colour255,bg=colour241,bold] %a %m-%d #[fg=colour255,bg=colour241,bold] %H:%M:%S #[fg=colour165]#[bg=default] #H '
set -g status-right-length 100
set -g status-left-length 70
#https://superuser.com/q/549930/630985
set-option -g mode-mouse on
set-option -g mouse-resize-pane on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set-option -g default-command "reattach-to-user-namespace -l zsh"
run '~/.tmux/plugins/tpm/tpm'
" GistID: 963f95aaf61d50e512511ac4eb097e50
"Constantly improve at vim
" http://vimgolf.com
" http://derekwyatt.org/vim/tutorials/advanced/
" https://statico.github.io/vim3.html
" https://www.reddit.com/r/vim/comments/8gmmk3/how_to_continue_to_improve_at_vim/
" https://stackoverflow.com/q/726894/2577465
"Why
" http://www.viemu.com/a-why-vi-vim.html
"Headstart
" https://github.com/mhinz/vim-galore
" https://github.com/bpierre/switch-to-vim-for-good
" http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/
" http://www.worldtimzone.com/res/vi.html
" https://danielmiessler.com/study/vim/
" http://learnvimscriptthehardway.stevelosh.com/
" https://github.com/learnbyexample/scripting_course/blob/master/Vim_curated_resources.md
"Tips
" http://nvie.com/posts/how-i-boosted-my-vim
"Refactoring in vim
" https://stackoverflow.com/a/8783131/2577465
"https://kev.town/2010/12/15/this-is-your-brain-on-vim/
"Term
" https://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/
" 1. Using vim-plug (https://junegunn.kr/2013/09/writing-my-own-vim-plugin-manager/
" https://sanctum.geek.nz/arabesque/buffers-windows-tabs/ (Buffers/windows/tabs)
"Vim as IDE http://vim.wikia.com/wiki/Use_Vim_like_an_IDE
"Key Learnings
" Read the fucking manual, :help is powerful
" Make life easier by vimrc
"vimrcs
" https://github.com/amix/vimrc
" https://github.com/nvie/vimrc/blob/master/vimrc
" https://github.com/garybernhardt/dotfiles/blob/master/.vimrc
" https://github.com/mhinz/dotfiles/blob/master/.vim/vimrc
" https://github.com/junegunn/dotfiles/blob/master/vimrc
"CheatSheets
" https://gist.github.com/0xadada/1ea7f96d108dcfbe75c9
" https://devhints.io/vim
" http://www.viemu.com/vi-vim-cheat-sheet.gif The ultimate vimrc https://github.com/amix/vimrc
" The ultimate vimrc https://github.com/amix/vimrc
" wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim and
" move it to ~/.vim/autoload and run :PlugInstall
" mkdir -p ~/.vim/undodir
" mkdir -p ~/.vim/backupdir
" mkdir -p ~/.vim/directory
"https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
silent !mkdir -p ~/.vim/undodir
silent !mkdir -p ~/.vim/backupdir
silent !mkdir -p ~/.vim/directory
endif
call plug#begin()
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
"Plug 'ctrlpvim/ctrlp.vim
"Plug 'Valloric/YouCompleteMe'
Plug 'terryma/vim-multiple-cursors' " https://medium.com/@schtoeffel/you-don-t-need-more-than-one-cursor-in-vim-2c44117d51db
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'Xuyuanp/nerdtree-git-plugin'
"Plug 'amix/vim-zenroom2'
" fugitive.vim: a Git wrapper so awesome, it should be illegal
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
"Plug 'w0rp/ale'
Plug 'mohitmun/gist-vim'
Plug 'mattn/webapi-vim' " dependancy for gist-vim
Plug 'vim-airline/vim-airline'
Plug 'airblade/vim-gitgutter'
Plug 'Chiel92/vim-autoformat'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align'
Plug 'scrooloose/nerdcommenter'
Plug 'yuttie/comfortable-motion.vim'
Plug 'sjl/gundo.vim'
" https://vi.stackexchange.com/a/8224/15805
"Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'suan/vim-instant-markdown'
"fucks up disable cut logic
"Plug 'maxbrunsfeld/vim-yankstack'
"Plug 'majutsushi/tagbar'
" slow downs cursor moment on large files
Plug 'Yggdroot/indentLine'
Plug '907th/vim-auto-save'
Plug 'machakann/vim-highlightedyank'
Plug 'Raimondi/delimitMate'
Plug 'elzr/vim-json'
"Plug 'google/vim-searchindex'
"removed this because its not compatible with is.vim
Plug 'osyo-manga/vim-anzu'
Plug 'simnalamburt/vim-mundo'
"Plug 'JamshedVesuna/vim-markdown-preview'
Plug 'benmills/vimux'
Plug 'haya14busa/is.vim'
Plug 'crusoexia/vim-monokai'
"Plug 'sickill/vim-monokai'
Plug 'haya14busa/vim-asterisk'
Plug 'pangloss/vim-javascript'
Plug 'brooth/far.vim'
Plug 'vim-ruby/vim-ruby'
Plug 'MattesGroeger/vim-bookmarks'
"Plug 'ervandew/supertab'
Plug 'easymotion/vim-easymotion'
"Plug 'svermeulen/vim-easyclip'
"Plug 'wellle/targets.vim'
" dependancy for vim-markdown
"Plug 'godlygeek/tabular'
"Plug 'plasticboy/vim-markdown'
Plug 'osyo-manga/vim-over'
Plug 'haya14busa/vim-edgemotion'
Plug 'dhruvasagar/vim-table-mode'
Plug 'RRethy/vim-illuminate', { 'on': 'IlluminationEnable' }
" TODO limit this for 3-4 chars
"Plug 'vim-scripts/AutoComplPop'
"Plug 'Shougo/deoplete.nvim'
"Plug 'roxma/nvim-yarp'
"Plug 'prabirshrestha/asyncomplete.vim'
"Plug 'roxma/vim-hug-neovim-rpc'
Plug 'maralla/completor.vim'
Plug 'ruanyl/vim-gh-line'
Plug 'danro/rename.vim'
"Plug 'SidOfc/mkdx'
call plug#end()
"source ~/.vim/cscope.vim
let g:deoplete#enable_at_startup = 1
syntax on
set number
set tabstop=2 shiftwidth=2 expandtab
set updatetime=100
let g:gitgutter_diff_base = 'HEAD'
autocmd BufWritePost * GitGutter
"Always show current position
set ruler
" Highlight search results
set hlsearch
set ignorecase
" Show matching brackets when text indicator is over them
set showmatch
"" Makes search act like search in modern browser
set incsearch
set hidden
set backspace=indent,eol,start
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
" If a file is changed outside of vim, automatically reload it without asking
set autoread
" Don't make backups at all
set nobackup
set nowritebackup
" Smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
"map <Left> <C-W>h
"map <Right> <C-W>l
" copied previous line word by word https://web.archive.org/web/20160429070600/http://vim.wikia.com/wiki/Duplicate_previous_line_word_by_word#
"nmap ,c @<Esc>kyWjP<BS>
" Mappings for moving lines up and down in all modes.
execute "set <M-j>=\ej"
execute "set <M-k>=\ek"
nnoremap <M-j> :m .+1<CR>==
nnoremap <M-k> :m .-2<CR>==
inoremap <M-j> <Esc>:m .+1<CR>==gi
inoremap <M-k> <Esc>:m .-2<CR>==gi
vnoremap <M-j> :m '>+1<CR>gv=gv
vnoremap <M-k> :m '<-2<CR>gv=gv
nmap ]h <Plug>GitGutterNextHunk
nmap [h <Plug>GitGutterPrevHunk
set mouse=a
" https://stackoverflow.com/a/5562707/2577465
map gn :bn<cr>
map gp :bp<cr>
map gb :Buffers<cr>
highlight DiffAdd cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red
" https://superuser.com/a/189198/630985
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <C-r><C-o>+
set foldmethod=indent
"set cursorline
" https://stackoverflow.com/a/360634/2577465
nnoremap <space> za
vnoremap <space> zf
let g:gist_get_multiplefile = 1
let g:gist_list_vsplit = 1
set nofoldenable " disable folding
set foldlevelstart=20
map <C-p> :FZF<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Nerd Tree
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let NERDTreeShowHidden=0
let NERDTreeIgnore = ['\.pyc$', '__pycache__']
let g:NERDTreeWinSize=35
map <leader>nn :NERDTreeToggle<cr>
map <leader>nb :NERDTreeFromBookmark<Space>
map <leader>nf :NERDTreeFind<cr>
map <leader>nt :NERDTreeFocus<cr>
" autocmd VimEnter * NERDTree
" Go to previous (last accessed) window.
autocmd VimEnter * wincmd p
"below command closes nerdtree if now files left
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"http://vim.wikia.com/wiki/Map_semicolon_to_colon
map ; :
"noremap ;; ;
"https://stackoverflow.com/questions/9051837/how-to-map-c-to-toggle-comments-in-vim?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa#comment11360335_9051932
nmap <C-_> <leader>c<Space>
vmap <C-_> <leader>c<Space>
imap <C-_> <Esc><leader>c<Space>li
"Not needed because of plugin
"map <silent> <Leader><Leader> :nohlsearch<cr>
"map <C-e> :noh<cr>
"http://vim.wikia.com/wiki/Avoid_the_escape_key
imap <leader>i <Esc>
" http://stevelosh.com/blog/2010/09/coming-home-to-vim/
set undofile
inoremap jj <ESC>
cmap jj <ESC>
vmap ii <ESC>
"https://medium.com/@Aenon/vim-swap-backup-undo-git-2bf353caa02f
set backupdir=~/.vim/backupdir//
set directory=~/.vim/directory//
set undodir=~/.vim/undodir//
set clipboard^=unnamed
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --no-heading --color=always '.shellescape(<q-args>), 1,
\ {'options': '--delimiter : --nth 2..'},
\ <bang>0)
function! s:ag_with_opts(arg, bang)
let tokens = split(a:arg)
let ag_opts = join(filter(copy(tokens), 'v:val =~ "^-"'))
let query = join(filter(copy(tokens), 'v:val !~ "^-"'))
echo ag_opts
echo query
call fzf#vim#ag(query, ag_opts, a:bang ? {} : {'down': '40%','options': '--delimiter : --nth 4..' })
endfunction
command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, {'options': '--delimiter : --nth 4..'}, <bang>0)
command! -bang -nargs=* Rag call fzf#vim#ag(<q-args>, {'options': '--delimiter : '}, <bang>0)
command! -nargs=* -bang CAg call s:ag_with_opts(<q-args>, <bang>0)
map <leader>f :Ag<CR>
map <C-f> :Ag<CR>
map swe :Ag <C-R><C-W><CR>
map swc :BLines <C-R><C-W><CR>
map <leader>/ :BLines <CR>
map <leader>ag :Rag<CR>
colorscheme monokai
" monokai with complete dark
hi Normal ctermfg=231 ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=#272822 gui=NONE
hi LineNr ctermfg=102 ctermbg=NONE cterm=NONE guifg=#90908a guibg=#3c3d37 gui=NONE
hi Search guibg=peru guifg=wheat
"nnoremap <leader>g :YcmCompleter GoTo<CR>
"nnoremap <leader>gd :YcmCompleter GoToDefinition<CR>
"nnoremap <leader>gc :YcmCompleter GoToDeclaration<CR>
"nnoremap <leader>gr :YcmCompleter GoToReferences<CR>
set completeopt-=preview
nnoremap <leader>ggs :GitGutterStageHunk<CR>
nnoremap <leader>ggsc :GitGutterStageHunk<CR>:!git commit -m "working"<CR>
nnoremap <leader>ggc :!git add %<CR>:!git commit -m "working" %<CR>
nnoremap <leader>ggd :!git diff %<CR>
nnoremap <leader>gdc :!git diff --cached %<CR>
nnoremap <leader>ggp :GitGutterPreviewHunk<CR>
nnoremap <leader>ggu :GitGutterUndoHunk<CR>
nnoremap <leader>gst :Gstatus<CR>
"https://shapeshed.com/vim-netrw/
"let g:netrw_banner = 0
"let g:netrw_liststyle = 3
"let g:netrw_browse_split = 4
"let g:netrw_altv = 1
"let g:netrw_winsize = 25
"augroup ProjectDrawer
"autocmd!
"autocmd VimEnter * :Vexplore
"augroup END
set history=1000 " Keep a bigger history of commands
" Fast editing and sourcing of `.vimrc`
nnoremap <leader>ev :e $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap <leader>ez :e ~/.zshrc<cr>
":au BufAdd,BufNewFile * nested tab sball
nnoremap <leader>za zR
nnoremap <C-j> <C-e>
nnoremap <C-k> <C-y>
"set iskeyword-=_
set ttimeoutlen=50
"set timeoutlen=500
let g:airline#extensions#tabline#enabled = 1
" close buffer when quitting
map <leader>q :bd<CR>
" understand below command
"autocmd CursorMoved * exe printf('match IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\'))
let g:ale_fixers = {
\ 'java': ['google_java_format'],
\}
map <leader>c :w !colordiff -u % -
"map <leader>h :exe printf('match IncSearch /\V\</Users/mohit/.vimrcs\>/', escape(expand('1'), '/\'))<CR>
autocmd CursorMoved * exe exists("HlUnderCursor")?HlUnderCursor?printf('match IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\')):'match none':""
let g:auto_save = 1
" BS because ctrl-R inserts ^M character
"vnoremap // y/\V<C-R>"<BS>
"http://vim.wikia.com/wiki/Search_for_visually_selected_text
vnoremap // y/\V<C-r>=escape(@",'/\')<CR>
"http://howivim.com/2016/salvatore-sanfilippo/
"vmap q <gv
"vmap <TAB> >gv
"https://github.com/bpierre/dotfiles/blob/master/vimrc
"nnoremap <C-n> i<CR><ESC>
cmap w!! w !sudo tee > /dev/null %
"https://stackoverflow.com/a/597932/2577465
nnoremap gr gd[{V%::s/<C-R>///gc<left><left><left>
"https://stackoverflow.com/a/8397808/2577465
map , \
map ,, <Leader><Leader>
"https://stackoverflow.com/a/30423919/2577465
nnoremap x "_x
nnoremap X "_X
nnoremap d "_d
nnoremap D "_D
vnoremap d "_d
nnoremap c "_c
nnoremap C "_C
vnoremap c "_c
set clipboard^=unnamed
nnoremap <leader>d "*d
nnoremap <leader>D "*D
vnoremap <leader>d "*d
let $FZF_DEFAULT_COMMAND = 'fd --type f'
map j gj
map k gk
"https://stackoverflow.com/questions/2744010/update-cscope-db-from-vim
map <leader>csr :!cscope -Rbq<CR>:cs reset<CR><CR>
"set hlsearch
"let g:incsearch#auto_nohlsearch = 1
""map / <Plug>(incsearch-nohl)
"map n <Plug>(incsearch-nohl-n)
"map N <Plug>(incsearch-nohl-N)
"map * <Plug>(incsearch-nohl-*)
"map # <Plug>(incsearch-nohl-#)
"map g* <Plug>(incsearch-nohl-g*)
"map g# <Plug>(incsearch-nohl-g#)
"augroup vimrc-incsearch-highlight
"autocmd!
"autocmd CmdlineEnter [/\?] :set hlsearch
"autocmd CmdlineLeave [/\?] :set nohlsearch
"augroup END
"map * <Plug>(asterisk-*)
"map # <Plug>(asterisk-#)
"map g* <Plug>(asterisk-g*)
"map g# <Plug>(asterisk-g#)
"map z* <Plug>(asterisk-z*)
"map gz* <Plug>(asterisk-gz*)
"map z# <Plug>(asterisk-z#)
"map gz# <Plug>(asterisk-gz#)
"let g:asterisk#keeppos = 1
"mmm * <Plug>(asterisk-z*)
"map # <Plug>(asterisk-z#)
"map g* <Plug>(asterisk-gz*)
"map g# <Plug>(asterisk-gz#)
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_SR = "\<Esc>]50;CursorShape=2\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
"autocmd InsertEnter * set cul
"autocmd InsertLeave * set nocul
autocmd FileType help wincmd L
" tmux knows the extended mouse mode
set ttymouse=xterm2
let g:gitgutter_map_keys = 0
map <leader>h :History<CR>
"https://stackoverflow.com/a/4740069/2577465
"http://vim.wikia.com/wiki/Use_Ctrl-O_instead_of_Esc_in_insert_mode_mappings
inoremap <C-h> <Left>
inoremap <C-l> <Right>
inoremap <expr> <C-k> ((pumvisible())?("\<C-p>"):("\<C-g>k"))
inoremap <expr> <C-j> ((pumvisible())?("\<C-n>"):("\<C-g>j"))
let g:airline#extensions#branch#enabled = 0
let g:airline#extensions#hunks#enabled = 0
"https://github.com/mrzool/dotfiles/blob/master/vim/.vimrc#L112
set dictionary=/usr/share/dict/words
" make Y behave like D and C
nnoremap Y y$
map <leader>jpp :%!jq '.'<CR>
set noeol
vnoremap > >gv
vnoremap < <gv
let g:fzf_history_dir = '~/.vim/fzf-history'
"https://github.com/ervandew/supertab/issues/53#issuecomment-9980930
"let g:SuperTabCrMapping = 0
"let g:SuperTabDefaultCompletionType = 'context'
"autocmd FileType *
"\ if &omnifunc != '' |
"\ call SuperTabChain(&omnifunc, '<c-p>') |
"\ endif
"https://stackoverflow.com/a/10525050/2577465
fu! SaveSess()
execute 'mksession! ' . getcwd() . '/.session.vim'
endfunction
fu! RestoreSess()
if filereadable(getcwd() . '/.session.vim')
execute 'so ' . getcwd() . '/.session.vim'
"if bufexists(1)
"for l in range(1, bufnr('$'))
"if bufwinnr(l) == -1
"exec 'sbuffer ' . l
"endif
"endfor
"endif
endif
endfunction
"autocmd VimLeave * call SaveSess()
"autocmd VimEnter * nested call RestoreSess()
set sessionoptions-=options
map \ss :call SaveSess()<CR>
map \rs :call RestoreSess()<CR>
" http://vim.wikia.com/wiki/Add_a_newline_after_given_patterns
" Insert a newline after each specified string (or before if use '!').
" If no arguments, use previous search.
command! -bang -nargs=* -range LineBreakAt <line1>,<line2>call LineBreakAt('<bang>', <f-args>)
function! LineBreakAt(bang, ...) range
let save_search = @/
if empty(a:bang)
let before = ''
let after = '\ze.'
let repl = '&\r'
else
let before = '.\zs'
let after = ''
let repl = '\r&'
endif
let pat_list = map(deepcopy(a:000), "escape(v:val, '/\\.*$^~[')")
let find = empty(pat_list) ? @/ : join(pat_list, '\|')
let find = before . '\%(' . find . '\)' . after
" Example: 10,20s/\%(arg1\|arg2\|arg3\)\ze./&\r/ge
execute a:firstline . ',' . a:lastline . 's/'. find . '/' . repl . '/ge'
let @/ = save_search
endfunction
"https://github.com/mitsuhiko/dotfiles/blob/master/vim/vimrc
"tab for brackets
nnoremap t %
vnoremap t %
"https://github.com/search?q=filename%3A.vimrc+matchpairs&type=Code
" <3 github <3 your search is awesome
set matchpairs+=<:>
"set matchpairs+=':'
"set matchpairs+=":"
vnoremap <tab> >gv
vnoremap <S-tab> <gv
"http://vim.wikia.com/wiki/Easy_indenting_in_insert_and_normal_mode_with_no_cursor_displacement
nnoremap <Tab> >>
nnoremap <S-Tab> <<
" fucks up with <CR>
let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_start_word_key = '<C-n>'
let g:multi_cursor_start_key = 'g<C-n>'
let g:multi_cursor_next_key = '<C-n>'
let g:multi_cursor_prev_key = '<C-p>'
let g:multi_cursor_skip_key = '<C-x>'
let g:multi_cursor_quit_key = '<Esc>'
"http://vim.wikia.com/wiki/Insert_newline_without_entering_insert_mode
" <S-CR> doesn't work in cli vim :(
execute "set <M-n>=\en"
nmap <M-n> o<Esc>
nmap <leader>id :IlluminationDisable<CR>
nmap <leader>ie :IlluminationEnable<CR>
"close preview and quickfix list
nmap <leader>pc :pclose<CR>:cclose<CR>
nmap <leader><leader>c :pclose<CR>:cclose<CR>
"imap <c-x><c-k> <plug>(fzf-complete-word)
"imap <c-x><c-f> <plug>(fzf-complete-path)
"imap <c-x><c-j> <plug>(fzf-complete-file-ag)
"imap <c-x><c-l> <plug>(fzf-complete-line)
nnoremap <Leader>u :MundoToggle<CR>
"let g:UltiSnipsExpandTrigger="<tab>"
"let g:UltiSnipsJumpForwardTrigger="<c-b>"
"let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" If you want :UltiSnipsEdit to split your window.
"let g:UltiSnipsEditSplit="vertical"
" remeber when i was debuging here doc and white space was fucking up
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
function! s:ag_in(...)
call fzf#vim#ag(join(a:000[1:], ' '), {'dir': a:1})
endfunction
command! -nargs=+ -complete=dir AgIn call s:ag_in(<f-args>)
nnoremap <silent> <C-d> :call comfortable_motion#flick(100)<CR>
nnoremap <silent> <C-u> :call comfortable_motion#flick(-100)<CR>
let g:comfortable_motion_no_default_key_mappings = 1
"https://stackoverflow.com/a/1722706/2577465
"map <C-f> g;
map <C-g> g;
"#TODO understand how omnicompletion works
function! Tab_Or_Complete() abort
" If completor is already open the `tab` cycles through suggested completions.
if pumvisible()
return "\<C-N>"
" If completor is not open and we are in the middle of typing a word then
" `tab` opens completor menu.
elseif col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-R>=completor#do('complete')\<CR>"
else
" If we aren't typing a word and we press `tab` simply do the normal `tab`
" action.
return "\<Tab>"
endif
endfunction
" Use `tab` key to select completions. Default is arrow keys.
" Use tab to trigger auto completion. Default suggests completions as you type.
"let g:completor_auto_trigger = 1
inoremap <expr> <Tab> Tab_Or_Complete()
map <C-a> ggVG
" delete blank lines
map <leader>dbl :g/^$/d<CR>:noh<CR>
" remove trailing space
map <leader>rts :%s/\s\+$//e<CR>
" unused keys
" shift - K, M
map K <Nop>
"https://github.com/bag-man/dotfiles/blob/master/vimrc#L59
map H ^
map L $
nnoremap M :Maps<CR>
nnoremap <leader>gf :GFiles?<CR>
nnoremap * *N
set viminfo+='1000
"https://github.com/sputtene/dotfiles/blob/79db8ab3b0586fb787fc59b42715dba786135c6d/.vimrc
"
set viminfo=
set viminfo+='1000 " max number of previous files for which the marks are remembered
set viminfo+=! " save and restore globals in all uppercase
"set viminfo+=% " save and restore buffer list
set viminfo+=/1000 " max number of search and substitute patterns to save
set viminfo+=:1000 " max number of command line items to save
set viminfo+=<100 " max number of lines for each register to save
set viminfo+=@100 " max number of input-line history to save
set viminfo+=f1 " store file marks ('0 to '9, 'A to 'Z)
set viminfo+=h " disable effect of hlsearch when loading viminfo
set viminfo+=s10 " max size of an item in Kb
"Vimnotes
"http://vim.wikia.com/wiki/Delete_all_lines_containing_a_pattern
" :g!/http/d deletes lines not containing http
"pain points
" vim multiple cursor is slow
" autocomplete when using vim
" writing markdown faster
" https://stackoverflow.com/a/6937075/2577465
" run command on selected text
" :'<,'>!ls `cat`
" #TODO explore
"https://stackoverflow.com/questions/2575545/vim-pipe-selected-text-to-shell-cmd-and-receive-output-on-vim-info-command-line
"https://stackoverflow.com/questions/6762531/execute-command-for-several-lines-in-vim
" #TODO how to replace timestamp with date in file
map <leader>aspl :!aspell -c % <CR>
map <leader>espl :setlocal spell<CR>
map <leader>dspl :setlocal nospell<CR>
autocmd FileType ruby map <C-b> :!ruby %<CR>
" TODO explore https://github.com/bag-man/dotfiles/blob/master/vimrc#L285
map <leader>sgc :%s/<C-R><C-W>//gc<Left><Left><Left>
# Install zsh-async if it’s not present
if [[ ! -a ~/.zsh-async ]]; then
git clone [email protected]:mafredri/zsh-async ~/.zsh-async
ln -s "$HOME/.zsh-async/async.zsh" /usr/local/share/zsh/site-functions/async
fi
# Initialize zsh-async
autoload -Uz async && async
# Start a worker that will report job completion
async_start_worker vagrant_prompt_worker -n
# Wrap vagrant status in a function, so we can pass in the working directory
# Define a function to process the result of the job
completed_callback() {
output=$@
#export spotify_track=$3
#IFS=$'\n' spotify_info=( "$3" )
IFS=$'\n' spotify_info=( $(echo "$3") )
export spotify_track=$spotify_info[1]
export spotify_album=$spotify_info[2]
export spotify_artist=$spotify_info[3]
export spotify_percent_progress=$spotify_info[4]
export spotify_position=$spotify_info[5]
export spotify_duration=$spotify_info[6]
}
# Register our callback function to run when the job completes
async_register_callback vagrant_prompt_worker completed_callback
# Start the job
#async_job vagrant_prompt_worker export-spotify-status $PWD
# GistID:963f95aaf61d50e512511ac4eb097e50
# vim: set ft=zsh:
export ZSH=~/.oh-my-zsh
plugins=(
git
sudo
tmuxinator
transfer
tmux
#vi-mode
copyfile
copydir
emoji-clock
encode64
lol
jsontools
z
)
ALIASFILE=~/.aliases.zsh
source $ZSH/oh-my-zsh.sh
. ~/.secret_common_sh_rc
. $ALIASFILE
. ~/.colored_man_pages.zsh
~/.global_worker.zsh > /dev/null &!
#. ~/.spotify.zsh
#autoload -Uz myspotify && myspotify
#. ~/.zsh-async.zsh
#if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export EDITOR=vim
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=500000 #How many lines of history to keep in memory
SAVEHIST=500000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
#
# ====================
# Get new tip from the art of command line repo everyday. can be use for different stuff also
#TAOCL_FILE=~/.taocl.md
#if [ ! -f $TAOCL_FILE ]; then
#echo "Getting TAOCL from github"
#\curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md -o $TAOCL_FILE
#fi
#sed '/cowsay[.]png/d' $TAOCL_FILE | pandoc -f markdown -t html | xmlstarlet fo --html --dropdtd | xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | xmlstarlet unesc | fmt -80 | iconv -t US | cowsay
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export HOMEBREW_NO_AUTO_UPDATE=1
export FZF_COMPLETION_TRIGGER=''
bindkey '^T' fzf-completion
bindkey '^I' $fzf_default_completion
# ==============================================
# ==============================================
# [email protected]:rupa/z.git
# Using inbuilt zsh 'z' plugin
#. ~/.cli-tools/z/z.sh
# Dotfiles to follow
# https://github.com/whiteinge/dotfiles/
# All about awesome-cli
# https://github.com/whiteinge/ok.sh Github client in bash
## https://github.com/agarrharr/awesome-cli-apps
# explore more on https://github.com/alebcay/awesome-shell
#
# A command-line todo list manager for people that want to finish tasks, not organize them
# https://github.com/sjl/t
#
#https://www.slideshare.net/jaguardesignstudio/why-zsh-is-cooler-than-your-shell-16194692
# Learning Command line
# * https://github.com/learnbyexample/Command-line-text-processing
# * https://github.com/jlevy/the-art-of-command-line
# * https://www.tldp.org/LDP/abs/html/contributed-scripts.html
# * https://www.tldp.org/LDP/abs/html/abs-guide.html
# * http://zsh.sourceforge.net/Guide/zshguide.html
# * https://github.com/dylanaraps/pure-bash-bible
#https://pthree.org/?s=zsh+prompt
#https://github.com/wilywampa/vimconfig/blob/b95caa50883438288729b6e8ff963783b110a3a5/dotfiles/.zshrc
#https://sgeb.io/posts/2014/04/zsh-zle-custom-widgets/
# Better searching in command mode
bindkey -M vicmd '?' history-incremental-search-backward
bindkey -M vicmd '/' history-incremental-search-forward
# Beginning search with arrow keys
bindkey "^[OA" up-line-or-beginning-search
bindkey "^[OB" down-line-or-beginning-search
bindkey -M vicmd "k" up-line-or-beginning-search
bindkey -M vicmd "j" down-line-or-beginning-search
bindkey "^j" down-line-or-beginning-search
bindkey "^k" up-line-or-beginning-search
eval $(thefuck --alias)
HEART='❤'
DOT=' ● '
SILENT_EMOJI="😶"
get_volume_indicator(){
export_osascript_system_status
volume_bar_count=$(( $volume_level / 10))
if [ $volume_level -eq 0 ]; then
echo -n "$SILENT_EMOJI"
else
printf "|%.0s" {0..$volume_bar_count}
fi
}
get_battery(){
battery_info=`pmset -g batt`
current_charge=$(echo $battery_info | grep -o '[0-9]\+%' | awk '{sub (/%/, "", $1); print $1}')
#if [[ $current_charge -lt 10 ]]; then
#echo -n "$FG[052]"
#elif [[ $current_charge -lt 30 ]]; then
#echo -n "$FG[058]"
#elif [[ $current_charge -lt 50 ]]; then
#echo -n "$FG[064]"
#elif [[ $current_charge -lt 70 ]]; then
#echo -n "$FG[070]"
#elif [[ $current_charge -lt 90 ]]; then
#echo -n "$FG[076]"
#else
#echo -n "$FG[082]"
#fi
echo -n "$HEART $current_charge "
}
export_osascript_system_status(){
for i in $(cat ~/.export_osascript_system_status ); do
export $i
done
}
get_spotify_widget(){
export_osascript_system_status
if [[ -n $spotify_track ]]; then
else
return
fi
local columns=$(($COLUMNS - 20))
echo -n $FG[241] $spotify_track
echo -n " - "
echo -n $spotify_artist
int=${spotify_percent_progress%.*}
spotify_percent_progress=$(( $int * $columns / 100 ))
#spotify_percent_progress=printf "%.0f\n" "$spotify_percent_progress"
echo " ($FG[241]$spotify_position/$FG[241]$spotify_duration)"
#echo -n $FG[076]
#printf "=%.0s" {0..$spotify_percent_progress}
#echo -n $reset_color
#remain=$(($columns - $spotify_percent_progress ))
#printf "=%.0s" {0..$remain}
#printf "|%.0s" {0..$spotify_percent_progress}
}
#TODO what is difference when using function keyword or not
function repeat_string(){
#printf "-%.0s" $COLUMNS
chus=$(( $1 - 4))
printf "$2%.0s" $(seq 1 $chus)
}
get_todo_status(){
#a=$(FORCE_COLOR=0 tb -l notes | tail -n2)
#echo $a
}
explain(){
response=$(w3m -dump "http://explainshell.com/explain?cmd="$(echo $@ | tr ' ' '+'))
\cat -s <(grep -v -e explainshell -e • -e □ -e "source manpages" <<< "$response")
}
push(){
adb -d push $1 /storage/emulated/0/
}
pull(){
adb -d pull /storage/emulated/0/$1
}
notify(){
osascript -e "display notification \"$2\" with title \"$1\""
}
ipaddress(){
curl ipinfo.io/ip
}
socktest(){
\curl ipinfo.io/ip --socks5-hostname $1
}
httptest(){
\curl ipinfo.io/ip -x $1
}
capture() {
sudo dtrace -p "$1" -qn '
syscall::write*:entry
/pid == $target && arg0 == 1/ {
printf("%s", copyinstr(arg1, arg2));
}
'
}
#===========================
# THEME START
#===========================
# af-magic.zsh-theme
# Repo: https://github.com/andyfleming/oh-my-zsh
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
# motivation: I forget if vim is running in bg https://news.ycombinator.com/item?id=17423100
# copied https://github.com/denysdovhan/spaceship-prompt/blob/40f52260840bff5ab24f014c62241fdb9be293c0/sections/jobs.zsh
jobs_prompt() {
local jobs_amount=$((jobs) | wc -l | tr -d " ")
[[ $jobs_amount -gt 0 ]] || return
echo "$FG[196]($jobs_amount job)"
}
get_tmux_session_name(){
if [ -n "$TMUX" ]; then
session_name=$(tmux display -p | cut -d '[' -f2 | cut -d ']' -f1)
echo -n "[mux:$session_name]"
fi
}
# primary prompt
if [ -n "$SSH_CLIENT" ]; then
S_TYPE="[ssh]"
else
S_TYPE=""
fi
S_TYPE=$S_TYPE$(get_tmux_session_name)
PROMPT='$FG[237]
$FG[237]$S_TYPE$FG[237]%~
$(get_todo_status)
$FG[237]$(repeat_string $COLUMNS '-')%{$reset_color%}
$FG[032]%c\
$(git_prompt_info) \
$(jobs_prompt)\
$FG[105]%(!.#.»)%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='${return_code}'
#PROMPT='$(bsl_set_status_line)hi>>>'
# color vars
eval my_gray='$FG[237]'
eval my_orange='$FG[214]'
# right prompt
# Inspiration for todo in right prompt https://wynnnetherland.com/journal/contextual-todo-list-counts-in-your-zsh-prompt/
#TODO figure async prompt to speed things up
#https://medium.com/@henrebotha/how-to-write-an-asynchronous-zsh-prompt-b53e81720d32
#TODO https://stackoverflow.com/a/6052267/2577465 use this cool technique
#TODO https://github.com/junegunn/fzf/wiki/Examples#google-chrome-os-xlinux
if type "virtualenv_prompt_info" > /dev/null
then
RPROMPT='$(virtualenv_prompt_info)$my_gray$(get_battery)$DOT$(get_volume_indicator)$DOT$(time12)%{$reset_color%}'
else
RPROMPT='$my_gray%~%{$reset_color%}%'
fi
# git settings
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
#===========================
# THEME END
#===========================
gencscopedb(){
CSCOPE_DIR="$PWD/cscope"
if [ ! -d "$CSCOPE_DIR" ]; then
mkdir "$CSCOPE_DIR"
fi
echo "Finding files ..."
find "$PWD" -name '*.[ch]' \
-o -name '*.java' \
-o -name '*properties' \
-o -name '*.cpp' \
-o -name '*.cc' \
-o -name '*.hpp' \
-o -name '*.py' \
-o -name '*.rb' \
-o -name '*.php' > "$CSCOPE_DIR/cscope.files"
echo "Adding files to cscope db: $PWD/cscope.db ..."
cscope -b -i "$CSCOPE_DIR/cscope.files" -f "$CSCOPE_DIR/cscope.out"
export CSCOPE_DB="$CSCOPE_DIR/cscope.out"
echo "Exported CSCOPE_DB to: '$CSCOPE_DB'"
}
# mkdir, and cd
function mcd() {
mkdir -p "$1" && cd "$1";
}
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
list_repo_containing_search(){
#TODO need to edit function
# == == == == == == == == == == == == == == == == == == == ==
# List repo by user
# curl -G 'https://api.github.com/users/mohitmun/repos?page=3&per_page=100'
# == == == == == == == == == == == == == == == == == == == ==
# List repo by org
# curl -G 'https://api.github.com/orgs/google/repos?page=3&per_page=100'
# == == == == == == == == == == == == == == == == == == == ==
# List repo info
# curl -G 'https://api.github.com/repo/username/reponame'
# == == == == == == == == == == == == == == == == == == == ==
for NUM in `seq 16`; do
curl "https://github.com/search?p=$GPAGE&q=my_query&type=Code" --compressed > github$GPAGE;
cat github$NUM | pup "#code_search_results > div.code-list a.text-bold text{}" >> searchlist;
done
uniq searchlist > searchlistuniq
while read repo;
do curl "https://api.github.com/repos/"$repo > `echo $repo | tr '/' '-'`
sleep 2
done < searchlistuniq
cat * | jq -r '[.full_name, .stargazers_count, .description] | @csv' > repos.csv
}
cht(){
curl cht.sh/$1
}
#https://github.com/paulmillr/dotfiles/blob/master/home/.zshrc.sh
#
# Load 8 cores at once.
function maxcpu() {
dn=/dev/null
yes > $dn & yes > $dn & yes > $dn & yes > $dn &
yes > $dn & yes > $dn & yes > $dn & yes > $dn &
}
# $ retry ping google.com
function retry() {
echo Retrying "$@"
$@
sleep 1
retry $@
}
# $ git log --no-merges --pretty=format:"%ae" | stats
# # => 514 [email protected]
# # => 200 [email protected]
function stats() {
sort | uniq -c | sort -r
}
# Shortcut for searching commands history.
# hist git
function hist() {
history | grep $@
}
# Monitor IO in real-time (open files etc).
function openfiles() {
sudo dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'
}
# Execute commands for each file in current directory.
function each() {
for dir in *; do
# echo "${dir}:"
cd $dir
$@
cd ..
done
}
# Find files and exec commands at them.
# $ find-exec .coffee cat | wc -l
# # => 9762
function find-exec() {
find . -type f -iname "*${1:-}*" -exec "${2:-file}" '{}' \;
}
# Better find(1)
function ff() {
find . -iname "*${1:-}*"
}
#
# Show current Finder directory.
#function finder {
#osascript 2>/dev/null <<EOF
#tell application "Finder"
#return POSIX path of (target of window 1 as alias)
#end tell
#EOF
#github.com/tj/burl
BURL_FILE=/usr/local/bin/burl
if [ ! -f $BURL_FILE ]; then
echo "Getting burl from github"
\curl -s https://raw.githubusercontent.com/tj/burl/master/bin/burl -o $BURL_FILE
chmod +x $BURL_FILE
fi
# chpwd(){
# ls
# }
curl_github(){
curl -u $GITHUB_USERNAME_SPAM:$GITHUB_PASSWORD_SPAM "https://api.github.com$1"
}
#TODO https://gist.github.com/phette23/5270658
#TODO https://superuser.com/questions/292652/change-iterm2-window-and-tab-titles-in-zsh/292660#292660
c() {
local cols sep google_history open
cols=$(( COLUMNS / 3 ))
sep='{::}'
if [ "$(uname)" = "Darwin" ]; then
google_history="$HOME/Library/Application Support/Google/Chrome/Default/History"
open=open
else
google_history="$HOME/.config/google-chrome/Default/History"
open=xdg-open
fi
cp -f "$google_history" /tmp/h
sqlite3 -separator $sep /tmp/h \
"select substr(title, 1, $cols), url
from urls order by last_visit_time desc" |
awk -F $sep '{printf "%-'$cols's \x1b[36m%s\x1b[m\n", $1, $2}' |
fzf --ansi --multi | sed 's#.*\(https*://\)#\1#' | xargs $open > /dev/null 2> /dev/null
}
zrc(){
vim ~/.zshrc
source ~/.zshrc
echo "Done: update zsh configure file."
}
#TODO https://github.com/zsh-users/zsh-autosuggestions
#TODO https://github.com/zsh-users/zsh-completions
#TODO https://github.com/ericfreese/zsh-prioritize-cwd-history
#TODO https://github.com/ericfreese/rat
#TODO https://github.com/ericfreese/zsh-cwd-history
#TODO https://github.com/larkery/zsh-histdb
#TODO what is precmd
google(){
search=""
echo "Googling: $@"
for term in $@; do
search="$search%20$term"
done
open "http://www.google.com/search?q=$search"
}
TMOUT=1
#https://github.com/robbyrussell/oh-my-zsh/issues/5910#issuecomment-294509017
TRAPALRM() {
if [[ $WIDGET != *"complete"* && $WIDGET != *"-search" ]]; then;
#async_job vagrant_prompt_worker export-spotify-status $PWD
zle reset-prompt
#bsl_set_status_line
#thanks https://github.com/wilywampa/vimconfig/blob/b95caa50883438288729b6e8ff963783b110a3a5/dotfiles/.zshrc#L1374
if [[ -n $BUFFER ]]; then
TMOUT=5
else
TMOUT=1
fi
#echo $BUFFER > ~/.debug_async
fi
}
NEWLINE=$'\n'
#https://superuser.com/a/1029103/630985
del-prompt-accept-line() {
OLD_PROMPT="$PROMPT"
OLD_RPROMPT="$RPROMPT"
RPROMPT=""
PROMPT="$FG[237]$(repeat_string $COLUMNS -)${NEWLINE}$FG[105]%(!.#.»»)%{$reset_color%} "
zle reset-prompt
RPROMPT="$OLD_RPROMPT"
PROMPT="$OLD_PROMPT"
zle accept-line
}
zle -N del-prompt-accept-line
bindkey "^M" del-prompt-accept-line
#TODO check zsh folder here at https://github.com/cehoffman/dotfiles
# TODO what is zstyle ':completion:*'
#TODO spotify show shuffle status
#TODO https://news.ycombinator.com/item?id=17755199
#TODO htoprc
# TODO why this code breaks
#testmybug(){
#printf "-%.0s" $(seq 1 $COLUMNS)
#}
#PROMPT="$(testmybug)
#53hello >>>"
# combined effors of following
# https://github.com/joshbuchea/config/blob/master/.zshrc
# Convert video to GIF
#
# Usage: vid2gif in.mov [width] [fps]
#
# typical gif framerates seem to be between 10–20
#
# possibly run through gif optimization tool
#
# ffmpeg options explained:
#
# -i input
# -y overwrite output files without confirmation
# -t duration
# -ss position
#
function vid2gif() {
local width=${2:-600}
local rate=${3:-20}
local filters="fps=$rate,scale=$width:-1:flags=lanczos"
# generate a palette
#
# not sure if palette needs scale or flags (or all of $filters?)...
ffmpeg -i "$1" -vf "$filters,palettegen" -y palette.png
# then generate gif with palette
ffmpeg -i "$1" -i palette.png -filter_complex "$filters,paletteuse" "${1%.*}.gif"
# remove palette image file
rm palette.png
}
proxy_server(){
#TODO fix this awesomeness
~/.proxy_server.sh $1
}
killp(){
kill $(lsof -t -i:$1)
}
#Most edited files in project(https://news.ycombinator.com/item?id=16300152)
mosteditedfiles(){
git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -10
}
# GistID:963f95aaf61d50e512511ac4eb097e50
# vim: set ft=zsh:
export ZSH=~/.oh-my-zsh
local reset_color="%f"
plugins=(
git
sudo
tmuxinator
transfer
tmux
#vi-mode
copyfile
copydir
emoji-clock
encode64
lol
jsontools
z
)
ALIASFILE=~/.aliases.zsh
#source $ZSH/oh-my-zsh.sh
source /Users/mohitmunjani/.oh-my-zsh/lib/spectrum.zsh
source /Users/mohitmunjani/.oh-my-zsh/plugins/git-prompt/git-prompt.plugin.zsh
source /Users/mohitmunjani/.oh-my-zsh/lib/git.zsh
. ~/.secret_common_sh_rc
. $ALIASFILE
. ~/.colored_man_pages.zsh
~/.global_worker.zsh > /dev/null &!
#. ~/.spotify.zsh
#autoload -Uz myspotify && myspotify
#. ~/.zsh-async.zsh
#if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export EDITOR=vim
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=500000 #How many lines of history to keep in memory
SAVEHIST=500000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
#
# ====================
# Get new tip from the art of command line repo everyday. can be use for different stuff also
#TAOCL_FILE=~/.taocl.md
#if [ ! -f $TAOCL_FILE ]; then
#echo "Getting TAOCL from github"
#\curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md -o $TAOCL_FILE
#fi
#sed '/cowsay[.]png/d' $TAOCL_FILE | pandoc -f markdown -t html | xmlstarlet fo --html --dropdtd | xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | xmlstarlet unesc | fmt -80 | iconv -t US | cowsay
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export HOMEBREW_NO_AUTO_UPDATE=1
export FZF_COMPLETION_TRIGGER=''
bindkey '^T' fzf-completion
bindkey '^I' $fzf_default_completion
# ==============================================
# ==============================================
# [email protected]:rupa/z.git
# Using inbuilt zsh 'z' plugin
#. ~/.cli-tools/z/z.sh
# Dotfiles to follow
# https://github.com/whiteinge/dotfiles/
# All about awesome-cli
# https://github.com/whiteinge/ok.sh Github client in bash
## https://github.com/agarrharr/awesome-cli-apps
# explore more on https://github.com/alebcay/awesome-shell
#
# A command-line todo list manager for people that want to finish tasks, not organize them
# https://github.com/sjl/t
#
#https://www.slideshare.net/jaguardesignstudio/why-zsh-is-cooler-than-your-shell-16194692
# Learning Command line
# * https://github.com/learnbyexample/Command-line-text-processing
# * https://github.com/jlevy/the-art-of-command-line
# * https://www.tldp.org/LDP/abs/html/contributed-scripts.html
# * https://www.tldp.org/LDP/abs/html/abs-guide.html
# * http://zsh.sourceforge.net/Guide/zshguide.html
# * https://github.com/dylanaraps/pure-bash-bible
# Better searching in command mode
bindkey -M vicmd '?' history-incremental-search-backward
bindkey -M vicmd '/' history-incremental-search-forward
# Beginning search with arrow keys
bindkey "^[OA" up-line-or-beginning-search
bindkey "^[OB" down-line-or-beginning-search
bindkey -M vicmd "k" up-line-or-beginning-search
bindkey -M vicmd "j" down-line-or-beginning-search
bindkey "^j" down-line-or-beginning-search
bindkey "^k" up-line-or-beginning-search
eval $(thefuck --alias)
HEART='❤'
DOT=' ● '
SILENT_EMOJI="😶"
get_volume_indicator(){
export_osascript_system_status
volume_bar_count=$(( $volume_level / 10))
if [ $volume_level -eq 0 ]; then
echo -n "$SILENT_EMOJI"
else
printf "|%.0s" {0..$volume_bar_count}
fi
}
get_battery(){
battery_info=`pmset -g batt`
current_charge=$(echo $battery_info | grep -o '[0-9]\+%' | awk '{sub (/%/, "", $1); print $1}')
#if [[ $current_charge -lt 10 ]]; then
#echo -n "$FG[052]"
#elif [[ $current_charge -lt 30 ]]; then
#echo -n "$FG[058]"
#elif [[ $current_charge -lt 50 ]]; then
#echo -n "$FG[064]"
#elif [[ $current_charge -lt 70 ]]; then
#echo -n "$FG[070]"
#elif [[ $current_charge -lt 90 ]]; then
#echo -n "$FG[076]"
#else
#echo -n "$FG[082]"
#fi
echo -n "$HEART $current_charge "
}
export_osascript_system_status(){
for i in $(cat ~/.export_osascript_system_status ); do
export $i
done
}
get_spotify_widget(){
export_osascript_system_status
if [[ -n $spotify_track ]]; then
else
return
fi
local columns=$(($COLUMNS - 20))
echo -n $FG[241] $spotify_track
echo -n " - "
echo -n $spotify_artist
int=${spotify_percent_progress%.*}
spotify_percent_progress=$(( $int * $columns / 100 ))
#spotify_percent_progress=printf "%.0f\n" "$spotify_percent_progress"
echo " ($FG[241]$spotify_position/$FG[241]$spotify_duration)"
#echo -n $FG[076]
#printf "=%.0s" {0..$spotify_percent_progress}
#echo -n $reset_color
#remain=$(($columns - $spotify_percent_progress ))
#printf "=%.0s" {0..$remain}
#printf "|%.0s" {0..$spotify_percent_progress}
}
#TODO what is difference when using function keyword or not
function repeat_string(){
#printf "-%.0s" $COLUMNS
chus=$(( $1 - 4))
printf "$2%.0s" $(seq 1 $chus)
}
get_todo_status(){
#a=$(FORCE_COLOR=0 tb -l notes | tail -n2)
#echo $a
}
explain(){
response=$(w3m -dump "http://explainshell.com/explain?cmd="$(echo $@ | tr ' ' '+'))
\cat -s <(grep -v -e explainshell -e • -e □ -e "source manpages" <<< "$response")
}
push(){
adb -d push $1 /storage/emulated/0/
}
pull(){
adb -d pull /storage/emulated/0/$1
}
notify(){
osascript -e "display notification \"$2\" with title \"$1\""
}
ipaddress(){
curl ipinfo.io/ip
}
socktest(){
\curl ipinfo.io/ip --socks5-hostname $1
}
httptest(){
\curl ipinfo.io/ip -x $1
}
capture() {
sudo dtrace -p "$1" -qn '
syscall::write*:entry
/pid == $target && arg0 == 1/ {
printf("%s", copyinstr(arg1, arg2));
}
'
}
#===========================
# THEME START
#===========================
# af-magic.zsh-theme
# Repo: https://github.com/andyfleming/oh-my-zsh
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
# motivation: I forget if vim is running in bg https://news.ycombinator.com/item?id=17423100
# copied https://github.com/denysdovhan/spaceship-prompt/blob/40f52260840bff5ab24f014c62241fdb9be293c0/sections/jobs.zsh
jobs_prompt() {
local jobs_amount=$((jobs) | wc -l | tr -d " ")
[[ $jobs_amount -gt 0 ]] || return
echo "$FG[196]($jobs_amount job)"
}
get_tmux_session_name(){
if [ -n "$TMUX" ]; then
session_name=$(tmux display -p | cut -d '[' -f2 | cut -d ']' -f1)
echo -n "[mux:$session_name]"
fi
}
# primary prompt
if [ -n "$SSH_CLIENT" ]; then
S_TYPE="[ssh]"
else
S_TYPE=""
fi
S_TYPE=$S_TYPE$(get_tmux_session_name)
PROMPT="$FG[237]
$FG[237]$S_TYPE$FG[237]%~
$(get_todo_status)
$FG[237]$(repeat_string $COLUMNS '-')%{$reset_color%}
$FG[032]%c\
$(git_prompt_info) \
$(jobs_prompt)\
$FG[105]%(!.#.»)%{$reset_color%} "
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='${return_code}'
#PROMPT='$(bsl_set_status_line)hi>>>'
# color vars
eval my_gray='$FG[237]'
eval my_orange='$FG[214]'
# right prompt
# Inspiration for todo in right prompt https://wynnnetherland.com/journal/contextual-todo-list-counts-in-your-zsh-prompt/
#TODO figure async prompt to speed things up
#https://medium.com/@henrebotha/how-to-write-an-asynchronous-zsh-prompt-b53e81720d32
#TODO https://stackoverflow.com/a/6052267/2577465 use this cool technique
#TODO https://github.com/junegunn/fzf/wiki/Examples#google-chrome-os-xlinux
RPROMPT="$my_gray$(get_battery)$DOT$(get_volume_indicator)$DOT$(time12)%{$reset_color%}"
# git settings
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
#===========================
# THEME END
#===========================
gencscopedb(){
CSCOPE_DIR="$PWD/cscope"
if [ ! -d "$CSCOPE_DIR" ]; then
mkdir "$CSCOPE_DIR"
fi
echo "Finding files ..."
find "$PWD" -name '*.[ch]' \
-o -name '*.java' \
-o -name '*properties' \
-o -name '*.cpp' \
-o -name '*.cc' \
-o -name '*.hpp' \
-o -name '*.py' \
-o -name '*.rb' \
-o -name '*.php' > "$CSCOPE_DIR/cscope.files"
echo "Adding files to cscope db: $PWD/cscope.db ..."
cscope -b -i "$CSCOPE_DIR/cscope.files" -f "$CSCOPE_DIR/cscope.out"
export CSCOPE_DB="$CSCOPE_DIR/cscope.out"
echo "Exported CSCOPE_DB to: '$CSCOPE_DB'"
}
# mkdir, and cd
function mcd() {
mkdir -p "$1" && cd "$1";
}
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
list_repo_containing_search(){
#TODO need to edit function
# == == == == == == == == == == == == == == == == == == == ==
# List repo by user
# curl -G 'https://api.github.com/users/mohitmun/repos?page=3&per_page=100'
# == == == == == == == == == == == == == == == == == == == ==
# List repo by org
# curl -G 'https://api.github.com/orgs/google/repos?page=3&per_page=100'
# == == == == == == == == == == == == == == == == == == == ==
# List repo info
# curl -G 'https://api.github.com/repo/username/reponame'
# == == == == == == == == == == == == == == == == == == == ==
for NUM in `seq 16`; do
curl "https://github.com/search?p=$GPAGE&q=my_query&type=Code" --compressed > github$GPAGE;
cat github$NUM | pup "#code_search_results > div.code-list a.text-bold text{}" >> searchlist;
done
uniq searchlist > searchlistuniq
while read repo;
do curl "https://api.github.com/repos/"$repo > `echo $repo | tr '/' '-'`
sleep 2
done < searchlistuniq
cat * | jq -r '[.full_name, .stargazers_count, .description] | @csv' > repos.csv
}
cht(){
curl cht.sh/$1
}
#https://github.com/paulmillr/dotfiles/blob/master/home/.zshrc.sh
#
# Load 8 cores at once.
function maxcpu() {
dn=/dev/null
yes > $dn & yes > $dn & yes > $dn & yes > $dn &
yes > $dn & yes > $dn & yes > $dn & yes > $dn &
}
# $ retry ping google.com
function retry() {
echo Retrying "$@"
$@
sleep 1
retry $@
}
# $ git log --no-merges --pretty=format:"%ae" | stats
# # => 514 [email protected]
# # => 200 [email protected]
function stats() {
sort | uniq -c | sort -r
}
# Shortcut for searching commands history.
# hist git
function hist() {
history | grep $@
}
# Monitor IO in real-time (open files etc).
function openfiles() {
sudo dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'
}
# Execute commands for each file in current directory.
function each() {
for dir in *; do
# echo "${dir}:"
cd $dir
$@
cd ..
done
}
# Find files and exec commands at them.
# $ find-exec .coffee cat | wc -l
# # => 9762
function find-exec() {
find . -type f -iname "*${1:-}*" -exec "${2:-file}" '{}' \;
}
# Better find(1)
function ff() {
find . -iname "*${1:-}*"
}
#
# Show current Finder directory.
#function finder {
#osascript 2>/dev/null <<EOF
#tell application "Finder"
#return POSIX path of (target of window 1 as alias)
#end tell
#EOF
#github.com/tj/burl
BURL_FILE=/usr/local/bin/burl
if [ ! -f $BURL_FILE ]; then
echo "Getting burl from github"
\curl -s https://raw.githubusercontent.com/tj/burl/master/bin/burl -o $BURL_FILE
chmod +x $BURL_FILE
fi
# chpwd(){
# ls
# }
curl_github(){
curl -u $GITHUB_USERNAME_SPAM:$GITHUB_PASSWORD_SPAM "https://api.github.com$1"
}
#TODO https://gist.github.com/phette23/5270658
#TODO https://superuser.com/questions/292652/change-iterm2-window-and-tab-titles-in-zsh/292660#292660
c() {
local cols sep google_history open
cols=$(( COLUMNS / 3 ))
sep='{::}'
if [ "$(uname)" = "Darwin" ]; then
google_history="$HOME/Library/Application Support/Google/Chrome/Default/History"
open=open
else
google_history="$HOME/.config/google-chrome/Default/History"
open=xdg-open
fi
cp -f "$google_history" /tmp/h
sqlite3 -separator $sep /tmp/h \
"select substr(title, 1, $cols), url
from urls order by last_visit_time desc" |
awk -F $sep '{printf "%-'$cols's \x1b[36m%s\x1b[m\n", $1, $2}' |
fzf --ansi --multi | sed 's#.*\(https*://\)#\1#' | xargs $open > /dev/null 2> /dev/null
}
zrc(){
vim ~/.zshrc
source ~/.zshrc
echo "Done: update zsh configure file."
}
#TODO https://github.com/zsh-users/zsh-autosuggestions
#TODO https://github.com/zsh-users/zsh-completions
#TODO https://github.com/ericfreese/zsh-prioritize-cwd-history
#TODO https://github.com/ericfreese/rat
#TODO https://github.com/ericfreese/zsh-cwd-history
#TODO https://github.com/larkery/zsh-histdb
#TODO what is precmd
google(){
search=""
echo "Googling: $@"
for term in $@; do
search="$search%20$term"
done
open "http://www.google.com/search?q=$search"
}
#TMOUT=1
#https://github.com/robbyrussell/oh-my-zsh/issues/5910#issuecomment-294509017
TRAPALRM() {
if [[ $WIDGET != *"complete"* && $WIDGET != *"-search" ]]; then;
#async_job vagrant_prompt_worker export-spotify-status $PWD
zle reset-prompt
#bsl_set_status_line
#thanks https://github.com/wilywampa/vimconfig/blob/b95caa50883438288729b6e8ff963783b110a3a5/dotfiles/.zshrc#L1374
if [[ -n $BUFFER ]]; then
TMOUT=5
else
TMOUT=1
fi
#echo $BUFFER > ~/.debug_async
fi
}
NEWLINE=$'\n'
#https://superuser.com/a/1029103/630985
del-prompt-accept-line() {
OLD_PROMPT="$PROMPT"
OLD_RPROMPT="$RPROMPT"
RPROMPT=""
PROMPT="$FG[237]$(repeat_string $COLUMNS -)${NEWLINE}$FG[105]%(!.#.»»)%{$reset_color%} "
zle reset-prompt
RPROMPT="$OLD_RPROMPT"
PROMPT="$OLD_PROMPT"
zle accept-line
}
zle -N del-prompt-accept-line
bindkey "^M" del-prompt-accept-line
#TODO check zsh folder here at https://github.com/cehoffman/dotfiles
# TODO what is zstyle ':completion:*'
#TODO spotify show shuffle status
#TODO https://news.ycombinator.com/item?id=17755199
#TODO htoprc
# TODO why this code breaks
#testmybug(){
#printf "-%.0s" $(seq 1 $COLUMNS)
#}
#PROMPT="$(testmybug)
#53hello >>>"
# combined effors of following
# https://github.com/joshbuchea/config/blob/master/.zshrc
# Convert video to GIF
#
# Usage: vid2gif in.mov [width] [fps]
#
# typical gif framerates seem to be between 10–20
#
# possibly run through gif optimization tool
#
# ffmpeg options explained:
#
# -i input
# -y overwrite output files without confirmation
# -t duration
# -ss position
#
function vid2gif() {
local width=${2:-600}
local rate=${3:-20}
local filters="fps=$rate,scale=$width:-1:flags=lanczos"
# generate a palette
#
# not sure if palette needs scale or flags (or all of $filters?)...
ffmpeg -i "$1" -vf "$filters,palettegen" -y palette.png
# then generate gif with palette
ffmpeg -i "$1" -i palette.png -filter_complex "$filters,paletteuse" "${1%.*}.gif"
# remove palette image file
rm palette.png
}
proxy_server(){
#TODO fix this awesomeness
~/.proxy_server.sh $1
}
killp(){
kill $(lsof -t -i:$1)
}
#Most edited files in project(https://news.ycombinator.com/item?id=16300152)
mosteditedfiles(){
git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -10
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
<key>AppleSmoothFixedFontsSizeThreshold</key>
<integer>1</integer>
<key>AppleWindowTabbingMode</key>
<string>manual</string>
<key>AutoHideTmuxClientSession</key>
<true/>
<key>Default Bookmark Guid</key>
<string>E37BCC44-5B6C-40AB-A201-F59E069E75DC</string>
<key>EnableDivisionView</key>
<false/>
<key>GlobalKeyMap</key>
<dict>
<key>0x19-0x60000</key>
<dict>
<key>Action</key>
<integer>39</integer>
<key>Text</key>
<string></string>
</dict>
<key>0x48-0x60000</key>
<dict>
<key>Action</key>
<integer>18</integer>
<key>Text</key>
<string></string>
</dict>
<key>0x4a-0x60000</key>
<dict>
<key>Action</key>
<integer>20</integer>
<key>Text</key>
<string></string>
</dict>
<key>0x4b-0x60000</key>
<dict>
<key>Action</key>
<integer>21</integer>
<key>Text</key>
<string></string>
</dict>
<key>0x4c-0x60000</key>
<dict>
<key>Action</key>
<integer>19</integer>
<key>Text</key>
<string></string>
</dict>
<key>0x9-0x40000</key>
<dict>
<key>Action</key>
<integer>32</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf700-0x300000</key>
<dict>
<key>Action</key>
<integer>7</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf701-0x300000</key>
<dict>
<key>Action</key>
<integer>6</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf702-0x300000</key>
<dict>
<key>Action</key>
<integer>2</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf702-0x320000</key>
<dict>
<key>Action</key>
<integer>33</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf703-0x300000</key>
<dict>
<key>Action</key>
<integer>0</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf703-0x320000</key>
<dict>
<key>Action</key>
<integer>34</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf729-0x100000</key>
<dict>
<key>Action</key>
<integer>5</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72b-0x100000</key>
<dict>
<key>Action</key>
<integer>4</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72c-0x100000</key>
<dict>
<key>Action</key>
<integer>9</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72c-0x20000</key>
<dict>
<key>Action</key>
<integer>9</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72d-0x100000</key>
<dict>
<key>Action</key>
<integer>8</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72d-0x20000</key>
<dict>
<key>Action</key>
<integer>8</integer>
<key>Text</key>
<string></string>
</dict>
</dict>
<key>GlobalTouchBarMap</key>
<dict>
<key>touchbar:14582875-2D44-41BA-8B5B-89142A5F1D8B</key>
<dict>
<key>Action</key>
<integer>28</integer>
<key>Label</key>
<string>SH</string>
<key>Text</key>
<string>E37BCC44-5B6C-40AB-A201-F59E069E75DC</string>
</dict>
<key>touchbar:8292C059-568B-4890-93D2-DEC5FE9A8600</key>
<dict>
<key>Action</key>
<integer>29</integer>
<key>Label</key>
<string>SV</string>
<key>Text</key>
<string>E37BCC44-5B6C-40AB-A201-F59E069E75DC</string>
</dict>
</dict>
<key>HideScrollbar</key>
<false/>
<key>Hotkey</key>
<true/>
<key>HotkeyChar</key>
<integer>32</integer>
<key>HotkeyCode</key>
<integer>49</integer>
<key>HotkeyMigratedFromSingleToMulti</key>
<true/>
<key>HotkeyModifiers</key>
<integer>262144</integer>
<key>HotkeyWindowFloatsAboveOtherWindows</key>
<true/>
<key>LeftOption</key>
<integer>2</integer>
<key>LoadPrefsFromCustomFolder</key>
<true/>
<key>NSNavLastRootDirectory</key>
<string>~/Desktop/iterm2_settings</string>
<key>NSNavPanelExpandedSizeForOpenMode</key>
<string>{868, 448}</string>
<key>NSQuotedKeystrokeBinding</key>
<string></string>
<key>NSRepeatCountBinding</key>
<string></string>
<key>NSScrollAnimationEnabled</key>
<false/>
<key>NSScrollViewShouldScrollUnderTitlebar</key>
<false/>
<key>NSTableView Columns v2 KeyBingingTable</key>
<data>
YnBsaXN0MDDUAQIDBAUGNjdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoK4HCA8aGxwdHh8gJjAxMlUkbnVsbNIJCgsOWk5TLm9iamVjdHNWJGNsYXNzogwN
gAKACoAN0xAJChEVGVdOUy5rZXlzoxITFIADgASABaMWFxiABoAHgAiACVpJZGVudGlm
aWVyVVdpZHRoVkhpZGRlblEwI0BowAAAAAAACNIhIiMkWiRjbGFzc25hbWVYJGNsYXNz
ZXNcTlNEaWN0aW9uYXJ5oiMlWE5TT2JqZWN00xAJCicrGaMSExSAA4AEgAWjLC0YgAuA
DIAIgAlRMSNAdKGdsi0OVtIhIjM0Xk5TTXV0YWJsZUFycmF5ozM1JVdOU0FycmF5XxAP
TlNLZXllZEFyY2hpdmVy0Tg5VUFycmF5gAEACAARABoAIwAtADIANwBGAEwAUQBcAGMA
ZgBoAGoAbABzAHsAfwCBAIMAhQCJAIsAjQCPAJEAnACiAKkAqwC0ALUAugDFAM4A2wDe
AOcA7gDyAPQA9gD4APwA/gEAAQIBBAEGAQ8BFAEjAScBLwFBAUQBSgAAAAAAAAIBAAAA
AAAAADoAAAAAAAAAAAAAAAAAAAFM
</data>
<key>NSTableView Sort Ordering v2 KeyBingingTable</key>
<data>
YnBsaXN0MDDUAQIDBAUGFBVYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA1VJG51bGzSCQoLDFpOUy5vYmplY3RzViRjbGFzc6CAAtIODxARWiRjbGFz
c25hbWVYJGNsYXNzZXNeTlNNdXRhYmxlQXJyYXmjEBITV05TQXJyYXlYTlNPYmplY3Rf
EA9OU0tleWVkQXJjaGl2ZXLRFhdVQXJyYXmAAQgRGiMtMjc7QUZRWFlbYGt0g4ePmKqt
swAAAAAAAAEBAAAAAAAAABgAAAAAAAAAAAAAAAAAAAC1
</data>
<key>NSTableView Supports v2 KeyBingingTable</key>
<true/>
<key>NSToolbar Configuration com.apple.NSColorPanel</key>
<dict>
<key>TB Is Shown</key>
<integer>1</integer>
</dict>
<key>NSTouchBarConfig: full screen</key>
<dict>
<key>CurrentItems</key>
<array>
<string>iTermTouchBarIdentifierManPage</string>
<string>iTermTouchBarIdentifierColorPreset</string>
<string>iTermTouchBarIdentifierFunctionKeys</string>
<string>NSTouchBarItemIdentifierFlexibleSpace</string>
<string>touchbar:14582875-2D44-41BA-8B5B-89142A5F1D8B</string>
<string>touchbar:8292C059-568B-4890-93D2-DEC5FE9A8600</string>
<string>tab bar</string>
<string>NSTouchBarItemIdentifierOtherItemsProxy</string>
</array>
<key>DefaultItems</key>
<array>
<string>iTermTouchBarIdentifierManPage</string>
<string>iTermTouchBarIdentifierColorPreset</string>
<string>iTermTouchBarIdentifierFunctionKeys</string>
<string>NSTouchBarItemIdentifierFlexibleSpace</string>
<string>tab bar</string>
<string>NSTouchBarItemIdentifierOtherItemsProxy</string>
<string>iTermTouchBarIdentifierAddMark</string>
<string>iTermTouchBarIdentifierPreviousMark</string>
<string>iTermTouchBarIdentifierNextMark</string>
</array>
</dict>
<key>NSTouchBarConfig: regular</key>
<dict>
<key>CurrentItems</key>
<array>
<string>iTermTouchBarIdentifierManPage</string>
<string>iTermTouchBarIdentifierFunctionKeys</string>
<string>touchbar:8292C059-568B-4890-93D2-DEC5FE9A8600</string>
<string>touchbar:14582875-2D44-41BA-8B5B-89142A5F1D8B</string>
<string>NSTouchBarItemIdentifierFlexibleSpace</string>
<string>NSTouchBarItemIdentifierOtherItemsProxy</string>
<string>iTermTouchBarIdentifierAddMark</string>
<string>iTermTouchBarIdentifierPreviousMark</string>
<string>iTermTouchBarIdentifierNextMark</string>
</array>
<key>DefaultItems</key>
<array>
<string>iTermTouchBarIdentifierManPage</string>
<string>iTermTouchBarIdentifierColorPreset</string>
<string>iTermTouchBarIdentifierFunctionKeys</string>
<string>NSTouchBarItemIdentifierFlexibleSpace</string>
<string>NSTouchBarItemIdentifierOtherItemsProxy</string>
<string>iTermTouchBarIdentifierAddMark</string>
<string>iTermTouchBarIdentifierPreviousMark</string>
<string>iTermTouchBarIdentifierNextMark</string>
</array>
</dict>
<key>NSWindow Frame ProfilesPanel</key>
<string>205 478 735 382 0 0 1440 900 </string>
<key>NSWindow Frame SUUpdateAlert</key>
<string>410 394 620 392 0 0 1440 900 </string>
<key>NSWindow Frame SessionsPreferences</key>
<string>269 126 606 469 0 0 1440 900 </string>
<key>NSWindow Frame SharedPreferences</key>
<string>241 360 796 473 0 0 1440 900 </string>
<key>NSWindow Frame iTerm Window 0</key>
<string>2 52 1435 825 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 1</key>
<string>176 74 780 451 0 0 1440 877 </string>
<key>New Bookmarks</key>
<array>
<dict>
<key>ASCII Anti Aliased</key>
<true/>
<key>Ambiguous Double Width</key>
<false/>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>BM Growl</key>
<true/>
<key>Background Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Background Image Location</key>
<string></string>
<key>Blinking Cursor</key>
<false/>
<key>Blur</key>
<false/>
<key>Bold Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Character Encoding</key>
<integer>4</integer>
<key>Close Sessions On End</key>
<true/>
<key>Columns</key>
<integer>80</integer>
<key>Command</key>
<string></string>
<key>Cursor Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Custom Command</key>
<string>No</string>
<key>Custom Directory</key>
<string>Recycle</string>
<key>Default Bookmark</key>
<string>No</string>
<key>Description</key>
<string>Default</string>
<key>Disable Window Resizing</key>
<true/>
<key>Flashing Bell</key>
<false/>
<key>Foreground Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Guid</key>
<string>E37BCC44-5B6C-40AB-A201-F59E069E75DC</string>
<key>Horizontal Spacing</key>
<real>1</real>
<key>Idle Code</key>
<integer>0</integer>
<key>Initial Text</key>
<string></string>
<key>Jobs to Ignore</key>
<array>
<string>rlogin</string>
<string>ssh</string>
<string>slogin</string>
<string>telnet</string>
</array>
<key>Keyboard Map</key>
<dict>
<key>0x2a-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>*</string>
</dict>
<key>0x2b-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>+</string>
</dict>
<key>0x2d-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>-</string>
</dict>
<key>0x2d-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1f</string>
</dict>
<key>0x2e-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>.</string>
</dict>
<key>0x2f-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>/</string>
</dict>
<key>0x3-0x200000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0xd</string>
</dict>
<key>0x30-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>0</string>
</dict>
<key>0x31-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>1</string>
</dict>
<key>0x32-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>2</string>
</dict>
<key>0x32-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x00</string>
</dict>
<key>0x33-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>3</string>
</dict>
<key>0x33-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b</string>
</dict>
<key>0x34-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>4</string>
</dict>
<key>0x34-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1c</string>
</dict>
<key>0x35-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>5</string>
</dict>
<key>0x35-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1d</string>
</dict>
<key>0x36-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>6</string>
</dict>
<key>0x36-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1e</string>
</dict>
<key>0x37-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>7</string>
</dict>
<key>0x37-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1f</string>
</dict>
<key>0x38-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>8</string>
</dict>
<key>0x38-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x7f</string>
</dict>
<key>0x39-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>9</string>
</dict>
<key>0x7f-0x100000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x15</string>
</dict>
<key>0x7f-0x80000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b 0x7f</string>
</dict>
<key>0xf700-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2A</string>
</dict>
<key>0xf700-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5A</string>
</dict>
<key>0xf700-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6A</string>
</dict>
<key>0xf701-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2B</string>
</dict>
<key>0xf701-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5B</string>
</dict>
<key>0xf701-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6B</string>
</dict>
<key>0xf702-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2D</string>
</dict>
<key>0xf702-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5D</string>
</dict>
<key>0xf702-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6D</string>
</dict>
<key>0xf702-0x280000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>b</string>
</dict>
<key>0xf703-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2C</string>
</dict>
<key>0xf703-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5C</string>
</dict>
<key>0xf703-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6C</string>
</dict>
<key>0xf703-0x280000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>f</string>
</dict>
<key>0xf704-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2P</string>
</dict>
<key>0xf705-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2Q</string>
</dict>
<key>0xf706-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2R</string>
</dict>
<key>0xf707-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2S</string>
</dict>
<key>0xf708-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[15;2~</string>
</dict>
<key>0xf709-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[17;2~</string>
</dict>
<key>0xf70a-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[18;2~</string>
</dict>
<key>0xf70b-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[19;2~</string>
</dict>
<key>0xf70c-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[20;2~</string>
</dict>
<key>0xf70d-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[21;2~</string>
</dict>
<key>0xf70e-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[23;2~</string>
</dict>
<key>0xf70f-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[24;2~</string>
</dict>
<key>0xf728-0x0</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x4</string>
</dict>
<key>0xf728-0x80000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>d</string>
</dict>
<key>0xf729-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2H</string>
</dict>
<key>0xf729-0x40000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5H</string>
</dict>
<key>0xf72b-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2F</string>
</dict>
<key>0xf72b-0x40000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5F</string>
</dict>
<key>0xf739-0x0</key>
<dict>
<key>Action</key>
<integer>13</integer>
<key>Text</key>
<string></string>
</dict>
</dict>
<key>Mouse Reporting</key>
<true/>
<key>Name</key>
<string>Default</string>
<key>Non Ascii Font</key>
<string>Monaco 12</string>
<key>Non-ASCII Anti Aliased</key>
<true/>
<key>Normal Font</key>
<string>Monaco 12</string>
<key>Option Key Sends</key>
<integer>2</integer>
<key>Prevent Opening in a Tab</key>
<false/>
<key>Prompt Before Closing 2</key>
<false/>
<key>Right Option Key Sends</key>
<integer>0</integer>
<key>Rows</key>
<integer>25</integer>
<key>Screen</key>
<integer>-1</integer>
<key>Scrollback Lines</key>
<integer>1000</integer>
<key>Selected Text Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>0.8353000283241272</real>
<key>Red Component</key>
<real>0.70980000495910645</real>
</dict>
<key>Send Code When Idle</key>
<false/>
<key>Shortcut</key>
<string></string>
<key>Silence Bell</key>
<false/>
<key>Space</key>
<integer>0</integer>
<key>Sync Title</key>
<false/>
<key>Tags</key>
<array/>
<key>Terminal Type</key>
<string>xterm-256color</string>
<key>Transparency</key>
<real>0.0</real>
<key>Unlimited Scrollback</key>
<true/>
<key>Use Bold Font</key>
<true/>
<key>Use Bright Bold</key>
<true/>
<key>Use Italic Font</key>
<true/>
<key>Use Non-ASCII Font</key>
<false/>
<key>Vertical Spacing</key>
<real>1</real>
<key>Visual Bell</key>
<true/>
<key>Window Type</key>
<integer>0</integer>
<key>Working Directory</key>
<string>/Users/mohit</string>
</dict>
<dict>
<key>ASCII Anti Aliased</key>
<true/>
<key>Ambiguous Double Width</key>
<false/>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>BM Growl</key>
<true/>
<key>Background Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Background Image Location</key>
<string></string>
<key>Blinking Cursor</key>
<false/>
<key>Blur</key>
<false/>
<key>Bold Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Character Encoding</key>
<integer>4</integer>
<key>Close Sessions On End</key>
<true/>
<key>Columns</key>
<integer>80</integer>
<key>Command</key>
<string></string>
<key>Cursor Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Custom Command</key>
<string>No</string>
<key>Custom Directory</key>
<string>Recycle</string>
<key>Default Bookmark</key>
<string>No</string>
<key>Description</key>
<string>Default</string>
<key>Disable Window Resizing</key>
<true/>
<key>Flashing Bell</key>
<false/>
<key>Foreground Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
</dict>
<key>Guid</key>
<string>410B08F5-37A6-43B5-A8AD-CAB65427E7A0</string>
<key>Horizontal Spacing</key>
<real>1</real>
<key>Idle Code</key>
<integer>0</integer>
<key>Initial Text</key>
<string></string>
<key>Jobs to Ignore</key>
<array>
<string>rlogin</string>
<string>ssh</string>
<string>slogin</string>
<string>telnet</string>
</array>
<key>Keyboard Map</key>
<dict>
<key>0x2a-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>*</string>
</dict>
<key>0x2b-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>+</string>
</dict>
<key>0x2d-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>-</string>
</dict>
<key>0x2d-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1f</string>
</dict>
<key>0x2e-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>.</string>
</dict>
<key>0x2f-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>/</string>
</dict>
<key>0x3-0x200000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0xd</string>
</dict>
<key>0x30-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>0</string>
</dict>
<key>0x31-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>1</string>
</dict>
<key>0x32-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>2</string>
</dict>
<key>0x32-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x00</string>
</dict>
<key>0x33-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>3</string>
</dict>
<key>0x33-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b</string>
</dict>
<key>0x34-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>4</string>
</dict>
<key>0x34-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1c</string>
</dict>
<key>0x35-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>5</string>
</dict>
<key>0x35-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1d</string>
</dict>
<key>0x36-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>6</string>
</dict>
<key>0x36-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1e</string>
</dict>
<key>0x37-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>7</string>
</dict>
<key>0x37-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1f</string>
</dict>
<key>0x38-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>8</string>
</dict>
<key>0x38-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x7f</string>
</dict>
<key>0x39-0x200000</key>
<dict>
<key>Action</key>
<integer>12</integer>
<key>Text</key>
<string>9</string>
</dict>
<key>0x7f-0x100000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x15</string>
</dict>
<key>0x7f-0x80000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b 0x7f</string>
</dict>
<key>0xf700-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2A</string>
</dict>
<key>0xf700-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5A</string>
</dict>
<key>0xf700-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6A</string>
</dict>
<key>0xf701-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2B</string>
</dict>
<key>0xf701-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5B</string>
</dict>
<key>0xf701-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6B</string>
</dict>
<key>0xf702-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2D</string>
</dict>
<key>0xf702-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5D</string>
</dict>
<key>0xf702-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6D</string>
</dict>
<key>0xf702-0x280000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>b</string>
</dict>
<key>0xf703-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2C</string>
</dict>
<key>0xf703-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5C</string>
</dict>
<key>0xf703-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6C</string>
</dict>
<key>0xf703-0x280000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>f</string>
</dict>
<key>0xf704-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2P</string>
</dict>
<key>0xf705-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2Q</string>
</dict>
<key>0xf706-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2R</string>
</dict>
<key>0xf707-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2S</string>
</dict>
<key>0xf708-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[15;2~</string>
</dict>
<key>0xf709-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[17;2~</string>
</dict>
<key>0xf70a-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[18;2~</string>
</dict>
<key>0xf70b-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[19;2~</string>
</dict>
<key>0xf70c-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[20;2~</string>
</dict>
<key>0xf70d-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[21;2~</string>
</dict>
<key>0xf70e-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[23;2~</string>
</dict>
<key>0xf70f-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[24;2~</string>
</dict>
<key>0xf728-0x0</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x4</string>
</dict>
<key>0xf728-0x80000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>d</string>
</dict>
<key>0xf729-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2H</string>
</dict>
<key>0xf729-0x40000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5H</string>
</dict>
<key>0xf72b-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2F</string>
</dict>
<key>0xf72b-0x40000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5F</string>
</dict>
<key>0xf739-0x0</key>
<dict>
<key>Action</key>
<integer>13</integer>
<key>Text</key>
<string></string>
</dict>
</dict>
<key>Mouse Reporting</key>
<true/>
<key>Name</key>
<string>tmux</string>
<key>Non Ascii Font</key>
<string>Monaco 12</string>
<key>Non-ASCII Anti Aliased</key>
<true/>
<key>Normal Font</key>
<string>Monaco 12</string>
<key>Option Key Sends</key>
<integer>2</integer>
<key>Prevent Opening in a Tab</key>
<false/>
<key>Prompt Before Closing 2</key>
<false/>
<key>Right Option Key Sends</key>
<integer>0</integer>
<key>Rows</key>
<integer>25</integer>
<key>Screen</key>
<integer>-1</integer>
<key>Scrollback Lines</key>
<integer>1000</integer>
<key>Selected Text Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>0.8353000283241272</real>
<key>Red Component</key>
<real>0.70980000495910645</real>
</dict>
<key>Send Code When Idle</key>
<false/>
<key>Shortcut</key>
<string></string>
<key>Silence Bell</key>
<false/>
<key>Space</key>
<integer>0</integer>
<key>Sync Title</key>
<false/>
<key>Tags</key>
<array/>
<key>Terminal Type</key>
<string>xterm-256color</string>
<key>Transparency</key>
<real>0.0</real>
<key>Unlimited Scrollback</key>
<true/>
<key>Use Bold Font</key>
<true/>
<key>Use Bright Bold</key>
<true/>
<key>Use Italic Font</key>
<true/>
<key>Use Non-ASCII Font</key>
<false/>
<key>Vertical Spacing</key>
<real>1</real>
<key>Visual Bell</key>
<true/>
<key>Window Type</key>
<integer>0</integer>
<key>Working Directory</key>
<string>/Users/mohit</string>
</dict>
</array>
<key>NoSyncAutoBurialReveal</key>
<true/>
<key>NoSyncCommandHistoryHasEverBeenUsed</key>
<true/>
<key>NoSyncHaveUsedCopyMode</key>
<true/>
<key>NoSyncHaveWarnedAboutPasteConfirmationChange</key>
<true/>
<key>NoSyncInstallationId</key>
<string>4266D194-953B-4A36-8C97-192FD7803194</string>
<key>NoSyncLastTipTime</key>
<real>550061134.91409099</real>
<key>NoSyncNeverRemindPrefsChangesLostForFile</key>
<true/>
<key>NoSyncNeverRemindPrefsChangesLostForFile_selection</key>
<integer>0</integer>
<key>NoSyncPermissionToShowTip</key>
<true/>
<key>NoSyncSuppressBroadcastInputWarning</key>
<true/>
<key>NoSyncSuppressBroadcastInputWarning_selection</key>
<integer>0</integer>
<key>NoSyncTimeOfFirstLaunchOfVersionWithTip</key>
<real>535632399.47796798</real>
<key>NoSyncTipsToNotShow</key>
<array>
<string>000</string>
<string>0000</string>
<string>0001</string>
<string>0002</string>
<string>0003</string>
<string>0004</string>
<string>0005</string>
<string>0006</string>
<string>0007</string>
<string>0008</string>
<string>0009</string>
<string>0010</string>
<string>0011</string>
<string>0012</string>
<string>0013</string>
<string>0014</string>
<string>0015</string>
<string>0016</string>
<string>0017</string>
<string>0018</string>
<string>0019</string>
<string>0020</string>
<string>0021</string>
<string>0022</string>
<string>0023</string>
<string>0024</string>
<string>0025</string>
<string>0026</string>
<string>0027</string>
<string>0028</string>
<string>0029</string>
<string>0030</string>
<string>0031</string>
<string>0032</string>
<string>0033</string>
<string>0034</string>
<string>0035</string>
<string>0036</string>
<string>0037</string>
<string>0038</string>
<string>0039</string>
<string>0040</string>
<string>0041</string>
<string>0042</string>
<string>0043</string>
<string>0044</string>
<string>0045</string>
<string>0046</string>
<string>0047</string>
<string>0048</string>
<string>0049</string>
<string>0050</string>
<string>0051</string>
<string>0052</string>
<string>0053</string>
<string>0054</string>
<string>0055</string>
<string>0056</string>
<string>0057</string>
<string>0058</string>
<string>0059</string>
<string>0060</string>
<string>0061</string>
<string>0062</string>
<string>0063</string>
<string>0064</string>
<string>0065</string>
<string>0066</string>
<string>0067</string>
<string>0068</string>
<string>0069</string>
<string>0070</string>
<string>0071</string>
<string>0071</string>
<string>0070</string>
<string>0069</string>
<string>0068</string>
</array>
<key>OpenTmuxWindowsIn</key>
<integer>2</integer>
<key>PMPrintingExpandedStateForPrint2</key>
<false/>
<key>PasteTabToStringTabStopSize</key>
<integer>2</integer>
<key>PointerActions</key>
<dict>
<key>Button,1,1,,</key>
<dict>
<key>Action</key>
<string>kContextMenuPointerAction</string>
</dict>
<key>Button,2,1,,</key>
<dict>
<key>Action</key>
<string>kPasteFromClipboardPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeDown,,</key>
<dict>
<key>Action</key>
<string>kPrevWindowPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeLeft,,</key>
<dict>
<key>Action</key>
<string>kPrevTabPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeRight,,</key>
<dict>
<key>Action</key>
<string>kNextTabPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeUp,,</key>
<dict>
<key>Action</key>
<string>kNextWindowPointerAction</string>
</dict>
</dict>
<key>PrefsCustomFolder</key>
<string>/Users/mohit/Desktop/iterm2_settings</string>
<key>Print In Black And White</key>
<true/>
<key>SUEnableAutomaticChecks</key>
<true/>
<key>SUFeedAlternateAppNameKey</key>
<string>iTerm</string>
<key>SUFeedURL</key>
<string>https://iterm2.com/appcasts/final.xml?shard=47</string>
<key>SUHasLaunchedBefore</key>
<true/>
<key>SULastCheckTime</key>
<date>2018-06-14T11:38:18Z</date>
<key>SUSendProfileInfo</key>
<false/>
<key>Secure Input</key>
<false/>
<key>ShowFullScreenTabBar</key>
<false/>
<key>SmartPlacement</key>
<false/>
<key>UseBorder</key>
<false/>
<key>WordCharacters</key>
<string></string>
<key>findMode_iTerm</key>
<integer>0</integer>
<key>iTerm Version</key>
<string>3.1.5</string>
</dict>
</plist>

Find duplicate files https://www.reddit.com/r/tinycode/comments/2ek3mi/fast_duplicate_file_finder_in_100_lines_of_c/ck0m716/

#!/bin/sh
find $1 -type f -name '*' -print0 | xargs -0 md5sum > hashes.txt
sort -k 1,1 < hashes.txt > hashes-sorted.txt
uniq --check-chars=32 --all-repeated=separate hashes-sorted.txt

pup is like jq but for html, pup is insane because traversing up using selector only wasnt possible (AFAIK). pup solves this problem. no nokogiri or bs4. pup FTW

pup ':parent-of(:parent-of(SELECTOR)) > a json' 

Learning jq for cmd line json processing (https://stedolan.github.io/jq/manual, https://jqplay.org)

ZSH, tmux, Emacs and SSH: A copy-paste story (https://news.ycombinator.com/item?id=17002527)

use https://github.com/nferraz/st, simple statistics from the command line

join network from command line https://github.com/herrbischoff/awesome-macos-command-line#wi-fi

networksetup -setairportnetwork en0 WIFI_SSID WIFI_PASSWORD

command line twitter client t

gem install t

https://stackoverflow.com/a/33735937/2577465

Start the program with—

dolphin &!

The &! (or equivalently, &|) is a zsh-specific shortcut to both background and disown the process, such that exiting the shell will leave it running.

$$ process id https://stackoverflow.com/questions/5163144/what-are-the-special-dollar-sign-shell-variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment