How do I configure fpp (Facebook Path Picker) to open new tabs in macvim using a vimer alias? - tabs

I believe that I need to set the $FPP_EDITOR environment variable to be able to change the default editor that fpp would invoke when opening files.
I have aliased mvim to vimer -t with alias mvim="vimer -t". This means that the mvim command should open new files in the currently available (operating system level) macvim window, and even if a sequence of files is included, it should open them in new tabs in that (operating system level) window. So if I already have an instance of macvim running and I try to pass in 4 files, I now have one window with 5 tabs in it.
But when I try to use mvim as the editor (with export FPP_EDITOR="mvim"), it opens the files in new macvim (operating system level) window, in separate (vim buffer level) windows in a single tab. So if I already have an instance of macvim running and I try to pass in 4 files, I now have two macvim "instances" running in separate OS-level windows, one with 1 tab with 1 buffer-level window, and one with 1 tab with 4 buffer-level windows.
It seems like FPP must be doing more than just passing in files in a sequence as a suffix to the $FPP_EDITOR command. I'm not sure what that is, nor exactly how to figure it out.

This is an answer to the question (technically) that I figured out as I was writing out the question.
But, it's missing all the right extra info about what was going wrong, so I'm going to this as an answer, but will happily accept another answer that can do more than just answer the question per se, but can give some background info about why the aliasing only sorta works.
The key though (if you just want a solution) is to use
export FPP_EDITOR="vimer -t"
and this performs as desired. For some reason it does not seem that setting the environment variable to a command that is aliased uses the aliased command, if it has an available original meaning (which mvim does).

Related

How to set silent_functions(1) as default in Octave? [duplicate]

I'm new to octave, and want to run a few commands on startup automatically every time it opens.
I typed "help startup" and saw "Octave uses the file ".octaverc". I did a bit of searching online at https://www.math.utah.edu/docs/info/octave_4.html, and saw the .octaverc file should be in the following path:
OCTAVE_HOME/lib/octave/VERSION/startup/octaverc
PROBLEM:
In that directory I don't have a startup folder, only "oct" and "site". I do see hidden files, which was my first thought since the file begins with "." character. So I then used Agent Ransack in the directory, and still nothing came up.
QUESTION:
1) Do I have to make the startup folder and octaverc file myself?
2) If so, does one, both or none have to be hidden?
3) Can it be a txt file, or does it have a special extension?
4) Do I just type the commands straight into the file or is there special formatting?
NOTE:
In case I'm going about this the wrong way, there are the operations I'd like to have run on startup:
PS1('>> '), addpath('D:\Users\Me\Desktop'), clc
Thanks ahead of time for the help!!
Possible locations (and their differences) for octaverc files are specified in the documentation.
In short, these are, from more general to specific:
octave-home/share/octave/site/m/startup/octaverc (most generic, for entire system)
octave-home/share/octave/version/m/startup/octaverc (to cover for more than one octave versions installed on the system, possibly requiring different startup scripts)
~/.octaverc (where ~ is unix-speak for a user's home directory -- covering for user-specific startup files)
.octaverc files in any directory, creating specific startup conditions for specific directories
octaverc files are effectively simple script files that are executed from most generic to most specific each time octave starts. Therefore, in the presence of conflicting commands, the more specific file can effectively be used to override the more generic behaviour.
Octave also supports (but does not recommend) the use of the startup.m file, for matlab compatibility.
You might also want to check out pathdef and savepath as well.
As a more general tip, if you ever want to search for a specific keyword from the documentation (e.g. octaverc), you can type this kind of search query in duckduckgo (or google):
octaverc site:https://octave.org/doc/interpreter/
(or just download the documentation as pdf and search the pdf)
Found the solution, the file was in the following path:
OCTAVE_HOME/share/octave/site/m/startup
to find out where OCTAVE_HOME is for you, just type "OCTAVE_HOME" into your Octave command line window.
ANSWERS:
1) You do not have to make a startup octaverc file yourself
2) The file is actually not hidden, so it should be easy to find given you're looking in the right place.
3) The file doesn't have an extension. It's just octaverc.
4) Under the last line of the existing file, you can just append commands as you would type them at the Octave command line window.
the last(7.3.0) octave version placed HERE:/ does not find the THERE:/openEMS/matlab directory even it is already loaded with octaverc or addpath. It keeps looking into the work dir where openEMS is not placed and does not recognize, for instance, the 'physical_constants.m' file.

