IntelliJ IDEA plugin to fold .conf files? - intellij-idea

I have a Scala app built with Lift framework. It has a few .conf files. When I open those .conf files in my IntelliJ IDEA Ultimate Fancy Pants Edition, I do not see any buttons to fold those curly braces in those files. Hotkeys do not do it either. Browsed for plugins, none applicable found. Is there any solution to enable code folding in .conf files?
Update:
Here is an illustration of what would be lovely. Those "-" and "+" icons do not appear in .conf files:

The relevant plugin is the HOCON plugin.
To install, click the Get button from the above JetBrains Marketplace link. Or, from within IntelliJ, go to Settings/Preferences (Ctrl+Alt+S for Windows; ⌘+Comma for Mac) and select Plugins, then click Marketplace to search for the plugin and install it. Restart IntelliJ to enable it.
To confirm, go back to Settings/Preferences and select Editor > File Types. You should now see HOCON (Human-Optimized Config Object Notation) file types among those listed as "Recognized File Types". Click HOCON and you should see *.conf under "File name patterns".
All your .conf files should now appear in IntelliJ with syntax highlighting and code folding.
Edited Oct 2020 to remove Scala plugin reference, as it no longer seems to support HOCON files.

Those .conf files are of HOCON type ("Human-Optimized Config Object Notation"). To enable folding them, you have to force the editor treat them as such. In IntelliJ settings, configure it as illustrated:
Preferences->Editor->File Types, and there add filename patterns to HOCON filetype.

2020+
The best option is to install HOCON plugin separately. For now, HOCON file type is not bundled with Scala plugin anymore.
P.S. All credits to ghik's comment. Decided to put this into separate answer because I was not able to find the tip at first time.

Related

Does the "Ignored Files" settings create an external ignore file for it's select VCS?

I assumed that if I have my VCS set up with Git and listed files within the "ignored files" settings, then IntelliJ Idea is automatically creating a .gitignore file. This doesn't appear to be the case.
My project has a .gitignore file and it does not match the settings within "Ignored Files". I suspect this is a failure on my part to understand what this IntelliJ setting is.
So Ignored Files has nothing to do with my gitignore file?
Right: The "Ignore" feature of IDEA is separate from the specific version control ignore feature.
The IDEA help at https://www.jetbrains.com/help/idea/2016.2/configuring-ignored-files.html says
If the version control system that you are using has its own ignore facilities, use the corresponding native command provided by the version control integration.
Unfortunately the git plugin currently does not have specific commands to deal with .gitignore files.
There is a plugin that deals with that (though I never tried it myself):
https://plugins.jetbrains.com/plugin/7495
Interestingly, I have not found a feature request at IDEA's bug tracker (https://youtrack.jetbrains.com/). You may try to create a request there.

Make *.apib files load into IntelliJ Markdown plug-in

How can I tell IntelliJ (or its Markdown or Multimarkdown plug-in) that files named *.apib are Markdown, and should be handled the same way as files named *.md?
I found the Preferences for the plugins (Preferences: Other Settings: Markdown/MultiMarkdown), but these only control what it means to "be handled the same way," not how to get there in the first place.
I also found Preferences: Plugins, but it only seems to handle installing the plugins, not configuring them.
Open Preferences and choose Editor. Select File Types and select Markdown Language, then add *.apib to the list of patterns.

How to force IntelliJ to use a different home folder

