On 07/04/2022 10:23 AM, Little Girl wrote:
Hey there,
H wrote:
I am running Geany 1.36 under CentOS 7 and just experienced a crash of the desktop which resulted in an empty file list when I reloaded Geany...
I'd like to avoid this in the future and was thinking that I might be able to group various related files into Geany Projects which I can then open/close as needed, and, importantly, were the editor to crash, I could then simply reload the project.
I've got a couple of ways to do this depending on whether the files I want to open as a project are in the same directory or not. I'll include both below even though you're working with files that are in various locations. You may have them all together in the future, so the other method may someday come in handy.
Method 1: If all of your project files are scattered in various locations, you can give Geany a list of files, including their paths, as options on the command line. For example, this will open (or create and open) your files in Geany:
geany "~/Desktop/foo.txt" "~/Documents/bar.txt" "~/Development/baz.txt"
Note that you can type the command each time or copy it into your .bashrc file as an alias or into a shortcut or into a script.
Method 2: If all of your project files are in the same directory, you can create an empty Geany project file (a file ending in the .geany extension) in that directory and give Geany a list of files as options on the command line using the Geany project file as the command's *first* option. For example, this will open (or create and open) your files in Geany and write some information about them into the Geany project file:
geany "foo.geany" "bar.txt" "baz.txt" "bat.txt"
From then on, when you want to open those files again, you can either double-click the Geany project file or use the Geany project file as an option for Geany on the command line. For example, this will open your files in Geany:
geany "foo.geany"
Note that you can see the data in Geany project files by opening them in another text editor or printing their contents into a terminal window.
Thank you, I am considering rethinking how I organize my different types of "projects" to fit into the second paradigm, see reply to Lex.