Auto completion in JetBrains consoles - console

I'm using WebStorm and PhpStorm and I have the same problem for both:
I don't have auto-completion using the console.
For example here I have a folder with a name starting with rn and when I want to auto-complete with tab it make a tab :/

I found a solution. I decided to use an another shell : bash
in Tool > Terminal > shell path

Related

How can I use oh-my-zsh with PHPStorm?

I just got oh-my-zsh (a very good command line utility) and would like to utilize this within the PHPStorm terminal. How can I accomplish this?
As oh-my-zsh is more of an extended zsh-configuration, it should be sufficient to just tell PHPStorm to use zsh as Shell. This can be done in the Settings dialog (Menu File->Settings) under section Project Settings->Terminal. Just change Shell Path to the path of zsh (can be found out with type zsh in a terminal).
To affect every (new) project you may have to repeat this in File->Default Settigs
For once and all setup:
Set it in Preferences->Tools->Terminal and Shell Path = /bin/zsh
restart your PhpStorm and thats it.

What command-line to use in Symfony2 framework in windows

I'm creating a website using Symfony2 framework but I can't get proceed to the creation of the website because I don't know where to type like these
$ php symfony configure:database "mysql:host=localhost;dbname=jobeet" root mYsEcret,
$ php symfony doctrine:build-schema.
It seems an Linux command and it doesn't work on windows command-prompt.
What commandLine should I used for this ?
You need to add your PHP installation directory to the %PATH% environment variable, or work from the PHP installation directory.
To add it to path (The best approach - Edited for Windows 7):
Right-click on a My Computer icon
Click Properties
Click Advanced system settings from the left nav
Click Advanced tab
Click Environment Variables button
In the System Variables section, select Path (case-insensitive) and click Edit button
Add a semi-colon (;) to the end of the string, then add the full file system path of your PHP installation (e.g. C:\Program Files\PHP)
Keep clicking OK etc until all dialog boxes have disappeared
Close your command prompt and open it again
Sorted
Alternatively, you can run cd <PHP installation path> before you try and run you command, or call your script like <FULL file system path of php.exe> <path to script>
Then you open the CMD and you write the Symfony commands
I would suggest you to use Easyphp, it has phpreg.exe (or something like that) that will put php in %PATH% variable. It also allows you to create virtual hosts from browser, and easyphp will take care of everything else.
Instead of Sublime, use Phpstorm. It has by far the best Symfony2 plugin of all editors. If you are still learning S2, you will definatelly need autocompletion for forms, services, doctrine... Just amazing!

oh-my-zsh config file not loading

I am trying to get ZSH config working correctly on Mac OSX. I installed it using curl: curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh. Then I modified my zshrc file to fit my needs. It works only after I run source ~/.zshrc. But then if I come back and open a new tab or new terminal I have to do source ~/.zshrc to get the config settings to work again. Has anybody ran into this issue? I believe there is a way to make it so I don't have to do source ~/.zshrc with every new tab.
I figured this out. It was due to my config file. The part of the zsh config that wasn't loading needed to be moved down after the plugins load. After moving that it all worked as expected.
If you have themes like Powerlevel9k installed for your zsh shell then source the oh-my-zsh config file after the theme variable assignments in your .zshrc file like shown below.
Eg:
........
........
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=('status' 'load' 'ram_joined' 'time')
# source oh-my-zsh config
source $ZSH/oh-my-zsh.sh
Not the ideal solution but solves the issue:
Terminal -> Preferences -> Profiles -> Shells -> Startup
Check the box that says "Run command" and in the input box run
source ~/.zsh/.zshrc
This will be executed when you open a new terminal window / tab.
My final solution was to go to Terminal --> Preferences --> General --> Shells open with --> Command (complete path), and set it to /bin/zsh (or your path to zsh), and then set both New windows/tabs open with to "Same profile". It works fine for me.
My initial attempt was to go to Terminal --> Preferences --> Profiles, and in my default profile's "shell" tab's Startup section, I set it to run command "source ~/.zshrc". This also solved the problem of /.zshrc not loading, but it seemed tedious to see that command show on every terminal tab/window.
I had a similar problem. I found that I had long ago changed my Terminal preferences to run tcsh instead of the default login shell. Took me forever to figure this out!

How to use XULRunner to run SQLite Manager outside of Firefox in Mac OS X Lion?