Keyboard short for uploading two files in PhpStorm

The problem
In PhpStorm I have a style.css- and a app.js-file that I have to upload to a server over and over again. I'm trying to automate it.
They're compiled by Webpack, so they are generated/compiled. Which means that I can't simply use the 'Tools' >> 'Deployment' >> 'Upload to...' (since that file isn't and won't every be open).
What I currently do
At the moment, every time I want to see the changed I've done, then I do this (for each file):
Navigate to the files in the file-tree (using the mouse)
Select it
The I've set up a shortcut for Main menu >> Tools >> Deployment >> Upload to..., where-after I select the server I want to upload to.
I do this approximately 100+ times per day.
The ideal solution
The ideal solution would be, that if I pressed a shortcut like CMD + Option + Shift + G
That it then uploaded a selection of files (a scope?) to a predefined remote server.
Solution attempts
Open and upload.
Changing to those files (using CMD + p) and then uploading them (once they're open). But the files are generated, which means that it takes PhpStorm a couple of seconds to render the content (which is necessary before I can do anything with the file) - so that's not faster.
Macro.
Recording a macro, uploading the two files, looking like this:
If I go to the menu and trigger the Macro, then it works. So far so good.
But if I assign a shortcut key and trigger that shortcut while in a file, then it shows me this:
And if I press '1' (for it to upload to number 1 on the list), then it uploads the file that I'm currently in(!?), and not the two files from my macro.
I've tried several different shortcuts (to rule out some kind of keyboard-shortcut-clash):
CMD + Option + CTRL + 0
CMD + Shift 0
CMD + ;
... Same result.
And the PhpStorm Macro's doesn't seem to give me that many options anyways.
Keyboard Maestro.
I've tried doing it using Keyboard Maestro.
But I can't get it setup right. Because if it can't find the folders (if they're off-screen or if I'm in a different project and forgot to adjust they shortcuts), then it blasts through the rest of the recorded actions, resulting in chaos. Ideally it should stop, if it can't find the file on the screen.
Update1 - External program
Even if it's not possible to do in PhpStorm, - are there then another program that I could achieve this with?
Update2 - Automatic Deployment in PhpStorm
I've previously used this, - but I've had happen a few times that I started sync'ing waaaay to many files, overwriting critical core files. It seems smart, but can possibly tear down walls if I've forgotten to define an ignore properly.
I wish there was an 'Automatic Deployment for theses files'-function.
Update3 - File Watchers
I looked into file-watchers ( recommendation from #LazyOne ). Based on this forum thread, then file watchers cannot be used to upload files.
It is possible to accomplish it using external program scp (Secure Copy Protocol):
Steps:
1. Create a Scope (for compiled files app.js and style.css)
2. Create a Custom File Watcher with scp over that Scope
Start with Scope:
Create a Local Scope with name scp files for your compiled files directory (I will assume that your webpack compiles into dist directory):
Then, to add dist directory into Scope, select that folder and click on Include Recursively. Apply and Move to File Watchers
Create a custom template for File Watcher:
Choose a Name
Choose File type as Any
Choose Scope as scp files(created earlier)
Choose Program as scp
Choose Arguments as $FileName$ REMOTE_USER#REMOTE_HOST:/REMOTE_DIR_PATH/$FileName$
Choose Working directory as $FileDir$
That's it, basically what we have done is every time when a file in that scope changes, that file is copied with scp to the remote server to the corresponding path.
Voila. Apply Everything and recompile your project and you will see that everything is uploaded to the server.
(I assumed that you have already set up your ssh client; Generated public/private keys; Added a public key in your remote server; And, know ssh credentials to connect to your remote server)
I figured this out myself. I posted the answer here.
The two questions are kind of similar but not identical.
This way I found is also not the best, since it stores the server password in clean text. So I'll leave the question open, in case someone can come up with a better way to achieve this.

Files not under caret on new computer

I opened my project on another computer, and the files where I'd been using a file watcher were expanded, like before they used to be nested like home.scss is now after I run the watcher once on that file.
Is there a way to automatically make all the files be nested?
Because when adding new files and folder with git, it would be quite troublesome to go into each and every file in order to make them become nested.
Like I have some minified JavaScript files that used to be nested, but now is expanded for some reason.
Hope you understand. Thank you.
Edit: Nested***
Is there a way to automatically make all the files go under a caret like that?
Unfortunately not. Such nesting information (to "go under a caret" as you are saying) is taken from "Output path to refresh" field of the corresponding File Watcher.
You have to run file watcher for such files at least once in order to see files nested like you have it on your another computer.
Here is how you can run File Watchers manually without the need to modify those files (so no extra history will appear in your git (or whatever VCS you may be using there)).
https://stackoverflow.com/a/20012655/783119
P.S.
In PhpStorm 2016.3 (the next version that will be released in 1.5-2 months or so) such nesting will be done automatically (the most common combinations) so there will be no need to have File Watchers for providing such info.
If you wish -- you can try EAP build right now (EAP means Early Access Program .. which is sort of Alpha/Beta builds (simply speaking).. and therefore some bugs for new functionality might be present and performance may not be optimal).

Is it possible to change an .accde file icon to a custom image?

I am trying to make my Access (2013) application look less like Access and more like a "real" piece of software. One of the things I am trying to accomplish is changing the icon from the normal A/grid/lock to an image of my choosing.
Is this possible? If not really, what is my next best option?
Thanks!
You can change the icon that Access shows when running your database, it's under Options -> Current database.
You cannot change the icon that Explorer shows for your .accde file.
Of course you can create a shortcut with the commandline to MSACCESS.EXE and your database, and that shortcut can have a custom icon.
You may also be interested in this answer by Albert D. Kallal: https://stackoverflow.com/a/24638829/3820271
I just developed this method yesterday to allow an Access Executable to have a custom icon. It does involve making some additions to your computer's registry. Be aware I did this for Access 2010 on a Windows 7 machine. I have not tested this for windows 8 or 10, but I do think it will be the same.
I know the entries of .14 ONLY refer to Access 2010. Access 2013 should be .15 and Access 2016 should be .16.
When you export your "accde" registry entries to a .reg file, stick with the .14, .15, or .16 that is exported for your specific system. The only thing you will be changing is any occurrence of "accde" to "accxx" with the "xx" being your new letters for your chosen suffix for the Access executable database.
Below is the .reg file that will perform the registry "fixes" and I have included a few notes along the way. This is not for the beginner, but I do believe a seasoned Access developer should be able to follow. Are you a little uncomfortable with the registry? Use Google to help you find a write-up or two about the registry and how to make changes to the registry.
OK, the .reg file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.accVR]
"Content Type"="application/msaccess.exec"
#="Access.ACCVRFile.14"
[HKEY_CLASSES_ROOT\.accVR\Access.ACCVRFile.14]
[HKEY_CLASSES_ROOT\.accVR\Access.ACCVRFile.14\ShellNew]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
FileExts\.accVR]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
FileExts\.accVR\OpenWithList]
"a"="MSACCESS.EXE"
"MRUList"="a"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
FileExts\.accVR\OpenWithProgids]
"Access.accVRFile.14"=hex(0):
[HKEY_CLASSES_ROOT\Access.ACCVRFile.14]
#="Microsoft Access ACCVR Database"
[HKEY_CLASSES_ROOT\Access.ACCVRFile.14\CLSID]
#="{73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}"
[HKEY_CLASSES_ROOT\Access.ACCVRFile.14\DefaultIcon]
#="C:\\_Work\\VR\\VR Logo.ico"
[HKEY_CLASSES_ROOT\Access.ACCVRFile.14\shell]
[HKEY_CLASSES_ROOT\Access.ACCVRFile.14\shell\Open]
[HKEY_CLASSES_ROOT\Access.ACCVRFile.14\shell\Open\command]
#="\"C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSACCESS.EXE\" /NOSTARTUP \"%1\" %2 %3 %4 %5 %6 %7 %8 %9"
"command"=hex (7):79,00,6b,00,47,00,5e,00,56,00,35,00,21,00,21,00,21,00,21,00,\
21,00,21,00,21,00,21,00,21,00,4d,00,4b,00,4b,00,53,00,6b,00,41,00,43,00,43,\
00,45,00,53,00,53,00,46,00,69,00,6c,00,65,00,73,00,3e,00,32,00,41,00,5a,00,\
7e,00,60,00,4f,00,37,00,71,00,43,00,3f,00,4f,00,57,00,2c,00,66,00,65,00,5a,\
00,79,00,63,00,78,00,68,00,20,00,2f,00,4e,00,4f,00,53,00,54,00,41,00,52,00,\
54,00,55,00,50,00,20,00,22,00,25,00,31,00,22,00,20,00,25,00,32,00,20,00,25,\
00,33,00,20,00,25,00,34,00,20,00,25,00,35,00,20,00,25,00,36,00,20,00,25,00,\
37,00,20,00,25,00,38,00,20,00,25,00,39,00,00,00,00,00
From top line down:
Any .reg file has to start with the correct name of the regedit.exe you will be dealing with. In this case I am dealing with Windows 7, therefore version 5.00.
The rest of the code in this file came straight out of the registry.
Within [HKEY_CLASSES_ROOT] I scrolled down to the entry ".accde"
Right click on this and select the "Export" option from the drop down menu.
Provide the folder and file name to export to.
Now you need to do the same within [HKEY_CURRENT_USER]. Here you will need to:
Scroll to Software, then Microsoft, then Windows, then CurrentVersion, then Explorer, then FileExts, and finally .accde.
Right click, select Export, etc.
And lastly, within the [HKEY_CLASSES_ROOT] scroll to "Access.ACCDEFile.14"
Right click on this and select the "Export" option, provide the saving info and save the file.
Put these three files together, leaving out the Windows Registry Editor Version line from the second and third files.
What I did from here was to create my own suffix rather than use the Microsoft .accde. I used the initials of the company this software is being written for. In this example, I will just use my own initials, VR. Keeping the ".acc" and just changing the "de" to whatever I will be using for the new suffix in order to use my custom icon.
You do not need to stay with only two characters.
In this new .reg file, carefully work your way through the file changing the "de" (or "DE") within any accordance of "accde" (or "ACCDE") you find.
For example, one of the places you will find "ACCDE" is in the string "[HKEY_CLASSES_ROOT\Access.ACCDEFile.14" Change the "DE" to "VR" (for this example) giving you the new string "[HKEY_CLASSES_ROOT\Access.ACCVRFile.14"
When you are finished, I suggest you search for the string "accde" within the file to be sure you have changed them all to the new suffix you are going to use.
Before using this .reg file to update your registry, BACKUP YOUR REGISTRY!!!

