Helper Scripts - Vim & Greasemonkey
Posted: Thu May 29, 2014 3:15 pm
If you use Vim, this should be useful. In my .vimrc I've got the following line:
This allows me to hit F4-l have all my open files saved and the directory I've currently in run with love. There are no prompts or hoops of any kind, it just runs the game you're working on, like magic.
__________________________________________________
If you use Greasemonkey (or Chrome I guess) this might be useful. I want the most relevent text to show up at the start of the tab, and the love forum does it backwards in my opinion. But that's okay, because this little script fixes that:
Now the elements on either side of the dash are swapped, and the post title / section name are first.
That's all I've got for now.
Code: Select all
:map <F4>l :wa<CR> <bar> :silent !love %:h<CR><C-l>
__________________________________________________
If you use Greasemonkey (or Chrome I guess) this might be useful. I want the most relevent text to show up at the start of the tab, and the love forum does it backwards in my opinion. But that's okay, because this little script fixes that:
Code: Select all
// ==UserScript==
// @name Invert Love2d Forum Page Titles
// @namespace bdjnk
// @include *love2d.org/forums*
// @version 0.1
// @grant none
// ==/UserScript==
window.addEventListener("load", invertTitle, false);
function invertTitle () {
var title = document.title;
var token = " - ";
if (title.indexOf(token) < 0) { return; }
var fixed = "";
fixed += title.substr(title.indexOf(token)+token.length);
fixed += token;
fixed += title.substr(0, title.indexOf(token));
document.title = fixed;
}
That's all I've got for now.