I have installed XULRunner 11.0 (xr) from here:
Downloads - sqlite-manager - Extension for Firefox and other apps to manage any sqlite database - Google Project Hosting
I have followed the steps listed here:
kiveo - Mac SQLite Manager Standalone App
I have read and tried the suggestions here (though they're for version 6.0):
stackoverflow: How to Install and run a XulRunner Application on Mac OS X?
I am able to get the help listing with this command:
/Library/Frameworks/XUL.framework/xulrunner-bin -h
I am able to run the app from Firefox using this command (after changing the max version in sqlitemanager-xr-0/application.ini to 11.0 from 11.0a1):
/Applications/Firefox.app/Contents/MacOS/firefox --app ~/Downloads/sqlitemanager-xr-0/application.ini
Here are the contents of the application.ini file:
[App]
Name=sqlite-manager
ID=SQLiteManager#mrinalkant.blogspot.com
Version=0.7.7
BuildID=201111132204
Vendor=lazierthanthou
Copyright=Copyright (c) 2008 - 2011 lazierthanthou
[Gecko]
MinVersion=2.0
MaxVersion=11.0
[XRE]
EnableExtensionManager=1
When I run the following command in Terminal, with or without sudo, it just immediately returns to the command prompt. There are no error messages. No application appears under Applications. Nothing seems to happen at all. (And, despite the stackoverflow page above noting that --install-app may not really be supported, it is in the XULRunner help listing - which I guess doesn't necessarily mean it'll work ;)
/Library/Frameworks/XUL.framework/xulrunner-bin --install-app Downloads/sqlitemanager-xr-0/ /Applications
Following a suggestion below, I checked for an exit code. The line above is returning 2.
Help?
Just like you did with Firefox, this command should run your app:
/Library/Frameworks/XUL.framework/xulrunner-bin --app ~/Downloads/sqlitemanager-xr-0/application.ini
Also, the --app switch is optional within XULRunner.
Here's how you can make a self-contained application you can run from the Dock.
Use the xulrunner --install-app command to create the application and then copy all contents of XUL.framework/Versions/Current into the generated application at /Applications/sqlite-manager.app/Contents/MacOS.
You can then create a wrapper script that runs the xulrunner within the generated app with the application.ini file as described here.
For example, put the following into sqlite-manager.app/Contents/MacOS/sqlite-manager and make it executable.
#!/usr/bin/env bash
APP_PATH="/Applications/sqlite-manager.app"
"$APP_PATH/Contents/MacOS/xulrunner" --app "$APP_PATH/Contents/Resources/application.ini"
Now you have to tell OS X to run sqlite-manager instead of xulrunner. You can do that by editing sqlite-manager.app/Contents/info.plist and setting CFBundleExecutable to sqlite-manager like this:
<key>CFBundleExecutable</key>
<string>sqlite-manager</string>
The only limitation of this approach is that it breaks when you move the application or rename it. I'd love suggestions on how to get rid of the absolute path within the sqlite-manager script.
try this:
firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
or on OS X
/Applications/Firefox.app/Contents/MacOS/firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
(found on http://www.egeek.me/2013/09/07/how-to-run-sqlite-manager-with-a-single-command/)
works fine for me on UBUNTU 12.04 to start sqlite manager without starting firefox first
If the install was successful, I think the app should be available in some usual place for your system (which wasn't mentioned, but I'm guessing OSX :). Have you looked under /Applications?
To see whether the command failed quietly, you could check its return value. Is there a verbose switch?
$ cd narnia
bash: cd: narnia: No such file or directory
$ echo $?
1
$ cd .
$ echo $?
0
$ cd narnia && echo "success"
bash: cd: narnia: No such file or directory
$ cd . && echo "success"
success

Disable saving history

Is it possible to disable saving command history / session in R by default ? I really hate those .RData and .RHistory files !!
If you're using RStudio, you can simply disable in settings.
Go to Tools -> Global options -> General and un-tick always save history.
Just start up R with --no-save. See R --help.
Add this to your shortcuts (in Windows for example this is under "Target" when you right-click on the shortcut and choose properties).
If you are using an R gui, an alternative and quite nice approach, due to Brian Ripley, (see here), is to put the following lines in your 'R_HOME/etc/Rprofile.site' file:
q <- function (save = "no", status = 0, runLast = TRUE)
.Internal(quit(save, status, runLast))
One note of caution: this won't work when you invoke R from the command-line. In that case, just use the --no-save argument described in #mdsumner answer.
To learn more about 'Rprofile.site', and '.Rprofile' (an optional per-directory config file), see the always useful ?Startup help file.
Even more flexible (Windows), add R and RStudio to your right-click menu so you can start in any directory
R-Gui: save the following in a file rguihere.reg, and double-click
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\RGui]
#="R Gui here"
[HKEY_CLASSES_ROOT\Folder\shell\RGui\command]
#="cmd.exe /c \"pushd %L &&start rgui --no-restore --no-save\""
RStudio
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\RStudio]
#="RStudio here"
[HKEY_CLASSES_ROOT\Folder\shell\RStudio\command]
#="cmd.exe /c \"pushd %L &&start C:\\PROGRA~1\\RStudio\\bin\\rstudio.exe\""

Resources