Opening files with drag n drop in jedit for ubuntu - jedit

This may seem like a stupid question, but I really can't find a way to open files from nautilus using jedit. I tried drag n drop and it doesn't work. Couldn't find any plugins in jedit to do this either.
Alternatively, I don't mind just double clicking to open, but I can't set jedit as default text editor application since it doesn't appear in my application list for some reason. So there's no way I can open the files from nautilus.
The only way i can open at the momemnt is either within jedit or in the terminal, but these are really inefficient for me. So it would be great if anyone could give me a hand in solving this trivial problem.
I did some googling and from here http://jedit-devel.narkive.com/3Qsqp2II/jedit-devel-jedit-drag-and-drop-bug-in-gnome, seems like the versions may be affecting this issue. Not sure about this. But here are my facts
java version "1.7.0_65"
jEdit 5.1.0

How about adding jEdit to List of Applications in “Open With” When Right-Clicking Files in Nautilus?
Instructions from https://ubuntugenius.wordpress.com/2012/06/18/ubuntu-fix-add-program-to-list-of-applications-in-open-with-when-right-clicking-files-in-nautilus/
For example, this is my jedit.desktop file:
$ cat /usr/share/applications/jedit.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=jEdit
GenericName=Text Editor
Comment=Text editor for code
Exec=jedit %F
Terminal=false
MimeType=text/plain;
Icon=jedit
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;
[Desktop Action Window]
Name=New Window
Exec=jedit
OnlyShowIn=Unity;
[Desktop Action Document]
Name=New File
Exec=jedit
OnlyShowIn=Unity;
If you want to make jEdit the default for opening the particular filetype, you can now right-click one, choose Properties, go to the Open With tab, click on jEdit under Recommended Applications, and click the Set as default button.
Hope this helps.

This should work and works just fine for me.
If you are using the version included in the Ubuntu repository, try changing to our official version in our own repository as described on our homepage.
If you are using the official version, look in your Activity Log for anything suspicious when trying to drag&drop.
Also jEdit should be available as a normal Application and for "Open with Application..." just fine, at least with our official packages.
If all does not work, open a bug in the bugs tracker, then we can maybe help you better than here.

This might be something unique to my wonky machine running Ubuntu 12.04, but I found the line JAVA="${JAVA_HOME}/bin/java" to be the problem.
From a terminal, it resolves to the correct value of /usr/lib/jvm/java-8-oracle/bin/java.
However, from the desktop or launcher bar, it resolves to /com/home/users/current/local/java.
Maybe someone more learned than I can explain this, but my solution was to edit the file at /usr/local/bin/jedit, replacing the last line:
exec "${JAVA}" -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -jar "/usr/local/share/jEdit/5.3.0/jedit.jar" -reuseview "$#"
With:
exec "java" -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -jar "/usr/local/share/jEdit/5.3.0/jedit.jar" -reuseview "$#"
This only works if the JVM is set up properly.

Related

How to run a script from startup on Raspbian 10 (buster)?

