https://github.com/shawncplus/dotfiles You can use the installer and only choose to install the tmux config
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/
Sanitize and bind
http://www.php.net/manual/en/mysqli.quickstart.prepared-statements.php
Caveat that ^^ is not global See notes/comments here: https://coderwall.com/p/_-_cmq
Created by a coworker of mine http://vanilla-js.com/
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
Important note about #2 is that it's not a global replace. See: https://coderwall.com/p/_-_cmq
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
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.
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 -
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()
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
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
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.
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
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>
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.
If vim is your default editor having a vimrc with at least
set nu
for line numbers is helpful. SecondlyCtrl-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, hitESC
. Will do exactly what you're doing in Sublime. 10 seconds.Ctrl-V,20G,es,"squash",ESC