Joined October 2012
·

Shawn Biddle

CoachMePlus
·
Buffalo, NY
·
·
·

Posted to Changing My Git Editor On The Fly over 1 year ago

If vim is your default editor having a vimrc with at least set nu for line numbers is helpful. Secondly Ctrl-V to start block selection, <Line Number>G to jump to that line number, e to go to the end of the word, s to delete the word and start editing, type squash/fixup, hit ESC. Will do exactly what you're doing in Sublime. 10 seconds.

Ctrl-V,20G,es,"squash",ESC

Posted to tmux and vim don't have to be ugly over 1 year ago

https://github.com/shawncplus/dotfiles You can use the installer and only choose to install the tmux config

Posted to tmux and vim don't have to be ugly over 1 year ago

github.com/powerline/powerline http://i.imgur.com/L9Z6LhG.png

I did a whole video on these operators, for example what does !215:$:t do. https://www.youtube.com/watch?v=9wcBBuZ6H4w see also: http://shawnbiddle.com/bash/

Caveat that ^^ is not global See notes/comments here: https://coderwall.com/p/_-_cmq

Posted to Lazy front-enders are lazy over 1 year ago

Created by a coworker of mine http://vanilla-js.com/

Posted to Bang Cash (!$) over 1 year ago

The first line is a bit useless since you're just shortening :e %:h to :e %% You're doing a lot of work to just save one letter. You can just do map <leader>e :e %:h<CR> Personally I have it opening in a new tab

Posted to Three very useful command line tips over 1 year ago

Important note about #2 is that it's not a global replace. See: https://coderwall.com/p/_-_cmq

Posted to Safe boolean check over 1 year ago

my.property || false works as well and is slightly less verbose and has the benefit of actually returning the value of my.property if it isn't falsey without having to duplicate the variable name like my.property ? my.property : false

Posted to Few ways to quit Vim over 1 year ago

This is older but just noticed this post. :wq and ZZ are not the same command. ZZ does not alter the last mod time if the file isn't changed, :wq will. ZZ and :x are analogues, however.

Posted to Create multiple subfolders over 1 year ago

Not to forget that you can have folders after the set. mkdir -p foo/{bar,baz}/hello will create

foo/
   bar/
     hello/
   baz/
     hello/

Or you can have a partial name. mkdir hello{1..5}world will create hello1world, hello2world, hello3world, etc.

Manual entry: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_04.html

See also git checkout -

Posted to Always close your comments over 1 year ago

That means your compression is broken, it should be stripping comments. If all it's doing is joining lines it's not doing its job.

Surely there's a more robust logging solution one could use in production over console.log? That is unless you're implying that you're coding on live.

I've seen a bunch of these and similar tips for hiding console.log in production but how is console.log getting to production anyway? I've never seen a reason to use console.log over proper breakpoint debugging which requires no code to be turned on/off in production or code at all for that matter. console.log, to me, seems like just a less obtrusive alert()

Posted to Add some color to your diff output over 1 year ago

Git diff has color git diff --color=always. Likewise you can use vim as the diff tool (shameless plug) http://www.youtube.com/watch?v=hb5RVnOda2o&feature=plcp

EDIT: It seems I misread the post as if git was the one lacking color

Small change but you don't need the ., find defaults to the current directory

The hack for this in PHP versions before this is available is the following

function exampleArray () {
    return array ( 'title' => 'banana', 'body' => 'skin' );
}

list ($title, $body) = array_values(exampleArray());

I say hack because it assumes that the order of values returned from the method will never change which is quite dangerous

SuperTab might be relevant to your interests http://www.vim.org/scripts/script.php?script_id=1643

Posted to BASH history tricks over 1 year ago

The only downside of ^^ is that it's not a global replace, so if you had

somecommand foo bar foobar

then did

^foo^blah

You'd get

somecommand blah bar foobar

instead of

somecommand blah bar blahbar
Posted to Vim tip: returning to last change over 1 year ago

Also gi will put you back into insert mode where you were last in insert mode. Handy if you go to normal mode to look around a file and want to jump back to where you were.

Posted to git push current branch over 1 year ago

You can also set this as the default by setting push.default to upstream http://www.kernel.org/pub/software/scm/git/docs/git-config.html so that git push will push the current branch to its upstream

Posted to Making arrow keys work in vim over 1 year ago

Just throwing this out there, using your arrow keys for movement in vim is a pretty big, if not the biggest, antipattern for vim usage. Practicing by removing them is a good way to get yourself off the habit. There is almost always a better way to move around than a single character motion

no <down> <Nop>
no <left> <Nop>
no <right> <Nop>
no <up> <Nop>
ino <down> <Nop>
ino <left> <Nop>
ino <right> <Nop>
ino <up> <Nop>
vno <down> <Nop>
vno <left> <Nop>
vno <right> <Nop>
vno <up> <Nop>
Posted to Save and Quit Shortcut over 1 year ago

It's not exactly the same. :wq will update the last-mod time even if you haven't changed the file whereas ZZ will not.

Achievements
134 Karma
1,587 Total ProTip Views