I have designed a GUI that I want to run as soon as I turn on my Raspberry Pi. It is currently set up to automatically log in as user on startup, but if that makes the process more difficult I can change that. My Raspi runs on Raspbian 10 (buster), which has made things difficult since I can only find tutorials for Raspbian 8 or so.
I have tried modifying autostart folder, but it is not in the same location as it was in previous Raspbian versions and doesn't seem to be working the way it used to. Tutorials have said to create a .desktop file in /home/pi/.config/autostart but I don't have a .config folder, or at least it's hidden. For me, autostart is in /etc/xdg/autostart and when I try to create a new file here using nano in the terminal, I get the message [Directory '/etc/xdg/autostart' is not writable] and it doesn't save my file.
I have also tried calling my script in /etc/rc.local but it did nothing. Some have said it doesn't work for GUIs.
Here's what I type into terminal:
$ nano /etc/xdg/autostart/gui.desktop
and a new file pops up, but at the bottom I get the warning [Directory '/etc/xdg/autostart' is not writable]
How can I get my GUI script to run on startup with Raspbian 10 (buster)?
There are a number of issues here, first when you are looking at tutorials recognize that Linux distros are built in layers, for simplicity let's say your "layer stack" looks like this: kernel, systemd, x11, xdg, lxde. The kernel boots, then starts systemd, which then starts x11 (and a lot of other stuff), x11 starts xdg (and some other stuff, I think), lxde is started by either x11 or xdg I'm not sure which.
You want to add something to this process, you can do it at the kernel level (bad idea), at they systemd level (probably not right unless its a daemon), at the x11 level (still probably bad as you still don't have a user session yet), or at the xdg or lxde level.
xdg is probably the right place as it has all you need ( a gui, a user session) while being common (xdg will still work if you switch window managers, probably)
With that out of the way, why isn't your solution of modifying xdg working? It's because '/etc/xdg/autostart' is a system configuration directory. Any changes made to it will apply to all users. You may want this, but the system is trying to protect other users on your system and only allows root to make changes to everyone. If you want to do that use "sudo" (documented elsewhere on stack exchange and the internet). If you want to do it just for you use ~/.config/autostart, (https://wiki.archlinux.org/index.php/XDG_Autostart) you might need to create that directory with "mkdir ~/.config/" and then "emacs ~/.config/autostart"
Would it be better to have the python program run in a terminal window from startup? That way you would see what it is doing in case of errors.
If so, perhaps check this out https://stackoverflow.com/a/61730679/7575617
By the way, in the file manager, hit CTRL+H to toggle viewing hidden files and folders.

Open arbitrary file in existing Intellij Project

Intellij is my goto editor for .. just about everything . I tried sublime, vscode, adam and others.. and I do always come back to IJ.
In the past I had been able to use the command line launcher /usr/local/bin/idea and it would open a general file in the currently opened Intellij project. Split second to open. That is not working presently : instead a new Intellij window/application is launched for the sole purpose of editing maybe a small text file. This can take minutes and lots of memory.
The command line options to the launcher are v limited and do not include specifying "open in new window" or not:
$idea --help
Usage:
/usr/local/bin/idea -h | -? | --help
/usr/local/bin/idea [project_dir]
/usr/local/bin/idea [-l|--line line] [project_dir|--temp-project] file[:line]
/usr/local/bin/idea diff <left> <right>
/usr/local/bin/idea merge <local> <remote> [base] <merged>
I would also mention: I do want separate windows for Intellij projects so do not want to reset this option under Appearance & Behavior | System Settings | Project Opening:
Also: note there is a similar question here
Edit non-project files in IntelliJ but that question does require specific project-related capabilities and does not answer my question. My question is for opening general text files.
A partial solution is to use the --temp-project command line option. It creates an unnecessary additional window but does not open an entirely new Application. It's pretty quick. E.g. for
idea --temp-project zoo.data
we get a project with that one file:
I'd still prefer to open the arbitrary file within the currently opened Project - which did happen in the past.

phpStorm 7 Code completion stopped working

I have been working with phpStorm and it had suddenly stopped showing suggestions for code completion. When i do Ctrl + space its behaving correctly by showing all the possible options in a drop down.
I have followed the below link and have did invalidate cache but still of no use.
PhpStorm code completion doesn't show core classes/extensions
My Setup is:
OS: Mac - 10.9.2 (Mavericks)
PHPStorm: 7.1.3
I just had the same problem, fixed it when I realized I mistakenly put PHPStorm in Power Save Mode. Click the little fellow on the bottom right of your PHPStorm window and switch that off
Indeed, the Power saving mode (File > Power Saving Mode) allow you to disable the code inspection functionnality.
However sometimes the PhpStorm code analysis failed and you lost your code completion. In this case you juste have to ask for a new code analysis (File > Synchronize [CTRL+ALT+Y]) or invalid the cache and force a restart (File > Invalid cache / Restart).
Hope that helps.
Invalidating the cache did not work for me, but this did:
Enable power save mode (File > Power Save Mode), then disable it.
If your are using a Linux distro (Ubuntu, Debian, Centos) etc, it is due to ibus.
Just change the Shortcut (run: ibus-setup and change to Super+Ctrl+Space for instance) and everything will be fine again.
Or (my favorite): uninstall ibus if you are not using it.
In a Debian/Ubuntu distro should be:
sudo apt-get remove ibus
Ctrl+Space autocompletion should be back.
It was power saving mode for me too. It's an option at the bottom of the File menu.
install a previous version
https://www.jetbrains.com/phpstorm/download/other.html
Worked for me after I tried everything.
I struggled with this for a few hours this morning. After invalidation of caches, a complete reinstall, etc.. nothing worked.
I closed phpstorm and removed the .idea folder in the filesystem. I then renamed the project folder and reopened it. Autocomplete was now working!
I noticed that phpstorm then created the old project directory in the background, even though I did not open it and put a .idea folder in it. Something is obviously corrupted here.
" ... stopped showing suggestions for code completion".
On mac you can invoke it by fn+ctrl+space.
Going to php-storm -> Settings -> Keymap -> Set Active Changelist you can see it is associated with ^+space.
on windows ctrl+space

Is it possible to launch more than one Webstorm instance using the command-line launcher?

Webstorm can be launched from the command line using the command wstorm. However, would it be possible to launch more than one instance? Usually, the second time I run wstorm, it doesn't open another Webstorm for me and does nothing.
In OS X, this is apparently caused by an outdated wstorm (a Python script at /usr/local/bin/wstorm). I verified the solution indicated in this ticket with WebStorm 2016.1.3:
Go to Tools > Create Command-line Launcher....
UPDATE Nov-2016: As of WebStorm 2016.3, the default name of the launcher changed from wstorm to webstorm. If you prefer wstorm instead, make sure to edit the script name before clicking OK:
Just run:
WebStorm.exe "Full\path\to\the\project\that\contains\the\.idea\folder\of\your\project"
The project will run in the same instance but in a separted window as described here: https://www.jetbrains.com/webstorm/help/opening-multiple-projects.html
NOTE: This was tested on WebStorm 9.0.3 and may not work on previous versions.

Change the default sort order in KDE's file dialog (working with Kate)

Recently, my Kate text editor is showing files and folders "By Date" in the file dialogs, and I would like to get back to alphabetical order. I am running Ubuntu 12.04 with Unity, KDE Platform Version 4.8.5 (4.8.5), Kate Version 3.8.5. I can't figure out how to change it.
Ok, I've figured it out. On Ubuntu 13.04 (at least), edit the file:
~/.kde/share/config/kdeglobals
It is a configuration file in the Windows INI style format. Locate the section called
[KFileDialog Settings]
Change the settings:
Sort by=Date
Sort reversed=true
into:
Sort by=Name
Sort reversed=false
Furthermore, changing
View Style=Simple
into
View Style=Detail
will make it easy to change the sort order on the fly.
The changes will not be immediately picked up by Kate. I did not need to restart the computer or even logout from my Ubuntu Unity session, but logout is probably the way to go if the changes do not take effect after a while.