Skip to content

or-equals/dotfiles

Repository files navigation

Or Equals Development Environment

NeoVim with Tmux is our default development environment. This configuration is optimized for Elixir, Ruby, and JavaScript development.


Installations

The following tools are required to set up the development environment:

  • 1Password - Password management tool.
  • Dash - Quickly access documentation for various languages and frameworks.
  • Postgres App - Easy PostgreSQL database management for macOS.
  • iTerm - Enhanced terminal emulator for a better command-line experience.

Setup

Follow these steps to configure your development environment:

  1. Install the tools listed in the Installations section above.

  2. Clone this repository and run the setup script:

    git clone https://github.com/or-equals/dotfiles.git
    cd dotfiles
    ./setup.sh

    The setup script will:

    • Install necessary tools (e.g., NeoVim, Tmux, asdf, plugins).
    • Symlink configuration files to your home directory.
    • Set up the environment for development.
  3. Create a localized Git configuration:

    Create a file at ~/.gitconfig.local with the following content:

    [github]
      user = YourGitHubUsername
    [user]
      email = your@email.com
      name = FirstName LastName

    You can add additional Git configurations to this file as needed.

  4. Install Vim plugins:

    Open NeoVim by typing nvim in your terminal, then run the following command to install plugins defined in .vimrc:

    :PlugInstall
    
  5. Update remote NeoVim plugins:

    Ensure all remote plugins are installed by running the following command in NeoVim:

    :UpdateRemotePlugins
    

Features

This configuration provides a rich set of features to enhance your development workflow. Below is a summary of the key features, with links to configuration files for more details:

Below is an overview of many of the aliases, custom functions, and helpful features that come from these dotfiles. Think of this as a quick reference for the “goodies” provided, grouped by context.


Shell & Zsh

Aliases

Rails & Ruby
  • ss – Runs the Rails server (bundle exec rails server).
  • sc – Rails console (bundle exec rails console).
  • be – Shortcut for bundle exec.
  • fr – Shortcut for forego run.
  • rdb – Drops, creates, migrates, and seeds the database (bin/rails db:drop db:create db:migrate && bin/rails db:seed).
  • zdb – Same as rdb but also runs after_party:run if your app uses that.
  • groutes your_route – Searches for a route by name within rails routes | grep.
  • twiki – Calls db:migrate, followed by db:migrate:redo and db:test:prepare in Rails (handy for quick DB resets).
Phoenix & Elixir
  • im – Starts an IEx session with mix (iex -S mix).
  • pss – Starts the Phoenix server (mix phx.server).
  • ho – Lists outdated dependencies for your Elixir project (mix hex.outdated).
  • proutes your_route – Searches for a route by name (mix phx.routes | grep).
Filesystem / Navigation
  • .. / cd.. – Go up a directory.
  • lls -F -G -lah (detailed list with colors).
  • lals -a (show hidden files).
  • llls -l (long list).
  • mdmkdir -p (create intermediate directories automatically).
  • cdep – Remove Elixir + Node build artifacts (rm -rf deps _build assets/node_modules).
  • rdep – Clears deps, _build, assets/node_modules, then runs mix deps.get, and re-installs Node dependencies.
Git
  • gapgit add -p (interactive add).
  • gbgit branch.
  • gcgit commit -v.
  • gcogit checkout.
  • gdgit diff.
  • gdcgit diff --cached.
  • gdhgit diff HEAD.
  • glgit pull.
  • gpgit push.
  • gprgit pull --rebase.
  • grgit rebase.
  • gragit rebase --abort.
  • grcgit rebase --continue.
  • gstgit status.
  • gnap – A helper that adds all changes in “intent to add” mode, does partial interactive add, and then a gref (not in the snippet, but presumably a custom reference to commit or stash).
  • glg – Graphical log (git log --graph --oneline --decorate --color --all).
  • prunemerged – Removes branches that have been merged into your current branch.

(Additional aliases for “duet” merges and commits, if your team uses git duet, are also present.)

Docker
  • dcudocker-compose up.
  • dcuddocker-compose up -d (detached).
  • dcddocker-compose down.
  • dcsdocker-compose stop.
  • dcpdocker-compose ps.
  • dcldocker-compose logs -f.
  • dcrdocker-compose run.
  • dcedocker-compose exec.
