org-mode: Open parent directory of linked file - emacs

Is there a function in org-mode to open the parent directory of a linked file instead of the file itself?
Background: Having links to files under version control (subversion), I want to update the file before opening it.

The main question I have is: when you click on the link, do you always expect to go to the containing directory? If so, why not change the link
to point to the directory, instead of pointing to the file?
If you sometimes want to go to the directory and sometimes to the file,
then you might (no guarantees) be able to do it by defining your own link type (but note that org-add-link-type was declared obsolete in v9.0 and you are supposed to use org-link-set-parameters instead - the manual needs updating). You'll need to program the criteria (or perhaps supply an argument somehow) for when you want to visit the directory and when you want to visit the file.

Related

Where does VSCode save the context about open files?

I am aware that I am asking for an implementation detail but I want to hack something for my use case and hence the question.
My use case: I use an on-demand instance where source code is hosted at work. This means I get a new machine (let's say every day) where I open the same source folder (but hosted on that remote machine). Because of this, the context of opened files in editor gets lost between sessions.
I am curious where does VSCode save the information about open files in a workspace. If I know that, I am hoping I can copy that file at the end of day before I give up an on-demand instance AND when I get the next instance (which may have a different remote url but same file paths), I can somehow hack this file to open all the editors from previous session in the new on-demand. Does my question make sense? Let me know if something is not clear.
On Windows the workspace state is stored here:
%APPDATA%\Code\User\workspaceStorage
And on Linux:
~/.config/Code/User/workspaceStorage
Every workspace has a subfolder here with a hashed name. To find out which one belongs to your workspace, open the contained workspace.json, which looks like this:
{
"folder": "file:///c%3A/some/path"
}
Choose the one that matches your workspace folder and copy the complete folder.
However, I am not sure how VS Code calculates the hashes for the folder names, so maybe it won't use the same hash again in your new instance. But this definitely is the place where the information is stored, so it's worth a try.

Can you create a file or folder by path in VS Code?

In Atom, hitting Cmd+N brings up a window where you can type in basically any path to create any file or folder anywhere in the project. In VSCode, hitting Cmd+N brings up a dialog where you can create a file in the currently focused folder, and I believe you can type a path to create a file in a subfolder (whether it exists or not), but not as flexibly as in Atom.
Is there way to do it Atom-style in VSCode?
I don't know for sure whether this is what you're looking for, but still there exists this plugin which can emulate the file/directory creation feature of Atom.
Since i use vscode-vim it's fairly easy to create new folders and files using command mode. If you're familiar with using terminal, then you can use shell commands to create file/dir.
I have no idea whether one could do what you had mentioned the proper way with vanilla vscode.
Hope this helps you somehow.

Go To File with directory in NetBeans

The "Go to File" dialog is handy (Alt-Shift-o), but my project has a hundred files called index.phtml. Is there any way to include the directory? Say, search for docs/index.phtml?
Or do I just have to fix/wait for https://netbeans.org/bugzilla/show_bug.cgi?id=222697?
I'm using NetBeans PHP 7.3.
No, only file names can be searched for.
When looking at the code of the Jump To module, you can notice that a org.netbeans.modules.parsing.spi.indexing.CustomIndexerFactory gets registered which only keeps record of file names including their extension. So currently there is no way to to search for files with a path specified.
However, I think it shouldn't be too difficult to change the indexer of the Jump To module to not omit the path, I'd worry about the performance though.

Change folder names in Joomla site

I'm trying to change some folder names in a Joomla (1.5.23) website to better define what they contain. Everything I find refers to changing template names but in the admin panel I don't see anything named "templates".
So far I've been able to make all my changes by directly editing the files in the database but I can't find how to change a folder name. I tried changing it in the category manager and published it but still uses the old folder names.
Any direction would help at this point.
From the Admin, under Extensions, you'll see Template Manager. It displays your available templates based on folders in the \templates folder, and uses the templateDetails.xml within that folder for the admnin form.
Your best bet is to simply copy one of those folders, makes changes in the templateDetails.xml files (so you that you'll see a different name in the admin), and further investigate how it works from the copied version.

Can I search Netbeans' local history?

In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.
Is there a way to run a search on the local history of this file?
I saw in this answer that the local history is kept in this path
<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).
I tried running AgentRansack on that directory, but to no avail.
I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.
Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.