Repository: rmm5t/dotfiles
Branch: master
Commit: 43d04ce4ce8b
Files: 102
Total size: 95.1 KB
Directory structure:
gitextract_hhc_yfqc/
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .gitmodules
├── Brewfile
├── README.md
├── ackrc
├── agignore
├── bash_aliases
├── bash_completion
├── bash_powerline
├── bash_profile
├── bashrc
├── bundle/
│ └── config
├── ctags
├── editrc
├── emacs.d/
│ ├── backups/
│ │ └── .keep
│ ├── init.el
│ ├── locks/
│ │ └── .keep
│ ├── personal/
│ │ ├── ace-jump-mode.el
│ │ ├── add-node-modules-path.el
│ │ ├── ag.el
│ │ ├── alchemist.el
│ │ ├── auctex.el
│ │ ├── bindings.el
│ │ ├── c.el
│ │ ├── company-mode.el
│ │ ├── csv-mode.el
│ │ ├── dash-at-point.el
│ │ ├── defuns.el
│ │ ├── diff.el
│ │ ├── dimmer.el
│ │ ├── dired-details+.el
│ │ ├── dired.el
│ │ ├── disabled.el
│ │ ├── editorconfig.el
│ │ ├── exec-path-from-shell.el
│ │ ├── expand-region.el
│ │ ├── flx-ido.el
│ │ ├── flycheck.el
│ │ ├── flymake.el
│ │ ├── fonts.el
│ │ ├── forge.el
│ │ ├── global.el
│ │ ├── grep.el
│ │ ├── groovy-mode.el
│ │ ├── hl-line.el
│ │ ├── htmlize.el
│ │ ├── ido.el
│ │ ├── javascript.el
│ │ ├── jekyll.el
│ │ ├── js2-mode.el
│ │ ├── kbd-macros.el
│ │ ├── key-chord.el
│ │ ├── lua-mode.el
│ │ ├── mac.el
│ │ ├── magit.el
│ │ ├── markdown-mode.el
│ │ ├── maxframe.el
│ │ ├── motion-mode.el
│ │ ├── multiple-cursors.el
│ │ ├── nodejs-repl.el
│ │ ├── org.el
│ │ ├── powerline.el
│ │ ├── prettier-js.el
│ │ ├── projectile-rails.el
│ │ ├── projectile.el
│ │ ├── rbenv.el
│ │ ├── recentf.el
│ │ ├── rectangle.el
│ │ ├── restclient.el
│ │ ├── rhtml-mode.el
│ │ ├── ri-emacs.el
│ │ ├── ruby-hash-syntax.el
│ │ ├── ruby-mode.el
│ │ ├── saveplace.el
│ │ ├── scratch.el
│ │ ├── server-mode.el
│ │ ├── shell-mode.el
│ │ ├── shell-pop.el
│ │ ├── tabs.el
│ │ ├── textile-mode.el
│ │ ├── theme.el
│ │ ├── toggle-quotes.el
│ │ ├── utf-8.el
│ │ ├── yaml-mode.el
│ │ ├── yasnippet.el
│ │ └── zoom.el
│ └── vendor/
│ ├── mode-line-bell.el
│ ├── rcodetools.el
│ └── upgrade.rb
├── gemrc
├── gitconfig
├── gitignore
├── guard.rb
├── inputrc
├── install.rb
├── irbrc
├── rubocop.yml
├── screenrc
├── tmux.conf
├── vimrc
└── yarnrc
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [rmm5t]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
custom: "https://www.paypal.me/rmm5t/5"
================================================
FILE: .gitignore
================================================
.DS_Store
bundle/cache
emacs.d/ac-dict
emacs.d/bookmarks
emacs.d/eln-cache
emacs.d/elpa
emacs.d/projectile-bookmarks.eld
emacs.d/abbrev_defs
emacs.d/auto-save-list
emacs.d/backups/*
!emacs.d/backups/.keep
emacs.d/locks/*
!emacs.d/locks/.keep
emacs.d/places
emacs.d/recentf
emacs.d/tramp
emacs.d/transient
emacs.d/ido.last
emacs.d/.org-id-locations
emacs.d/.mc-lists.el
emacs.d/personal/custom.el
emacs.d/personal/private.el
emacs.d/projectile.cache
emacs.d/var
emacs.d/forge-database*
*.elc
================================================
FILE: .gitmodules
================================================
[submodule "emacs.d/vendor/ri-emacs"]
path = emacs.d/vendor/ri-emacs
url = https://github.com/pedz/ri-emacs.git
[submodule "emacs.d/vendor/jekyll.el"]
path = emacs.d/vendor/jekyll.el
url = https://github.com/talison/jekyll.el.git
[submodule "emacs.d/vendor/projectile"]
path = emacs.d/vendor/projectile
url = https://github.com/bbatsov/projectile.git
[submodule "emacs.d/vendor/insert-time.el"]
path = emacs.d/vendor/insert-time.el
url = https://github.com/rmm5t/insert-time.el.git
[submodule "emacs.d/vendor/electric-align"]
path = emacs.d/vendor/electric-align
url = https://github.com/zk-phi/electric-align.git
================================================
FILE: Brewfile
================================================
tap "d12frosted/emacs-plus"
tap "dopplerhq/cli"
tap "homebrew/bundle"
tap "homebrew/services"
tap "puma/puma"
brew "ack"
brew "ca-certificates"
brew "openssl@3"
brew "sqlite"
brew "python@3.12"
brew "awscli"
brew "bash-completion"
brew "glib"
brew "certbot"
brew "direnv"
brew "p11-kit"
brew "unbound"
brew "gnutls"
brew "icu4c@76"
brew "harfbuzz"
brew "libass"
brew "pango"
brew "srt"
brew "tesseract"
brew "ffmpeg"
brew "forego"
brew "gdbm"
brew "gdk-pixbuf"
brew "git"
brew "gnupg"
brew "gnupg@1.4"
brew "go"
brew "pkgconf"
brew "gobject-introspection"
brew "heroku"
brew "htop"
brew "hub"
brew "shared-mime-info"
brew "libheif"
brew "imagemagick"
brew "jq"
brew "libffi"
brew "librsvg"
brew "libyaml"
brew "mailcatcher"
brew "mcrypt"
brew "zlib"
brew "mysql"
brew "nginx"
brew "node-build"
brew "nodenv"
brew "openssl@1.1"
brew "png2ico"
brew "postgresql@15", restart_service: true, link: true
brew "python@3.10"
brew "python@3.11"
brew "python@3.9"
brew "ruby-build"
brew "rbenv"
brew "rbenv-default-gems"
brew "redis", restart_service: true
brew "telnet"
brew "the_silver_searcher"
brew "tmux"
brew "tree"
brew "watch"
brew "wget"
brew "d12frosted/emacs-plus/emacs-plus@29"
brew "dopplerhq/cli/doppler", link: false
brew "puma/puma/puma-dev"
cask "chromedriver"
cask "google-cloud-sdk"
cask "keycastr"
cask "libreoffice"
================================================
FILE: README.md
================================================
# Getting Started
Clone this (or a forked version of this) repository.
$ cd ~
$ git clone https://github.com/rmm5t/dotfiles.git .dotfiles
**(Option 1)** If you'd like to symlink everything from this repository to your
home directory, run `install.rb`. This will also sync and update all the git
submodules within.
$ cd ~/.dotfiles
$ ./install.rb
This install script is idempotent, meaning you can run it over and over again
without fear of breaking anything. Use it as an installer or to upgrade after
merging from an upstream fork.
**(Option 2)** If you'd like to just symlink one or more configurations to your
home directory manually, you can. If you take this approach, you'll have to
update all the git submodules manually.
$ cd ~/.dotfiles
$ git submodule sync
$ git submodule update --init --recursive
$ ln -ns emacs ~/.emacs
$ ln -ns emacs.d ~/.emacs.d
**(Option 3)** Just look around and pick and choose what you like for your own
dotfiles.
## Notes
If you'd like to use git and github, be sure to add your own `~/.gitconfig_local` file:
```
[user]
email = email@example.com
name = Your Name
[github]
user = your-github-username
```
## Requirements
* *nix environment (e.g. Mac OS X or Linux)
* Bash version >= 3 (for command line enhancements)
* Emacs version >= 30 (for emacs config and setup)
* Ruby (for the install.rb to work)
## License
[MIT License](https://rmm5t.mit-license.org/)
================================================
FILE: ackrc
================================================
--ignore-dir=log
--ignore-dir=vendor
--ignore-dir=node_modules
--ignore-dir=tmp
--ignore-dir=.bundle
--ignore-file=is:tags
--ignore-file=is:TAGS
--ignore-file=is:.gitignore
================================================
FILE: agignore
================================================
.DS_Store
\#*
.\#*
/TAGS
*.elc
/.bundle
/vendor/bundle
/vendor/ruby
/vendor/rbx
/vendor/jruby
/*/.bundle
/*/vendor/bundle
/*/vendor/ruby
/*/vendor/rbx
/*/vendor/jruby
/*/*/.bundle
/*/*/vendor/bundle
/*/*/vendor/ruby
/*/*/vendor/rbx
/*/*/vendor/jruby
/sorbet
/*/sorbet
/*/*/sorbet
*.rbc
*.rbi
/public/assets
.rake_t_cache
.rbenv-gemsets
.sass-cache
/dump
*.log
.git
/tmp
/*/tmp
/*/*/tmp
/vcr
/*/vcr
/*/*/vcr
/notes*
================================================
FILE: bash_aliases
================================================
# https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
COLOR_BLACK="$(__tput setaf 0)"
COLOR_WHITE="$(__tput setaf 7)"
COLOR_DARK_GRAY="$(__tput setaf 8)"
COLOR_GRAY="$(__tput setaf 15)"
COLOR_RED="$(__tput setaf 1)"
COLOR_GREEN="$(__tput setaf 2)"
COLOR_YELLOW="$(__tput setaf 3)"
COLOR_BLUE="$(__tput setaf 4)"
COLOR_MAGENTA="$(__tput setaf 5)"
COLOR_CYAN="$(__tput setaf 6)"
COLOR_RESET="$(__tput sgr0)"
# Adds an alias to the current shell and to this file.
# Borrowed from Mislav (http://github.com/mislav/dotfiles/tree/master/bash_aliases)
add-alias ()
{
local name=$1 value=$2
echo "alias $name='$value'" >> ~/.bash_aliases
eval "alias $name='$value'"
alias $name
}
############################################################
## Bash
############################################################
alias cd..="cd .."
alias ..="cd .."
alias ...="cd ../../"
alias ....="cd ../../../"
alias .2="cd ../../"
alias .3="cd ../../../"
alias .4="cd ../../../../"
alias .5="cd ../../../../../"
alias ~="cd ~"
alias c="clear"
alias path='echo -e ${PATH//:/\\n}'
alias ax="chmod a+x"
############################################################
## List
############################################################
# for Mac (good for dark backgrounds)
export LSCOLORS=gxfxcxdxbxegedabagacad
# for non-Mac and `tree` command (good for dark backgrounds)
# For LS_COLORS template: $ dircolors /etc/DIR_COLORS
export LS_COLORS='no=00:fi=00:di=00;36:ln=00;35:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;31:'
if [[ `uname` == 'Darwin' ]]; then
alias ls="ls -G"
else
alias ls="ls --color=auto"
fi
alias l="ls"
alias ll="ls -lh"
alias la="ls -a"
alias lal="ls -alh"
############################################################
## Git
############################################################
if [ -d "/Applications/GitX.app/" ]; then
alias gitx="/Applications/GitX.app/Contents/Resources/gitx"
fi
function gb {
tput rmam; git branch -v $*; tput smam
}
alias g="git"
# alias gb="tput rmam; git branch -a -v; tput smam"
alias gba="git branch -a -v"
alias gc="git commit -v"
alias gca="git commit -v -a"
alias gcob="git checkout -b"
alias gd="git diff"
alias gl="git pull"
alias glr="git pull --rebase"
alias gf="git fetch"
alias gp="git push"
alias gs="git status -sb"
alias gr="git remote"
alias grp="git remote prune"
alias grhu="git reset --hard @{upstream}"
alias gcp="git cherry-pick"
alias gg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci)%Creset %C(cyan)%an%Creset'"
alias ggs="gg --stat"
alias gsl="git shortlog -sn --no-merges"
alias gw="git whatchanged"
alias gsu="git submodule update --init --recursive"
alias gi="git config branch.master.remote 'origin'; git config branch.master.merge 'refs/heads/master'"
if [ `which hub 2> /dev/null` ]; then
alias git="hub"
fi
alias gchurn="git log --pretty="format:" --name-only | grep -vE '^(vendor/|$)' | sort | uniq -c | sort"
alias gcherry="git log --left-right --graph --cherry-pick --oneline" # master...feature
alias ggemfilelock="git checkout HEAD -- Gemfile.lock && bundle install"
function gsd {
target=${1%/}
git submodule deinit $target
git rm -f $target
rm -rf .git/modules/$target
}
# Useful report of what has been committed locally but not yet pushed to another
# branch. Defaults to the remote origin/master. The u is supposed to stand for
# undone, unpushed, or something.
# $1: upstream (default: master)
# $2: head (default: current HEAD)
function gu {
local branch=$1
if [ -z "$1" ]; then
branch=master
fi
if [[ ! "$branch" =~ "/" ]]; then
branch=origin/$branch
fi
local cmd="git cherry -v $branch $2"
echo $cmd
$cmd
}
function gco {
if [ -z "$1" ]; then
git checkout $(git symbolic-ref --short refs/remotes/origin/HEAD | awk -F/ '{print $2}')
git sync
else
git checkout $*
fi
}
function gprune {
local remote=$1
if [ -z "$1" ]; then
remote=origin
fi
local cmd="git remote prune $remote"
echo $cmd
$cmd
}
function st {
if [ -d ".svn" ]; then
svn status
else
git status -sb
fi
}
############################################################
## Subversion
############################################################
# Remove all .svn folders from directory recursively
alias svn-clean='find . -name .svn -print0 | xargs -0 rm -rf'
############################################################
## OS X
############################################################
# Get rid of those pesky .DS_Store files recursively
alias dstore-clean='find . -type f -name .DS_Store -print0 | xargs -0 rm'
# Track who is listening to your iTunes music
alias whotunes='lsof -r 2 -n -P -F n -c iTunes -a -i TCP@`hostname`:3689'
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apple’s System Logs to improve shell startup speed
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
# Show/hide hidden files in Finder
alias showdotfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hidedotfiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias showdeskicons="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
alias hidedeskicons="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias caffeinated="caffeinate -disu"
############################################################
## Ruby
############################################################
alias rtags="ctags -e -R app lib vendor tasks"
function gemdir {
echo `gem env gemdir`
}
function gemfind {
local gems=`gemdir`/gems
echo `ls $gems | grep -i $1 | sort | tail -1`
}
# Use: gemcd <name>, cd's into your gems directory
# that best matches the name provided.
function gemcd {
cd `gemdir`/gems/`gemfind $1`
}
# Use: gemdoc <gem name>, opens the rdoc of the gem
# that best matches the name provided.
function gemdoc {
open `gemdir`/doc/`gemfind $1`/rdoc/index.html
}
alias rehash="rbenv rehash && nodenv rehash"
function update-rubygems {
cyan=`tput setaf 6`
reset=`tput sgr0`
for version in `rbenv whence gem`; do
rbenv shell "$version"
echo
echo "${cyan}Updating rubygems for ${version}${reset}"
gem update --system --quiet
echo
echo "${cyan}Updating bundler for ${version}${reset}"
gem update bundler --quiet
done
}
############################################################
## Bundler
############################################################
function ignore_vendor_ruby {
grep -q 'vendor/bundle' .gitignore > /dev/null
if [[ $? -ne 0 ]]; then
echo -e "\nvendor/bundle" >> .gitignore
fi
grep -q 'vendor/ruby' .gitignore > /dev/null
if [[ $? -ne 0 ]]; then
echo -e "\nvendor/ruby" >> .gitignore
fi
}
alias b="bundle"
alias bu="b update"
alias bub="bu --bundler"
alias be="b exec"
alias binit="bi && bundle package"
alias ba="bundle-audit update && bundle-audit"
# This relies on a global config to force a `--path vendor` whenever `bundle
# install` is executed.
# ----------
# Bundler v1: Be sure to install https://github.com/rmm5t/rbenv-bundle-path-fix
# Bundler v2: Be sure to first run: `bundle config --global path vendor`
function bi {
if [ -f ./vendor/cache ]; then
b install --local $*
else
b install $*
fi
}
############################################################
## Middleman
############################################################
alias m="be middleman"
############################################################
## NPM/Yarn
############################################################
alias y="yarn"
alias yi="yarn install"
alias yu="yarn upgrade"
alias yinit="echo -e \"yarn-offline-mirror \\\"./node_cache\\\"\\nyarn-offline-mirror-pruning true\" >> ./.yarnrc; yi"
############################################################
## Docker
############################################################
alias d="docker"
alias dc="docker-compose"
alias dcr="dc run"
alias docker_rm_all='docker rm $(docker ps -a -q)'
alias dr="docker run -it --rm"
############################################################
## AWS Stuff
############################################################
alias dynamodb-start="docker run -d -p 8000:8000 -v ~/.dynamodb/data:/data --name dynamodb --restart always amazon/dynamodb-local -jar DynamoDBLocal.jar -dbPath /data -sharedDb"
alias dynamodb-stop="docker stop dynamodb && docker rm dynamodb"
alias postgis-start="docker run -d -p 5433:5432 -v ~/.postgis/data:/var/lib/postgresql/data --name postgis -e POSTGRES_PASSWORD=postgres --restart always mdillon/postgis"
alias postgis-stop="docker stop postgis && docker rm postgis"
############################################################
## Heroku
############################################################
function heroku_command {
if [ -z "$*" ]; then
echo "run console"
else
echo "$*"
fi
}
function hdemo {
heroku `heroku_command $*` --remote demo
}
function hdev {
heroku `heroku_command $*` --remote dev
}
function hdev2 {
heroku `heroku_command $*` --remote dev2
}
function hstaging {
heroku `heroku_command $*` --remote staging
}
function hproduction {
heroku `heroku_command $*` --remote production
}
alias deploy_hproduction='hproduction maintenance:on && git push production && hproduction run rake db:migrate && hproduction maintenance:off'
alias deploy_hstaging='hstaging maintenance:on && git push staging && hstaging run rake db:migrate && hstaging maintenance:off'
############################################################
## Kubernetes
############################################################
function kubectl_command {
if [[ "$1" =~ (-w|^$) ]]; then
echo "get pods -o wide $1"
elif [[ "$1" =~ "restart" ]]; then
echo "rollout restart deployment $(basename $PWD)-deployment"
elif [[ "$1" =~ "shell" ]]; then
echo "exec exec --stdin --tty $2"
elif [[ "$1" =~ "context" ]]; then
echo "config use-context $2"
# elif [[ "$1" =~ (deployment ) ]]; then
# echo "$* $(basename $PWD)-deployment"
# elif [[ "$*" =~ (hpa|ingress|service) ]]; then
# echo "$* $(basename $PWD)-dsogenericcharts3"
else
echo ${*/--dryrun/}
fi
}
function k {
cmd="kubectl $(kubectl_command $*) -n $(basename $PWD)"
echo "${COLOR_CYAN}$ $cmd${COLOR_RESET}"
if ! [[ "$*" =~ "--dryrun" ]]; then
$cmd
fi
}
############################################################
## Rails
############################################################
alias tl="tail -f log/development.log"
alias tp="tail -1000 -f ~/Library/Logs/puma-dev.log"
alias ss="spring status && echo && spring stop"
# Rails 3 or 4
function r {
if [ -e "script/rails" ]; then
script/rails $*
else
rails $* # Assumes ./bin is in the PATH
fi
}
alias restart="touch tmp/restart.txt"
alias refresh="rehash && ss && direnv allow && restart"
alias rr="refresh"
############################################################
## MongoDB
############################################################
alias repair-mongo="rm /usr/local/var/mongodb/mongod.lock && mongod --repair"
############################################################
## Redis
############################################################
alias redis-flushall="redis-cli flushall"
function redis-flushdb() {
redis-cli -n $1 flushdb
}
############################################################
## Media
############################################################
# brew install ffmpeg --with-libvorbis --with-theora --with-fdk-aac --with-tools
function mp32ogg {
file=$1
ffmpeg -i "$file" -c:a libvorbis -q:a 4 $(basename ${file} .mp3).ogg
}
function ogg2mp3 {
file=$1
ffmpeg -i "$file" -c:a libmp3lame $(basename ${file} .ogg).mp3
}
############################################################
## Emacs
############################################################
alias e="emacsclient -nw"
############################################################
## Miscellaneous
############################################################
alias install_ffmpeg='brew install ffmpeg --with-libvorbis --with-theora --with-fdk-aac --with-faac --with-tools'
export GREP_COLOR="1;37;41"
alias grep="grep --color=auto"
alias wgeto="wget -q -O -"
if ! [ `which md5 2> /dev/null` ]; then
alias md5="openssl dgst -md5"
fi
alias sha1="openssl dgst -sha1"
alias sha2="openssl dgst -sha256" # shortcut
alias sha256="openssl dgst -sha256"
alias sha512="openssl dgst -sha512"
alias b64="openssl enc -base64"
alias 256color="export TERM=xterm-256color"
alias dig="dig +noall +answer"
alias flushdns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
alias whichlinux='uname -a; cat /etc/*release; cat /etc/issue'
alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
alias myip4="curl -s4 http://icanhazip.com/"
alias mylocation="curl -s4 http://ip-api.com/json | prettyjson"
# curl with response time outptu:
alias curlt="curl -w '\n\n------------------------\nResponse time: %{time_total}s\n'"
function eachd {
for dir in *; do
cd $dir
echo $dir
$1
cd ..
done
}
function fakefile {
let mb=$1
let bytes=mb*1048576
dd if=/dev/random of=${mb}MB-fakefile bs=${bytes} count=1 &> /dev/null
}
function color() {
for c; do
tput setab $c
printf ' %03d ' $c
done
tput sgr0
echo
}
function colors() {
x=6
y=40
color {0..7}
color {8..15}
for ((i=0; i<$y; i++)); do
color $(seq $((i*$x+16)) $((i*$x+$x-1+16)))
done
}
# Slow cat down
function scroll() {
# brew install pv
cat $1 | pv --quiet --line-mode --rate-limit 2500
}
############################################################
================================================
FILE: bash_completion
================================================
# http://onrails.org/articles/2006/11/17/rake-command-completion-using-rake
if [ -f ~/bin/rake_completion ]; then
. ~/bin/rake_completion
fi
# https://stackoverflow.com/a/24665529/8985
__git_complete g __git_main
__git_complete gco _git_checkout
__git_complete gc _git_commit
__git_complete gl _git_pull
__git_complete glr _git_pull
__git_complete gp _git_push
__git_complete gs _git_status
__git_complete gb _git_branch
__git_complete gu _git_branch
__git_complete gd _git_diff
__git_complete gcp _git_cherry_pick
__git_complete gr _git_remote
__git_complete gcherry _git_log
__git_complete git-pr _git_checkout
================================================
FILE: bash_powerline
================================================
#!/usr/bin/env bash
# Borrowed and customized from https://github.com/riobard/bash-powerline
__powerline() {
# Unicode symbols
readonly PS_SYMBOL_DARWIN=''
# readonly PS_SYMBOL_LINUX='$'
readonly PS_SYMBOL_LINUX='🐧 '
readonly PS_SYMBOL_OTHER='%'
readonly GIT_BRANCH_SYMBOL='⑂'
readonly GIT_BRANCH_CHANGED_SYMBOL='+'
readonly GIT_NEED_PUSH_SYMBOL='⇡'
readonly GIT_NEED_PULL_SYMBOL='⇣'
readonly RUBY_SYMBOL='⬙'
readonly NODE_SYMBOL='⬢'
function __tput { tput $* 2> /dev/null; }
# https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
readonly FG_BLACK="\[$(__tput setaf 0)\]"
readonly FG_WHITE="\[$(__tput setaf 7)\]"
readonly FG_DARK_GRAY="\[$(__tput setaf 8)\]"
readonly FG_GRAY="\[$(__tput setaf 15)\]"
readonly FG_RED="\[$(__tput setaf 1)\]"
readonly FG_GREEN="\[$(__tput setaf 2)\]"
readonly FG_YELLOW="\[$(__tput setaf 3)\]"
readonly FG_BLUE="\[$(__tput setaf 4)\]"
readonly FG_MAGENTA="\[$(__tput setaf 5)\]"
readonly FG_CYAN="\[$(__tput setaf 6)\]"
readonly FG_HIGH_RED="\[$(__tput setaf 9)\]"
readonly FG_HIGH_GREEN="\[$(__tput setaf 10)\]"
readonly FG_HIGH_YELLOW="\[$(__tput setaf 11)\]"
readonly FG_HIGH_BLUE="\[$(__tput setaf 12)\]"
readonly FG_HIGH_MAGENTA="\[$(__tput setaf 13)\]"
readonly FG_HIGH_CYAN="\[$(__tput setaf 14)\]"
readonly BG_BLACK="\[$(__tput setab 0)\]"
readonly BG_WHITE="\[$(__tput setab 7)\]"
readonly BG_DARK_GRAY="\[$(__tput setab 8)\]"
readonly BG_GRAY="\[$(__tput setab 15)\]"
readonly BG_RED="\[$(__tput setab 1)\]"
readonly BG_GREEN="\[$(__tput setab 2)\]"
readonly BG_YELLOW="\[$(__tput setab 3)\]"
readonly BG_BLUE="\[$(__tput setab 4)\]"
readonly BG_MAGENTA="\[$(__tput setab 5)\]"
readonly BG_CYAN="\[$(__tput setab 6)\]"
readonly BG_HIGH_RED="\[$(__tput setab 9)\]"
readonly BG_HIGH_GREEN="\[$(__tput setab 10)\]"
readonly BG_HIGH_YELLOW="\[$(__tput setab 11)\]"
readonly BG_HIGH_BLUE="\[$(__tput setab 12)\]"
readonly BG_HIGH_MAGENTA="\[$(__tput setab 13)\]"
readonly BG_HIGH_CYAN="\[$(__tput setab 14)\]"
readonly BG_DEEP_GREEN="\[$(__tput setab 22)\]"
readonly BG_DEEP_RED="\[$(__tput setab 88)\]"
readonly DIM="\[$(__tput dim)\]"
readonly REVERSE="\[$(__tput rev)\]"
readonly RESET="\[$(__tput sgr0)\]"
readonly BOLD="\[$(__tput bold)\]"
# what OS?
case "$(uname)" in
Darwin)
readonly PS_SYMBOL=$PS_SYMBOL_DARWIN
;;
Linux)
readonly PS_SYMBOL=$PS_SYMBOL_LINUX
;;
*)
readonly PS_SYMBOL=$PS_SYMBOL_OTHER
esac
### Ruby #######################################################
if [ `which rbenv 2> /dev/null` ]; then
__ruby_version() { printf $(rbenv version-name); }
elif [ `which ruby 2> /dev/null` ]; then
__ruby_version() { printf $(ruby --version | cut -d' ' -f2); }
else
__ruby_version() { return; }
fi
__ruby_info() {
local version=$(__ruby_version)
[ -z "${version}" ] && return
printf " $RUBY_SYMBOL ${version} "
}
### Node.js ####################################################
if [ `which nodenv 2> /dev/null` ]; then
__node_version() { printf $(nodenv version-name); }
elif [ `which node 2> /dev/null` ]; then
__node_version() { printf $(node -v | cut -d'v' -f2); }
else
__node_version() { return; }
fi
__node_info() {
local version=$(__node_version)
[ -z "${version}" ] && return
printf " $NODE_SYMBOL ${version} "
}
### Git ########################################################
__git_info() {
[ -x "$(which git)" ] || return # git not found
local git_eng="env LANG=C git" # force git output in English to make our work easier
# get current branch name or short SHA1 hash for detached head
local branch="$($git_eng symbolic-ref --short HEAD 2>/dev/null || $git_eng describe --tags --always 2>/dev/null)"
[ -n "$branch" ] || return # git branch not found
local marks
# branch is modified?
[ -n "$($git_eng status --porcelain)" ] && marks+=" $GIT_BRANCH_CHANGED_SYMBOL"
# how many commits local branch is ahead/behind of remote?
local stat="$($git_eng status --porcelain --branch | grep '^##' | grep -o '\[.\+\]$')"
local aheadN="$(echo $stat | grep -o 'ahead [[:digit:]]\+' | grep -o '[[:digit:]]\+')"
local behindN="$(echo $stat | grep -o 'behind [[:digit:]]\+' | grep -o '[[:digit:]]\+')"
[ -n "$aheadN" ] && marks+=" $GIT_NEED_PUSH_SYMBOL$aheadN"
[ -n "$behindN" ] && marks+=" $GIT_NEED_PULL_SYMBOL$behindN"
printf " $GIT_BRANCH_SYMBOL $branch$marks "
}
### PROMPT #####################################################
# __title_info() { echo -ne "${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}"; }
__title_info() { echo -ne "${PWD##*/} : ${USER}@${HOSTNAME%%.*}"; }
case $TERM in
xterm*|rxvt|Eterm|eterm)
title() { echo -ne "\033]2;$(__title_info)\007"; }
;;
screen)
title() { echo -ne "\033_$(__title_info)\033\\"; }
;;
esac
ps1() {
# Check the exit code of the previous command and display different
# colors in the prompt accordingly.
if [ $? -eq 0 ]; then
local BG_EXIT="$BG_DEEP_GREEN"
else
local BG_EXIT="$BG_DEEP_RED"
fi
PS1="\n$BG_DARK_GRAY$FG_GRAY \s $RESET"
PS1+="$BG_HIGH_YELLOW$FG_BLACK \w $RESET"
PS1+="$BG_HIGH_RED$FG_GRAY$(__ruby_info)$RESET"
PS1+="$BG_DEEP_GREEN$FG_GRAY$(__node_info)$RESET"
PS1+="$BG_HIGH_BLUE$FG_GRAY$(__git_info)$RESET\n"
PS1+="$BG_GRAY$FG_BLACK \u@\h $RESET"
PS1+="$BG_EXIT$FG_GRAY $PS_SYMBOL $RESET "
}
PROMPT_COMMAND="ps1 && title"
}
__powerline
unset __powerline
================================================
FILE: bash_profile
================================================
# ~/.bash_profile: executed by bash for login shells.
if [ -e ~/.bashrc ] ; then
. ~/.bashrc
fi
# Put all local machine customizations in ~/.bash_local
if [ -e ~/.bash_local ] ; then
. ~/.bash_local
fi
================================================
FILE: bashrc
================================================
## This file is sourced by all *interactive* bash shells on startup. This
## file *should generate no output* or it will break the scp and rcp commands.
############################################################
if [ -e /etc/bashrc ] ; then
. /etc/bashrc
fi
# Suppress MacOS warnign about zsh
export BASH_SILENCE_DEPRECATION_WARNING=1
############################################################
## MANPATH
############################################################
function conditionally_prefix_manpath {
local dir=$1
if [ -d $dir ]; then
MANPATH="$dir:${MANPATH}"
fi
}
conditionally_prefix_manpath /usr/local/man
conditionally_prefix_manpath ~/man
############################################################
## SYSTEM PATH
############################################################
function conditionally_prefix_path {
local dir=$1
if [ -d $dir ]; then
PATH="$dir:${PATH}"
fi
}
conditionally_prefix_path /usr/local/bin
conditionally_prefix_path /usr/local/sbin
conditionally_prefix_path /usr/texbin
############################################################
## HOMEBREW
############################################################
if [ -f /opt/homebrew/bin/brew ] && [ `uname -m` == "arm64" ]; then
eval $(/opt/homebrew/bin/brew shellenv)
conditionally_prefix_path /opt/homebrew/opt/python/libexec/bin
elif [ -f /usr/local/bin/brew ]; then
eval $(/usr/local/bin/brew shellenv)
conditionally_prefix_path /usr/local/opt/python/libexec/bin
fi
[[ $(type -P go) ]] && export PATH="$PATH:$(go env GOPATH)/bin"
[[ $(type -P brew) ]] && source "$(brew --prefix)/share/google-cloud-sdk/path.bash.inc"
############################################################
## LOCAL PATH
############################################################
export PNPM_HOME=~/Library/pnpm
conditionally_prefix_path $PNPM_HOME
conditionally_prefix_path ~/.nodenv/bin
conditionally_prefix_path ~/bin
conditionally_prefix_path ~/bin/private
if [ `which rbenv 2> /dev/null` ]; then
eval "$(rbenv init -)"
fi
if [ `which nodenv 2> /dev/null` ]; then
eval "$(nodenv init -)"
fi
PATH=.:./bin:./node_modules/.bin:${PATH}
############################################################
## Other paths
############################################################
function conditionally_prefix_cdpath {
local dir=$1
if [ -d $dir ]; then
CDPATH="$dir:${CDPATH}"
fi
}
conditionally_prefix_cdpath ~/work
conditionally_prefix_cdpath ~/work/oss
CDPATH=.:${CDPATH}
# Set INFOPATH so it includes users' private info if it exists
# if [ -d ~/info ]; then
# INFOPATH="~/info:${INFOPATH}"
# fi
############################################################
## General development configurations
###########################################################
export RBXOPT=-X19
############################################################
## Terminal behavior
############################################################
if [ -f ~/.bash_powerline ]; then
. ~/.bash_powerline
fi
# if [ -n "$BASH" ]; then
# export PS1='\[\033[32m\]\n[\s: \w] (⬥ $(ruby_prompt)) (⬢ $(node_prompt)) $(git_prompt)\n\[\033[31m\][\u@\h]\$ \[\033[00m\]'
# fi
############################################################
## Optional shell behavior
############################################################
shopt -s cdspell
shopt -s extglob
shopt -s checkwinsize
export PAGER="less"
export EDITOR="emacsclient -nw"
############################################################
## History
############################################################
# When you exit a shell, the history from that session is appended to
# ~/.bash_history. Without this, you might very well lose the history of entire
# sessions (weird that this is not enabled by default).
shopt -s histappend
export HISTIGNORE="&:pwd:ls:ll:lal:[bf]g:exit:rm*:sudo rm*"
# remove duplicates from the history (when a new item is added)
export HISTCONTROL=erasedups
# increase the default size from only 1,000 items
export HISTSIZE=10000
export HISTFILESIZE=1000000
############################################################
## Aliases
############################################################
if [ -e ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
############################################################
## Bash Completion, if available
############################################################
if [ -f /opt/homebrew/etc/bash_completion ] && [ `uname -m` == "arm64" ]; then
. /opt/homebrew/etc/bash_completion
elif [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
elif [ -f /etc/profile.d/bash_completion ]; then
. /etc/profile.d/bash_completion
elif [ -f ~/.bash_completion ]; then
# Fallback. This should be sourced by the above scripts.
. ~/.bash_completion
fi
# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[ -f /Users/rmcgeary/.config/yarn/global/node_modules/tabtab/.completions/serverless.bash ] && . /Users/rmcgeary/.config/yarn/global/node_modules/tabtab/.completions/serverless.bash
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[ -f /Users/rmcgeary/.config/yarn/global/node_modules/tabtab/.completions/sls.bash ] && . /Users/rmcgeary/.config/yarn/global/node_modules/tabtab/.completions/sls.bash
############################################################
## Other
############################################################
if [[ "$USER" == '' ]]; then
# mainly for cygwin terminals. set USER env var if not already set
USER=$USERNAME
fi
# Make sure this appears even after rbenv, git-prompt and other shell extensions
# that manipulate the prompt.
if [ `which direnv 2> /dev/null` ]; then
eval "$(direnv hook bash)"
fi
############################################################
## Ruby Performance Boost (see https://gist.github.com/1688857)
############################################################
# export RUBY_GC_MALLOC_LIMIT=60000000
# # export RUBY_FREE_MIN=200000 # Ruby <= 2.0
# export RUBY_GC_HEAP_FREE_SLOTS=200000 # Ruby >= 2.1
================================================
FILE: bundle/config
================================================
---
BUNDLE_PATH: "vendor"
# BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE: "true"
BUNDLE_JOBS: "12"
BUNDLE_GEM__TEST: "minitest"
BUNDLE_GEM__CI: "github"
BUNDLE_GEM__MIT: "true"
BUNDLE_GEM__COC: "false"
BUNDLE_GEM__CHANGELOG: "true"
BUNDLE_GEM__LINTER: "true"
================================================
FILE: ctags
================================================
--langmap=ruby:+.thor
================================================
FILE: editrc
================================================
bind "^R" em-inc-search-prev
================================================
FILE: emacs.d/backups/.keep
================================================
================================================
FILE: emacs.d/init.el
================================================
(setq custom-file "~/.emacs.d/personal/custom.el")
(load custom-file 'noerror)
(load "~/.emacs.d/personal/defuns")
;; self managed
;; ------------------
(personal 'bindings)
(personal 'c)
(personal 'company-mode)
(personal 'diff)
(personal 'dired)
(personal 'disabled)
(personal 'flymake)
(personal 'fonts)
(personal 'global)
(personal 'grep)
;; (personal 'ido) ;; replaced by flx-ido
(personal 'javascript)
(personal 'kbd-macros)
(personal 'mac)
(personal 'org)
(personal 'private)
(personal 'recentf)
(personal 'rectangle)
(personal 'ri-emacs)
(personal 'ruby-mode)
(personal 'saveplace)
(personal 'scratch)
(personal 'server-mode)
(personal 'shell-mode)
(personal 'tabs)
(personal 'theme)
(personal 'utf-8)
(personal 'zoom)
;; elpa managed
;; ------------------
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;; (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
(when (not package-archive-contents) (package-refresh-contents))
(package 'add-node-modules-path)
(package 'ag)
(package 'alchemist)
(package 'browse-kill-ring)
(package 'bundler)
(package 'coffee-mode)
(package 'csv-mode)
(package 'dash-at-point)
(package 'dimmer)
(package 'direnv)
(package 'docker)
(package 'dockerfile-mode)
(package 'editorconfig)
(package 'exec-path-from-shell)
(package 'expand-region)
(package 'feature-mode)
(package 'flx-ido)
(package 'flx-isearch)
(package 'flycheck)
(package 'groovy-mode)
(package 'haml-mode)
(package 'htmlize)
(package 'js2-mode)
(package 'json-mode)
(package 'lua-mode)
(package 'magit)
(package 'forge)
(package 'markdown-mode)
(package 'maxframe)
(package 'motion-mode)
(package 'multiple-cursors)
(package 'nodejs-repl)
(package 'powerline)
(package 'prettier-js)
(package 'projectile)
(package 'projectile-rails)
(package 'rbenv)
(package 'rhtml-mode)
(package 'restclient)
(package 'ruby-hash-syntax)
(package 'sass-mode)
(package 'shell-pop)
(package 'textile-mode)
(package 'typescript-mode)
(package 'vue-mode)
(package 'wgrep-ag)
(package 'yaml-mode)
(package 'yasnippet)
;; submodule managed
;; ------------------
(add-to-list 'load-path "~/.emacs.d/vendor/")
;; (vendor 'ace-jump-mode) ;; unused
;; (vendor 'auctex) ;; unused
(vendor 'feature-mode)
;; (vendor 'hl-line) ;; unused
(vendor 'jekyll)
;; (vendor 'key-chord) ;; unused
(vendor 'mode-line-bell)
(vendor 'rcodetools 'xmp)
(vendor 'insert-time 'insert-time 'insert-date 'insert-date-time 'insert-personal-time-stamp)
(vendor 'electric-align 'electric-align-mode)
================================================
FILE: emacs.d/locks/.keep
================================================
================================================
FILE: emacs.d/personal/ace-jump-mode.el
================================================
;;; Quick navigation jumping by word, char, or line
; Make all jumps case-insensitive
(setq ace-jump-mode-case-sensitive-search nil)
================================================
FILE: emacs.d/personal/add-node-modules-path.el
================================================
(eval-after-load 'js-mode
'(add-hook 'js-mode-hook #'add-node-modules-path))
(eval-after-load 'js2-mode
'(add-hook 'js2-mode-hook #'add-node-modules-path))
================================================
FILE: emacs.d/personal/ag.el
================================================
(require 'ag)
(add-to-list 'ag-arguments "--hidden")
================================================
FILE: emacs.d/personal/alchemist.el
================================================
(require 'elixir-mode)
(add-to-list 'elixir-mode-hook 'alchemist-mode)
================================================
FILE: emacs.d/personal/auctex.el
================================================
;;; LaTeX
;; Try the MacTeX distribution:
;; http://www.tug.org/mactex/
(require 'tex-site)
================================================
FILE: emacs.d/personal/bindings.el
================================================
;;; Global key bindigns
;; How to Define Keyboard Shortcuts in Emacs
;; http://xahlee.org/emacs/keyboard_shortcuts.html
;; Window manipulation
(global-set-key [(control kp-6)] 'enlarge-window-horizontally)
(global-set-key [(control kp-4)] 'shrink-window-horizontally)
(global-set-key [(control kp-8)] 'enlarge-window)
(global-set-key [(control kp-2)] 'shrink-window)
;; Find stuff
(global-set-key [(f2)] 'ag-project-regexp)
(global-set-key [(meta f2)] 'ag-regexp)
(global-set-key [(shift f2)] 'occur)
(global-set-key [(control meta f2)] 'ag-dired-regexp)
;; Keyboard macros
(global-set-key [(shift f4)] 'kmacro-start-macro-or-insert-counter)
;; (global-set-key [(f4)] 'kmacro-end-or-call-macro) ;; already defined
;; Refresh-like
(global-set-key [(f5)] 'revert-buffer)
;; Query Replace
(global-set-key [(f6)] 'query-replace)
(global-set-key [(control f6)] 'query-replace-regexp)
;; Indenting and alignment
(global-set-key [(f8)] 'indent-region)
(global-set-key [(control f8)] 'align)
(global-set-key [(shift f8)] 'align-current)
(global-set-key [(meta f8)] 'align-regexp)
;; Version control and change related
(global-set-key [(control f9)] 'magit-status)
(global-set-key [(f9)] 'magit-status)
;; map the window manipulation keys to meta 0, 1, 2, o
(global-set-key (kbd "M-3") 'split-window-horizontally) ; was digit-argument
(global-set-key (kbd "M-2") 'split-window-vertically) ; was digit-argument
(global-set-key (kbd "M-1") 'delete-other-windows) ; was digit-argument
(global-set-key (kbd "M-0") 'delete-window) ; was digit-argument
(global-set-key (kbd "M-o") 'other-window) ; was facemenu-keymap
(global-set-key (kbd "M-O") 'rotate-windows)
;; Replace dired's M-o
(add-hook 'dired-mode-hook (lambda () (define-key dired-mode-map (kbd "M-o") 'other-window))) ; was dired-omit-mode
;; Replace ibuffer's M-o
(add-hook 'ibuffer-mode-hook (lambda () (define-key ibuffer-mode-map (kbd "M-o") 'other-window))) ; was ibuffer-visit-buffer-1-window
;; To help Unlearn C-x 0, 1, 2, o
(global-unset-key (kbd "C-x 3")) ; was split-window-horizontally
(global-unset-key (kbd "C-x 2")) ; was split-window-vertically
(global-unset-key (kbd "C-x 1")) ; was delete-other-windows
(global-unset-key (kbd "C-x 0")) ; was delete-window
(global-unset-key (kbd "C-x o")) ; was other-window
;; Repeat
(global-set-key [(control z)] 'repeat) ; was suspend-frame
;; Window navigation
(windmove-default-keybindings 'meta)
;; Mac OS X conventions
(global-set-key (kbd "M-a") 'mark-whole-buffer) ; was backward-sentence.
;; Find matching parens
(global-set-key (kbd "C-'") 'match-paren)
;; Easy inserts
(global-set-key (kbd "C-.") 'insert-arrow)
;; ibuffer > list-buffers
(global-set-key (kbd "C-x C-b") 'ibuffer)
;; Easier buffer killing
(global-unset-key (kbd "M-k"))
(global-set-key (kbd "M-K") 'kill-current-buffer)
;; Improved navigation and editing (assumes misc.el)
(global-set-key (kbd "M-Z") 'zap-up-to-char)
(global-set-key (kbd "M-F") 'forward-to-word)
(global-set-key (kbd "M-B") 'backward-to-word)
;; Personal textmate.el bindings
(global-set-key (kbd "C-c f") 'textmate-goto-file)
(global-set-key [(control return)] 'textmate-next-line)
;; Tags
(global-set-key (kbd "M-,") 'pop-tag-mark) ; was tags-loop-continue
;; Goto Line
(global-set-key [remap goto-line] 'goto-line-with-feedback)
(global-set-key (kbd "s-\\") 'fixup-whitespace)
;; Utility bindings
(global-set-key (kbd "C-c +") 'increment-number-at-point)
;; Help teach to unlearn the arrow keys
(global-unset-key (kbd "<left>"))
(global-unset-key (kbd "<right>"))
(global-unset-key (kbd "<up>"))
(global-unset-key (kbd "<down>"))
================================================
FILE: emacs.d/personal/c.el
================================================
(add-to-list 'auto-mode-alist '("ino$" . c-mode))
================================================
FILE: emacs.d/personal/company-mode.el
================================================
(add-hook 'after-init-hook 'global-company-mode)
================================================
FILE: emacs.d/personal/csv-mode.el
================================================
;;; Comma seperated values
(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
================================================
FILE: emacs.d/personal/dash-at-point.el
================================================
(global-set-key "\C-cd" 'dash-at-point)
(global-set-key "\C-ce" 'dash-at-point-with-docset)
================================================
FILE: emacs.d/personal/defuns.el
================================================
;;; Personal functions
;; For loading personal configurations
(defun personal (library)
(load (concat "~/.emacs.d/personal/" (symbol-name library)) 'noerror))
;; For loading packages from the Emacs Lisp Package Archive (ELPA)
(defun package (package)
(when (not (package-installed-p package))
(package-install package))
(personal package))
;; For loading libraries from the vendor directory
;; Modified from defunkt's original version to support autoloading.
;; http://github.com/defunkt/emacs/blob/master/defunkt/defuns.el
(defun vendor (library &rest autoload-functions)
(let* ((file (symbol-name library))
(normal (concat "~/.emacs.d/vendor/" file))
(suffix (concat normal ".el"))
(found nil))
(cond
((file-directory-p normal) (add-to-list 'load-path normal) (set 'found t))
((file-directory-p suffix) (add-to-list 'load-path suffix) (set 'found t))
((file-exists-p suffix) (set 'found t)))
(when found
(if autoload-functions
(dolist (autoload-function autoload-functions)
(autoload autoload-function (symbol-name library) nil t))
(require library)))
(personal library)))
;; Arrows are common, especially in ruby
(defun insert-arrow ()
(interactive)
(delete-horizontal-space)
(insert " => "))
(defun insert-file-name ()
"Insert the full path file name into the current buffer."
(interactive)
(insert (buffer-file-name (window-buffer (minibuffer-selected-window)))))
;; Quickly jump back and forth between matching parens/brackets
(defun match-paren (&optional arg)
"Go to the matching parenthesis character if one is adjacent to point."
(interactive "^p")
(cond ((looking-at "\\s(") (forward-sexp arg))
((looking-back "\\s)" 1) (backward-sexp arg))
;; Now, try to succeed from inside of a bracket
((looking-at "\\s)") (forward-char) (backward-sexp arg))
((looking-back "\\s(" 1) (backward-char) (forward-sexp arg))))
;; Make the whole buffer pretty and consistent
(defun iwb()
"Indent Whole Buffer"
(interactive)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max)))
(defun delete-window-replacement (&optional p)
"Kill current window. If called with PREFIX, kill the buffer too."
(interactive "P")
(if p
(kill-buffer nil))
(delete-window))
(defun delete-other-windows-replacement (&optional p)
"Make the selected window fill its frame. If called with PREFIX,
kill all other visible buffers."
(interactive "P")
(if p
(dolist (window (window-list))
(unless (equal (window-buffer window) (current-buffer))
(kill-buffer (window-buffer window)))))
(delete-other-windows))
(defun lorem ()
(interactive)
(insert "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent libero orci, auctor sed, faucibus vestibulum, gravida vitae, arcu. Nunc posuere. Suspendisse potenti. Praesent in arcu ac nisl ultricies ultricies. Fusce eros. Sed pulvinar vehicula ante. Maecenas urna dolor, egestas vel, tristique et, porta eu, leo. Curabitur vitae sem eget arcu laoreet vulputate. Cras orci neque, faucibus et, rhoncus ac, venenatis ac, magna. Aenean eu lacus. Aliquam luctus facilisis augue. Nullam fringilla consectetuer sapien. Aenean neque augue, bibendum a, feugiat id, lobortis vel, nunc. Suspendisse in nibh quis erat condimentum pretium. Vestibulum tempor odio et leo. Sed sodales vestibulum justo. Cras convallis pellentesque augue. In eu magna. In pede turpis, feugiat pulvinar, sodales eget, bibendum consectetuer, magna. Pellentesque vitae augue."))
;; ;; Use the text around point as a cue what it is that we want from the
;; ;; editor. Allowance has to be made for the case that point is at the
;; ;; edge of a buffer.
;; (defun indent-or-expand (arg)
;; "Either indent according to mode, or expand the word preceding
;; point."
;; (interactive "*P")
;; (if (and
;; (or (bobp) (= ?w (char-syntax (char-before))))
;; (or (eobp) (not (= ?w (char-syntax (char-after))))))
;; (dabbrev-expand arg)
;; (indent-according-to-mode)))
;; This override for transpose-words fixes what I consider to be a flaw with the
;; default implementation in simple.el. To traspose chars or lines, you always
;; put the point on the second char or line to transpose with the previous char
;; or line. The default transpose-words implementation does the opposite by
;; flipping the current word with the next word instead of the previous word.
;; The new implementation below instead makes transpose-words more consistent
;; with how transpose-chars and trasponse-lines behave.
(defun transpose-words (arg)
"[Override for default transpose-words in simple.el]
Interchange words around point, leaving point at end of
them. With prefix arg ARG, effect is to take word before or
around point and drag it backward past ARG other words (forward
if ARG negative). If ARG is zero, the words around or after
point and around or after mark are interchanged."
(interactive "*p")
(if (eolp) (forward-char -1))
(transpose-subr 'backward-word arg)
(forward-word (+ arg 1)))
;; Borrowed from https://gist.github.com/1415844
;; Also see http://emacsworld.blogspot.com/2011/12/moving-buffers-between-windows.html
(defun rotate-left (l)
(append (cdr l) (list (car l))))
(defun rotate-windows ()
(interactive)
(let ((start-positions (rotate-left (mapcar 'window-start (window-list))))
(buffers (rotate-left (mapcar 'window-buffer (window-list)))))
(mapcar* (lambda (window buffer pos)
(set-window-buffer window buffer)
(set-window-start window pos))
(window-list)
buffers
start-positions)))
;; Borrowed from http://whattheemacsd.com/key-bindings.el-01.html
(defun goto-line-with-feedback ()
"Show line numbers temporarily, while prompting for the line number input"
(interactive)
(unwind-protect
(progn
(display-line-numbers-mode 1)
(goto-line (read-number "Goto line: ")))
(display-line-numbers-mode -1)))
;; Borrowed from http://superuser.com/q/603421/8424
(defun replace-smart-quotes (beg end)
"Replace 'smart quotes' in buffer or region with ascii quotes."
(interactive "r")
(format-replace-strings '(("\x201C" . "\"")
("\x201D" . "\"")
("\x2018" . "'")
("\x2019" . "'"))
nil beg end))
(defun yank-and-replace-smart-quotes ()
"Yank (paste) and replace smart quotes from the source with ascii quotes."
(interactive)
(yank)
(replace-smart-quotes (mark) (point)))
;; Borrowed from https://www.emacswiki.org/emacs/IncrementNumber
(defun increment-number-at-point ()
(interactive)
(skip-chars-backward "0-9")
(or (looking-at "[0-9]+")
(error "No number at point"))
(replace-match (number-to-string (1+ (string-to-number (match-string 0))))))
;; https://stackoverflow.com/a/23382008/8985
;; https://stackoverflow.com/a/34203839/8985
;; https://unix.stackexchange.com/a/83382/2038
(require 'ansi-color)
(defun display-ansi-color (&optional beg end)
"Interpret ANSI color esacape sequence by colorifying cotent.
Operate on selected region or whole buffer."
(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (point-min) (point-max))))
(ansi-color-apply-on-region beg end))
================================================
FILE: emacs.d/personal/diff.el
================================================
;;; Diff
;; Side by side is the only way
(setq ediff-split-window-function 'split-window-horizontally)
;; Pretty colors for diff output. Credit goes to Rob C. There must be a better
;; way to do this instead of defface.
(defface diff-added '((t (:inherit diff-changed :background "#70FB67" :foreground "black"))) nil)
(defface diff-file-header '((((class color) (min-colors 88) (background dark)) (:background "#5686E2" :weight bold))) nil)
(defface diff-header '((((class color) (min-colors 88) (background dark)) (:background "#3469D0"))) nil)
(defface diff-hunk-header '((t (:inherit diff-header :background "#3469D0"))) nil)
(defface diff-index '((t (:inherit diff-file-header :background "#5686E2"))) nil)
(defface diff-removed '((t (:inherit diff-changed :background "#FF453C"))) nil)
================================================
FILE: emacs.d/personal/dimmer.el
================================================
(setq dimmer-fraction 0.30)
(dimmer-activate)
================================================
FILE: emacs.d/personal/dired-details+.el
================================================
(setq dired-details-hidden-string "» ")
================================================
FILE: emacs.d/personal/dired.el
================================================
;;; Dired
;; Use gnu ls instead (macos requires `brew install coreutils`)
(setq insert-directory-program "gls")
(setq dired-listing-switches "-ah --dired --group-directories-first --time-style=long-iso")
;; Allows recursive deletes
(setq dired-recursive-deletes 'top)
;; Borrowed from http://whattheemacsd.com/setup-dired.el-02.html
(defun dired-back-to-top ()
(interactive)
(beginning-of-buffer)
(dired-next-line 4))
(defun dired-jump-to-bottom ()
(interactive)
(end-of-buffer)
(dired-next-line -1))
(add-hook 'dired-mode-hook
(lambda ()
(define-key dired-mode-map
(vector 'remap 'beginning-of-buffer) 'dired-back-to-top)
(define-key dired-mode-map
(vector 'remap 'end-of-buffer) 'dired-jump-to-bottom)
))
================================================
FILE: emacs.d/personal/disabled.el
================================================
;;; Enable functions that are disabled by default
;; Upcase and downcase regions
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
;; Sets the current horizontal position for C-n and C-p
(put 'set-goal-column 'disabled nil)
;; Restrict buffer editing to a region
(put 'narrow-to-region 'disabled nil)
;; Dired functions
(put 'dired-find-alternate-file 'disabled nil)
================================================
FILE: emacs.d/personal/editorconfig.el
================================================
(editorconfig-mode 1)
================================================
FILE: emacs.d/personal/exec-path-from-shell.el
================================================
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
================================================
FILE: emacs.d/personal/expand-region.el
================================================
(global-set-key (kbd "C-=") 'er/expand-region)
================================================
FILE: emacs.d/personal/flx-ido.el
================================================
;;; Fuzzy matching for Emacs ... a la Sublime Text.
(require 'flx-ido)
(ido-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
;; disable ido faces to see flx highlights.
(setq ido-use-faces nil)
================================================
FILE: emacs.d/personal/flycheck.el
================================================
;;; http://www.flycheck.org/manual/latest/index.html
(require 'flycheck)
;; disable lisp checkdoc
(with-eval-after-load 'flycheck
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc)))
;; turn on flychecking globally
(add-hook 'after-init-hook #'global-flycheck-mode)
;; disable jshint since we prefer eslint checking
(setq-default flycheck-disabled-checkers
(append flycheck-disabled-checkers
'(javascript-jshint)))
;; use eslint with web-mode
;; (flycheck-add-mode 'javascript-eslint 'web-mode)
;; customize flycheck temp file prefix
(setq-default flycheck-temp-prefix ".flycheck")
;; disable json-jsonlist checking for json files
(setq-default flycheck-disabled-checkers
(append flycheck-disabled-checkers
'(json-jsonlist)))
;; ;; https://github.com/purcell/exec-path-from-shell
;; ;; only need exec-path-from-shell on OSX
;; ;; this hopefully sets up path and other vars better
;; (when (memq window-system '(mac ns))
;; (exec-path-from-shell-initialize))
;; use local eslint from node_modules before global
;; http://emacs.stackexchange.com/questions/21205/flycheck-with-file-relative-eslint-executable
(defun my/use-eslint-from-node-modules ()
(let* ((root (locate-dominating-file
(or (buffer-file-name) default-directory)
"node_modules"))
(eslint (and root
(expand-file-name "node_modules/eslint/bin/eslint.js"
root))))
(when (and eslint (file-executable-p eslint))
(setq-local flycheck-javascript-eslint-executable eslint))))
(add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules)
;; Disable some js2-mode features when flycheck is enabled
(add-hook 'flycheck-mode-hook (lambda () (setq-local js2-strict-missing-semi-warning nil)))
(set-face-attribute 'flycheck-error nil
:underline "orange"
:background "firebrick4")
(set-face-attribute 'flycheck-warning nil
:underline "DarkOrange"
:foreground "black"
:background "yellow")
(set-face-attribute 'flycheck-info nil
:underline "forest green")
================================================
FILE: emacs.d/personal/flymake.el
================================================
;;; Flymake
(defface flymake-errline '((t (:background "#330000" :overline "red" :underline "red"))) nil)
(defface flymake-warnline '((t (:background "#333300" :overline "yellow" :underline "yellow"))) nil)
================================================
FILE: emacs.d/personal/fonts.el
================================================
;;; Fonts
(when (eq system-type 'darwin)
;; default Latin font (e.g. Consolas)
;; default font size (point * 10)
(set-face-attribute 'default nil :family "Monaco" :height 120 :weight 'normal))
;; To change a font size globally:
;; (set-face-attribute 'default nil :height 360)
;; (set-face-attribute 'default nil :height 240)
;; (set-face-attribute 'default nil :height 160)
;; (set-face-attribute 'default nil :height 120)
;; To change the font size interactively per buffer:
;; Up: C-x C-+, C-x C-=
;; Down: C-x C--
;; Reset: C-x C-0
================================================
FILE: emacs.d/personal/forge.el
================================================
(with-eval-after-load 'magit
(require 'forge))
================================================
FILE: emacs.d/personal/global.el
================================================
;;; Generic emacs settings I cannot live without
;; Turn off visual line moves: https://emacs.stackexchange.com/a/8031/10738
(setq line-move-visual nil)
;; Use command as the meta key; option key as super
(setq ns-command-modifier 'meta)
(setq ns-option-modifier 'super)
;; Don't show the startup screen
(setq inhibit-startup-message t)
;; "y or n" instead of "yes or no"
(fset 'yes-or-no-p 'y-or-n-p)
;; Highlight regions and add special behaviors to regions.
;; "C-h d transient" for more info
(setq transient-mark-mode t)
(pending-delete-mode t)
;; Display line and column numbers
(setq line-number-mode t)
(setq column-number-mode t)
;; Modeline info
(display-time-mode 1)
;; (display-battery-mode 1)
;; Change fringe
(set-fringe-mode '(nil . 0))
;; Emacs gurus don't need no stinking scroll bars
(when (fboundp 'toggle-scroll-bar)
(toggle-scroll-bar -1))
;; Explicitly show the end of a buffer
(set-default 'indicate-empty-lines t)
;; Line-wrapping
(set-default 'fill-column 78)
;; Prevent the annoying beep on errors
;; (setq visible-bell t)
;; Make sure all backup files only live in one place
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
;; Make sure all lock files only live in one place
(setq lock-file-name-transforms
'((".*" "~/.emacs.d/locks/\\1" t)))
;; Gotta see matching parens
(show-paren-mode t)
;; Don't truncate lines
(setq truncate-lines t)
(setq truncate-partial-width-windows nil)
;; For emacsclient
(server-start)
;; Trailing whitespace is unnecessary
(defvar whitespace-cleanup-on-save t)
;; (setq whitespace-cleanup-on-save t)
;; (setq whitespace-cleanup-on-save nil)
(add-hook 'before-save-hook
(lambda () (if whitespace-cleanup-on-save (whitespace-cleanup))))
;; (add-hook 'js2-mode-hook (lambda ()
;; (add-hook 'before-save-hook
;; (lambda () (if whitespace-cleanup-on-save (whitespace-cleanup))))))
;; Trash can support
(setq delete-by-moving-to-trash t)
;; `brew install aspell --lang=en` (instead of ispell)
(setq-default ispell-program-name "aspell")
(setq ispell-list-command "list")
(setq ispell-extra-args '("--sug-mode=ultra"))
;; Set the default directory to my personal work directory
(setq default-directory "~/work/")
;; zap-up-to-char, forward-to-word, backward-to-word, etc
(require 'misc)
================================================
FILE: emacs.d/personal/grep.el
================================================
;;; Grep is wicked
;; Grep/Find. This needs some cleanup
(setq grep-command "grep -Irine ")
(eval-after-load 'grep
'(progn
(add-to-list 'grep-find-ignored-files "*.log")
(add-to-list 'grep-find-ignored-directories "log")
(add-to-list 'grep-find-ignored-directories "node_modules")
(add-to-list 'grep-find-ignored-directories "node_cache")
(add-to-list 'grep-find-ignored-directories "vendor")
(add-to-list 'grep-find-ignored-directories "build")
))
================================================
FILE: emacs.d/personal/groovy-mode.el
================================================
(add-to-list 'auto-mode-alist '("Jenkinsfile$" . groovy-mode))
================================================
FILE: emacs.d/personal/hl-line.el
================================================
;;; Highlight current line
(global-hl-line-mode 1)
;; Great for black background
(set-face-background 'hl-line "black")
;; Other background colors
;; (set-face-background 'hl-line "#181800")
;; (set-face-background 'hl-line "lemon chiffon")
;; (set-face-background 'hl-line "#220")
;; (set-face-background 'hl-line "#110")
;; (set-face-background 'hl-line "#222")
;; (set-face-background 'hl-line "#111")
;; Other foreground colors
;; (set-face-foreground 'hl-line "white")
;; (set-face-foreground 'hl-line nil)
================================================
FILE: emacs.d/personal/htmlize.el
================================================
;;; Convert buffer text and decorations to HTML
(setq htmlize-html-major-mode 'html-mode)
================================================
FILE: emacs.d/personal/ido.el
================================================
;;; Interactive do, find-file and iswitchb replacement with fuzzy/flex matching.
(ido-mode t)
(setq ido-enable-flex-matching t) ; fuzzy matching is a must have
(setq ido-enable-last-directory-history nil) ; forget latest selected directory names
;; prioritize order by extension
(setq ido-file-extensions-order '(".rb" ".emacs" ".el" ".md" ".txt" ".yml" ".json"))
================================================
FILE: emacs.d/personal/javascript.el
================================================
;;; Javscript is fun
;; Standard js-mode
(setq js-indent-level 2)
================================================
FILE: emacs.d/personal/jekyll.el
================================================
;; Custom support for Jekyll blogs
(setq jekyll-directory (expand-file-name "~/work/ryan.mcgeary.org/"))
(setq jekyll-post-ext ".md")
(setq jekyll-post-template "---\nlayout: post\ntitle: %s\n---\n\n")
(defun jekyll-find-posts ()
(interactive)
(find-file (concat jekyll-directory jekyll-posts-dir)))
(defun jekyll-find-drafts ()
(interactive)
(find-file (concat jekyll-directory jekyll-drafts-dir)))
(global-set-key (kbd "C-c b n") 'jekyll-draft-post)
(global-set-key (kbd "C-c b P") 'jekyll-publish-post)
(global-set-key (kbd "C-c b p") 'jekyll-find-posts)
(global-set-key (kbd "C-c b d") 'jekyll-find-drafts)
================================================
FILE: emacs.d/personal/js2-mode.el
================================================
;; js2-mode
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(setq js2-cleanup-whitespace t)
(setq js2-basic-offset 2)
(setq js2-bounce-indent-p t)
(setq js2-consistent-level-indent-inner-bracket-p t)
(setq js2-use-ast-for-indentation-p t)
;; Warning customizations
(setq js2-strict-inconsistent-return-warning nil)
(add-hook 'js2-mode-hook
(lambda ()
(local-set-key (kbd "TAB") 'smart-tab)
))
================================================
FILE: emacs.d/personal/kbd-macros.el
================================================
================================================
FILE: emacs.d/personal/key-chord.el
================================================
;;; Key-chord without modifier keys
(key-chord-mode 1)
(key-chord-define-global "df" 'jump-char-forward)
================================================
FILE: emacs.d/personal/lua-mode.el
================================================
(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
================================================
FILE: emacs.d/personal/mac.el
================================================
;;; Cocoa!
;; Hide the tool bar
(when (fboundp 'tool-bar-mode)
(tool-bar-mode 0))
;; Slow down the mouse wheel acceleration
(when (boundp 'mouse-wheel-scroll-amount)
(setq mouse-wheel-scroll-amount '(0.01)))
;; Prevent anti aliasing
;; (setq mac-allow-anti-aliasing nil)
;; Mac-style key-binding mode. Aquamacs-like
;; (mac-key-mode)
;; Full screen mode
;; (mac-hide-menu-bar)
;; (mac-show-menu-bar)
================================================
FILE: emacs.d/personal/magit.el
================================================
;;; It's Magit! An Emacs mode for Git.
(add-to-list 'load-path "~/.emacs.d/vendor/git-modes")
(add-hook
'magit-mode-hook
(lambda ()
;; Hide "Recent Commits"
;; https://github.com/magit/magit/issues/3230
(magit-add-section-hook 'magit-status-sections-hook
'magit-insert-unpushed-to-upstream
'magit-insert-unpushed-to-upstream-or-recent
'replace)
(setq yas-dont-activate t)))
(setq magit-push-always-verify nil)
(setq git-commit-summary-max-length 70)
;; full screen magit-status
;; borrowed from http://whattheemacsd.com/setup-magit.el-01.html
(defadvice magit-status (around magit-fullscreen activate)
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defun magit-quit-session ()
"Restores the previous window configuration and kills the magit buffer"
(interactive)
(kill-buffer)
(jump-to-register :magit-fullscreen))
;; Allow ignoring of whitespace
;; borrowed from http://whattheemacsd.com/setup-magit.el-02.html
(defun magit-toggle-whitespace ()
(interactive)
(if (member "-w" magit-diff-options)
(magit-dont-ignore-whitespace)
(magit-ignore-whitespace)))
(defun magit-ignore-whitespace ()
(interactive)
(add-to-list 'magit-diff-options "-w")
(magit-refresh))
(defun magit-dont-ignore-whitespace ()
(interactive)
(setq magit-diff-options (remove "-w" magit-diff-options))
(magit-refresh))
(eval-after-load 'magit
'(progn
(define-key magit-mode-map (kbd "M-3") 'split-window-horizontally) ; was magit-show-level-3
(define-key magit-mode-map (kbd "M-2") 'split-window-vertically) ; was magit-show-level-2
(define-key magit-mode-map (kbd "M-1") 'delete-other-windows) ; was magit-show-level-1
(define-key magit-mode-map (kbd "<tab>") 'magit-section-toggle) ; was smart-tab
(define-key magit-status-mode-map (kbd "M-K") 'magit-quit-session)
(define-key magit-status-mode-map (kbd "W") 'magit-toggle-whitespace)
))
================================================
FILE: emacs.d/personal/markdown-mode.el
================================================
;;; Markdown
(add-to-list 'auto-mode-alist '("\\.markdown$" . gfm-mode))
(add-to-list 'auto-mode-alist '("\\.md$" . gfm-mode))
(add-to-list 'auto-mode-alist '("\\.md\\.erb$" . gfm-mode))
(add-to-list 'auto-mode-alist '("\\.text$" . gfm-mode))
;; Original premise borrowed from https://gist.github.com/siancu/4542778
(defun marked-markdown-preview ()
"run Marked on the current file if Marked is installed;
otherwise fallback to markdown-preview"
(interactive)
(or
(dolist (app '("/Applications/Marked 2.app" "/Applications/Marked.app"))
(when (file-exists-p app)
(cl-return (shell-command (concat "open -a " (shell-quote-argument app) " " (shell-quote-argument buffer-file-name))))))
(markdown-preview)))
(eval-after-load 'markdown-mode
'(progn
(define-key markdown-mode-map (kbd "C-c C-v") 'marked-markdown-preview)))
================================================
FILE: emacs.d/personal/maxframe.el
================================================
;;; Frame size manipulation.
(defun personal-init-fullscreen ()
;; (setq ns-auto-hide-menu-bar t)
(setq ns-use-native-fullscreen nil)
(global-set-key [(meta return)] 'toggle-frame-fullscreen)
;; (add-hook 'after-init-hook 'toggle-frame-fullscreen t)
)
(defun personal-init-ns-fullscreen ()
;; (setq ns-auto-hide-menu-bar t)
(setq ns-use-native-fullscreen nil)
(global-set-key [(meta return)] 'ns-toggle-fullscreen)
(add-hook 'after-init-hook 'ns-toggle-fullscreen t))
(defun personal-init-maxframe ()
;; Biggest monitor width I currently have. This is necessary when multiple
;; monitors exist; otherwise, the frame will span multiple displays.
(setq mf-max-width 2560)
(global-set-key [(meta return)] 'mf)
(add-hook 'after-init-hook 'maximize-frame t))
(if (window-system)
(cond
((fboundp 'toggle-frame-fullscreen)
(personal-init-fullscreen))
((fboundp 'ns-toggle-fullscreen)
(personal-init-ns-fullscreen))
(t
(personal-init-maxframe))
))
================================================
FILE: emacs.d/personal/motion-mode.el
================================================
(require 'motion-mode)
;; following add-hook is very important.
(add-hook 'ruby-mode-hook 'motion-recognize-project)
;; (add-to-list 'ac-modes 'motion-mode)
;; (add-to-list 'ac-sources 'ac-source-dictionary)
;; set key-binds as you like
(define-key motion-mode-map (kbd "C-c C-c") 'motion-execute-rake)
(define-key motion-mode-map (kbd "C-c C-d") 'motion-dash-at-point)
================================================
FILE: emacs.d/personal/multiple-cursors.el
================================================
(global-set-key (kbd "C-c C-.") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-s-.") 'mc/mark-all-like-this)
(global-set-key (kbd "s-SPC") 'set-rectangular-region-anchor)
================================================
FILE: emacs.d/personal/nodejs-repl.el
================================================
(add-hook 'js2-mode-hook
(lambda ()
(define-key js-mode-map (kbd "C-x C-e") 'nodejs-repl-send-last-sexp)
(define-key js-mode-map (kbd "C-c C-r") 'nodejs-repl-send-region)
(define-key js-mode-map (kbd "C-c C-l") 'nodejs-repl-load-file)
(define-key js-mode-map (kbd "C-c C-z") 'nodejs-repl-switch-to-repl)))
================================================
FILE: emacs.d/personal/org.el
================================================
;;; org-mode
(require 'org)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
;; (global-set-key (kbd "C-c r") 'remember)
;; (add-hook 'remember-mode-hook 'org-remember-apply-template)
;; (setq org-remember-templates
;; '((?n "* %U %?" "~/org/inbox.org")))
;; (setq remember-annotation-functions '(org-remember-annotation))
;; (setq remember-handler-functions '(org-remember-handler))
================================================
FILE: emacs.d/personal/powerline.el
================================================
(setq powerline-arrow-shape 'arrow)
(powerline-default-theme)
(setq powerline-image-apple-rgb nil)
(custom-set-faces
'(mode-line ((t (:background "#ffcc00" :foreground "black"))))
'(powerline-active1 ((t (:background "grey22" :foreground "white" :inherit mode-line))))
'(powerline-active2 ((t (:background "grey40" :foreground "white" :inherit mode-line))))
)
================================================
FILE: emacs.d/personal/prettier-js.el
================================================
(use-package prettier-js)
(add-hook 'js-mode-hook 'prettier-js-mode)
(add-hook 'js2-mode-hook 'prettier-js-mode)
================================================
FILE: emacs.d/personal/projectile-rails.el
================================================
(projectile-rails-global-mode)
(setq projectile-rails-vanilla-command "bin/rails"
projectile-rails-spring-command "bin/spring"
projectile-rails-zeus-command "bin/zeus")
================================================
FILE: emacs.d/personal/projectile.el
================================================
(projectile-mode +1)
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
================================================
FILE: emacs.d/personal/rbenv.el
================================================
(global-rbenv-mode)
================================================
FILE: emacs.d/personal/recentf.el
================================================
;;; Recent Files
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
================================================
FILE: emacs.d/personal/rectangle.el
================================================
;;; Rectangles
;; Compliment to kill-rectangle (just like kill-ring-save compliments
;; kill-region)
;; http://www.emacsblog.org/2007/03/17/quick-tip-set-goal-column/#comment-183
(defun kill-save-rectangle (start end &optional fill)
"Save the rectangle as if killed, but don't kill it. See
`kill-rectangle' for more information."
(interactive "r\nP")
(kill-rectangle start end fill)
(goto-char start)
(yank-rectangle))
;; Give it a memorable key binding
(global-set-key (kbd "C-x r M-k") 'kill-save-rectangle)
================================================
FILE: emacs.d/personal/restclient.el
================================================
;; restclient
(add-to-list 'auto-mode-alist '("\\.restclient$" . restclient-mode))
================================================
FILE: emacs.d/personal/rhtml-mode.el
================================================
(add-to-list 'auto-mode-alist '("\\.erb$" . rhtml-mode))
================================================
FILE: emacs.d/personal/ri-emacs.el
================================================
(add-to-list 'load-path (expand-file-name "~/.emacs.d/vendor/ri-emacs"))
(setq ri-ruby-script (expand-file-name "~/.emacs.d/vendor/ri-emacs/ri-emacs.rb"))
(autoload 'ri "ri-ruby" nil t)
(add-hook 'ruby-mode-hook
(lambda ()
(local-set-key [(f1)] 'ri)
;; (local-set-key "\M-\C-i" 'ri-ruby-complete-symbol)
(local-set-key [(meta f1)] 'ri-ruby-show-args)
))
================================================
FILE: emacs.d/personal/ruby-hash-syntax.el
================================================
(add-hook 'ruby-mode-hook
(lambda ()
(local-set-key (kbd "C-;") 'ruby-toggle-hash-syntax)
))
================================================
FILE: emacs.d/personal/ruby-mode.el
================================================
;;; Ruby
;; Run the current ruby buffer
(defun ruby-eval-buffer()
"Evaluate the buffer with ruby."
(interactive)
(shell-command-on-region (point-min) (point-max) "ruby"))
(defun ruby-insert-end ()
"Insert \"end\" at point and reindent current line."
(interactive)
(insert "end")
(ruby-indent-line t)
(end-of-line))
;; Local key bindings
(add-hook 'ruby-mode-hook
(lambda ()
;; (ruby-electric-mode)
(local-set-key [(control c) (control e)] 'ruby-insert-end)
(local-set-key [(control meta f1)] 'xmp) ;; gem install rcodetools
(local-set-key [(control meta shift f1)] 'ruby-eval-buffer)
(local-set-key (kbd "TAB") 'smart-tab)
))
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Capfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Guardfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("autotest$" . ruby-mode))
(add-to-list 'auto-mode-alist '("irbrc$" . ruby-mode))
(add-to-list 'auto-mode-alist '("sake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("god$" . ruby-mode))
(add-to-list 'auto-mode-alist '("thor$" . ruby-mode))
(add-to-list 'auto-mode-alist '("gemspec$" . ruby-mode))
(add-to-list 'auto-mode-alist '("builder$" . ruby-mode))
(add-to-list 'auto-mode-alist '("jbuilder$" . ruby-mode))
;; Better indention for multi-line paren blocks
(setq ruby-deep-indent-paren-style nil)
;; Disable `coding: utf-8` magic comments
(setq ruby-insert-encoding-magic-comment nil)
;; Until Emacs 24.4
;; http://stackoverflow.com/questions/7961533/emacs-ruby-method-parameter-indentation
(defadvice ruby-indent-line (after unindent-closing-paren activate)
(let ((column (current-column))
indent offset)
(save-excursion
(back-to-indentation)
(let ((state (syntax-ppss)))
(setq offset (- column (current-column)))
(when (and (eq (char-after) ?\))
(not (zerop (car state))))
(goto-char (cadr state))
(setq indent (current-indentation)))))
(when indent
(indent-line-to indent)
(when (> offset 0) (forward-char offset)))))
================================================
FILE: emacs.d/personal/saveplace.el
================================================
(require 'saveplace)
(setq-default save-place t)
================================================
FILE: emacs.d/personal/scratch.el
================================================
;; Scratch buffer goodness
;; https://emacs.stackexchange.com/a/74/10738
(defun prepare-scratch-for-kill ()
(save-excursion
(set-buffer (get-buffer-create "*scratch*"))
(add-hook 'kill-buffer-query-functions 'kill-scratch-buffer t)))
(defun kill-scratch-buffer ()
(let (kill-buffer-query-functions)
(kill-buffer (current-buffer)))
;; no way, *scratch* shall live
(prepare-scratch-for-kill)
;; Since we "killed" it, don't let caller try too
nil)
(prepare-scratch-for-kill)
================================================
FILE: emacs.d/personal/server-mode.el
================================================
(defun server-save-edit ()
(interactive)
(save-buffer)
(server-edit)
(kill-buffer))
(add-hook 'server-visit-hook
(lambda ()
(unless (equal major-mode 'git-commit-mode)
(local-set-key [(control c) (control c)] 'server-save-edit))
))
================================================
FILE: emacs.d/personal/shell-mode.el
================================================
;;; Shell scripts
(add-to-list 'auto-mode-alist '("bashrc$" . sh-mode))
(add-to-list 'auto-mode-alist '("bash_profile$" . sh-mode))
(add-to-list 'auto-mode-alist '("bash_aliases$" . sh-mode))
(add-to-list 'auto-mode-alist '("bash_local$" . sh-mode))
(add-to-list 'auto-mode-alist '("bash_completion$" . sh-mode))
(add-to-list 'auto-mode-alist '("\\.powenv$" . sh-mode))
(add-to-list 'auto-mode-alist '("\\.env\.?.*$" . sh-mode))
(add-hook 'shell-mode-hook (lambda () (setq tab-width 8)))
================================================
FILE: emacs.d/personal/shell-pop.el
================================================
;;; Shell-Pop is a utility which helps you pop up and pop out shell buffer
;;; window easily.
(setq shell-pop-shell-type (quote ("ansi-term" "*ansi-term*" (lambda nil (ansi-term shell-pop-term-shell)))))
(setq shell-pop-shell "/bin/bash")
(setq shell-pop-window-height 40)
(setq shell-pop-window-position "bottom")
(global-set-key [f7] 'shell-pop)
================================================
FILE: emacs.d/personal/tabs.el
================================================
;;; Tab management
;; Spaces instead of tabs
(setq-default indent-tabs-mode nil)
;; If there is a tab, make it the size of 2 spaces
(setq-default tab-width 2)
;; Mode specific indent sizes
;; TODO: Consider putting these in their own mode specific inits
(setq c-basic-offset 4)
(setq css-indent-offset 2)
(setq sh-basic-offset 2)
(set-default 'javascript-indent-level 2)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Hippie expand. Groovy vans with tie-dyes.
(setq hippie-expand-try-functions-list
'(yas-hippie-try-expand
try-expand-dabbrev
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name
try-complete-lisp-symbol))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Smart Tab
;; Borrowed from snippets at
;; http://www.emacswiki.org/emacs/TabCompletion
;; TODO: Take a look at https://github.com/genehack/smart-tab
(defvar smart-tab-using-hippie-expand t
"turn this on if you want to use hippie-expand completion.")
(defun smart-tab (prefix)
"Needs `transient-mark-mode' to be on. This smart tab is
minibuffer compliant: it acts as usual in the minibuffer.
In all other buffers: if PREFIX is \\[universal-argument], calls
`smart-indent'. Else if point is at the end of a symbol,
expands it. Else calls `smart-indent'."
(interactive "P")
(cl-labels ((smart-tab-must-expand (&optional prefix)
(unless (or (consp prefix)
mark-active)
(looking-at "\\_>"))))
(cond ((minibufferp)
(minibuffer-complete))
((smart-tab-must-expand prefix)
(if smart-tab-using-hippie-expand
(hippie-expand prefix)
(dabbrev-expand prefix)))
((smart-indent)))))
(defun smart-indent ()
"Indents region if mark is active, or current line otherwise."
(interactive)
(if mark-active
(indent-region (region-beginning)
(region-end))
(indent-for-tab-command)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(global-set-key (kbd "TAB") 'smart-tab)
================================================
FILE: emacs.d/personal/textile-mode.el
================================================
;;; Textile
(add-to-list 'auto-mode-alist '("\\.textile$" . textile-mode))
================================================
FILE: emacs.d/personal/theme.el
================================================
;;; Theme customization
;; (load-theme 'adwaita)
;; (load-theme 'deeper-blue)
;; (load-theme 'dichromacy)
;; (load-theme 'leuven)
;; (load-theme 'leuven-dark)
;; (load-theme 'light-blue)
;; (load-theme 'manoj-dark)
;; (load-theme 'misterioso)
;; (load-theme 'modus-operandi)
;; (load-theme 'modus-vivendi) ; decent
;; (load-theme 'tango)
;; (load-theme 'tango-dark)
;; (load-theme 'tsdh-dark) ; decent
;; (load-theme 'tsdh-light)
;; (load-theme 'wheatgrass)
;; (load-theme 'whiteboard)
(load-theme 'wombat) ; fave
(set-cursor-color "orange")
(set-face-attribute 'region nil :background "cornflower blue")
(set-face-attribute 'isearch nil :background "gold" :foreground "black")
(set-face-attribute 'lazy-highlight nil :background "dark goldenrod" :foreground "white")
================================================
FILE: emacs.d/personal/toggle-quotes.el
================================================
(global-set-key (kbd "C-c C-'") 'toggle-quotes)
================================================
FILE: emacs.d/personal/utf-8.el
================================================
;;; Gotta do UTF-8
(require 'un-define "un-define" t)
(set-buffer-file-coding-system 'utf-8 'utf-8-unix)
(set-default buffer-file-coding-system 'utf-8-unix)
(set-default-coding-systems 'utf-8-unix)
(prefer-coding-system 'utf-8-unix)
================================================
FILE: emacs.d/personal/yaml-mode.el
================================================
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
(add-to-list 'auto-mode-alist '("\\.eslintrc$" . yaml-mode))
(add-hook 'yaml-mode-hook
'(lambda ()
(define-key yaml-mode-map "\C-m" 'newline-and-indent)))
================================================
FILE: emacs.d/personal/yasnippet.el
================================================
;;; Snippets make typing fun
(yas-global-mode 1)
;; (yas-load-directory "~/.emacs.d/vendor/yasnippet/snippets")
;; (yas-load-directory "~/.emacs.d/vendor/yasnippets-rails/rails-snippets")
;; (yas-load-directory "~/.emacs.d/vendor/yasnippets-shoulda")
(setq yas-prompt-functions '(yas-ido-prompt
yas-completing-prompt))
;; (add-hook 'yas-minor-mode-hook
;; (lambda () (define-key yas-minor-mode-map
;; (kbd "TAB") 'smart-tab))) ; was yas-expand
================================================
FILE: emacs.d/personal/zoom.el
================================================
;;; Custom folding support
(defun zoom-way-out() (interactive)
(set-selective-display 0))
(defun zoom-way-in() (interactive)
(set-selective-display 4))
(defun zoom-out() (interactive)
(set-selective-display
(if selective-display
(if (or (= selective-display 0) (>= selective-display 20))
0
(+ selective-display 2))
0)))
(defun zoom-in() (interactive)
(set-selective-display
(if selective-display
(if (= selective-display 0)
20
(if (<= selective-display 4)
4
(- selective-display 2)))
20)))
(global-set-key [(meta \))] 'zoom-way-out)
(global-set-key [(meta _)] 'zoom-in)
(global-set-key [(meta +)] 'zoom-out)
================================================
FILE: emacs.d/vendor/mode-line-bell.el
================================================
;; Recommended by Ryan Davis
;; Found at http://www.elliotglaysher.org/emacs/
;; -----------------------------------------------------------------------
;; Prevent the bell from ringing all the time.
;; -----------------------------------------------------------------------
;; nice little alternative visual bell; Miles Bader <miles /at/ gnu.org>
;; TODO(erg): Figure out why that note doesn't appear in the mode-line-bar...
(defcustom mode-line-bell-string "ding" ; "♪"
"Message displayed in mode-line by `mode-line-bell' function."
:group 'user)
(defcustom mode-line-bell-delay 0.1
"Number of seconds `mode-line-bell' displays its message."
:group 'user)
;; internal variables
(defvar mode-line-bell-cached-string nil)
(defvar mode-line-bell-propertized-string nil)
(defun mode-line-bell ()
"Briefly display a highlighted message in the mode-line.
The string displayed is the value of `mode-line-bell-string',
with a red background; the background highlighting extends to the
right margin. The string is displayed for `mode-line-bell-delay'
seconds.
This function is intended to be used as a value of `ring-bell-function'."
(unless (equal mode-line-bell-string mode-line-bell-cached-string)
(setq mode-line-bell-propertized-string
(propertize
(concat
(propertize
"x"
'display
`(space :align-to (- right ,(string-width mode-line-bell-string))))
mode-line-bell-string)
'face '(:foreground "yellow")))
(setq mode-line-bell-cached-string mode-line-bell-string))
(message mode-line-bell-propertized-string)
(sit-for mode-line-bell-delay)
(message ""))
(setq ring-bell-function 'mode-line-bell)
(provide 'mode-line-bell)
================================================
FILE: emacs.d/vendor/rcodetools.el
================================================
;;; rcodetools.el -- annotation / accurate completion / browsing documentation
;;; Copyright (c) 2006-2008 rubikitch <rubikitch@ruby-lang.org>
;;;
;;; Use and distribution subject to the terms of the Ruby license.
(defvar xmpfilter-command-name "ruby -S xmpfilter --dev --fork --detect-rbtest"
"The xmpfilter command name.")
(defvar rct-doc-command-name "ruby -S rct-doc --dev --fork --detect-rbtest"
"The rct-doc command name.")
(defvar rct-complete-command-name "ruby -S rct-complete --dev --fork --detect-rbtest"
"The rct-complete command name.")
(defvar ruby-toggle-file-command-name "ruby -S ruby-toggle-file"
"The ruby-toggle-file command name.")
(defvar rct-fork-command-name "ruby -S rct-fork")
(defvar rct-option-history nil) ;internal
(defvar rct-option-local nil) ;internal
(make-variable-buffer-local 'rct-option-local)
(defvar rct-debug nil
"If non-nil, output debug message into *Messages*.")
;; (setq rct-debug t)
(defadvice comment-dwim (around rct-hack activate)
"If comment-dwim is successively called, add => mark."
(if (and (eq major-mode 'ruby-mode)
(eq last-command 'comment-dwim)
;; TODO =>check
)
(insert "=>")
ad-do-it))
;; To remove this advice.
;; (progn (ad-disable-advice 'comment-dwim 'around 'rct-hack) (ad-update 'comment-dwim))
(defun rct-current-line ()
"Return the vertical position of point..."
(+ (count-lines (point-min) (point))
(if (= (current-column) 0) 1 0)))
(defun rct-save-position (proc)
"Evaluate proc with saving current-line/current-column/window-start."
(let ((line (rct-current-line))
(col (current-column))
(wstart (window-start)))
(funcall proc)
(goto-char (point-min))
(forward-line (1- line))
(move-to-column col)
(set-window-start (selected-window) wstart)))
(defun rct-interactive ()
"All the rcodetools-related commands with prefix args read rcodetools' common option. And store option into buffer-local variable."
(list
(let ((option (or rct-option-local "")))
(if current-prefix-arg
(setq rct-option-local
(read-from-minibuffer "rcodetools option: " option nil nil 'rct-option-history))
option))))
(defun rct-shell-command (command &optional buffer)
"Replacement for `(shell-command-on-region (point-min) (point-max) command buffer t' because of encoding problem."
(let ((input-rb (concat (make-temp-name "xmptmp-in") ".rb"))
(output-rb (concat (make-temp-name "xmptmp-out") ".rb"))
(coding-system-for-read buffer-file-coding-system))
(write-region (point-min) (point-max) input-rb nil 'nodisp)
(shell-command
(rct-debuglog (format "%s %s > %s" command input-rb output-rb))
t " *rct-error*")
(with-current-buffer (or buffer (current-buffer))
(insert-file-contents output-rb nil nil nil t))
(delete-file input-rb)
(delete-file output-rb)))
(defvar xmpfilter-command-function 'xmpfilter-command)
(defun xmp (&optional option)
"Run xmpfilter for annotation/test/spec on whole buffer.
See also `rct-interactive'. "
(interactive (rct-interactive))
(rct-save-position
(lambda ()
(rct-shell-command (funcall xmpfilter-command-function option)))))
(defun xmpfilter-command (&optional option)
"The xmpfilter command line, DWIM."
(setq option (or option ""))
(flet ((in-block (beg-re)
(save-excursion
(goto-char (point-min))
(when (re-search-forward beg-re nil t)
(let ((s (point)) e)
(when (re-search-forward "^end\n" nil t)
(setq e (point))
(goto-char s)
(re-search-forward "# => *$" e t)))))))
(cond ((in-block "^class.+< Test::Unit::TestCase$")
(format "%s --unittest %s" xmpfilter-command-name option))
((in-block "^\\(describe\\|context\\).+do$")
(format "%s --spec %s" xmpfilter-command-name option))
(t
(format "%s %s" xmpfilter-command-name option)))))
;;;; Completion
(defvar rct-method-completion-table nil) ;internal
(defvar rct-complete-symbol-function 'rct-complete-symbol--normal
"Function to use rct-complete-symbol.")
;; (setq rct-complete-symbol-function 'rct-complete-symbol--icicles)
(defvar rct-use-test-script t
"Whether rct-complete/rct-doc use test scripts.")
(defun rct-complete-symbol (&optional option)
"Perform ruby method and class completion on the text around point.
This command only calls a function according to `rct-complete-symbol-function'.
See also `rct-interactive', `rct-complete-symbol--normal', and `rct-complete-symbol--icicles'."
(interactive (rct-interactive))
(call-interactively rct-complete-symbol-function))
(defun rct-complete-symbol--normal (&optional option)
"Perform ruby method and class completion on the text around point.
See also `rct-interactive'."
(interactive (rct-interactive))
(let ((end (point)) beg
pattern alist
completion)
(setq completion (rct-try-completion)) ; set also pattern / completion
(save-excursion
(search-backward pattern)
(setq beg (point)))
(cond ((eq completion t) ;sole completion
(message "%s" "Sole completion"))
((null completion) ;no completions
(message "Can't find completion for \"%s\"" pattern)
(ding))
((not (string= pattern completion)) ;partial completion
(delete-region beg end) ;delete word
(insert completion)
(message ""))
(t
(message "Making completion list...")
(with-output-to-temp-buffer "*Completions*"
(display-completion-list
(all-completions pattern alist)))
(message "Making completion list...%s" "done")))))
;; (define-key ruby-mode-map "\M-\C-i" 'rct-complete-symbol)
(defun rct-debuglog (logmsg)
"if `rct-debug' is non-nil, output LOGMSG into *Messages*. Returns LOGMSG."
(if rct-debug
(message "%s" logmsg))
logmsg)
(defun rct-exec-and-eval (command opt)
"Execute rct-complete/rct-doc and evaluate the output."
(let ((eval-buffer (get-buffer-create " *rct-eval*")))
;; copy to temporary buffer to do completion at non-EOL.
(rct-shell-command
(format "%s %s %s --line=%d --column=%d %s"
command opt (or rct-option-local "")
(rct-current-line)
;; specify column in BYTE
(string-bytes
(encode-coding-string
(buffer-substring (point-at-bol) (point))
buffer-file-coding-system))
(if rct-use-test-script (rct-test-script-option-string) ""))
eval-buffer)
(message "")
(eval (with-current-buffer eval-buffer
(goto-char 1)
(unwind-protect
(read (current-buffer))
(unless rct-debug (kill-buffer eval-buffer)))))))
(defun rct-test-script-option-string ()
(if (null buffer-file-name)
""
(let ((test-buf (rct-find-test-script-buffer))
(bfn buffer-file-name)
bfn2 t-opt test-filename)
(if (and test-buf
(setq bfn2 (buffer-local-value 'buffer-file-name test-buf))
(file-exists-p bfn2))
;; pass test script's filename and lineno
(with-current-buffer test-buf
(setq t-opt (format "%s@%s" buffer-file-name (rct-current-line)))
(format "-t %s --filename=%s" t-opt bfn))
""))))
(require 'cl)
(defun rct-find-test-script-buffer (&optional buffer-list)
"Find the latest used Ruby test script buffer."
(setq buffer-list (or buffer-list (buffer-list)))
(dolist (buf buffer-list)
(with-current-buffer buf
(if (and buffer-file-name (string-match "test.*\.rb$" buffer-file-name))
(return buf)))))
;; (defun rct-find-test-method (buffer)
;; "Find test method on point on BUFFER."
;; (with-current-buffer buffer
;; (save-excursion
;; (forward-line 1)
;; (if (re-search-backward "^ *def *\\(test_[A-Za-z0-9?!_]+\\)" nil t)
;; (match-string 1)))))
(defun rct-try-completion ()
"Evaluate the output of rct-complete."
(rct-exec-and-eval rct-complete-command-name "--completion-emacs"))
;;;; TAGS or Ri
(autoload 'ri "ri-ruby" nil t)
(defvar rct-find-tag-if-available t
"If non-nil and the method location is in TAGS, go to the location instead of show documentation.")
(defun rct-ri (&optional option)
"Browse Ri document at the point.
If `rct-find-tag-if-available' is non-nil, search the definition using TAGS.
See also `rct-interactive'. "
(interactive (rct-interactive))
(rct-exec-and-eval
rct-doc-command-name
(concat "--ri-emacs --use-method-analyzer "
(if (buffer-file-name)
(concat "--filename=" (buffer-file-name))
""))))
(defun rct-find-tag-or-ri (fullname)
(if (not rct-find-tag-if-available)
(ri fullname)
(condition-case err
(let ()
(visit-tags-table-buffer)
(find-tag-in-order (concat "::" fullname) 'search-forward '(tag-exact-match-p) nil "containing" t))
(error
(ri fullname)))))
;;;;
(defun ruby-toggle-buffer ()
"Open a related file to the current buffer. test<=>impl."
(interactive)
(find-file (shell-command-to-string
(format "%s %s" ruby-toggle-file-command-name buffer-file-name))))
;;;; rct-fork support
(defun rct-fork (options)
"Run rct-fork.
Rct-fork makes xmpfilter and completion MUCH FASTER because it pre-loads heavy libraries.
When rct-fork is running, the mode-line indicates it to avoid unnecessary run.
To kill rct-fork process, use \\[rct-fork-kill].
"
(interactive (list
(read-string "rct-fork options (-e CODE -I LIBDIR -r LIB): "
(rct-fork-default-options))))
(rct-fork-kill)
(rct-fork-minor-mode 1)
(start-process-shell-command
"rct-fork" "*rct-fork*" rct-fork-command-name options))
(defun rct-fork-default-options ()
"Default options for rct-fork by collecting requires."
(mapconcat
(lambda (lib) (format "-r %s" lib))
(save-excursion
(goto-char (point-min))
(loop while (re-search-forward "\\<require\\> ['\"]\\([^'\"]+\\)['\"]" nil t)
collect (match-string-no-properties 1)))
" "))
(defun rct-fork-kill ()
"Kill rct-fork process invoked by \\[rct-fork]."
(interactive)
(when rct-fork-minor-mode
(rct-fork-minor-mode -1)
(interrupt-process "rct-fork")))
(define-minor-mode rct-fork-minor-mode
"This minor mode is turned on when rct-fork is run.
It is nothing but an indicator."
:lighter " <rct-fork>" :global t)
;;;; unit tests
(when (and (fboundp 'expectations))
(require 'ruby-mode)
(require 'el-mock nil t)
(expectations
(desc "comment-dwim advice")
(expect "# =>"
(with-temp-buffer
(ruby-mode)
(setq last-command nil)
(call-interactively 'comment-dwim)
(setq last-command 'comment-dwim)
(call-interactively 'comment-dwim)
(buffer-string)))
(expect (regexp "^1 +# =>")
(with-temp-buffer
(ruby-mode)
(insert "1")
(setq last-command nil)
(call-interactively 'comment-dwim)
(setq last-command 'comment-dwim)
(call-interactively 'comment-dwim)
(buffer-string)))
(desc "rct-current-line")
(expect 1
(with-temp-buffer
(rct-current-line)))
(expect 1
(with-temp-buffer
(insert "1")
(rct-current-line)))
(expect 2
(with-temp-buffer
(insert "1\n")
(rct-current-line)))
(expect 2
(with-temp-buffer
(insert "1\n2")
(rct-current-line)))
(desc "rct-save-position")
(expect (mock (set-window-start * 7) => nil)
(stub window-start => 7)
(with-temp-buffer
(insert "abcdef\nghi")
(rct-save-position #'ignore)))
(expect 2
(with-temp-buffer
(stub window-start => 1)
(stub set-window-start => nil)
(insert "abcdef\nghi")
(rct-save-position #'ignore)
(rct-current-line)))
(expect 3
(with-temp-buffer
(stub window-start => 1)
(stub set-window-start => nil)
(insert "abcdef\nghi")
(rct-save-position #'ignore)
(current-column)))
(desc "rct-interactive")
(expect '("read")
(let ((current-prefix-arg t))
(stub read-from-minibuffer => "read")
(rct-interactive)))
(expect '("-S ruby19")
(let ((current-prefix-arg nil)
(rct-option-local "-S ruby19"))
(stub read-from-minibuffer => "read")
(rct-interactive)))
(expect '("")
(let ((current-prefix-arg nil)
(rct-option-local))
(stub read-from-minibuffer => "read")
(rct-interactive)))
(desc "rct-shell-command")
(expect "1+1 # => 2\n"
(with-temp-buffer
(insert "1+1 # =>\n")
(rct-shell-command "xmpfilter")
(buffer-string)))
(desc "xmp")
(desc "xmpfilter-command")
(expect "xmpfilter --rails"
(let ((xmpfilter-command-name "xmpfilter"))
(with-temp-buffer
(insert "class TestFoo < Test::Unit::TestCase\n")
(xmpfilter-command "--rails"))))
(expect "xmpfilter "
(let ((xmpfilter-command-name "xmpfilter"))
(with-temp-buffer
(insert "context 'foo' do\n")
(xmpfilter-command))))
(expect "xmpfilter "
(let ((xmpfilter-command-name "xmpfilter"))
(with-temp-buffer
(insert "describe Array do\n")
(xmpfilter-command))))
(expect "xmpfilter --unittest --rails"
(let ((xmpfilter-command-name "xmpfilter"))
(with-temp-buffer
(insert "class TestFoo < Test::Unit::TestCase\n"
" def test_0\n"
" 1 + 1 # =>\n"
" end\n"
"end\n")
(xmpfilter-command "--rails"))))
(expect "xmpfilter --spec "
(let ((xmpfilter-command-name "xmpfilter"))
(with-temp-buffer
(insert "context 'foo' do\n"
" specify \"foo\" do\n"
" 1 + 1 # =>\n"
" end\n"
"end\n")
(xmpfilter-command))))
(expect "xmpfilter --spec "
(let ((xmpfilter-command-name "xmpfilter"))
(with-temp-buffer
(insert "describe Array do\n"
" it \"foo\" do\n"
" [1] + [1] # =>\n"
" end\n"
"end\n")
(xmpfilter-command))))
(expect "xmpfilter "
(let ((xmpfilter-command-name "xmpfilter"))
(with-temp-buffer
(insert "1 + 2\n")
(xmpfilter-command))))
(desc "rct-fork")
(expect t
(stub start-process-shell-command => t)
(stub interrupt-process => t)
(rct-fork "-r activesupport")
rct-fork-minor-mode)
(expect nil
(stub start-process-shell-command => t)
(stub interrupt-process => t)
(rct-fork "-r activesupport")
(rct-fork-kill)
rct-fork-minor-mode)
))
(provide 'rcodetools)
================================================
FILE: emacs.d/vendor/upgrade.rb
================================================
#!/usr/bin/env ruby
Dir["*/"].each do |dir|
puts "\nUpgrading #{dir}..."
Dir.chdir(dir) do
`git checkout master`
`git pull`
`git submodule update --init --recursive`
end
end
================================================
FILE: gemrc
================================================
---
gem: --no-document
:benchmark: false
:backtrace: false
:update_sources: true
:verbose: true
:bulk_threshold: 1000
:sources:
- http://rubygems.org
================================================
FILE: gitconfig
================================================
# ~/.gitconfig_local template
#
# [user]
# email =
# name =
# [github]
# user =
[include]
path = ~/.gitconfig_local
[alias]
co = checkout
cp = cherry-pick
st = status
br = branch
w = whatchanged
amend = commit --amend
unstage = reset HEAD --
# https://stackoverflow.com/a/30998048/8985
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
[apply]
whitespace = nowarn
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[merge]
summary = true
[push]
default = upstream
[diff]
ignoresubmodules = untracked
compactionHeuristic = true
[core]
excludesfile = ~/.gitignore
[heroku]
account = personal
[pull]
rebase = true
[fetch]
prune = true
[submodule]
fetchJobs = 4
[gpg]
program = gpg1
[pager]
branch = false
[init]
defaultBranch = main
================================================
FILE: gitignore
================================================
.DS_Store
\#*
.\#*
/TAGS
*.elc
**/.bundle
**/vendor/bundle
**/vendor/ruby
**/vendor/rbx
**/vendor/jruby
**/gemfiles/vendor
*.rbc
/public/assets
.rake_t_cache
.rbenv-gemsets
.powenv
.env
.envrc
.foreman
.sass-cache
/dump
**/*notes.*
**/notes-*.*
**/notes_*.*
/http.restclient
lib/tasks/rmm5t.rake
================================================
FILE: guard.rb
================================================
notification :emacs
================================================
FILE: inputrc
================================================
set enable-bracketed-paste off
================================================
FILE: install.rb
================================================
#!/usr/bin/env ruby
# Inspired by http://errtheblog.com/posts/89-huba-huba
# This is idempotent, meaning you can run it over and over again without fear of
# breaking anything. Use it as an installer or to upgrade after merging from an
# upstream fork.
home = File.expand_path('~')
Dir['*'].each do |file|
next if file =~ /install/ || file =~ /README/
if file =~ /^[A-Z]/
target = File.join(home, file)
else
target = File.join(home, ".#{file}")
end
`ln -ns #{File.expand_path file} #{target}`
end
`git submodule sync`
`git submodule update --init --recursive`
================================================
FILE: irbrc
================================================
require 'irb/completion'
begin
require 'irb/ext/save-history'
rescue LoadError
# no-op
end
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:AUTO_INDENT] = true
if Kernel.const_defined?("Rails")
def show_logs
Rails.logger = Logger.new($stdout)
end
end
if defined?(Rails::Console)
def show_mongo
return false unless defined?(Moped)
if Moped.logger == Rails.logger
Moped.logger = Logger.new($stdout)
true
else
Moped.logger = Rails.logger
false
end
end
alias show_moped show_mongo
def show_active_record
return false unless defined?(ActiveRecord)
ActiveRecord::Base.logger = Logger.new($stdout)
true
end
alias show_ar show_active_record
end
# Simulate HISTCONTROL=erasedups behavior from bash
# https://stackoverflow.com/a/47919632/8985
class EraseDupsInputMethod < IRB::ReadlineInputMethod
def gets
super.tap do # super adds line to HISTORY
HISTORY.pop if HISTORY[-1] == HISTORY[-2]
end
end
end
# Method to pretty-print object methods
# Coded by sebastian delmont
# http://snippets.dzone.com/posts/show/2916
class Object
ANSI_BOLD = "\033[1m".freeze
ANSI_RESET = "\033[0m".freeze
ANSI_LGRAY = "\033[0;37m".freeze
ANSI_GRAY = "\033[1;30m".freeze
# Print object's methods
def pretty_methods(*options)
methods = self.methods
methods -= Object.methods unless options.include? :more
filter = options.select { |opt| opt.is_a? Regexp }.first
methods = methods.select { |name| name =~ filter } if filter
data = methods.sort.collect do |name|
method = self.method(name)
if method.arity.zero?
args = "()"
elsif method.arity.positive?
n = method.arity
args = "(#{(1..n).collect {|i| "arg#{i}"}.join(", ")})"
elsif method.arity.negative?
n = -method.arity
args = "(#{(1..n).collect {|i| "arg#{i}"}.join(", ")}, ...)"
end
klass = $1 if method.inspect =~ /Method: (.*?)#/
[name, args, klass]
end
max_name = data.collect { |item| item[0].size }.max
max_args = data.collect { |item| item[1].size }.max
data.each do |item|
print " #{ANSI_BOLD}#{item[0].to_s.rjust(max_name)}#{ANSI_RESET}"
print "#{ANSI_GRAY}#{item[1].ljust(max_args)}#{ANSI_RESET}"
print " #{ANSI_LGRAY}#{item[2]}#{ANSI_RESET}\n"
end
data.size
end
end
class Object
def local_methods
(methods - Object.instance_methods).sort
end
def local_readers(regex = nil)
methods = local_methods.select do |name|
arity = method(name).arity.zero?
match = regex ? name =~ regex : true
arity && match
end
methods.each do |name|
print name.to_s.rjust(20)
print " : "
begin
puts send(name).to_s.truncate(80)
rescue StandardError => e
puts e.message
end
end
methods.size
end
end
================================================
FILE: rubocop.yml
================================================
inherit_gem:
rubocop-pragmatic: ruby.yml
================================================
FILE: screenrc
================================================
# turn off startup message
startup_message off
# change escape leader
escape ^Zz
# utf8
setenv LC_CTYPE en_US.UTF-8
defutf8 on
# longer scrollback
defscrollback 15000
# clear screen when exiting a full screen program
altscreen on
# status line
hardstatus alwayslastline "%{=b}%{b}%w"
# monitor activity
defmonitor on
activity "<%n>"
silencewait 15
bell_msg "DING! (%n)"
vbell_msg "DING! (%n)"
vbell on
# scrollbars
termcapinfo xterm* ti@:te@
# fix backspace
termcapinfo xterm* 'bc@:bs@'
================================================
FILE: tmux.conf
================================================
# Set the prefix to C-z instead of C-b; C-z
set -g prefix C-o
unbind C-b
bind-key -r C-o send-prefix
bind-key | split-window -h
bind-key - split-window -v
set -g base-index 1 # Start window index #s at 1
set -g default-terminal "xterm-256color"
set-option -g status-keys emacs
set-option -g mode-keys emacs
set-window-option -g mode-keys emacs
set-window-option -g monitor-activity on
# set-option -g mouse-select-pane on
set-option -g visual-activity on
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-fg white
================================================
FILE: vimrc
================================================
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
================================================
FILE: yarnrc
================================================
disable-self-update-check true
version-sign-git-tag true
gitextract_hhc_yfqc/ ├── .github/ │ └── FUNDING.yml ├── .gitignore ├── .gitmodules ├── Brewfile ├── README.md ├── ackrc ├── agignore ├── bash_aliases ├── bash_completion ├── bash_powerline ├── bash_profile ├── bashrc ├── bundle/ │ └── config ├── ctags ├── editrc ├── emacs.d/ │ ├── backups/ │ │ └── .keep │ ├── init.el │ ├── locks/ │ │ └── .keep │ ├── personal/ │ │ ├── ace-jump-mode.el │ │ ├── add-node-modules-path.el │ │ ├── ag.el │ │ ├── alchemist.el │ │ ├── auctex.el │ │ ├── bindings.el │ │ ├── c.el │ │ ├── company-mode.el │ │ ├── csv-mode.el │ │ ├── dash-at-point.el │ │ ├── defuns.el │ │ ├── diff.el │ │ ├── dimmer.el │ │ ├── dired-details+.el │ │ ├── dired.el │ │ ├── disabled.el │ │ ├── editorconfig.el │ │ ├── exec-path-from-shell.el │ │ ├── expand-region.el │ │ ├── flx-ido.el │ │ ├── flycheck.el │ │ ├── flymake.el │ │ ├── fonts.el │ │ ├── forge.el │ │ ├── global.el │ │ ├── grep.el │ │ ├── groovy-mode.el │ │ ├── hl-line.el │ │ ├── htmlize.el │ │ ├── ido.el │ │ ├── javascript.el │ │ ├── jekyll.el │ │ ├── js2-mode.el │ │ ├── kbd-macros.el │ │ ├── key-chord.el │ │ ├── lua-mode.el │ │ ├── mac.el │ │ ├── magit.el │ │ ├── markdown-mode.el │ │ ├── maxframe.el │ │ ├── motion-mode.el │ │ ├── multiple-cursors.el │ │ ├── nodejs-repl.el │ │ ├── org.el │ │ ├── powerline.el │ │ ├── prettier-js.el │ │ ├── projectile-rails.el │ │ ├── projectile.el │ │ ├── rbenv.el │ │ ├── recentf.el │ │ ├── rectangle.el │ │ ├── restclient.el │ │ ├── rhtml-mode.el │ │ ├── ri-emacs.el │ │ ├── ruby-hash-syntax.el │ │ ├── ruby-mode.el │ │ ├── saveplace.el │ │ ├── scratch.el │ │ ├── server-mode.el │ │ ├── shell-mode.el │ │ ├── shell-pop.el │ │ ├── tabs.el │ │ ├── textile-mode.el │ │ ├── theme.el │ │ ├── toggle-quotes.el │ │ ├── utf-8.el │ │ ├── yaml-mode.el │ │ ├── yasnippet.el │ │ └── zoom.el │ └── vendor/ │ ├── mode-line-bell.el │ ├── rcodetools.el │ └── upgrade.rb ├── gemrc ├── gitconfig ├── gitignore ├── guard.rb ├── inputrc ├── install.rb ├── irbrc ├── rubocop.yml ├── screenrc ├── tmux.conf ├── vimrc └── yarnrc
Condensed preview — 102 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (108K chars).
[
{
"path": ".github/FUNDING.yml",
"chars": 453,
"preview": "# These are supported funding model platforms\n\ngithub: [rmm5t]\n# patreon: # Replace with a single Patreon username\n# ope"
},
{
"path": ".gitignore",
"chars": 492,
"preview": ".DS_Store\n\nbundle/cache\nemacs.d/ac-dict\nemacs.d/bookmarks\nemacs.d/eln-cache\nemacs.d/elpa\nemacs.d/projectile-bookmarks.el"
},
{
"path": ".gitmodules",
"chars": 634,
"preview": "[submodule \"emacs.d/vendor/ri-emacs\"]\n path = emacs.d/vendor/ri-emacs\n url = https://github.com/pedz/ri-emacs.git\n[sub"
},
{
"path": "Brewfile",
"chars": 1327,
"preview": "tap \"d12frosted/emacs-plus\"\ntap \"dopplerhq/cli\"\ntap \"homebrew/bundle\"\ntap \"homebrew/services\"\ntap \"puma/puma\"\nbrew \"ack\""
},
{
"path": "README.md",
"chars": 1460,
"preview": "# Getting Started\n\nClone this (or a forked version of this) repository.\n\n $ cd ~\n $ git clone https://github.com/r"
},
{
"path": "ackrc",
"chars": 174,
"preview": "--ignore-dir=log\n--ignore-dir=vendor\n--ignore-dir=node_modules\n--ignore-dir=tmp\n--ignore-dir=.bundle\n\n--ignore-file=is:t"
},
{
"path": "agignore",
"chars": 414,
"preview": ".DS_Store\n\\#*\n.\\#*\n/TAGS\n*.elc\n/.bundle\n/vendor/bundle\n/vendor/ruby\n/vendor/rbx\n/vendor/jruby\n/*/.bundle\n/*/vendor/bundl"
},
{
"path": "bash_aliases",
"chars": 13871,
"preview": "# https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit\nCOLOR_BLACK=\"$(__tput setaf 0)\"\nCOLOR_WHITE=\"$(__tput setaf 7)\"\n\n"
},
{
"path": "bash_completion",
"chars": 675,
"preview": "# http://onrails.org/articles/2006/11/17/rake-command-completion-using-rake\nif [ -f ~/bin/rake_completion ]; then\n . ~/"
},
{
"path": "bash_powerline",
"chars": 5593,
"preview": "#!/usr/bin/env bash\n\n# Borrowed and customized from https://github.com/riobard/bash-powerline\n\n__powerline() {\n # Unico"
},
{
"path": "bash_profile",
"chars": 209,
"preview": "# ~/.bash_profile: executed by bash for login shells.\n\nif [ -e ~/.bashrc ] ; then\n . ~/.bashrc\nfi\n\n# Put all local mach"
},
{
"path": "bashrc",
"chars": 6196,
"preview": "## This file is sourced by all *interactive* bash shells on startup. This\n## file *should generate no output* or it wil"
},
{
"path": "bundle/config",
"chars": 253,
"preview": "---\nBUNDLE_PATH: \"vendor\"\n# BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE: \"true\"\n\nBUNDLE_JOBS: \"12\"\nBUNDLE_GEM__TEST: \"minitest"
},
{
"path": "ctags",
"chars": 21,
"preview": "--langmap=ruby:+.thor"
},
{
"path": "editrc",
"chars": 29,
"preview": "bind \"^R\" em-inc-search-prev\n"
},
{
"path": "emacs.d/backups/.keep",
"chars": 0,
"preview": ""
},
{
"path": "emacs.d/init.el",
"chars": 2766,
"preview": "(setq custom-file \"~/.emacs.d/personal/custom.el\")\n(load custom-file 'noerror)\n\n(load \"~/.emacs.d/personal/defuns\")\n\n;; "
},
{
"path": "emacs.d/locks/.keep",
"chars": 0,
"preview": ""
},
{
"path": "emacs.d/personal/ace-jump-mode.el",
"chars": 134,
"preview": ";;; Quick navigation jumping by word, char, or line\n\n; Make all jumps case-insensitive\n(setq ace-jump-mode-case-sensitiv"
},
{
"path": "emacs.d/personal/add-node-modules-path.el",
"chars": 161,
"preview": "(eval-after-load 'js-mode\n '(add-hook 'js-mode-hook #'add-node-modules-path))\n\n(eval-after-load 'js2-mode\n '(add-hook "
},
{
"path": "emacs.d/personal/ag.el",
"chars": 53,
"preview": "(require 'ag)\n(add-to-list 'ag-arguments \"--hidden\")\n"
},
{
"path": "emacs.d/personal/alchemist.el",
"chars": 71,
"preview": "(require 'elixir-mode)\n(add-to-list 'elixir-mode-hook 'alchemist-mode)\n"
},
{
"path": "emacs.d/personal/auctex.el",
"chars": 96,
"preview": ";;; LaTeX\n\n;; Try the MacTeX distribution:\n;; http://www.tug.org/mactex/\n\n(require 'tex-site)\n"
},
{
"path": "emacs.d/personal/bindings.el",
"chars": 3671,
"preview": ";;; Global key bindigns\n\n;; How to Define Keyboard Shortcuts in Emacs\n;; http://xahlee.org/emacs/keyboard_shortcuts.html"
},
{
"path": "emacs.d/personal/c.el",
"chars": 50,
"preview": "(add-to-list 'auto-mode-alist '(\"ino$\" . c-mode))\n"
},
{
"path": "emacs.d/personal/company-mode.el",
"chars": 49,
"preview": "(add-hook 'after-init-hook 'global-company-mode)\n"
},
{
"path": "emacs.d/personal/csv-mode.el",
"chars": 94,
"preview": ";;; Comma seperated values\n\n(add-to-list 'auto-mode-alist '(\"\\\\.[Cc][Ss][Vv]\\\\'\" . csv-mode))\n"
},
{
"path": "emacs.d/personal/dash-at-point.el",
"chars": 92,
"preview": "(global-set-key \"\\C-cd\" 'dash-at-point)\n(global-set-key \"\\C-ce\" 'dash-at-point-with-docset)\n"
},
{
"path": "emacs.d/personal/defuns.el",
"chars": 7478,
"preview": ";;; Personal functions\n\n;; For loading personal configurations\n(defun personal (library)\n (load (concat \"~/.emacs.d/per"
},
{
"path": "emacs.d/personal/diff.el",
"chars": 796,
"preview": ";;; Diff\n\n;; Side by side is the only way\n(setq ediff-split-window-function 'split-window-horizontally)\n\n;; Pretty color"
},
{
"path": "emacs.d/personal/dimmer.el",
"chars": 46,
"preview": "(setq dimmer-fraction 0.30)\n(dimmer-activate)\n"
},
{
"path": "emacs.d/personal/dired-details+.el",
"chars": 40,
"preview": "(setq dired-details-hidden-string \"» \")\n"
},
{
"path": "emacs.d/personal/dired.el",
"chars": 798,
"preview": ";;; Dired\n\n;; Use gnu ls instead (macos requires `brew install coreutils`)\n(setq insert-directory-program \"gls\")\n(setq d"
},
{
"path": "emacs.d/personal/disabled.el",
"chars": 393,
"preview": ";;; Enable functions that are disabled by default\n\n;; Upcase and downcase regions\n(put 'upcase-region 'disabled nil)\n(pu"
},
{
"path": "emacs.d/personal/editorconfig.el",
"chars": 22,
"preview": "(editorconfig-mode 1)\n"
},
{
"path": "emacs.d/personal/exec-path-from-shell.el",
"chars": 74,
"preview": "(when (memq window-system '(mac ns))\n (exec-path-from-shell-initialize))\n"
},
{
"path": "emacs.d/personal/expand-region.el",
"chars": 47,
"preview": "(global-set-key (kbd \"C-=\") 'er/expand-region)\n"
},
{
"path": "emacs.d/personal/flx-ido.el",
"chars": 190,
"preview": ";;; Fuzzy matching for Emacs ... a la Sublime Text.\n\n(require 'flx-ido)\n(ido-mode 1)\n(ido-everywhere 1)\n(flx-ido-mode 1)"
},
{
"path": "emacs.d/personal/flycheck.el",
"chars": 2183,
"preview": ";;; http://www.flycheck.org/manual/latest/index.html\n(require 'flycheck)\n\n;; disable lisp checkdoc\n(with-eval-after-load"
},
{
"path": "emacs.d/personal/flymake.el",
"chars": 208,
"preview": ";;; Flymake\n\n(defface flymake-errline '((t (:background \"#330000\" :overline \"red\" :underline \"red\"))) nil)\n(defface flym"
},
{
"path": "emacs.d/personal/fonts.el",
"chars": 549,
"preview": ";;; Fonts\n\n(when (eq system-type 'darwin)\n ;; default Latin font (e.g. Consolas)\n ;; default font size (point * 10)\n "
},
{
"path": "emacs.d/personal/forge.el",
"chars": 49,
"preview": "(with-eval-after-load 'magit\n (require 'forge))\n"
},
{
"path": "emacs.d/personal/global.el",
"chars": 2308,
"preview": ";;; Generic emacs settings I cannot live without\n\n;; Turn off visual line moves: https://emacs.stackexchange.com/a/8031/"
},
{
"path": "emacs.d/personal/grep.el",
"chars": 489,
"preview": ";;; Grep is wicked\n\n;; Grep/Find. This needs some cleanup\n(setq grep-command \"grep -Irine \")\n\n(eval-after-load 'grep\n "
},
{
"path": "emacs.d/personal/groovy-mode.el",
"chars": 63,
"preview": "(add-to-list 'auto-mode-alist '(\"Jenkinsfile$\" . groovy-mode))\n"
},
{
"path": "emacs.d/personal/hl-line.el",
"chars": 516,
"preview": ";;; Highlight current line\n\n(global-hl-line-mode 1)\n\n;; Great for black background\n(set-face-background 'hl-line \"black\""
},
{
"path": "emacs.d/personal/htmlize.el",
"chars": 91,
"preview": ";;; Convert buffer text and decorations to HTML\n\n(setq htmlize-html-major-mode 'html-mode)\n"
},
{
"path": "emacs.d/personal/ido.el",
"chars": 366,
"preview": ";;; Interactive do, find-file and iswitchb replacement with fuzzy/flex matching.\n\n(ido-mode t)\n(setq ido-enable-flex-mat"
},
{
"path": "emacs.d/personal/javascript.el",
"chars": 67,
"preview": ";;; Javscript is fun\n\n;; Standard js-mode\n(setq js-indent-level 2)\n"
},
{
"path": "emacs.d/personal/jekyll.el",
"chars": 632,
"preview": ";; Custom support for Jekyll blogs\n\n(setq jekyll-directory (expand-file-name \"~/work/ryan.mcgeary.org/\"))\n(setq jeky"
},
{
"path": "emacs.d/personal/js2-mode.el",
"chars": 437,
"preview": ";; js2-mode\n\n(add-to-list 'auto-mode-alist '(\"\\\\.js$\" . js2-mode))\n\n(setq js2-cleanup-whitespace t)\n(setq js2-basic-offs"
},
{
"path": "emacs.d/personal/kbd-macros.el",
"chars": 0,
"preview": ""
},
{
"path": "emacs.d/personal/key-chord.el",
"chars": 107,
"preview": ";;; Key-chord without modifier keys\n\n(key-chord-mode 1)\n\n(key-chord-define-global \"df\" 'jump-char-forward)\n"
},
{
"path": "emacs.d/personal/lua-mode.el",
"chars": 55,
"preview": "(add-to-list 'auto-mode-alist '(\"\\\\.lua$\" . lua-mode))\n"
},
{
"path": "emacs.d/personal/mac.el",
"chars": 410,
"preview": ";;; Cocoa!\n\n;; Hide the tool bar\n(when (fboundp 'tool-bar-mode)\n (tool-bar-mode 0))\n\n;; Slow down the mouse wheel accel"
},
{
"path": "emacs.d/personal/magit.el",
"chars": 2032,
"preview": ";;; It's Magit! An Emacs mode for Git.\n\n(add-to-list 'load-path \"~/.emacs.d/vendor/git-modes\")\n\n(add-hook\n 'magit-mode-h"
},
{
"path": "emacs.d/personal/markdown-mode.el",
"chars": 863,
"preview": ";;; Markdown\n\n(add-to-list 'auto-mode-alist '(\"\\\\.markdown$\" . gfm-mode))\n(add-to-list 'auto-mode-alist '(\"\\\\.md$\" "
},
{
"path": "emacs.d/personal/maxframe.el",
"chars": 1015,
"preview": ";;; Frame size manipulation.\n\n(defun personal-init-fullscreen ()\n ;; (setq ns-auto-hide-menu-bar t)\n (setq ns-use-nati"
},
{
"path": "emacs.d/personal/motion-mode.el",
"chars": 370,
"preview": "(require 'motion-mode)\n;; following add-hook is very important.\n(add-hook 'ruby-mode-hook 'motion-recognize-project)\n;; "
},
{
"path": "emacs.d/personal/multiple-cursors.el",
"chars": 286,
"preview": "(global-set-key (kbd \"C-c C-.\") 'mc/edit-lines)\n(global-set-key (kbd \"C->\") 'mc/mark-next-like-this)\n(global-set-key"
},
{
"path": "emacs.d/personal/nodejs-repl.el",
"chars": 364,
"preview": "(add-hook 'js2-mode-hook\n (lambda ()\n (define-key js-mode-map (kbd \"C-x C-e\") 'nodejs-repl-send-last"
},
{
"path": "emacs.d/personal/org.el",
"chars": 512,
"preview": ";;; org-mode\n\n(require 'org)\n(add-to-list 'auto-mode-alist '(\"\\\\.org$\" . org-mode))\n(define-key global-map \"\\C-cl\" 'org-"
},
{
"path": "emacs.d/personal/powerline.el",
"chars": 375,
"preview": "(setq powerline-arrow-shape 'arrow)\n\n(powerline-default-theme)\n\n(setq powerline-image-apple-rgb nil)\n\n(custom-set-faces\n"
},
{
"path": "emacs.d/personal/prettier-js.el",
"chars": 114,
"preview": "(use-package prettier-js)\n\n(add-hook 'js-mode-hook 'prettier-js-mode)\n(add-hook 'js2-mode-hook 'prettier-js-mode)\n"
},
{
"path": "emacs.d/personal/projectile-rails.el",
"chars": 182,
"preview": "(projectile-rails-global-mode)\n\n(setq projectile-rails-vanilla-command \"bin/rails\"\n projectile-rails-spring-command"
},
{
"path": "emacs.d/personal/projectile.el",
"chars": 161,
"preview": "(projectile-mode +1)\n(define-key projectile-mode-map (kbd \"s-p\") 'projectile-command-map)\n(define-key projectile-mode-ma"
},
{
"path": "emacs.d/personal/rbenv.el",
"chars": 20,
"preview": "(global-rbenv-mode)\n"
},
{
"path": "emacs.d/personal/recentf.el",
"chars": 88,
"preview": ";;; Recent Files\n\n(require 'recentf)\n(recentf-mode 1)\n(setq recentf-max-menu-items 25)\n\n"
},
{
"path": "emacs.d/personal/rectangle.el",
"chars": 523,
"preview": ";;; Rectangles\n\n;; Compliment to kill-rectangle (just like kill-ring-save compliments\n;; kill-region)\n;; http://www.emac"
},
{
"path": "emacs.d/personal/restclient.el",
"chars": 84,
"preview": ";; restclient\n\n(add-to-list 'auto-mode-alist '(\"\\\\.restclient$\" . restclient-mode))\n"
},
{
"path": "emacs.d/personal/rhtml-mode.el",
"chars": 57,
"preview": "(add-to-list 'auto-mode-alist '(\"\\\\.erb$\" . rhtml-mode))\n"
},
{
"path": "emacs.d/personal/ri-emacs.el",
"chars": 413,
"preview": "(add-to-list 'load-path (expand-file-name \"~/.emacs.d/vendor/ri-emacs\"))\n(setq ri-ruby-script (expand-file-name \"~/.emac"
},
{
"path": "emacs.d/personal/ruby-hash-syntax.el",
"chars": 127,
"preview": "(add-hook 'ruby-mode-hook\n (lambda ()\n (local-set-key (kbd \"C-;\") 'ruby-toggle-hash-syntax)\n "
},
{
"path": "emacs.d/personal/ruby-mode.el",
"chars": 2274,
"preview": ";;; Ruby\n\n;; Run the current ruby buffer\n(defun ruby-eval-buffer()\n \"Evaluate the buffer with ruby.\"\n (interactive)\n"
},
{
"path": "emacs.d/personal/saveplace.el",
"chars": 49,
"preview": "(require 'saveplace)\n(setq-default save-place t)\n"
},
{
"path": "emacs.d/personal/scratch.el",
"chars": 499,
"preview": ";; Scratch buffer goodness\n;; https://emacs.stackexchange.com/a/74/10738\n\n(defun prepare-scratch-for-kill ()\n (save-exc"
},
{
"path": "emacs.d/personal/server-mode.el",
"chars": 289,
"preview": "(defun server-save-edit ()\n (interactive)\n (save-buffer)\n (server-edit)\n (kill-buffer))\n\n(add-hook 'server-visit-hoo"
},
{
"path": "emacs.d/personal/shell-mode.el",
"chars": 490,
"preview": ";;; Shell scripts\n\n(add-to-list 'auto-mode-alist '(\"bashrc$\" . sh-mode))\n(add-to-list 'auto-mode-alist '(\"bash_profile$\""
},
{
"path": "emacs.d/personal/shell-pop.el",
"chars": 352,
"preview": ";;; Shell-Pop is a utility which helps you pop up and pop out shell buffer\n;;; window easily.\n\n(setq shell-pop-shell-typ"
},
{
"path": "emacs.d/personal/tabs.el",
"chars": 2219,
"preview": ";;; Tab management\n\n;; Spaces instead of tabs\n(setq-default indent-tabs-mode nil)\n\n;; If there is a tab, make it the siz"
},
{
"path": "emacs.d/personal/textile-mode.el",
"chars": 76,
"preview": ";;; Textile\n\n(add-to-list 'auto-mode-alist '(\"\\\\.textile$\" . textile-mode))\n"
},
{
"path": "emacs.d/personal/theme.el",
"chars": 782,
"preview": ";;; Theme customization\n\n;; (load-theme 'adwaita)\n;; (load-theme 'deeper-blue)\n;; (load-theme 'dichromacy)\n;; (load-them"
},
{
"path": "emacs.d/personal/toggle-quotes.el",
"chars": 48,
"preview": "(global-set-key (kbd \"C-c C-'\") 'toggle-quotes)\n"
},
{
"path": "emacs.d/personal/utf-8.el",
"chars": 234,
"preview": ";;; Gotta do UTF-8\n\n(require 'un-define \"un-define\" t)\n(set-buffer-file-coding-system 'utf-8 'utf-8-unix)\n(set-default b"
},
{
"path": "emacs.d/personal/yaml-mode.el",
"chars": 234,
"preview": "(add-to-list 'auto-mode-alist '(\"\\\\.yml$\" . yaml-mode))\n(add-to-list 'auto-mode-alist '(\"\\\\.eslintrc$\" . yaml-mode))\n(ad"
},
{
"path": "emacs.d/personal/yasnippet.el",
"chars": 510,
"preview": ";;; Snippets make typing fun\n\n(yas-global-mode 1)\n\n;; (yas-load-directory \"~/.emacs.d/vendor/yasnippet/snippets\")\n;; (ya"
},
{
"path": "emacs.d/personal/zoom.el",
"chars": 720,
"preview": ";;; Custom folding support\n\n(defun zoom-way-out() (interactive)\n (set-selective-display 0))\n(defun zoom-way-in() (inter"
},
{
"path": "emacs.d/vendor/mode-line-bell.el",
"chars": 1749,
"preview": ";; Recommended by Ryan Davis\n;; Found at http://www.elliotglaysher.org/emacs/\n\n;; --------------------------------------"
},
{
"path": "emacs.d/vendor/rcodetools.el",
"chars": 15176,
"preview": ";;; rcodetools.el -- annotation / accurate completion / browsing documentation\n\n;;; Copyright (c) 2006-2008 rubikitch <r"
},
{
"path": "emacs.d/vendor/upgrade.rb",
"chars": 193,
"preview": "#!/usr/bin/env ruby\n\nDir[\"*/\"].each do |dir|\n puts \"\\nUpgrading #{dir}...\"\n Dir.chdir(dir) do\n `git checkout master"
},
{
"path": "gemrc",
"chars": 150,
"preview": "---\ngem: --no-document\n:benchmark: false\n:backtrace: false\n:update_sources: true\n:verbose: true\n:bulk_threshold: 1000\n:s"
},
{
"path": "gitconfig",
"chars": 1108,
"preview": "# ~/.gitconfig_local template\n#\n# [user]\n# email =\n# name =\n# [github]\n# user =\n\n[include]\n path = ~/.gitconfig_l"
},
{
"path": "gitignore",
"chars": 296,
"preview": ".DS_Store\n\\#*\n.\\#*\n/TAGS\n*.elc\n**/.bundle\n**/vendor/bundle\n**/vendor/ruby\n**/vendor/rbx\n**/vendor/jruby\n**/gemfiles/vend"
},
{
"path": "guard.rb",
"chars": 20,
"preview": "notification :emacs\n"
},
{
"path": "inputrc",
"chars": 31,
"preview": "set enable-bracketed-paste off\n"
},
{
"path": "install.rb",
"chars": 583,
"preview": "#!/usr/bin/env ruby\n\n# Inspired by http://errtheblog.com/posts/89-huba-huba\n\n# This is idempotent, meaning you can run i"
},
{
"path": "irbrc",
"chars": 2950,
"preview": "require 'irb/completion'\nbegin\n require 'irb/ext/save-history'\nrescue LoadError\n # no-op\nend\n\nIRB.conf[:SAVE_HISTORY] "
},
{
"path": "rubocop.yml",
"chars": 43,
"preview": "inherit_gem:\n rubocop-pragmatic: ruby.yml\n"
},
{
"path": "screenrc",
"chars": 496,
"preview": "# turn off startup message\nstartup_message off\n\n# change escape leader\nescape ^Zz\n\n# utf8\nsetenv LC_CTYPE en_US.UTF-8\nde"
},
{
"path": "tmux.conf",
"chars": 561,
"preview": "# Set the prefix to C-z instead of C-b; C-z\nset -g prefix C-o\nunbind C-b\nbind-key -r C-o send-prefix\nbind-key | split-wi"
},
{
"path": "vimrc",
"chars": 192,
"preview": "\n\" Switch syntax highlighting on, when the terminal has colors\n\" Also switch on highlighting the last used search patter"
},
{
"path": "yarnrc",
"chars": 57,
"preview": "disable-self-update-check true\nversion-sign-git-tag true\n"
}
]
About this extraction
This page contains the full source code of the rmm5t/dotfiles GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 102 files (95.1 KB), approximately 29.0k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.