I have a computer with two hard drives. In the first one, an SSD disk, I have Windows partition (C) and on the second one (D), a raid volume, I install all the programs. I also moved my user folders (desktop, documents, downloads, pictures and videos) to D:/Users/David.
After installing IntelliJ Idea on D:/Program Filles(x86) a .IntelliJIdea13 directory appeared on D:/Users/David. No problem with this as all was working nice. Then I installed Scala plugin, created a new SBT project and build it. After this, the .sbt directory used by SBT was in C:/Users/David/.sbt but the references to the libraries in my project are pointing to D:/Users/David/.sbt. The question is, how can I force IntelliJ Idea or Scala plugin to download the libraries to D:/Users/David.sbt?
Not 100% sure if this can be a solution, you can change the HOME folder of Intellij IDEA. Look for the folder where the idea executable is. In Linux I have on
~/applications/idea13/bin
On Windows you can check the properties of the menu item. There should be file idea.properties that contains the home folder location of the idea files.
You can find more information here that describe more details:
Locations can be changed by editing the following file:
IDE_HOME\bin\idea.properties
Follow the comments in idea.properties file to change the defaults,
make sure to un-comment the lines defining these properties:
idea.config.path
idea.system.path
idea.plugins.path
idea.log.path
On the other hand you can change the location of your project to D:/Users/David. you should also have a look inside the project folder, there should be a .idea folder with has a library directory. They contains the location of the libs used in the project with their paths.
As dawez allready answered, you should edit idea.properties to set config, system, plugins and log paths.
But if you want to change the user.home path, then you must edit idea.exe.vmoptions file. Just add the following at the end of the file:
-Duser.home=your_new_user_home_path
If you use idea64.exe then you should edit idea64.exe.vmoptions file.
JetBrains had added complete set of features to support such a case and this is described here:
Changing IDE default directories used for config, plugins, and caches storage

IntelliJ Open module from desktop

I have been using IntelliJ sparingly for the last six months and one thing always puzzles/annoys me.
Each module of IntelliJ has a .iml folder in it's root. This .iml file is clearly recognized by IntelliJ it the file extension is associated with it during install.
Clicking on this .iml file I would expect the module to open up in IntellJ in the most recent project space. However, IntelleJ does not seem to want to do this, it has a popup saying the following.
Cannot open file:
No project to open file in.
So why can't intelliJ just open the module in the most recently used project space. Instead I have to go to great lengths to open a project space and then import the project which is so unproductive. Often I have to look open and inspect several projects an hour and as is, the process is onerous.
Am I missing something, or is there really no way to open projects directly from the desktop/file explorer?
Click the file which has .ipr extension to open it in intellij, and you can see it in the most recent project space after it is opened.
The *.iml file describes modules. It includes module paths, dependencies, order settings, etc. A project may contain multiple *.iml files.
The *.ipr file stores settings related to a project in general, for example, paths to modules and module libraries, compiler and configurations, entry points, etc.
You can find more detail in IntelliJ IDEA Web Help

.vimrc for IntelliJ Idea's vim plugin

I am using the vim plugin for IntelliJ Idea.
Where should I place the .vimrc for that plugin.
Using Windows XP
The latest version of the plugin will read settings from a file named .ideavimrc in the home directory.
On *nix, the home directory can be accessed at ~.
On Windows, you can use the %HOMEPATH% environment variable. (Normally, "C:\Users\<User Name>" or "C:\Documents and Settings\<User Name>", depending on your Windows version.)
If you rename your .vimrc to _ideavimrc in your ~ directory (/Users/ in windows)
Underscore is used instead of the . in windows for vim apparently
IntelliJ will honour it
Was tearing my hair out for a while getting this to work.
On my mac i simply ran ln -s "$HOME/.vimrc" "$HOME/.ideavimrc" to create a symlink so IntelliJ would use the same .vimrc as my standard vim.
My .vimrc is very simple. However, if there is config that is incompatible between IntelliJ and vim then you might have issues with this approach.
echo %homepath%
gives me my "home directory" on Windows XP,
where I need to put my .vimrc.
Unfortunately, the vim plugin for JetBrains doesn't effectively support the full functionality of a .vimrc. The file that the plugin uses is called .ideavimrc. This is what you should use and it should be placed in your home directory (see this other answer for details, particularly for Windows).
I have a very comprehensive .vimrc that I use. Unfortunately, I had to pare that down quite a bit to work as .ideavimrc. You can look at the gists to see the differences. For what it's worth, it's still provides nice functionality, including buffer switching across tabs and splits.
.ideavimrc
.vimrc
So why not just use the same file (i.e., .vimrc) for both? Well, for one thing, you need some settings in .ideavimrc that give precedence to the vim plugin for certain keyboard shortcuts that conflict with the IDE. See the top of my .ideavimrc for my settings (for example, sethandler <C-B> a:vim). The other thing is that it seemed that when my more complicated .vimrc couldn't be processed, other settings (such as just set noerrorbells) also wouldn't take effect.