Skip to content

Instantly share code, notes, and snippets.

View dwmoore's full-sized avatar
😎

Dave Moore dwmoore

😎
View GitHub Profile
@dwmoore
dwmoore / vim_cheatsheet.markdown
Last active August 29, 2015 14:17
Vim CheatSheet

#Vim CheatSheet

First, a note on the conventions used in this cheatsheet: Vim makes great use of the key modifiers shift and ctrl. I have noted any combined keypress as <command> key. In the case of shift, I have also included the normally recognized output: <shift> a (A) This is for clarity only and not part of the actual command.

###Moving Around First up, try to stay in normal mode as much as possible and edit with objects (discussed below) rather than going into insert mode and using arrow keys. Also, don't hold the h, j, k, l keys to move large distances,

h, j, k, l - Normal Mode - Move the cursor left, down, up, and right.

gg - Normal Mode - Go to the top of the document.

@dwmoore
dwmoore / ar_module_spec.rb
Created January 10, 2018 17:05
Testing Ruby modules included on and making use of ActiveRecrord Model functionality in RSpec
# Recently I had need to work on an ActiveRecord model
# that gained much of its functionality through the
# inclusion of a Ruby Module. Over the course of the
# work, I found that many of the models that include
# the module also included duplicated specs to cover
# the inherited behavior.
#
# Of course, this isn't ideal.
#
# In a perfect world, the module's behavior would be