Search git logs more effectively with —grep
Instead of using `git log | grep some_string’ try `git log -Ssome_string —stat -p`
Instead of using `git log | grep some_string’ try `git log -Ssome_string —stat -p`
We highly recommend the “vim-indent-object” plugin (included in Janus). It allows you to act on indentation levels as text objects. For example
1 def complex_method 2 [1,2, 3, 4, 5, "👾]", "🎃]"].each_with_index do |i, n| 3 0.upto(n) do |j| 4 result...
At SideReel, breaking the build is no laughing matter, if you forget to run rake all, and the build breaks, you’ll be forced to carry around, a big giant rake.
The following command in your vimrc will map <Leader>h in visual mode to dump the html for the syntax highlighted version of the selected region and open a web browser displaying it. (Especially useful for copying to email)
vmap <Leader>h :TOhtml<CR>:w! /tmp/tmp.htm<CR>:bd!<CR>:!open /tmp/tmp.htm<CR>
If you have a sequence of “normal” commands e.g. I# (Insert a # at the beginning of a line).. You can repeat that command over a series of lines by selecting (e.g. with Shift+V), then typing :normal I#.
This is handy for repeating editing commands over ranges
Here we often have specs alongside implementation using the :vsplit command. Sometimes we’ll have 4-5 files open at a time. Just in case you are not happy with vim’s default layout and you want to move some pane’s around. Use Ctrl+W (shift) followed by H,J,K or L to move the pane. (So to switch two panes in a vsplit use Ctrl + W (shift) H or L) .
Additionally, you can use Ctrl+W (shift) R to switch panes, R will rotate the pane arrangement.
Vim keeps track of everywhere your cursor has been in every file (up to 100 locations). To move forward and back through editing locations, you can use Ctrl+I (forward) and Ctrl+O (backward). This will also work across all open files. This is particularly useful with the shortcuts “gf” (You hit…
To send a text message when a process is no longer present, you can use the below command. This will only work on MacOSX and it requires that you determine your SMS gateway address. For an AT&T number at 415-291-0000 the number would be 4152910000@txt.att.net
Code
Our righteous ranger Richard Luther explains SOLID principles and how they apply to ruby.!