SkillAgentSearch skills...

Hermes

An environment for Ruby and JS developers in Darwin

Install / Use

/learn @New-Bamboo/Hermes
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Hermes

Hermes is an environment for Ruby and JavaScript developers in Darwin using Tmux, Vim and iTerm 2 that focuses on speed and ease of use.

Hermes is opinionated where having an opinion is important, but does not prevent you from customizing your tools.

Hermes gives you a lot of things for free:

  • Sensible defaults for developers.
  • Integration of Vim into tmux and tmux into iTerm 2.
  • Mouse and window integration, allowing selections within tmux and Vim panes, not across them.
  • Vim packages that provide git integration, command- and block-completion, fuzzy file search and ease of testing.

We feel that good documentation is a key part of using any new technology with lots of moving parts, so we will be improving Hermes' documentation in the days and weeks to come.

Hermes screenshot

Preliminary Thanks

Hermes combines plugins, settings, snippets, gists, and ideas from countless developers around the world. We would like to thank:

  • The Vim team.
  • The Tmux team.
  • The GNU Bash team
  • The Homebrew team.
  • Tim Pope. Seriously, you're awesome.
  • Thoughtbot for their dotfiles, essential in getting the Tmux configuration right.
  • Vimcasts, for showing the world just how powerful Vim can be.

Installation

Warning! Hermes is still early in development, so just to be careful, we strongly encourage you to install it in a separate user account, not your main one. That said, we have tested it on our own user accounts, where it worked just fine.

You can check to see which files will be overwritten in manifests/dotfile_manifest, or follow this link to view it on Github.

Prerequisites

Hermes relies on Homebrew and RVM to work properly. While Homebrew is a de facto standard developers using OS X, there are a good number of people that use RBenv, so support for that is in the pipeline. We are happy to look at any pull requests.

If these two tools are not available, the installer script will halt. Please refer to these tools' excellent documentation for installation instructions.

Fork first!

As the very first step, you should fork the Hermes on Github since this will make it easier for you to customize your installation. After you're done, you can run:

mkdir -p ~/.hermes
git clone https://github.com/<your_github_username>/Hermes.git ~/.hermes
cd ~/.hermes
./install.bash

This will perform the following actions:

  • Check that you have all the needed Homebrew dependencies
  • Back up any file or folder that would be overwritten by the installer process
  • Install all dotfiles and plugins available in the hermes directory and symlink them to the right locations in your home folder

You may also want to add Hermes's repository as an upstream repository, so you can pull in the changes done on the main trunk whenever you need to.

Hermes installation

What's included in the installer

The installer will:

  • check for dependencies
  • backup any existing dotfile that would be overwritten in a timestamped tar file that you can use to restore your previous configuration
  • install a number of required Homebrew packages
  • create a ~/hermes directory and symlink its content to your home folder where every piece of software expects to find its main configuration file(s)

Hermes includes:

  • configuration and plugins for Vim
  • configuration for Tmux
  • configuration for git
  • configuration and additional functionality for two shells: Bash and Fish.
  • settings for gem, ack, pow, pry and irb

In addition, Hermes glues all components together so they play nicely with each other and the OS. Two examples of this integration are are Hermes' support for the system clipboard in OS X and window/pane aware mouse integration.

Updates

Being a git-based project, you can update Hermes by simply pulling from the remote. If you forked the project, please remember to add the original repo as an upstream repository to make getting new project updates easier.

Documentation foreword

This document provides enough information to make you productive with Hermes, but it doesn't cover the totality of what's provided by all plugins, especially when it comes to Vim. Please refer to their original documentation for more details.

Hermes' goal is to provide a solid structure for you to build on top of without having to deal with any intermediate configuration layers. For example, Vim's entire configuration is managed canonically through the ~/.vimrc file and the ~/.vim folder. The only significant difference is that under the hood, those files are actually symlinks to your hermes folder.

Knowing how Hermes ties everything together is useful when it comes time to configure it.

Vim

