Repository: thoughtbot/dotfiles Branch: main Commit: 0db29b2becbe Files: 83 Total size: 50.8 KB Directory structure: gitextract_bzuroiub/ ├── .github/ │ └── workflows/ │ ├── dynamic-readme.yml │ └── dynamic-security.yml ├── .gitignore ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README-ES.md ├── README.md ├── SECURITY.md ├── agignore ├── aliases ├── asdfrc ├── bin/ │ ├── bundler-search │ ├── clear-port │ ├── git-ca │ ├── git-co-upstream-pr │ ├── git-create-branch │ ├── git-ctags │ ├── git-current-branch │ ├── git-delete-branch │ ├── git-merge-branch │ ├── git-rename-branch │ ├── git-trust-bin │ ├── git-up │ ├── replace │ ├── tat │ └── whats-in-port ├── ctags ├── ctags.d/ │ └── config.ctags ├── gemrc ├── git_template/ │ ├── hooks/ │ │ ├── commit-msg │ │ ├── ctags │ │ ├── post-checkout │ │ ├── post-commit │ │ ├── post-merge │ │ ├── post-rewrite │ │ ├── pre-commit │ │ ├── pre-push │ │ └── prepare-commit-msg │ └── info/ │ └── exclude ├── gitconfig ├── gitignore ├── gitmessage ├── hooks/ │ └── post-up ├── hushlogin ├── psqlrc ├── railsrc ├── rcrc ├── rspec ├── tmux.conf ├── vim/ │ ├── ftplugin/ │ │ ├── css.vim │ │ ├── gitcommit.vim │ │ ├── go.vim │ │ ├── markdown.vim │ │ ├── sass.vim │ │ └── scss.vim │ └── plugin/ │ └── ctags.vim ├── vimrc ├── vimrc.bundles ├── zprofile ├── zsh/ │ ├── completion/ │ │ ├── _ag │ │ ├── _bundler │ │ ├── _g │ │ ├── _production │ │ ├── _rspec │ │ └── _staging │ ├── configs/ │ │ ├── color.zsh │ │ ├── editor.zsh │ │ ├── fzf.zsh │ │ ├── history.zsh │ │ ├── homebrew.zsh │ │ ├── keybindings.zsh │ │ ├── options.zsh │ │ ├── post/ │ │ │ ├── completion.zsh │ │ │ └── path.zsh │ │ └── prompt.zsh │ └── functions/ │ ├── _git_delete_branch │ ├── change-extension │ ├── envup │ ├── g │ └── mcd ├── zshenv └── zshrc ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/dynamic-readme.yml ================================================ name: update-templates on: push: branches: - main workflow_dispatch: jobs: update-templates: permissions: contents: write pull-requests: write pages: write uses: thoughtbot/templates/.github/workflows/dynamic-readme.yaml@main secrets: token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .github/workflows/dynamic-security.yml ================================================ name: update-security on: push: paths: - SECURITY.md branches: - main workflow_dispatch: jobs: update-security: permissions: contents: write pull-requests: write pages: write uses: thoughtbot/templates/.github/workflows/dynamic-security.yaml@main secrets: token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .gitignore ================================================ !bin vim/bundle/ ================================================ FILE: CODEOWNERS ================================================ @purinkle ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Code of conduct By participating in this project, you agree to abide by the [thoughtbot code of conduct][1]. [1]: https://thoughtbot.com/open-source-code-of-conduct ================================================ FILE: LICENSE ================================================ LICENSE The MIT License Copyright (c) 2009-2016 thoughtbot, inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README-ES.md ================================================ Los dotfiles de thoughtbot ========================== ![prompt](http://images.thoughtbot.com/thoughtbot-dotfiles-prompt.png) Requerimientos -------------- Establece zsh como tu shell de inicio de sesión: chsh -s $(which zsh) Instalar -------- Clona en tu laptop: git clone git@github.com:thoughtbot/dotfiles.git ~/dotfiles (o [haz un fork y mantenlo actualizado](http://robots.thoughtbot.com/keeping-a-github-fork-updated)). Instala [rcm](https://github.com/thoughtbot/rcm): brew install rcm Instala los dotfiles: env RCRC=$HOME/dotfiles/rcrc rcup Después de la instalación inicial, puedes ejecutarlo sin establecer la variable `RCRC` (`rcup` establecerá un enlace simbólico (symlink) del repo `rcrc` hacia `~/.rcrc` para futuras ejecuciones de `rcup`). [Ve el ejemplo](https://github.com/thoughtbot/dotfiles/blob/master/rcrc). Este comando creará enlaces simbólicos (symlinks) para los archivos de configuración en tu directorio principal. Establecer la variable de entorno le dice a `rcup` que use las opciones de configuración preestablecidas: * Excluye los archivos `README.md`, `README-ES.md` y `LICENSE`, que son parte del repositorio `dotfiles`, pero no necesitan enlazarse simbólicamente. * Le da precedencia a las modificaciones personales que por defecto están en `~/dotfiles-local` * Por favor configura el archivo `rcrc` en caso de que quieras hacer modificaciones personales en un directorio distinto. Actualizar ---------- De vez en cuando deberías descargar las actualizaciones de estos dotfiles, y ejectuar rcup para ligar cualquier nuevo archivo e instalar los nuevos plugins de vim. **Nota** _Debes_ ejecutar `rcup` después de descargar para asegurarte que todos los archivos de los plugins estén instalados adecuadamente. Puedes ejecutar `rcup` con seguridad muchas veces para actualizar pronto y muy seguido! Haz tus propias modificaciones ------------------------------ Crea un directorio para tus modificaciones personales: mkdir ~/dotfiles-local Pon tus modificaciones en `~/dotfiles-local` anexado con `.local`: * `~/dotfiles-local/aliases.local` * `~/dotfiles-local/git_template.local/*` * `~/dotfiles-local/gitconfig.local` * `~/dotfiles-local/psqlrc.local` (proveemos `.psqlrc.local` en blanco para prevenir que `psql` arroje un error, pero debes sobreescribir el archivo con tu propia copia) * `~/dotfiles-local/tmux.conf.local` * `~/dotfiles-local/vimrc.local` * `~/dotfiles-local/vimrc.bundles.local` * `~/dotfiles-local/zshrc.local` * `~/dotfiles-local/zsh/configs/*` Por ejemplo, tu `~/dotfiles-local/aliases.local` tal vez se vea así: # Productivity alias todo='$EDITOR ~/.todo' Tu `~/dotfiles-local/gitconfig.local` tal vez se vea así: [alias] l = log --pretty=colored [pretty] colored = format:%Cred%h%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset [user] name = Dan Croak email = dan@thoughtbot.com Tu `~/dotfiles-local/vimrc.local` tal vez se vea así: " Color scheme colorscheme github highlight NonText guibg=#060606 highlight Folded guibg=#0A0A0A guifg=#9090D0 Si prefieres prevenir la instalación de un plugin predeterminado de vim en `.vimrc.bundles`, puedes ignorarlo sacándolo con `UnPlug` en tu `~/.vimrc.bundles.local`. " Don't install vim-scripts/tComment UnPlug 'tComment' `UnPlug` puede ser usado para instalar tu propio fork de un plugin o para instalar un plugin compartido con opciones personalizadas distintas. " Only load vim-coffee-script if a Coffeescript buffer is created UnPlug 'vim-coffee-script' Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' } " Use a personal fork of vim-run-interactive UnPlug 'vim-run-interactive' Plug '$HOME/plugins/vim-run-interactive' Para extender tus `git` hooks, crea scripts ejecutables en `~/dotfiles-local/git_template.local/hooks/*` files. Tu `~/dotfiles-local/zshrc.local` tal vez se vea así: # load pyenv if available if command -v pyenv &>/dev/null ; then eval "$(pyenv init -)" fi Tu `~/dotfiles-local/vimrc.bundles.local` tal vez se vea así: Plug 'Lokaltog/vim-powerline' Plug 'stephenmckinney/vim-solarized-powerline' Configuraciones de zsh ---------------------- Configuraciones adicionales para zsh pueden ir en el directorio `~/dotfiles-local/zsh/configs`. Este tiene dos subdirectorios especiales: `pre` para archivos que deben ser cargados primero y `post` para archivos que deben cargarse al final. Por ejemplo, `~/dotfiles-local/zsh/configs/pre/virtualenv` hace uso de varias características de shell que tal vez se vean afectadas por tu configuración, por lo tanto cárgalo primero: # Load the virtualenv wrapper . /usr/local/bin/virtualenvwrapper.sh Establecer una vinculación clave puede ocurrir en `~/dotfiles-local/zsh/configs/keys`: # Grep anywhere with ^G bindkey -s '^G' ' | grep ' Algunos cambios, como `chpwd`, deben ocurrir en `~/dotfiles-local/zsh/configs/post/chpwd`: # Show the entries in a directory whenever you cd in function chpwd { ls } Este directorio está a la mano para combinar dotfiles de múltiples equipos; un equipo puede agregar el archivo `virtualenv`, otro el archivo `keys` y un tercero el archivo `chpwd`. El archivo `~/dotfiles-local/zshrc.local` se carga después de `~/dotfiles-local/zsh/configs`. Configuraciones de vim ---------------------- Similar al directorio de configuración para zsh descrito arriba, vim automáticamente descarga los archivos en el directorio `~/dotfiles-local/vim/plugin`. Sin embargo, este no tiene el mismo soporte para los subdirectorios `pre` ni `post` que tiene nuestro `zshrc`. Este es un ejemplo `~/dotfiles-local/vim/plugin/c.vim`. Se carga cada vez que inicia vim, sin importar de nombre del archivo: # Indent C programs according to BSD style(9) set cinoptions=:0,t0,+4,(4 autocmd BufNewFile,BufRead *.[ch] setlocal sw=0 ts=8 noet ¿Qué viene incluido? ----------------- Configuración [vim](http://www.vim.org/): * [fzf](https://github.com/junegunn/fzf.vim) para hallazgo difuso de archivos/buffer/tags. * [Rails.vim](https://github.com/tpope/vim-rails) para una mejor navegación de la estructura de archivos de Rails via `gf` y `:A` (alterno), `:Rextract` parciales,`:Rinvert` migraciones, etc. * Ejecuta muchos tipos de pruebas [desde vim]([https://github.com/janko-m/vim-test) * Establece `` a un sólo espacio. * Navega entre los últimos dos archivos con espacio-espacio * Resaltado de sintaxis para Markdown, HTML, JavaScript, Ruby, Go, Elixir, y más. * Usa [Ag](https://github.com/ggreer/the_silver_searcher) en lugar de Grep cuando esté disponible. * Map `ct` para re-indexar [Exuberant Ctags](http://ctags.sourceforge.net/). * Usa [vim-mkdir](https://github.com/pbrisbin/vim-mkdir) para crear automáticamente directorios no existentes antes de escribir el buffer. * Usa [vim-plug](https://github.com/junegunn/vim-plug) para administrar plugins. [tmux](http://robots.thoughtbot.com/a-tmux-crash-course) configuración: * Mejora la resolición del color. * Eliminar desechos administrativos(bombre de sesión, nombre de host, tiempo) en la barra de estatus. * Establece el prefijo a `Ctrl+s` * Suaviza el color de la barra de estatus de un verde chillante a un gris claro. Configuración para [git](http://git-scm.com/): * Agrega el alias `create-branch` para crear branches. * Agrega el alias `delete-branch` para borrar branches. * Agrega el alias `merge-branch` para fusionar los branches en master. * Agrega el alias `up` para buscar y rebasar `origin/master` en el branch. Usa `git up -i` para rebases interactivos. * Agrega el hook `post-{checkout,commit,merge}` para re-indexar tus ctags. * Agrega `pre-commit` y `prepare-commit-msg` stubs que delegan hacia tu configuración local. * Agrega el alias `trust-bin` para anexar el `bin/` de un proyecto al `$PATH`. Configuración de [Ruby](https://www.ruby-lang.org/en/): * Agrega binstubs confiables al `PATH`. * Descarga el administrador de versiones ASDF. Alias de Shell y scripts: * `b` para `bundle`. * `g` sin argumentos es `git status` y con argumentos funciona como `git`. * `migrate` para `bin/rails db:migrate db:rollback && bin/rails db:migrate db:test:prepare`. * `mcd` para crear un directorio e ir a él. * `replace foo bar **/*.rb` para buscar y reemplazar en una lista dada de archivos. * `tat` para adjuntar a una sesión de tmux llamada igual que el directorio actual. * `v` para `$VISUAL`. Gracias ------- Gracias [Contribuyentes](https://github.com/thoughtbot/dotfiles/contributors)! Además, gracias a Corey Haines, Gary Bernhardt, y otros por compartir sus dotfiles y otros scripts de shell que derivaron en la inspiración para los artículos en este proyecto. Licencia -------- dotfiles está protegida por copyright © 2009-2017 thoughtbot. Es un software gratis, y tal vez redistribuido bajo los términos especificados en el archivo de la [`LICENCIA`] [`LICENCIA`]: /LICENSE Acerca de thoughtbot -------------------- ![thoughtbot](http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg) dotfiles es mantenido y creado por thoughtbot, inc. Los nombres y los logos de thoughtbot son marca registrada de thoughtbot, inc. Amamos el código de fuente abiarta! Ve [nuestros otros proyectos][community]. Estamos [disponibles para ser contratados][hire]. [community]: https://thoughtbot.com/community?utm_source=github [hire]: https://thoughtbot.com/hire-us?utm_source=github ================================================ FILE: README.md ================================================ # thoughtbot dotfiles ![prompt](http://images.thoughtbot.com/thoughtbot-dotfiles-prompt.png) ## Requirements Set zsh as your login shell: chsh -s $(which zsh) ## Install Clone onto your laptop: git clone git@github.com:thoughtbot/dotfiles.git ~/dotfiles (Or, [fork and keep your fork updated](http://robots.thoughtbot.com/keeping-a-github-fork-updated)). Install [rcm](https://github.com/thoughtbot/rcm): brew install rcm Install the dotfiles: env RCRC=$HOME/dotfiles/rcrc rcup After the initial installation, you can run `rcup` without the one-time variable `RCRC` being set (`rcup` will symlink the repo's `rcrc` to `~/.rcrc` for future runs of `rcup`). [See example](https://github.com/thoughtbot/dotfiles/blob/master/rcrc). This command will create symlinks for config files in your home directory. Setting the `RCRC` environment variable tells `rcup` to use standard configuration options: - Exclude the `README.md`, `README-ES.md` and `LICENSE` files, which are part of the `dotfiles` repository but do not need to be symlinked in. - Give precedence to personal overrides which by default are placed in `~/dotfiles-local` - Please configure the `rcrc` file if you'd like to make personal overrides in a different directory ## Update From time to time you should pull down any updates to these dotfiles, and run rcup to link any new files and install new vim plugins. **Note** You _must_ run `rcup` after pulling to ensure that all files in plugins are properly installed, but you can safely run `rcup` multiple times so update early and update often! ## Make your own customizations Create a directory for your personal customizations: mkdir ~/dotfiles-local Put your customizations in `~/dotfiles-local` appended with `.local`: - `~/dotfiles-local/aliases.local` - `~/dotfiles-local/git_template.local/*` - `~/dotfiles-local/gitconfig.local` - `~/dotfiles-local/psqlrc.local` (we supply a blank `.psqlrc.local` to prevent `psql` from throwing an error, but you should overwrite the file with your own copy) - `~/dotfiles-local/tmux.conf.local` - `~/dotfiles-local/vimrc.local` - `~/dotfiles-local/vimrc.bundles.local` - `~/dotfiles-local/zshrc.local` - `~/dotfiles-local/zsh/configs/*` For example, your `~/dotfiles-local/aliases.local` might look like this: # Productivity alias todo='$EDITOR ~/.todo' Your `~/dotfiles-local/gitconfig.local` might look like this: [alias] l = log --pretty=colored [pretty] colored = format:%Cred%h%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset [user] name = Dan Croak email = dan@thoughtbot.com Your `~/dotfiles-local/vimrc.local` might look like this: " Color scheme colorscheme github highlight NonText guibg=#060606 highlight Folded guibg=#0A0A0A guifg=#9090D0 If you don't wish to install a vim plugin from the default set of vim plugins in `.vimrc.bundles`, you can ignore the plugin by calling it out with `UnPlug` in your `~/.vimrc.bundles.local`. " Don't install vim-scripts/tComment (notice the username of the plugin is removed) UnPlug 'tComment' `UnPlug` can be used to install your own fork of a plugin or to install a shared plugin with different custom options. " Only load vim-coffee-script if a Coffeescript buffer is created UnPlug 'vim-coffee-script' Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' } " Use a personal fork of vim-run-interactive UnPlug 'vim-run-interactive' Plug '$HOME/plugins/vim-run-interactive' To extend your `git` hooks, create executable scripts in `~/dotfiles-local/git_template.local/hooks/*` files. Your `~/dotfiles-local/zshrc.local` might look like this: # load pyenv if available if which pyenv &>/dev/null ; then eval "$(pyenv init -)" fi Your `~/dotfiles-local/vimrc.bundles.local` might look like this: Plug 'Lokaltog/vim-powerline' Plug 'stephenmckinney/vim-solarized-powerline' ## zsh Configurations Additional zsh configuration can go under the `~/dotfiles-local/zsh/configs` directory. This has two special subdirectories: `pre` for files that must be loaded first, and `post` for files that must be loaded last. For example, `~/dotfiles-local/zsh/configs/pre/virtualenv` makes use of various shell features which may be affected by your settings, so load it first: # Load the virtualenv wrapper . /usr/local/bin/virtualenvwrapper.sh Setting a key binding can happen in `~/dotfiles-local/zsh/configs/keys`: # Grep anywhere with ^G bindkey -s '^G' ' | grep ' Some changes, like `chpwd`, must happen in `~/dotfiles-local/zsh/configs/post/chpwd`: # Show the entries in a directory whenever you cd in function chpwd { ls } This directory is handy for combining dotfiles from multiple teams; one team can add the `virtualenv` file, another `keys`, and a third `chpwd`. The `~/dotfiles-local/zshrc.local` is loaded after `~/dotfiles-local/zsh/configs`. ## zsh History Configurations The zsh history is configured with several useful options: - `hist_ignore_all_dups`: Removes duplicate commands from history - `hist_ignore_space`: Commands starting with a space are not saved to history (useful for sensitive commands) - `inc_append_history`: Adds commands to history as they're executed, not just when the shell exits - `share_history`: Shares history across multiple zsh sessions in real-time History size is set to 8,192 entries providing ample command history. ## vim Configurations Similarly to the zsh configuration directory as described above, vim automatically loads all files in the `~/dotfiles-local/vim/plugin` directory. This does not have the same `pre` or `post` subdirectory support that our `zshrc` has. This is an example `~/dotfiles-local/vim/plugin/c.vim`. It is loaded every time vim starts, regardless of the file name: # Indent C programs according to BSD style(9) set cinoptions=:0,t0,+4,(4 autocmd BufNewFile,BufRead *.[ch] setlocal sw=0 ts=8 noet ## What's in it? [vim](http://www.vim.org/) configuration: - [fzf](https://github.com/junegunn/fzf.vim) for fuzzy file/buffer/tag finding. - [Rails.vim](https://github.com/tpope/vim-rails) for enhanced navigation of Rails file structure via `gf` and `:A` (alternate), `:Rextract` partials, `:Rinvert` migrations, etc. - Run many kinds of tests [from vim]([https://github.com/janko-m/vim-test) - Set `` to a single space. - Switch between the last two files with space-space. - Syntax highlighting for Markdown, HTML, JavaScript, Ruby, Go, Elixir, more. - Use [Ag](https://github.com/ggreer/the_silver_searcher) instead of Grep when available. - Map `ct` to re-index ctags. - Use [vim-mkdir](https://github.com/pbrisbin/vim-mkdir) for automatically creating non-existing directories before writing the buffer. - Use [vim-plug](https://github.com/junegunn/vim-plug) to manage plugins. [tmux](http://robots.thoughtbot.com/a-tmux-crash-course) configuration: - Improve color resolution. - Remove administrative debris (session name, hostname, time) in status bar. - Set prefix to `Ctrl+s` - Soften status bar color from harsh green to light gray. [git](http://git-scm.com/) configuration: - Adds a `co-upstream-pr $PR_NUMBER $LOCAL_BRANCH_NAME` subcommand to checkout remote upstream branch into a local branch. - Adds a `create-branch` alias to create feature branches. - Adds a `delete-branch` alias to delete feature branches. - Adds a `merge-branch` alias to merge feature branches into master. - Adds an `up` alias to fetch and rebase `origin/master` into the feature branch. Use `git up -i` for interactive rebases. - Adds `post-{checkout,commit,merge}` hooks to re-index your ctags. - Adds `pre-commit` and `prepare-commit-msg` stubs that delegate to your local config. - Adds `trust-bin` alias to append a project's `bin/` directory to `$PATH`. [Ruby](https://www.ruby-lang.org/en/) configuration: - Add trusted binstubs to the `PATH`. - Load the ASDF version manager. [Rails](https://rubyonrails.org) - Adds [railsrc][] with the following options to integrate with [Suspenders][]. ``` --database=postgresql --skip-test -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb ``` If you want to skip this file altogether, run `rails new my_app --no_rc`. [railsrc]: https://github.com/rails/rails/blob/7f7f9df8641e35a076fe26bd097f6a1b22cb4e2d/railties/lib/rails/generators/rails/app/USAGE#L5C1-L7 [Suspenders]: https://github.com/thoughtbot/suspenders Shell aliases and scripts: - `...` for quicker navigation to the parent's parent directory. - `b` for `bundle`. - `g` with no arguments is `git status` and with arguments acts like `git`. - `migrate` for `bin/rails db:migrate db:rollback && bin/rails db:migrate db:test:prepare`. - `mcd` to make a directory and change into it. - `replace foo bar **/*.rb` to find and replace within a given list of files. - `tat` to attach to tmux session named the same as the current directory. - `v` for `$VISUAL`. ## Thanks Thank you, [contributors](https://github.com/thoughtbot/dotfiles/contributors)! Also, thank you to Corey Haines, Gary Bernhardt, and others for sharing your dotfiles and other shell scripts from which we derived inspiration for items in this project. ## License dotfiles is copyright © 2009 thoughtbot. It is free software, and may be redistributed under the terms specified in the [`LICENSE`] file. [`LICENSE`]: /LICENSE ## About thoughtbot ![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg) This repo is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc. We love open source software! See [our other projects][community]. We are [available for hire][hire]. [community]: https://thoughtbot.com/community?utm_source=github [hire]: https://thoughtbot.com/hire-us?utm_source=github ================================================ FILE: SECURITY.md ================================================ # Security Policy ## Supported Versions Only the the latest version of this project is supported at a given time. If you find a security issue with an older version, please try updating to the latest version first. If for some reason you can't update to the latest version, please let us know your reasons so that we can have a better understanding of your situation. ## Reporting a Vulnerability For security inquiries or vulnerability reports, visit . If you have any suggestions to improve this policy, visit . ================================================ FILE: agignore ================================================ /vendor ================================================ FILE: aliases ================================================ # Unix alias ll="ls -al" alias ln="ln -v" alias mkdir="mkdir -p" alias e="$EDITOR" alias v="$VISUAL" # Bundler alias b="bundle" # Rails alias migrate="bin/rails db:migrate db:rollback && bin/rails db:migrate db:test:prepare" alias s="rspec" # Pretty print the path alias path='echo -e ${PATH//:/\\n}' # Easier navigation: ..., ...., ....., and - alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias -- -="cd -" # Include custom aliases if [[ -f ~/.aliases.local ]]; then source ~/.aliases.local fi ================================================ FILE: asdfrc ================================================ legacy_version_file = yes ================================================ FILE: bin/bundler-search ================================================ #!/bin/sh # Search your bundle for the provided pattern # Requires bundler 1.8+ for execution as a bundler subcommand. # Examples: # bundle search Kernel.warn # bundle search current_user clearance # bundle search "Change your password" clearance # # Arguments: # 1. What to search for # 2. Which gem names to search (defaults to all gems) pattern="$1"; shift if command -v rg &>/dev/null; then rg "$pattern" $(bundle show --paths "$@") else ag "$pattern" $(bundle show --paths "$@") fi ================================================ FILE: bin/clear-port ================================================ #!/bin/sh # Kills the process running on the provided port # # clear-port 3000 if [ -n "$1" ]; then port_num="$(lsof -ti4TCP:"$1")" if [ $? -eq 0 ]; then kill "$port_num" fi else echo >&2 Usage: clear-port port-number exit 1 fi ================================================ FILE: bin/git-ca ================================================ #!/bin/sh git commit --amend -v --date="$(date +%Y-%m-%dT%H:%M:%S)" ================================================ FILE: bin/git-co-upstream-pr ================================================ #!/bin/sh set -e pull_request_number=$1 local_branch_name=$2 if [ -z "$pull_request_number" -o -z "$local_branch_name" ]; then echo "usage: git co-upstream-pr " exit 1 fi if git remote -v | grep -q upstream; then git fetch upstream "pull/$pull_request_number/head:$local_branch_name" git checkout "$local_branch_name" else cat </dev/null; then main_branch="$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@')" "$@" else echo "You don't have a primary branch reference set for your origin remote. Use: git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/{name_of_your_primary_branch} to set the reference and then try merging again." exit 1 fi git fetch origin line_count=$(git diff origin/$main_branch..$main_branch | wc -l) if [ $line_count -gt 0 ]; then printf "failed: $main_branch is not up to date with origin/$main_branch\n" exit 1 fi git checkout $main_branch git merge "@{-1}" ================================================ FILE: bin/git-rename-branch ================================================ #!/bin/sh set -e old=$(git current-branch) git branch -m "$old" "$1" git push origin --set-upstream "$1" git push origin --delete "$old" ================================================ FILE: bin/git-trust-bin ================================================ #!/bin/sh mkdir -p .git/safe ================================================ FILE: bin/git-up ================================================ #!/bin/sh set -e git fetch origin if git symbolic-ref --short refs/remotes/origin/HEAD >/dev/null; then git rebase "$(git symbolic-ref --short refs/remotes/origin/HEAD)" "$@" else echo "You don't have a primary branch reference set for your origin remote. Use: git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/{name_of_your_primary_branch} to set the reference and then try rebasing again." fi ================================================ FILE: bin/replace ================================================ #!/bin/sh # # Find and replace by a given list of files. # # replace foo bar **/*.rb find_this="$1" shift replace_with="$1" shift if command -v rg &>/dev/null ; then items=$(rg -l --color never "$find_this" "$@") else items=$(ag -l --nocolor "$find_this" "$@") fi temp="${TMPDIR:-/tmp}/replace_temp_file.$$" IFS=$'\n' for item in $items; do sed "s/$find_this/$replace_with/g" "$item" > "$temp" && mv "$temp" "$item" done ================================================ FILE: bin/tat ================================================ #!/bin/sh # # Attach or create tmux session named the same as current directory. path_name="$(basename "$PWD" | tr . -)" session_name=${1-$path_name} not_in_tmux() { [ -z "$TMUX" ] } session_exists() { tmux has-session -t "=$session_name" } create_detached_session() { (TMUX='' tmux new-session -Ad -s "$session_name") } create_if_needed_and_attach() { if not_in_tmux; then tmux new-session -As "$session_name" else if ! session_exists; then create_detached_session fi tmux switch-client -t "$session_name" fi } create_if_needed_and_attach ================================================ FILE: bin/whats-in-port ================================================ #!/bin/sh # List process running on provided port # # whats-in-port 3000 # # output: # COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME # ruby 25583 root 11u IPv4 0xee20607697a79bf7 0t0 TCP *:irdmi (LISTEN) if [ -n "$1" ]; then lsof -ni4TCP:"$1" else echo >&2 Usage: whats-in-port port-number exit 1 fi ================================================ FILE: ctags ================================================ --regex-ruby=/(^|[:;])[ \t]*([A-Z][[:alnum:]_]+) *=/\2/c,class,constant/ --regex-ruby=/^[ \t]*attr_(reader|writer|accessor) (:[a-z0-9_]+, )*:([a-z0-9_]+)/\3/A,attr/ --langdef=Elixir --langmap=Elixir:.ex.exs --regex-Elixir=/^[ \t]*def(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/f,functions,functions (def ...)/ --regex-Elixir=/^[ \t]*defcallback[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/c,callbacks,callbacks (defcallback ...)/ --regex-Elixir=/^[ \t]*defdelegate[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/d,delegates,delegates (defdelegate ...)/ --regex-Elixir=/^[ \t]*defexception[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/e,exceptions,exceptions (defexception ...)/ --regex-Elixir=/^[ \t]*defimpl[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/i,implementations,implementations (defimpl ...)/ --regex-Elixir=/^[ \t]*defmacro(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)\(/\2/a,macros,macros (defmacro ...)/ --regex-Elixir=/^[ \t]*defmacro(p?)[ \t]+([a-zA-Z0-9_?!]+)?[ \t]+([^ \tA-Za-z0-9_]+)[ \t]*[a-zA-Z0-9_!?!]/\3/o,operators,operators (e.g. "defmacro a <<< b")/ --regex-Elixir=/^[ \t]*defmodule[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/m,modules,modules (defmodule ...)/ --regex-Elixir=/^[ \t]*defprotocol[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/p,protocols,protocols (defprotocol...)/ --regex-Elixir=/^[ \t]*Record\.defrecord[ \t]+:([a-zA-Z0-9_]+)/\1/r,records,records (defrecord...)/ --regex-Elixir=/^[ \t]*test[ \t]+\"([a-z_][a-zA-Z0-9_?! ]*)\"*/\1/t,tests,tests (test ...)/ --exclude=bower_components --exclude=node_modules --exclude=vendor --languages=-javascript --langdef=js --langmap=js:.js --langmap=js:+.jsx --regex-js=/[ \t.]([A-Z][A-Z0-9._$]+)[ \t]*[=:][ \t]*([0-9"'\[\{]|null)/\1/n,constant/ ================================================ FILE: ctags.d/config.ctags ================================================ --regex-ruby=/(^|[:;])[ \t]*([A-Z][[:alnum:]_]+) *=/\2/c,class,constant/ --exclude=bower_components --exclude=node_modules --exclude=vendor --languages=-javascript --langdef=js --langmap=js:.js --langmap=js:+.jsx --regex-js=/[ \t.]([A-Z][A-Z0-9._$]+)[ \t]*[=:][ \t]*([0-9"'\[\{]|null)/\1/n,constant/ ================================================ FILE: gemrc ================================================ gem: --no-document ================================================ FILE: git_template/hooks/commit-msg ================================================ #!/bin/sh local_hook="$HOME"/.git_template.local/hooks/commit-msg if [ -f "$local_hook" ]; then . "$local_hook" fi ================================================ FILE: git_template/hooks/ctags ================================================ #!/bin/sh set -e PATH="/usr/local/bin:$PATH" dir="$(git rev-parse --git-dir)" trap 'rm -f "$dir/$$.tags"' EXIT git ls-files | \ "${CTAGS:-ctags}" --tag-relative=yes -L - -f"$dir/$$.tags" --languages=-javascript,sql mv "$dir/$$.tags" "$dir/tags" ================================================ FILE: git_template/hooks/post-checkout ================================================ #!/bin/sh local_hook="$HOME"/.git_template.local/hooks/post-checkout if [ -f "$local_hook" ]; then . "$local_hook"; fi .git/hooks/ctags >/dev/null 2>&1 & ================================================ FILE: git_template/hooks/post-commit ================================================ #!/bin/sh local_hook="$HOME"/.git_template.local/hooks/post-commit if [ -f "$local_hook" ]; then . "$local_hook"; fi .git/hooks/ctags >/dev/null 2>&1 & ================================================ FILE: git_template/hooks/post-merge ================================================ #!/bin/sh local_hook="$HOME"/.git_template.local/hooks/post-merge if [ -f "$local_hook" ]; then . "$local_hook"; fi .git/hooks/ctags >/dev/null 2>&1 & ================================================ FILE: git_template/hooks/post-rewrite ================================================ #!/bin/sh case "$1" in rebase) exec .git/hooks/post-merge ;; esac ================================================ FILE: git_template/hooks/pre-commit ================================================ #!/bin/sh local_hook="$HOME"/.git_template.local/hooks/pre-commit if [ -f "$local_hook" ]; then . "$local_hook" fi ================================================ FILE: git_template/hooks/pre-push ================================================ #!/bin/sh local_hook="$HOME"/.git_template.local/hooks/pre-push if [ -f "$local_hook" ]; then . "$local_hook" fi ================================================ FILE: git_template/hooks/prepare-commit-msg ================================================ #!/bin/sh local_hook="$HOME"/.git_template.local/hooks/prepare-commit-msg if [ -f "$local_hook" ]; then . "$local_hook" fi ================================================ FILE: git_template/info/exclude ================================================ # git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): # *.[oa] # *~ ================================================ FILE: gitconfig ================================================ [init] defaultBranch = main templatedir = ~/.git_template [push] default = current [color] ui = auto [alias] aa = add --all ap = add --patch branches = for-each-ref --sort=-committerdate --format=\"%(color:blue)%(authordate:relative)\t%(color:red)%(authorname)\t%(color:white)%(color:bold)%(refname:short)\" refs/remotes ci = commit -v co = checkout pf = push --force-with-lease st = status [core] excludesfile = ~/.gitignore autocrlf = input [merge] ff = only [commit] template = ~/.gitmessage [fetch] prune = true [rebase] autosquash = true [include] path = ~/.gitconfig.local [diff] colorMoved = zebra ================================================ FILE: gitignore ================================================ *.pyc *.sw[nop] .DS_Store .bundle .byebug_history .env .git/ /bower_components/ /log /node_modules/ /tmp db/*.sqlite3 log/*.log rerun.txt tmp/**/* /tags ================================================ FILE: gitmessage ================================================ # 50-character subject line # # 72-character wrapped longer description. This should answer: # # * Why was this change necessary? # * How does it address the problem? # * Are there any side effects? # # Include a link to the ticket, if any. # # Add co-authors if you worked on this code with others: # # Co-authored-by: Full Name # Co-authored-by: Full Name ================================================ FILE: hooks/post-up ================================================ #!/bin/sh touch "$HOME"/.psqlrc.local if [ -e "$HOME"/.vim/autoload/plug.vim ]; then vim -E -s +PlugUpgrade +qa else curl -fLo "$HOME"/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim fi vim -u "$HOME"/.vimrc.bundles +PlugUpdate +PlugClean! +qa reset -Q if [ -f "$HOME/.git_template/HEAD" ] && \ [ "$(cat "$HOME/.git_template/HEAD")" = "ref: refs/heads/main" ]; then echo "Removing ~/.git_template/HEAD in favor of defaultBranch" >&2 rm -f ~/.git_template/HEAD fi # detect old OS X broken /etc/zshenv and suggest rename if grep -qw path_helper /etc/zshenv 2>/dev/null; then dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) cat <&2 Warning: \`/etc/zshenv' configuration file on your system may cause unexpected PATH changes on subsequent invocations of the zsh shell. The solution is to rename the file to \`zprofile': sudo mv /etc/{zshenv,zprofile} (called from ${dir}/post-up:${LINENO}) MSG fi ================================================ FILE: hushlogin ================================================ ================================================ FILE: psqlrc ================================================ -- Official docs: http://www.postgresql.org/docs/9.3/static/app-psql.html -- Unofficial docs: http://robots.thoughtbot.com/improving-the-command-line-postgres-experience -- Don't display the "helpful" message on startup. \set QUIET 1 \pset null '[NULL]' -- http://www.postgresql.org/docs/9.3/static/app-psql.html#APP-PSQL-PROMPTING \set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# ' -- PROMPT2 is printed when the prompt expects more input, like when you type -- SELECT * FROM. %R shows what type of input it expects. \set PROMPT2 '[more] %R > ' -- Show how long each query takes to execute \timing -- Use best available output format \x auto \set VERBOSITY verbose \set HISTFILE ~/.psql_history- :DBNAME \set HISTCONTROL ignoredups \set COMP_KEYWORD_CASE upper \unset QUIET -- psql can't check for a file's existence, so we'll provide an empty local -- file that users can override with their custom dotfiles. To set your own -- personal settings, place your own file in ~/.psqlrc.local \i ~/.psqlrc.local ================================================ FILE: railsrc ================================================ --database=postgresql --skip-test --skip-rubocop ================================================ FILE: rcrc ================================================ EXCLUDES="*.md LICENSE CODEOWNERS" DOTFILES_DIRS="$HOME/dotfiles-local $HOME/dotfiles" COPY_ALWAYS="git_template/HEAD" ================================================ FILE: rspec ================================================ --colour --order random ================================================ FILE: tmux.conf ================================================ # improve colors set -g default-terminal 'screen-256color' # act like vim setw -g mode-keys vi bind-key h select-pane -L bind-key j select-pane -D bind-key k select-pane -U bind-key l select-pane -R bind-key -r C-h select-window -t :- bind-key -r C-l select-window -t :+ set -g prefix2 C-s # start window numbers at 1 to match keyboard order with tmux window order set -g base-index 1 set-window-option -g pane-base-index 1 # renumber windows sequentially after closing any of them set -g renumber-windows on # soften status bar color from harsh green to light gray set -g status-style bg='#666666',fg='#aaaaaa' # remove administrative debris (session name, hostname, time) in status bar set -g status-left '' set -g status-right '' # increase scrollback lines set -g history-limit 10000 # prefix -> back-one-character bind-key C-b send-prefix # prefix-2 -> forward-incremental-history-search bind-key C-s send-prefix -2 # don't suspend-client unbind-key C-z # Local config if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local' ================================================ FILE: vim/ftplugin/css.vim ================================================ setlocal iskeyword+=- ================================================ FILE: vim/ftplugin/gitcommit.vim ================================================ " Automatically wrap at 72 characters and spell check commit messages autocmd BufNewFile,BufRead PULLREQ_EDITMSG set syntax=gitcommit setlocal textwidth=72 setlocal spell ================================================ FILE: vim/ftplugin/go.vim ================================================ let g:go_fmt_command = "goimports" setlocal listchars=tab:\ \ ,trail:·,nbsp:· setlocal noexpandtab compiler go ================================================ FILE: vim/ftplugin/markdown.vim ================================================ " Enable spellchecking setlocal spell " Automatically wrap at 80 characters setlocal textwidth=80 ================================================ FILE: vim/ftplugin/sass.vim ================================================ setlocal iskeyword+=- ================================================ FILE: vim/ftplugin/scss.vim ================================================ setlocal iskeyword+=- ================================================ FILE: vim/plugin/ctags.vim ================================================ " Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'" " Index ctags from any project, including those outside Rails function! ReindexCtags() let l:ctags_hook_file = "$(git rev-parse --show-toplevel)/.git/hooks/ctags" let l:ctags_hook_path = system("echo " . l:ctags_hook_file) let l:ctags_hook_path = substitute(l:ctags_hook_path, '\n\+$', '', '') if filereadable(expand(l:ctags_hook_path)) exec '!'. l:ctags_hook_file else exec "!ctags -R ." endif endfunction " to stop this mapping from being added, put this in $MYVIMRC: " let g:thoughtbot_ctags_mappings_enabled = 0 let g:thoughtbot_ctags_mappings_enabled = get(g:, 'thoughtbot_ctags_mappings_enabled', 1) if g:thoughtbot_ctags_mappings_enabled != 0 nmap ct :call ReindexCtags() endif ================================================ FILE: vimrc ================================================ set encoding=utf-8 " Leader let mapleader = " " set backspace=2 " Backspace deletes like most programs in insert mode set nobackup set nowritebackup set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287 set history=50 set ruler " show the cursor position all the time set showcmd " display incomplete commands set termguicolors " make our colors pretty set incsearch " do incremental searching set laststatus=2 " Always display the status line set autowrite " Automatically :write before running commands set modelines=0 " Disable modelines as a security precaution set nomodeline " 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")) && !exists("syntax_on") syntax on endif if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles endif " Load matchit.vim, but only if the user hasn't installed a newer version. if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# '' runtime! macros/matchit.vim endif filetype plugin indent on augroup vimrcEx autocmd! " When editing a file, always jump to the last known cursor position. " Don't do it for commit messages, when the position is invalid, or when " inside an event handler (happens when dropping a file on gvim). autocmd BufReadPost * \ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif " Set syntax highlighting for specific file types autocmd BufRead,BufNewFile *.md set filetype=markdown autocmd BufRead,BufNewFile .{jscs,jshint,eslint}rc set filetype=json autocmd BufRead,BufNewFile \ aliases.local, \zshenv.local,zlogin.local,zlogout.local,zshrc.local,zprofile.local, \*/zsh/configs/* \ set filetype=sh autocmd BufRead,BufNewFile gitconfig.local set filetype=gitconfig autocmd BufRead,BufNewFile tmux.conf.local set filetype=tmux autocmd BufRead,BufNewFile vimrc.local set filetype=vim augroup END " ALE linting events augroup ale autocmd! if g:has_async autocmd VimEnter * \ set updatetime=1000 | \ let g:ale_lint_on_text_changed = 0 autocmd CursorHold * call ale#Queue(0) autocmd CursorHoldI * call ale#Queue(0) autocmd InsertEnter * call ale#Queue(0) autocmd InsertLeave * call ale#Queue(0) else echoerr "The thoughtbot dotfiles require NeoVim or Vim 8" endif augroup END " When the type of shell script is /bin/sh, assume a POSIX-compatible " shell for syntax highlighting purposes. let g:is_posix = 1 " Softtabs, 2 spaces set tabstop=2 set shiftwidth=2 set shiftround set expandtab " Display extra whitespace set list listchars=tab:»·,trail:·,nbsp:· " Use one space, not two, after punctuation. set nojoinspaces " Use ripgrep https://github.com/BurntSushi/ripgrep if executable('rg') " Use Rg over Grep set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case " Use rg in fzf for listing files. Lightning fast and respects .gitignore let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"' nnoremap \ :Rg " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher elseif executable('ag') " Use Ag over Grep set grepprg=ag\ --nogroup\ --nocolor " Use ag in fzf for listing files. Lightning fast and respects .gitignore let $FZF_DEFAULT_COMMAND = 'ag --literal --files-with-matches --nocolor --hidden -g ""' nnoremap \ :Ag endif " Make it obvious where 80 characters is set textwidth=80 set colorcolumn=+1 " Numbers set number set numberwidth=5 " Tab completion " will insert tab at beginning of line, " will use completion if not at beginning set wildmode=list:longest,list:full function! InsertTabWrapper() let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" else return "\" endif endfunction inoremap =InsertTabWrapper() inoremap " Switch between the last two files nnoremap " vim-test mappings nnoremap t :TestFile nnoremap s :TestNearest nnoremap l :TestLast nnoremap a :TestSuite nnoremap gt :TestVisit " Run commands that require an interactive shell nnoremap r :RunInInteractiveShell " Treat
  • and

    tags like the block tags they are let g:html_indent_tags = 'li\|p' " Set tags for vim-fugitive set tags^=.git/tags " Open new split panes to right and bottom, which feels more natural set splitbelow set splitright " Quicker window movement nnoremap j nnoremap k nnoremap h nnoremap l " Move between linting errors nnoremap ]r :ALENextWrap nnoremap [r :ALEPreviousWrap " Map Ctrl + p to open fuzzy find (FZF) nnoremap :Files " Set spellfile to location that is guaranteed to exist, can be symlinked to " Dropbox or kept in Git and managed outside of thoughtbot/dotfiles using rcm. set spellfile=$HOME/.vim-spell-en.utf-8.add " Autocomplete with dictionary words when spell check is on set complete+=kspell " Always use vertical diffs set diffopt+=vertical " Use Catpuccin Latte as our default color scheme colorscheme catppuccin_latte " Local config if filereadable($HOME . "/.vimrc.local") source ~/.vimrc.local endif ================================================ FILE: vimrc.bundles ================================================ if &compatible set nocompatible end " Remove declared plugins function! s:UnPlug(plug_name) if has_key(g:plugs, a:plug_name) call remove(g:plugs, a:plug_name) endif endfunction command! -nargs=1 UnPlug call s:UnPlug() let g:has_async = v:version >= 800 || has('nvim') call plug#begin('~/.vim/bundle') " Define bundles via Github repos Plug 'christoomey/vim-run-interactive' " If fzf has already been installed via Homebrew, use the existing fzf " Otherwise, install fzf. The `--all` flag makes fzf accessible outside of vim if executable("brew") let g:brew_fzf_path = trim(system("brew --prefix fzf")) endif if exists("g:brew_fzf_path") && isdirectory(g:brew_fzf_path) Plug g:brew_fzf_path else Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } endif Plug 'catppuccin/vim', { 'as': 'catppuccin' } Plug 'junegunn/fzf.vim' Plug 'elixir-lang/vim-elixir' Plug 'fatih/vim-go' Plug 'janko-m/vim-test' Plug 'pangloss/vim-javascript' Plug 'pbrisbin/vim-mkdir' Plug 'slim-template/vim-slim' Plug 'tpope/vim-bundler' Plug 'tpope/vim-endwise' Plug 'tpope/vim-eunuch' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-projectionist' Plug 'tpope/vim-rails' Plug 'tpope/vim-rake' Plug 'tpope/vim-repeat' Plug 'tpope/vim-rhubarb' Plug 'tpope/vim-surround' Plug 'vim-ruby/vim-ruby' Plug 'vim-scripts/tComment' if g:has_async Plug 'dense-analysis/ale' endif if filereadable(expand("~/.vimrc.bundles.local")) source ~/.vimrc.bundles.local endif call plug#end() ================================================ FILE: zprofile ================================================ if [ -d "/opt/homebrew" ]; then eval "$(/opt/homebrew/bin/brew shellenv)" elif [ -d "~/.linuxbrew" ]; then eval "$(~/.linuxbrew/bin/brew shellenv)" elif [ -d "/home/linuxbrew" ]; then eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" fi ================================================ FILE: zsh/completion/_ag ================================================ #compdef ag if (( CURRENT == 2 )); then compadd $(cut -f 1 tmp/tags .git/tags 2>/dev/null) else; _files fi ================================================ FILE: zsh/completion/_bundler ================================================ #compdef bundle local curcontext="$curcontext" state line _gems _opts ret=1 _arguments -C -A "-v" -A "--version" \ '(- 1 *)'{-v,--version}'[display version information]' \ '1: :->cmds' \ '*:: :->args' && ret=0 case $state in cmds) _values "bundle command" \ "install[Install the gems specified by the Gemfile or Gemfile.lock]" \ "update[Update dependencies to their latest versions]" \ "package[Package the .gem files required by your application]" \ "exec[Execute a script in the context of the current bundle]" \ "config[Specify and read configuration options for bundler]" \ "check[Determine whether the requirements for your application are installed]" \ "list[Show all of the gems in the current bundle]" \ "show[Show the source location of a particular gem in the bundle]" \ "console[Start an IRB session in the context of the current bundle]" \ "open[Open an installed gem in the editor]" \ "lock[Generate a lockfile for your dependencies]" \ "viz[Generate a visual representation of your dependencies]" \ "init[Generate a simple Gemfile, placed in the current directory]" \ "gem[Create a simple gem, suitable for development with bundler]" \ "help[Describe available tasks or one specific task]" \ "platform[Displays platform compatibility information]" \ "outdated[Show all of the outdated gems in the current bundle]" \ "clean[Cleans up unused gems in your bundler directory]" ret=0 ;; args) case $line[1] in help) _values 'commands' 'install' 'update' 'package' 'exec' 'config' 'check' 'list' 'show' 'console' 'open' 'lock' 'viz' 'init' 'gem' 'help' 'platform' 'outdated' 'clean' && ret=0 ;; install) _arguments \ '(--no-color)--no-color[disable colorization in output]' \ '(--local)--local[do not attempt to connect to rubygems.org]' \ '(--quiet)--quiet[only output warnings and errors]' \ '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \ '(--system)--system[install to the system location]' \ '(--deployment)--deployment[install using defaults tuned for deployment environments]' \ '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \ '(--path)--path=-[specify a different path than the system default]:path:_files' \ '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \ '(--without)--without=-[exclude gems that are part of the specified named group]:groups' ret=0 ;; exec) _normal && ret=0 ;; (open|show) _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') ) if [[ $_gems != "" ]]; then _values 'gems' $_gems && ret=0 fi ;; *) _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) if [[ $_opts != "" ]]; then _values 'options' $_opts && ret=0 fi ;; esac ;; esac return ret ================================================ FILE: zsh/completion/_g ================================================ #compdef g compdef g=git ================================================ FILE: zsh/completion/_production ================================================ #compdef production compdef production=heroku ================================================ FILE: zsh/completion/_rspec ================================================ #compdef rspec compadd -P spec/ $(ls spec/**/*_spec.rb | sed -E "s/spec\///g") ================================================ FILE: zsh/completion/_staging ================================================ #compdef staging compdef staging=heroku ================================================ FILE: zsh/configs/color.zsh ================================================ # makes color constants available autoload -U colors colors # enable colored output from ls, etc. on FreeBSD-based systems export CLICOLOR=1 ================================================ FILE: zsh/configs/editor.zsh ================================================ export VISUAL=vim export EDITOR=$VISUAL ================================================ FILE: zsh/configs/fzf.zsh ================================================ #!/usr/bin/env zsh if command -v fzf > /dev/null; then source <(fzf --zsh) elif [[ -x ~/.fzf/bin/fzf ]]; then source <(~/.fzf/bin/fzf --zsh) fi ================================================ FILE: zsh/configs/history.zsh ================================================ #!/usr/bin/env zsh setopt hist_ignore_all_dups hist_ignore_space inc_append_history share_history HISTFILE=~/.zhistory HISTSIZE=32768 SAVEHIST="${HISTSIZE}" export ERL_AFLAGS="-kernel shell_history enabled" ================================================ FILE: zsh/configs/homebrew.zsh ================================================ # To opt in to Homebrew analytics, `unset` this in ~/.zshrc.local . # Learn more about what you are opting in to at # https://docs.brew.sh/Analytics export HOMEBREW_NO_ANALYTICS=1 ================================================ FILE: zsh/configs/keybindings.zsh ================================================ # give us access to ^Q stty -ixon # vi mode bindkey -v bindkey "^F" vi-cmd-mode # handy keybindings bindkey "^A" beginning-of-line bindkey "^E" end-of-line bindkey "^K" kill-line bindkey "^P" history-search-backward bindkey "^Y" accept-and-hold bindkey "^N" insert-last-word bindkey "^Q" push-line-or-edit bindkey -s "^T" "^[Isudo ^[A" # "t" for "toughguy" ================================================ FILE: zsh/configs/options.zsh ================================================ # awesome cd movements from zshkit setopt autocd autopushd pushdminus pushdsilent pushdtohome cdablevars DIRSTACKSIZE=5 # Enable extended globbing setopt extendedglob # Allow [ or ] whereever you want unsetopt nomatch ================================================ FILE: zsh/configs/post/completion.zsh ================================================ # load our own completion functions fpath=(~/.zsh/completion /usr/local/share/zsh/site-functions $fpath) # completion; use cache if updated within 24h autoload -Uz compinit if [[ -n $HOME/.zcompdump(#qN.mh+24) ]]; then compinit -d $HOME/.zcompdump; else compinit -C; fi; # disable zsh bundled function mtools command mcd # which causes a conflict. compdef -d mcd ================================================ FILE: zsh/configs/post/path.zsh ================================================ # ensure dotfiles bin directory is loaded first PATH="$HOME/.bin:/usr/local/sbin:$PATH" # Try loading ASDF from the regular home dir location if [ -f "$HOME/.asdf/asdf.sh" ]; then . "$HOME/.asdf/asdf.sh" elif which brew >/dev/null && [ -f "$(brew --prefix asdf)/libexec/asdf.sh" ]; then . "$(brew --prefix asdf)/libexec/asdf.sh" fi # mkdir .git/safe in the root of repositories you trust PATH=".git/safe/../../bin:$PATH" export -U PATH ================================================ FILE: zsh/configs/prompt.zsh ================================================ # modify the prompt to contain git branch name if applicable git_prompt_info() { current_branch=$(git current-branch 2> /dev/null) if [[ -n $current_branch ]]; then echo " %{$fg_bold[green]%}$current_branch%{$reset_color%}" fi } setopt promptsubst # Allow exported PS1 variable to override default prompt. if ! env | grep -q '^PS1='; then PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%c%{$reset_color%}$(git_prompt_info) %# ' fi ================================================ FILE: zsh/functions/_git_delete_branch ================================================ _git_delete_branch () { __gitcomp "$(__git_heads)" } ================================================ FILE: zsh/functions/change-extension ================================================ # Change file extensions recursively in current directory # # change-extension erb haml function change-extension() { foreach f (**/*.$1) mv $f $f:r.$2 end } ================================================ FILE: zsh/functions/envup ================================================ # Load .env file into shell session for environment variables function envup() { if [ -f .env ]; then export $(sed '/^ *#/ d' .env) else echo 'No .env file found' 1>&2 return 1 fi } ================================================ FILE: zsh/functions/g ================================================ # No arguments: `git status` # With arguments: acts like `git` g() { if [[ $# -gt 0 ]]; then git "$@" else git status fi } ================================================ FILE: zsh/functions/mcd ================================================ # Make directory and change into it. function mcd() { mkdir -p "$1" && cd "$1"; } ================================================ FILE: zshenv ================================================ local _old_path="$PATH" # Local config [[ -f ~/.zshenv.local ]] && source ~/.zshenv.local if [[ $PATH != $_old_path ]]; then # `colors` isn't initialized yet, so define a few manually typeset -AHg fg fg_bold if [ -t 2 ]; then fg[red]=$'\e[31m' fg_bold[white]=$'\e[1;37m' reset_color=$'\e[m' else fg[red]="" fg_bold[white]="" reset_color="" fi cat <&2 ${fg[red]}Warning:${reset_color} your \`~/.zshenv.local' configuration seems to edit PATH entries. Please move that configuration to \`.zshrc.local' like so: ${fg_bold[white]}cat ~/.zshenv.local >> ~/.zshrc.local && rm ~/.zshenv.local${reset_color} (called from ${(%):-%N:%i}) MSG fi unset _old_path ================================================ FILE: zshrc ================================================ # load custom executable functions for function in ~/.zsh/functions/*; do source $function done # extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post # these are loaded first, second, and third, respectively. _load_settings() { _dir="$1" if [ -d "$_dir" ]; then if [ -d "$_dir/pre" ]; then for config in "$_dir"/pre/**/*~*.zwc(N-.); do . $config done fi for config in "$_dir"/**/*(N-.); do case "$config" in "$_dir"/(pre|post)/*|*.zwc) : ;; *) . $config ;; esac done if [ -d "$_dir/post" ]; then for config in "$_dir"/post/**/*~*.zwc(N-.); do . $config done fi fi } _load_settings "$HOME/.zsh/configs" eval "$(/opt/homebrew/bin/brew shellenv)" export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH" # Local config [[ -f ~/.zshrc.local ]] && source ~/.zshrc.local # aliases [[ -f ~/.aliases ]] && source ~/.aliases