commit b4f6dbd76f4a3d0eb519ba85d79d250717cda18e
parent 7deb8b163f06dcc2c27da3d71fbd4dad7c536e07
Author: Mark Feller <mark.feller@member.fsf.org>
Date: Sat, 16 Mar 2019 16:51:54 -0600
cleanup to use with osx
Diffstat:
8 files changed, 138 insertions(+), 195 deletions(-)
diff --git a/bootstrap.sh b/bootstrap.sh
@@ -1,3 +1,22 @@
#!/bin/sh
-sudo dnf install i3wm i3lock mpd ncmpcpp ripgrep
+PKGS=`grep -v ^\# packages | grep . | awk '{print $1}' | paste -sd ' ' -`
+
+bootstrap_linux() {
+ echo "Installing Packages"
+ sudo dnf install $PKGS
+}
+
+bootstrap_osx() {
+ echo "Installing Packages"
+ brew install $PKGS
+}
+
+if [[ "$OSTYPE" == "linux-gnu" ]]; then
+ bootstrap_linux
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+ bootstrap_osx
+ IGNORE="--ignore bin|conkyrc|tmux.conf|dunst|rofi|i3|i3status"
+fi
+
+stow $IGNORE dots
diff --git a/dots/.bashrc b/dots/.bashrc
@@ -1,146 +0,0 @@
-# .bashrc
-
-# Source global definitions
-if [ -f /etc/bashrc ]; then
- . /etc/bashrc
-fi
-
-# User specific environment
-PATH="$HOME/.local/bin:$HOME/.bin:$PATH"
-export PATH
-
-# Uncomment the following line if you don't like systemctl's auto-paging feature:
-# export SYSTEMD_PAGER=
-
-# User specific aliases and functions
-
-## Prompt
-export PS1="\e[37mλ \W »\e[0m "
-
-## Alias
-alias ls="ls -F"
-alias ll="ls -lh"
-alias l="ls -la"
-alias emacs="TERM=xterm-256color emacs"
-alias q="exit"
-alias :q="exit"
-alias neo="clear && neofetch"
-alias notify='terminal-notifier -title "Terminal" -message "Done with taks"'
-alias weather="curl wttr.in/\~Boulder+Colorado"
-alias f="fzf --preview=\"head -$LINES {}\""
-alias fz="vim \$(f)"
-alias vi=vim
-alias yt="youtube-dl"
-
-# Kubernetes
-alias kc="kubectl --kubeconfig=$HOME/cluster.config"
-alias helm="helm --kubeconfig=$HOME/cluster.config"
-export CORE=$GOPATH/src/gitlab.com/redeam/core
-alias c="cd $CORE"
-
-## Kubernetes
-function gdep {
- godepgraph -o gitlab.com/redeam -s gitlab.com/redeam/core/$1 | dot -Tpng -o /tmp/dep.png
- open /tmp/dep.png
-}
-
-function gp {
- kubectl --kubeconfig=$HOME/cluster.config get pods | egrep -o "$1.*Running" | egrep -o "$1[^ ]*" | head -1
-}
-
-function kcforward {
- POD=`gp $1`
- kubectl --kubeconfig=$HOME/cluster.config port-forward $POD $2:8001
-}
-
-alias kt="ktail --kubeconfig=$HOME/cluster.config -t '
-$BOLD$LIGHT_CYAN{{ .Container.Name }}$NONE $DIM{{ .Pod.Name }}$NONE $YELLOW{{ if .Timestamp }}{{ .Timestamp.Format \"2006-01-02T15:04:05.999999999Z07:00\" }}{{ end }}$NONE
-{{ .Message }} '"
-
-# coloured manuals
-man() {
- env \
- LESS_TERMCAP_mb=$(printf "\e[1;31m") \
- LESS_TERMCAP_md=$(printf "\e[1;31m") \
- LESS_TERMCAP_me=$(printf "\e[0m") \
- LESS_TERMCAP_se=$(printf "\e[0m") \
- LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
- LESS_TERMCAP_ue=$(printf "\e[0m") \
- LESS_TERMCAP_us=$(printf "\e[1;32m") \
- man "$@"
-}
-
-setxkbmap -layout us -option ctrl:nocaps
-
-# fkill - kill process
-fkill() {
- local pid
- pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
-
- if [ "x$pid" != "x" ]
- then
- echo $pid | xargs kill -${1:-9}
- fi
-}
-
-# ----------------------------------------------------------------------
-# Env
-export TERMINAL=$HOME/.bin/alacritty
-export PATH=$PATH:/usr/local/bin
-export PATH=$PATH:$HOME/.bin
-
-export HISTSIZE=1000
-export SAVEHIST=1000
-export HISTFILE=~/.history
-
-## User configuration
-export MANPATH=/usr/local/share/man:$MANPATH
-
-## Haskel
-export PATH=$PATH:$HOME/Library/Haskell/bin
-
-## Go
-export GOPATH=$HOME/prog/go
-export PATH=$PATH:$GOPATH/bin
-
-## Rust
-export PATH=$PATH:$HOME/.cargo/bin
-
-## fzf
-export FZF_DEFAULT_OPTS='--height 40% --exact'
-export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'"
-export FZF_CTRL_R_OPTS='--sort --exact'
-
-## Google Cloud SDK
-export PATH="/usr/local/opt/texinfo/bin:$PATH"
-export PATH="/usr/local/opt/gpg-agent/bin:$PATH"
-
-
-
-
-# re-wrote the script above
-bind '"\C-r": "\C-x1\e^\er"'
-bind -x '"\C-x1": __fzf_history';
-
-__fzf_history ()
-{
-__ehc $(history | fzf --tac --tiebreak=index | perl -ne 'm/^\s*([0-9]+)/ and print "!$1"')
-}
-
-__ehc()
-{
-if
- [[ -n $1 ]]
-then
- bind '"\er": redraw-current-line'
- bind '"\e^": magic-space'
- READLINE_LINE=${READLINE_LINE:+${READLINE_LINE:0:READLINE_POINT}}${1}${READLINE_LINE:+${READLINE_LINE:READLINE_POINT}}
- READLINE_POINT=$(( READLINE_POINT + ${#1} ))
-else
- bind '"\er":'
- bind '"\e^":'
-fi
-}
-
-# auto command to cd without cd
-shopt -s autocd
diff --git a/dots/.config/alacritty/alacritty.yml b/dots/.config/alacritty/alacritty.yml
@@ -24,12 +24,12 @@ window:
# Units are physical pixels; this is not DPI aware.
# (change requires restart)
padding:
- x: 10
- y: 10
+ x: 45
+ y: 45
# Window decorations
# Setting this to false will result in window without borders and title bar.
- # decorations: transparent
+ decorations: transparent
# Display tabs using this many cells (changes require restart)
tabspaces: 8
@@ -58,7 +58,7 @@ font:
# style: Italic
# Point size of the font
- size: 7
+ size: 12.0
# Offset is the extra space around each character. offset.y can be thought of
# as modifying the linespacing, and offset.x as modifying the letter spacing.
@@ -83,13 +83,13 @@ render_timer: false
# Use custom cursor colors. If true, display the cursor in the cursor.foreground
# and cursor.background colors, otherwise invert the colors of the cursor.
-#custom_cursor_colors: false
+custom_cursor_colors: false
# Colors (Tomorrow Night Bright)
colors:
# Default colors
primary:
- background: '#1d2021'
+ background: '#161819'
foreground: '#ebdbb2'
# Colors the cursor will use if `custom_cursor_colors` is true
@@ -186,8 +186,6 @@ mouse:
# or triple click.
double_click: { threshold: 300 }
triple_click: { threshold: 300 }
-
- # If this is `true`, the cursor is temporarily hidden when typing.
hide_when_typing: true
# Faux Scrollback
@@ -198,14 +196,14 @@ mouse:
# scrolling for applications like `man`.
#
# To disable this completely, set `faux_scrollback_lines` to 0.
- # faux_scrollback_lines: 1
+ faux_scrollback_lines: 1
selection:
semantic_escape_chars: ",│`|:\"' ()[]{}<>"
dynamic_title: true
-#hide_cursor_when_typing: true
+hide_cursor_when_typing: true
# Style of the cursor
#
@@ -213,7 +211,7 @@ dynamic_title: true
# - Block
# - Underline
# - Beam
-#cursor_style: Block
+cursor_style: Block
# Live config reload (changes require restart)
live_config_reload: true
@@ -224,7 +222,7 @@ live_config_reload: true
# Entries in shell.args are passed unmodified as arguments to the shell.
#
shell:
- program: /bin/bash
+ program: /bin/zsh
# args:
# - --login
@@ -263,9 +261,11 @@ shell:
# `command` must be a map containing a `program` string, and `args` array of
# strings. For example:
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
+#
+# USE: xxd -psd
key_bindings:
- - { key: V, mods: Control|Shift, action: Paste }
- - { key: C, mods: Control|Shift, action: Copy }
+ - { key: V, mods: Command, action: Paste }
+ - { key: C, mods: Command, action: Copy }
- { key: Q, mods: Command, action: Quit }
- { key: W, mods: Command, action: Quit }
- { key: Home, chars: "\x1bOH", mode: AppCursor }
@@ -443,18 +443,3 @@ key_bindings:
- { key: Key6, mods: Alt|Shift, chars: "\x1b^" } # Alt + ^
- { key: Backslash, mods: Alt, chars: "\x1b\\" } # Alt + \
- { key: Backslash, mods: Alt|Shift, chars: "\x1b|" } # Alt + |
-
- - { key: Period, mods: Alt, chars: "\x1b." }
- - { key: Key8, mods: Alt|Shift, chars: "\x1b*" }
- - { key: Key3, mods: Alt|Shift, chars: "\x1b#" }
-
- - { key: Key1, mods: Alt, chars: "\x1b1" }
- - { key: Key2, mods: Alt, chars: "\x1b2" }
- - { key: Key3, mods: Alt, chars: "\x1b3" }
- - { key: Key4, mods: Alt, chars: "\x1b4" }
- - { key: Key5, mods: Alt, chars: "\x1b5" }
- - { key: Key6, mods: Alt, chars: "\x1b6" }
- - { key: Key7, mods: Alt, chars: "\x1b7" }
- - { key: Key8, mods: Alt, chars: "\x1b8" }
- - { key: Key9, mods: Alt, chars: "\x1b9" }
- - { key: Key0, mods: Alt, chars: "\x1b0" }
diff --git a/dots/.vimrc b/dots/.vimrc
@@ -7,10 +7,15 @@
let mapleader =" "
call plug#begin('~/.vim/plugged')
+Plug 'Valloric/YouCompleteMe'
+Plug '/usr/local/opt/fzf'
+Plug 'rust-lang/rust.vim'
Plug 'junegunn/goyo.vim'
Plug 'fatih/vim-go'
call plug#end()
+map <leader>g :Goyo<CR>
+
" Some basics:
set nocompatible
set encoding=utf-8
@@ -24,3 +29,35 @@ call plug#end()
" Open corresponding .pdf
map <leader>p :!open <c-r>%<CR><CR>
+
+" enable man pages in vim
+ runtime ftplugin/man.vim
+
+" Window Navigation
+ nnoremap <C-h> <C-w>h
+ nnoremap <C-j> <C-w>j
+ nnoremap <C-k> <C-w>k
+ nnoremap <C-l> <C-w>l
+
+" fzf
+ noremap <C-x><C-f> :FZF<CR>
+ noremap <C-x>b :Buffers<CR>
+ noremap <C-x><C-s> :w<CR>
+ nmap <C-x><C-s> :w<CR>
+ noremap <C-c>psr :Rg<CR>
+ noremap <C-c>pf :GFiles<CR>
+ nmap <C-s> :BLines<CR>
+ autocmd! FileType fzf
+ autocmd FileType fzf set laststatus=0 noshowmode noruler
+ \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
+
+ noremap <C-x>` :cn<CR>
+ noremap <C-x><C-c> :qa<CR>
+ noremap <C-c><C-c> :GoBuild
+
+ command! Core execute ":cd $CORE"
+
+
+ nnoremap gi :GoImports<CR>
+
+ noremap <leader>t :vertical terminal<CR>+
\ No newline at end of file
diff --git a/dots/.zshenv b/dots/.zshenv
@@ -1,6 +1,5 @@
export TERMINAL=$HOME/bin/alacritty
export PATH=$PATH:/usr/local/bin
-export PATH=$PATH:$HOME/.bin
## ZSH Config
export ZDOTDIR=$HOME
@@ -28,9 +27,11 @@ export PATH="/usr/local/sbin:$PATH"
export PATH=$PATH:$HOME/Library/Haskell/bin
## Go
+export GOROOT=/usr/local/go
export GOPATH=$HOME/prog/go
export PATH=$PATH:$GOPATH/bin
export CORE=$GOPATH/src/gitlab.com/redeam/core
+export OPS=$GOPATH/src/gitlab.com/redeam/corestar
## Docker
export DOCKER_HIDE_LEGACY_COMMANDS=1
diff --git a/dots/.zshrc b/dots/.zshrc
@@ -14,11 +14,13 @@ alias f="fzf --preview=\"head -$LINES {}\""
alias fz="vim \$(f)"
alias vi=vim
alias yt="youtube-dl"
+alias r="ranger"
# Kubernetes
alias kc="kubectl --kubeconfig=$HOME/cluster.config"
alias helm="helm --kubeconfig=$HOME/cluster.config"
alias c="cd $CORE"
+alias o="cd $OPS"
## Kubernetes
function gdep {
@@ -26,15 +28,6 @@ function gdep {
open /tmp/dep.png
}
-function gp {
- kubectl --kubeconfig=$HOME/cluster.config get pods | egrep -o "$1.*Running" | egrep -o "$1[^ ]*" | head -1
-}
-
-function kcforward {
- POD=`gp $1`
- kubectl --kubeconfig=$HOME/cluster.config port-forward $POD $2:8001
-}
-
alias kt="ktail --kubeconfig=$HOME/cluster.config -t '
$BOLD$LIGHT_CYAN{{ .Container.Name }}$NONE $DIM{{ .Pod.Name }}$NONE $YELLOW{{ if .Timestamp }}{{ .Timestamp.Format \"2006-01-02T15:04:05.999999999Z07:00\" }}{{ end }}$NONE
{{ .Message }} '"
@@ -48,6 +41,17 @@ function fhc {
echo -n $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//') | pbcopy
}
+# fkill - kill process
+fkill() {
+ local pid
+ pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
+
+ if [ "x$pid" != "x" ]
+ then
+ echo $pid | xargs kill -${1:-9}
+ fi
+}
+
# coloured manuals
man() {
env \
@@ -63,15 +67,22 @@ man() {
autoload -U +X bashcompinit && bashcompinit
-# if [ -z $TMUX ]
-# then
-# tmux ls && read tmux_session && tmux attach -t ${tmux_session:-default} || tmux new -s ${tmux_session:-default}
-# fi
+if [[ "$OSTYPE" == "linux-gnu" ]]; then
+ setxkbmap -layout us -option ctrl:nocaps
+
+ # The next line updates PATH for the Google Cloud SDK.
+ if [ -f '/home/mjf/prog/google-cloud-sdk/path.zsh.inc' ]; then
+ . '/home/mjf/prog/google-cloud-sdk/path.zsh.inc';
+ fi
-setxkbmap -layout us -option ctrl:nocaps
+ # The next line enables shell command completion for gcloud.
+ if [ -f '/home/mjf/prog/google-cloud-sdk/completion.zsh.inc' ]; then
+ . '/home/mjf/prog/google-cloud-sdk/completion.zsh.inc';
+ fi
-# The next line updates PATH for the Google Cloud SDK.
-if [ -f '/home/mjf/prog/google-cloud-sdk/path.zsh.inc' ]; then . '/home/mjf/prog/google-cloud-sdk/path.zsh.inc'; fi
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+ if [ -f '/Users/markfeller/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then
+ source '/Users/markfeller/Downloads/google-cloud-sdk/completion.zsh.inc';
+ fi
+fi
-# The next line enables shell command completion for gcloud.
-if [ -f '/home/mjf/prog/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/mjf/prog/google-cloud-sdk/completion.zsh.inc'; fi
diff --git a/packages b/packages
@@ -0,0 +1,27 @@
+# Shell
+zsh
+
+# Music
+mpd
+mpc
+ncmpcpp
+
+# Utilities
+fzf
+ripgrep
+emacs
+vim
+ranger # file browser
+wget
+youtube-dl
+htop
+jq
+neofetch
+stow # manage dotfiles
+
+# build systems
+cmake
+gcc
+go
+pyenv
+ipython+
\ No newline at end of file
diff --git a/packages_linux b/packages_linux
@@ -0,0 +1,6 @@
+i3wm
+i3status
+i3lock
+rofi
+dunst
+libnotify+
\ No newline at end of file