PhpStorm and workspace issue

I have the newest version of PhpStorm.
Previously I worked with Eclipse and had the opportunity to see my whole workspace. In PhpStorm I need to open one instance per project.
In my daily workflow I need to search for strings in my workspace. In
PhpStorm I would need to switch from instance to instance and need to execute the string search again and again per instance.
Is there another solution or do I really need to execute my search multiple times?
In addition eclipse had the "Open Resource" function for the whole workspace. Does PhpStorm offers the Open Resource for whole workspace too?
In PhpStorm I need to open one instance per project.
That's correct -- currently having more than one project in one frame is not supported.
https://youtrack.jetbrains.com/issue/WI-15187 -- watch this ticket (star/vote/comment) to get notified on progress.
Is there another solution or do I really need to execute my search multiple times?
You can always attach any folder (from any project) to current project as Additional Content Root (will be listed as separate branch in Project View panel).
Settings (Preferences on Mac) | Project | Directories --> "Add Content Root" button.
Note that it will still be treated as one project (no separate settings) -- additional content root is treated as just a bunch of files/folders.
In addition eclipse had the "Open Resource" function for the whole workspace. Does PhpStorm offers the Open Resource for whole workspace too?
Look for commands under Navigate menu.
Navigate | File... Ctrl + Shift + N (using Default keymap) is
most likely what you need.
Useful info:
https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+for+Users+of+Eclipse+PDT+and+Eclipse-based+IDEs
PhpStorm has separate keymap that similar to what Eclipse uses.