DEV Community

JeremieRousseau
JeremieRousseau

Posted on Edited on

Geany Javascript Snnipet List.

Geany Javascript Snnipet List.

I code in Javascript and i don't found really lightweight Javascript IDE specifically on this language.

The subject of this article is not about pro or cons of each IDE against another IDE.

In fact, the raise of IA push me in brainstorming to code faster with geany but not entirly with AI.

And at the end i improve my skills.

To install Geany.

To configure snnipet in Geany,
*Tools->Configuration Files->snippets.conf *

and go at [Javascript]

Okay i finished by add v for var,
that feel stupid but i work faster.
v=var

After go in your own .js file type v and touch Tab, var appear.

And lot other, i searched list on google at a moment to see how other work but i found nothing so here long list of how i work.

t=false
f=false

without ; because i use boolean for toggle button in in if.

if=if(%cursor%)%block_cursor%
e=else

n=null
r=return;

un=undefined

For canvas user,

w=width
nw=nbrWidth
h=height
nh=nbrHeight

In my code i store a variable for another use some lines after first store.

sample:
var storeA = a;
// some code
a = anotherValue
// some code
a = storA

so:

s=store

And i use arg as prefix argument in function.

a=arg

I use separator between each function and sometime inside the code

com= // ===============================
comi= // -----------------------------

function Id( ParId )
{
return document.getElementById( ParId);
}

i=Id()

jso=JSON.parse();
jsos=JSON.stringify();

num=Number();
pop=pop(%cursor%);
par=parseInt(%cursor%)
;
typ=typeOf( %cursor% )

spl=split("%cursor%");
rou= Math.round

onc=onclick
ont=ontouchstart
set=setAttribute( "onclick", "" );
log=console.log(%cursor%);
rem=removeChild( Id("%cursor%") );
rema=removeAttribute( Id("%cursor%"));

For NodeJs with express

pos=app.post('/', function (req, res)%block_cursor%
get=app.get('/', function (req,

The interesting fact you can call ssh script to generate piece of code.

as this

spa={command:./Documents/span.sh}

You write span.sh beginning by echo and you write your code inside quote as:

echo '
var span = document.createElement("span");
span.id = "span";
span.innerHTML = "";
Id("").appendChild( span );
'

Don't forget with terminal inside your folder to change

chmod +x span.sh

I did that for input, textarea, button, function...

Top comments (0)