Zsh Other Goodies
  • rl – Reloads Zsh and Vim config by sourcing ~/.zshrc and ~/.vimrc.
  • cat – Actually calls bat, for a colorized cat replacement.
  • cd.. – Same as .., moves up one directory.
  • fdfd installed as an alternative to find.
  • The environment sets a few paths for asdf, yarn, cargo (Rust), etc.

And much more—just check out the .zshrc for details!


Vim/Neovim

Key Plugin Highlights

  • fzf.vim – Fuzzy finder integration.

    • :Files – Opens an fzf-based file finder.
    • :Rg / :Rgg – Searches with ripgrep, displayed in an fzf preview window.
    • :Find – Searches for the word under cursor in the project using ripgrep.
  • vim-plug – Plugin manager. Install by running :PlugInstall from within Neovim.

  • tpope/vim-rails, vim-bundler, vim-rake** – Powerful Ruby & Rails enhancements.

  • vim-elixir – Elixir syntax & indentation.

  • slim-template/vim-slim – Syntax highlight for Slim templates.

  • maxbrunsfeld/vim-yankstack – Keeps a stack of past yanks, so you can cycle them.

    • Use ⌥+P (option+P) or shift+option+P to cycle.
  • Tagbar – Provides an outline view of source code.

    • Press <End> to toggle the tagbar.
  • rainbow_csv – Nice CSV highlighting.

  • vim-rubocop – RuboCop integration for Ruby code.

Key Mappings / Features

  • Leader key is mapped to Space in many places.

  • <leader>t= – Align on =.

  • <leader>w – Writes the file (:w).

  • <leader>q – Quits and closes everything (:wqa).

  • <leader>u – Toggles Gundo (undo tree visual).

  • // – Clears search highlights.

  • gsv – Reloads .vimrc on the fly (:so ~/.vimrc).

  • gev – Edits the .vimrc in a new buffer (:e ~/.vimrc).

  • <Tab> / <S-Tab> – Indentation-based shifts in normal/visual modes.

  • Y – Now copies from cursor to the end of line (like C or D).

  • FZF:

    • <leader>p:Files (fuzzy file search).
    • RG something – search entire project for "something."
  • Pressing CR in normal mode – Toggles highlight search off (:noh).

  • Auto-close pairs for do/end vs. curly braces, etc. (via vim-endwise).

And many more convenience or alignment commands (see .vimrc comments for specific details).


Tmux

  • Prefix Key – Changed to Ctrl+z (instead of the default Ctrl+b).
  • Copy/Paste – Integrates with macOS clipboard.
    • <prefix> + C-c – Copies tmux selection to macOS clipboard.
    • <prefix> + C-v – Pastes from macOS clipboard into tmux.
  • Resize / Zoom:
    • Up Arrow – Temporarily zoom a pane (resize-pane -Z).
    • Down Arrow – Same as above.
  • Window management:
    • <prefix> + | – Split window vertically.
    • <prefix> + h/j/k/l – Move around panes.
  • Scrolling
    • Mouse mode is on. Scroll with mouse wheel to go into copy-mode automatically.
  • History – The scrollback buffer is extended to 100000 lines.

Other Tools & Extras

  • asdf is installed and configured for multiple languages (Elixir, Erlang, Flutter, Node.js, Python, Ruby, Rust, Postgres).
  • starship prompt is enabled in .zshrc, giving a minimal, fast, configurable prompt.
  • brew bundle in setup.sh automatically installs all the formulae from the Brewfile.
  • nvim is the main editor; vim and vi are aliased to nvim.
  • Ripgrep (rg) is used by default for searching within projects; integrated into Vim with fzf.
  • Bat (bat) is used for colorful cat replacements.
  • Zsh Syntax Highlighting, Zsh Autosuggestions are both loaded for a more user-friendly shell.

Final Tips

  1. Install Vim Plugins:

    • Launch nvim, run :PlugInstall to install all the plugins from .vimrc.
  2. setup.sh does a lot:

    • Installs Homebrew (if not installed).
    • Installs all brew formulae & casks from the Brewfile.
    • Symlinks these dotfiles into ~/. and ensures asdf is installed and updated.
  3. Local Overrides:

    • If you have local changes or environment-specific settings, place them in ~/.zshrc.local (loaded at the bottom of .zshrc).

That’s it! Enjoy your streamlined environment for Ruby, Elixir, JavaScript, and more. If you get stuck, comb through .zshrc or .vimrc to see additional details and function definitions.

About

Or Equals programming configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •