Sublime text- defining relative paths in settings? - relative-path

I'm trying to create, on Windows, a fully portable environment that contains git, python with all the packages I want, and, of course, Sublime. Since it's going to be portable, I'd like to be able to point SublimeGit at a relative path to the git directory. I understand that relative paths should start from the Data folder, however ..\\bin\\git.exe fails with a message that Sublime cannot find git. How should I define a relative path in a settings file, then?

Related

What is the default path in .desktop files and how to change?

I am installing a package manually on my own system because I need to make some changes to it that aren't available in the basic version in my package manager. I also am trying to keep packages installed locally if possible, so I'm installing it with prefix=$HOME/.local instead of the more common prefix=/usr/local.
When I do this, I have no problem executing the program from my terminal, because I added ~/.local/bin to my PATH and the package was installed with relative paths to its shared libraries (i.e. ~/.local/lib/<package>). Executing from the command line is no problem, but I want to be able to access it from the favorites menu in gnome, and for that I need to make use of the <package>.desktop file.
I could hard-code the path to the executable in the .desktop file itself, but when I pull a later version down and re-install it, I'll have to redo those steps. I was wondering if there's a way to avoid that.
I've tried symlinking the executable to a directory where .desktop files do have included in their path, and the application is correctly treated as a GUI option, but launching the executable results in an error trying to find a shared library. I think this has to do with how cmake handles rpaths, which to my understanding is a way of relatively linking executables with their required libraries.
I think what I want to do is have PATH inside a .desktop file include ~/.local/bin, without changing the .desktop file itself. Can I alter the 'default' path used in accessing a .desktop file?
The answer to my question was found in the Archwiki:
Specifically, I needed to add ~/.local/bin to my path in ~/.xinitrc. Now my graphical programs work as expected.

CMake search path configuration

we working on a C++/CMake project, that needs to run in both Windows and Linux. On Windows, we have to work with a number Visual Studio versions, both in 32- and 64 bit. In order to alleviate dependency issues in our team, we have manually compiled a number of dependencies for each configuration(vs2013_x64, vs2013_x86, vs2012_x64, vs2013_x86...) and installed them (using make install or similar commands) to a common folder for each configuration. Now we have a folder called "vs2013_x64" for example, that contains similar folders as /usr would on linux: CMake, include, lib, share, ...
Now my question is: How do I have to set up CMake, so that it treats this vs2013_x64 folder just like it does /usr on Linux?
I found a number of variables that seem related, for example
CMAKE_FIND_ROOT_PATH and CMAKE_SYSROOT. However, setting them to my vs2013_x64 folder for example does not work: FindXXX.cmake files in the vs2013_x64/CMake folder are not found, and even when I manually set the CMAKE_MODULE_PATH to that CMake folder, the Find* scripts are unable to find the include they are looking for, because the vs2013_x64/include folder does not appear to be searched.
A solution that did work was to set the CMAKE_PREFIX_PATH. This is nice and almost what I need, but lets say that on Linux, I would not want it to look at /usr at all under any circumstances. This would not be possible using the PREFIX_PATH solution if I understand it correctly.
From what I understood from the documentation,
CMAKE_FIND_ROOT_PATH is more configurable and has a number of additional variables such as CMAKE_FIND_ROOT_PATH_MODE_PROGRAM, CMAKE_FIND_ROOT_PATH_MODE_LIBRARY and CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This makes me believe that FIND_ROOT_PATH is what I actually SHOULD be doing - yet I am unable to make it work
Does what I am trying to do make sense? Can anyone clarify when and how to use what? Ideally, I would like a solution that allows me to set the search path to my vs2013_x64 folder on Windows, that defaults to /usr on Linux, but can optionally also be set to another directory containing lib/include/cmake folders. In addition, it would be nice if searching ONLY occurred in the configured path and nowhere else (to avoid mistakenly picking a library that was installed system-wide).
Thanks!

Is it possible to keep *.erl sources and *.beam output in the same directory with intellij-erlang?

I want to set up my HelloWorld intellij-erlang project with all files in the same directory so I can easily switch between IDEA and emacs/vim.
<my-project>/hello.erl
<my-project>/hello.beam
Now, if I configure the output directory to be the same as the source, hello.erl gets emptied as part of the build and the compilation fails.
I assumed it's something to do with copying resources to the output directory, so I've configured intellij-erlang to exclude *.erl from the resources with a !?*.erl pattern, but this does not have any effect, hello.erl still gets emptied before the compilation takes place.
As an experiment, I've also tried using separate src and out directories, and intellij-erlang always copies the *.erl to out irrespective of the resource patterns.
Based on all this, I would conclude that intellij-erlang cannot work with all files in the same directory. Have I missed anything?
Erlang programs should be build on standard OTP directory structure. Build tools like rebar (used by intellij) or erlang.mk build on this conventions. And so should all IDE's.
Intellij does it, just like you notice. And so does Emacs's plugin (that I use and can confirm). I would guess so does Vim's one.
So if you would like to be able to switch easily between your IDE's you should try to keep to this convetion of keeping you source files in src and compiled files in bin (and headers in include).

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

How to prevent Arduino IDE from moving sketch into new directory?

I have a few sketches I'd like to distribute together. All of them use a custom library which resides in the same folder. The current directory structure is totally flat. All .ino files are in a single folder, right next to the .cpp and .h files for the library. This makes it easy to distribute and update.
This would work perfectly, except that each time I open one of the sketches to upload, the Arduino IDE forces me to move it into a subfolder, then it can't find the custom library. Is there any way to disable this behavior, or can anyone suggest a workaround? Thanks!
I tried at first to do all flat and found it never ending battle. Rather than always working around that, I work with it. My example.
Where I have my local repo in some arbitrary location, then have symbolic links in the ./arduino/library/. directory pointing to them appropriate directories in the repo. In the example I have symbolic links for both SdFat and SFEMP3shield in the ./library/. directory. I use windows so rather than links (or the ln -s command) I use "hard junctions".
Note the libraries use a directory structure of ./ardunio/library/foo/example/bar/bar.ino. So I actually do all my projects in the ./example/bar/bar.ino sketch. Also its worth noting that I use an external editor (like notepad++).
This way my repo can have more or less of what I specify it to.