A stock vim installation with a basic configuration can go a long way and can be really beneficial when it comes to editing files on a server.

There is however a very simple problem with the default Vim installation that OS X provides: it cannot access the system clipboard. That means if you copy anything from outside the editor, it's not available in any of Vim's registers. Worse yet, if you copy anything in Vim using its internal commands, it won't be available to the rest of the system

To sort this out, Hermes installs Homebrew's version of Vim, which is available through the MacVim package:

brew install macvim --override-system-vim

This has some additional benefits, like having support for Ruby in plugins.

Let's now go with some defaults for a basic .vimrc file:

set nocompatible    "don't need Vi compatibility
set nobackup        "don't create backup files
set nowritebackup
set notimeout
set ttimeout
set ttimeoutlen=10
set noswapfile      "don't create swap files
set history=50      "keep a small history
set ruler           "always show position
set showcmd
set incsearch
set laststatus=2    "full status bar
set t_Co=256        "256 colors - requires a properly configured terminal emulator
syntax on           "turn syntax highlight on

filetype plugin indent on "let plugins manage indentation

" Send more characters for redraws
set ttyfast
" Enable mouse use in all modes
set mouse=a
set ttymouse=xterm2

" Fix backspace
set backspace=indent,eol,start
fixdel

" Softtabs, 2 spaces
set tabstop=2
set shiftwidth=2
set expandtab

" Display extra whitespace at the end of the line
set list listchars=tab:»·,trail:·
" Clipboard fix for OsX
set clipboard=unnamed

" Numbers
set number
set numberwidth=2

"Folding
set foldmethod=indent
set foldlevelstart=99

" Autocompletion options
set wildmode=list:longest,list:full
set complete=.,w,b"

These settings will allow you to efficiently edit any file whose type is supported by default, so Javascript and Ruby are already covered. The settings enable standard features like line numbering and syntax highlighting and also turn on features like mouse support and clipboard sharing that are useful in integrating Vim into iTerm and OS X.

Plugins

Plugins are a powerful way to extend Vim's capabilities. The implementation may change, but we feel you should be able to expect the following from a modern text editor:

  • Support for fuzzy search inside a directory tree. You should be able to easily open a file by name without navigating the tree.
  • Full text search inside a directory tree.
  • Snippet support with expansion, tab stops and completion. Like Textmate.
  • Integration with testing frameworks. You should be able to run tests without leaving the editor.
  • Tabs and split windows. You should be able to see tests and the corresponding code at the same time and be able to easily switch from one to the other.
  • Language specific features, like syntax-aware indentation and navigation.

Needless to say, a number of other text editors support these features. Vim, however, combines this with its extremely efficient modal editing approach.

Hermes provides a good number of plugins, aiming to strike a balance between features and speed. You can see the complete list under hermes/vim/bundle, but here are some highlights:

  • Ctrlp: a tool for fuzzy searching by file and tag.
  • Snipmate: unashamedly borrowing from Textmate, Snipmate provides tab completion based on snippet files.
  • The silver searcher: ag is a faster alternative to Ack.
  • TComment: toggles comments in nearly any language.
  • Rails.vim: provides shortcuts, generators and settings for working with Ruby on Rails projects. Absolutely killer.
  • Vimux: forms a bridge with Tmux to send text and commands to a Tmux pane. Vimux is essential for Hermes' testing support.

However, we encourage you to be wary of plugins for several reasons:

  • Vim has many conventional ways to accomplish certain tasks, and while it's possible to do things in many ways, it's important to try to understand the Vim way of doing things and play to its strengths.
  • One of Vim's benefits is speed and low memory footprint, making it responsive even when opening huge files. Increasing Vim's footprint through excessive numbers of plugins can eliminate this benefit.
  • Sometimes a plugin is not necessary. Simi
View on GitHub
GitHub Stars104
CategoryDevelopment
Updated2y ago
Forks28

Languages

VimL

Security Score

65/100

Audited on Mar 28, 2024

No findings