Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been searching for how to do this for quite some time and can't find an answer. I'm new to UNIX environments in general so excuse my ignorance.

I'm watching a screencast on Rails and in OSX it seems that from a terminal window, you can type "mate ." to open the current directory in TextMate. When I attempt a similar approach with gedit, "gedit .", gedit opens but gives an error stating that I attempted to open a folder rather than a file (duh). I have the Gedit file browser plugin enabled, and I can press F9 to toggle it, but I can't seem to open a directory using Gedit from the terminal.

Any help would be appreciated, and sorry if this is a silly question.

share|improve this question

3 Answers 3

Gedit is primarily a text editor and it cannot "open directories" (at least not in the main view). You probably want to set the default directory for the File Browser Pane plugin I guess.

If you start gedit on the command line with

$ gedit .

it seems like the File Browser will take the directory above the directory you gave it (.) as root directory (to overwrite the value from the previous session) and it will give you a warning that . was a directory, not a file (you knew that already). If you do not want to manually select a directory from the tree view you could start it with any directory below the directory you are interested in, so that the directory above the one you specified is the one you were actually interested in.

$ gedit ./a

The default directory is store in a gconf key (setting management of Gnome, roughly analog to the Windows registry). There might be some way to invoke gedit with that key overwritten, but I don't know how to do that. Anyway FTR, the actual key is /apps/gedit-2/plugins/filebrowser/on_load/virtual_root.

share|improve this answer

You can do simple loop in script:

#!/bin/bash

for FILE in *; do
    if [ -f $FILE ]; then
        gedit $FILE &
    fi
done

"for" will do looping for each item (variable FILE) in current directory. "if" checks for whether this is really file (in order to avoid opening directories). Last part is call to gedit itself. Ampersand (&) is there to load all files together (otherwise gedit will open one by one).

share|improve this answer
    
Sorry, noob question, but can you clarify where I can out this to make it a default action? –  Mild Fuzz May 12 '12 at 20:28

I found this little script that seems to work well for me

http://code.google.com/p/gedit-open-folder/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.