Giter Club home page Giter Club logo

gedit-processing's Introduction

#gedit-processing

A set of files and configurations to enable gedit as a Processing IDE.


###That sound great but what is included?

  • Syntax Highlighting (automatic when editing .pde files)
  • Running a sketch straight from Gedit
  • Auto-Formatting
  • Snippet completion

###How do I install it?

Download this branch and extract it.

The Syntax Highlighting:

Put the sourceview-3.0 folder inside /home/your-username/.local/share/

The Snippets:

Within Gedit, enable the Snippets Completion plugin. Go to Tools >> Manage Snippets Click on the Import Snippets button, select the snippets.xml file and confirm.

Running Sketches within Gedit:

Within Gedit, go to plugins and enable External Tools. Go to Tools >> Manage External Tools Add a new entry with the following code:

	#!/bin/sh
	processing-java --sketch=$GEDIT_CURRENT_DOCUMENT_DIR --output=$GEDIT_CURRENT_DOCUMENT_DIR/run --run --force

Note that if you have processing-java installed in a different folder than your system's default, you will need to change the script to:

	#!/bin/sh
	/path_to_processings_folder/processing-java --sketch=$GEDIT_CURRENT_DOCUMENT_DIR --output=$GEDIT_CURRENT_DOCUMENT_DIR/run --run --force

Auto-Formating:

Note that this requires you to have Vim installed in your system.

Go to Tools >> Manage External Tools Add a new entry with the following code:

	#!/bin/sh
	CMD_FILE_NAME=.formatcommand;
	TMP_FILE_NAME=.tempvimfile;
	touch $CMD_FILE_NAME&&echo "gg=G :wq! "$TMP_FILE_NAME > $CMD_FILE_NAME&&(vim $GEDIT_CURRENT_DOCUMENT_NAME -s $CMD_FILE_NAME > /dev/null 2>/dev/null)&&rm $CMD_FILE_NAME;
	cat $TMP_FILE_NAME
	rm $TMP_FILE_NAME

Set Save to Current Document

Set Entry to Nothing

Set Output to Replace Current Document

You might have to save before running it as it uses the saved file in the drive as source and for some users the plugin fails to save.


###How do I use the snippet completion? Gedit's snippet completion works like this: you type the shortform and press tab, it will create the entire snippet. For instance, using my snippets, if you type

	rec

And hit tab, it will turn into:

	rect();

With the caret within the parenthesis so that you can type the attributes you want. To see all the currently available snippets, go to the Snippet Manager.


###Why haven't you added the commas and whatnot? I had it earlier that the output for the operation above was:

	rect($1,$2,$3,$4);$0

What this did was make it so you just had to tab between parameters. It might sound great at first but Gedit can act erraticly, specially when we have things like mouseX also possible to complete with tab. Instead of:

	rect(mouseX, mouseY, width,height);

If I tried to input a snippet within the first parameter I would get:

	rect(mouseX

Due to this weird behavior, I thought it would be easier to type in the commas than to backtrack all the time.

###I think something could be made a lot better than what you currently have! By all means, feel free to either fork this or submit patches, I'm all ears. :)

###Note on the Auto-Format code Original Author

gedit-processing's People

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.