NERDTree does not open in the directory from which macvim was opened - macvim

I upgraded my macvim to 7.3 recently and I can no longer open nerdtree or netw in the directory in which macvim was opened, it always opens in my home directory.
For example,
If I open macvim in /users/me/test/project dir, I want the NERDTree root to be /Users/me/test/project and not /Users/me.
Any ideas?

You could map the key you use to open NERDTree like this(in .vimrc):
map <silent> <F1> :NERDTreeToggle %:p:h<CR>
This maps my F1 key to toggle(open/close) NERDTree using the path of the currently active buffer. If no buffer is open, it opens in the currently launched Macvim directory.

I had this problem after upgrading janus. simply adding this to my .gvimrc fixed it:
set autochdir
This will set the working directory to the current file.
More info here:
http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file

I did this
(all changes in .vimrc)
Enabled NERDTree as default.
autocmd VimEnter * NERDTree
Put this script I got from github in .vimrc. This will make vim AND NERDTree buffer quit with :q
Say, your project folder is /home/user/my-project, then do this:
mvim /home/user/my-project/README
You wil get the parent folder in the NERDTree with the files in it.

This problem (if it is the one I think it is) was fixed in Snapshot 55, so a simple update should fix it.

Related

How to open a project in PhpStorm from command line on Windows

How to open a project in PhpStorm from command line on Windows?
I tired this:
How to open a directory in PHPStorm or IntelliJ (or any JetBrains IDE) from the command line? but can't find Tools -> Create command line launcher on Windows.
I am using latest PhpStorm.
To open the current directory just run:
phpstorm64 .
If you are using git bash on Windows run:
cmd "/C phpstorm64 ."
Make sure that C:\Program Files\JetBrains\PhpStorm 2018.3.3\bin is in your environment variable PATH (it is by default after the installation)
Edit 2021:
Install Jetbrains Toolbox
Go to settings
Enable "Shell Scripts" and follow the instructions
Now you can use "phpstorm ." to open the current directory.
On macOS ( I assume on windows too) there is option to "Create Command-line Launcher". Just click that and you are good to go next time you open a terminal.
You can even specify how you would like to start "pstorm" / "phpstorm" / "ps" etc.. up to you.
Command-line launcher is currently only available fo UNIX; there is a feature request for providing it on Windows, IDEA-114307, please feel free to vote for it.
If you like to start PhpStorm from command prompt, open cmd console, cd to %PS_install_dir%/bin and run either phpstorm64.exe or phpstorm.bat, passing a path to project folder to it, like it's described in https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html. If you like to start it from any directory, add %PS_install_dir%/bin to your system %PATH%
I know this is too late, but it will help others if they need it:
if you want to open phpStorm in the current directory via cmd/Powershell, just use this command:
phpstorm64.exe .
Or if you want to open it in another directory, just use:
phpstorm64.exe YOUR_DIRECTORY_PATH
as simple as that!
go to your project using terminal
Cd myproject
and write
phpstorm64.exe
then hit enter
I see this is a little old but I wanted to supply my answer as I was grappling with this yesterday. My solution was to use cygwin.
Track down the phpstorm bin folder called something like C:\Users\UserName\AppData\Local\JetBrains\Toolbox\apps\PhpStorm\ch-0\201.7223.96\bin and add it to your windows system Path environment variable.
Next fire up a cygwin terminal and navigate into your project directory. I'm not a bash expert so I struggled to sort out the code as an alias but if you run:
crntproj=$(cygpath -w $PWD)
phpstorm.bat $crntproj
You need cygpath because simply running phpstorm.bat $PWD doesn't work as PHPStorm tries to open a folder called $PWD. I tried a bunch of variations trying to get it to open and none seemed to work.
It will fire up phpstorm with the current folder as the project path. And you now have a terminal feed from your project too.

PhpStorm dirs are not showing on tree

I will re-upload my project on my local. But I cannot see my dirs on tree like:
But the other projects allow seen dirs:
I checked my views, tools any settings and return to default settings. But its not showing ?
From the first screenshot it looks like the whole D: drive was used as a project root.
In PhpStorm do File > Close Project, then go to D: and delete .idea folder, then go to PhpStorm, press Open and select D:\UserData\Home\b****lu-app directory, then press OK.

Recover deleted file from PhpStorm and SourceTree

I have an open project in PhpStorm that I manage using SourceTree. I was trying to remove some image files from a commit using SourceTree, but accidentally selected a file that should not be deleted. I haven't changed anything (in either PhpStorm or SourceTree) since deleting the file. I tried to do Ctrl+Z in SourceTree but nothing happened. I then checked in PhpStorm Vcs -> local history, but it didn't show the file. How can I recover this file?
Try to right click on project main folder in phpStorm and select Local history / Show History in context menu (not vcs / local history). The file should be at the list as "Deleting".
This is documented by JetBrains here
TL;DR

prevent watir-webdriver running chrome as a first run

Everytime I use watir-webdriver to initialise a chrome browser instance, it launches as a first-run with an EULA pop-up and an additional getting-started tab open.
Both of these side-effects are preventing me from automating tests for chrome.
I have tried initialising a browser using just
Selenium::WebDriver.for :chrome, :switches => %w[--no-first-run]
but have the same result.
I am surprised to be unable find any other questions online about this, so assume I have done something weird!
I have placed chromedriver.exe in C:\Program Files (x86)\Google\Chrome\Application which is on my PATH variable.
Any ideas?
I have found a solution for this. In C:\Program Files (x86)\Google\Chrome\Application there is a file called master_preferences.
Opening this file and setting:
require_eula to false
show_welcome_page to false
fixed both issues for me.
Hopefully this helps someone!
I would put the chromedriver.exe on your PATH, so somewhere like C:/windows/system32 or the like, or you could add the directory
C:\Program Files (x86)\Google\Chrome\Application
to your PATH (right click My Computer -> Advanced -> Environment Variables)
It should then run OK.

Windows: How to open a .exe in a shell window that won't close?

I've had this problem for ages, and it's SO ANNOYING.
Suppose I want to run mysqldump.exe... here's my process: Start->run, type "cmd" ... dir into directory after directory until I finally get to c:/program files/mysql/bin/then I can FINALLY call "mysqldump.exe"
I don't mind using Windows Explorer to get to c:/program files/mysql/bin, but then I can't freaking open up any of the .exe files in a shell, and I can't open up shell with the directory being that one.
How can I do this?
This is what I do for those type of commands:
Drag a copy of the "Command Prompt" shortcut onto your desktop.
Open the properties of the shortcut.
Change the Target: field to: %SystemRoot%\system32\cmd.exe /k mysqldump.exe
Change the Start in: field to: c:/program files/mysql/bin/
Hit Ok, then rename the short cut from "Command Prompt" to "Mysqldump".
Then just double click the icon whenever you need that command. The "/k" option for cmd.exe leaves the window open.
Microsoft released a powertoy for Windows XP called Open Command Prompt Here. If you're using Vista, all you need to do is hold shift and right-click.
here's my process: Start->run, type
"cmd" ... dir into directory after
directory until I finally get to
c:/program files/mysql/bin/ then I can
FINALLY call "mysqldump.exe"
Why not just the following?
c:
cd "c:/program files/mysql/bin"
mysqldump.exe
Better yet, put this in a batch file and execute it.
You can also create a shortcut for cmd.exe and set the "Start in" directory to "c:/program files/mysql/bin".
You can download an add-in so that you can right click on the folder and open a command prompt. Saves a lot of time and you say you dont mind navigating to the location.
http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe
A nice little trick is that the icon in the adress bar of explorer could be dragged to a command line window and it insert the full path at your current cursor position.
It doesn't work in vista but if you SHIFT-RightClick on a folder you have an "Open Command Windows Here" option that appears.
Under xp you could have it by saving this as a .reg and executing it :
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd]
#="Open Command Prompt Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd\command]
#="cmd.exe /k pushd %L"
Just use the explorer to navigate to the bin or any directory. then enter cmd at the address bar und hit return. the command line with start at this location.
You can do it with python:
If you don't have activepython already, download from ActiveState's Website. Next, run PythonWin and create a new script. Write the following:
from subprocess import *
Call("c://program files//mysql//bin//mysqldump.exe")
Save the script somewhere. When you want to run it, just doubleclick. There are easier ways if you like writing batch files, but Python is more succinct than even windows for this case.
Just put c:/program files/mysql/bin/ into your path...
Then you can run mysqldump.exe directly without even opening a cmd prompt by typing it into " Start > Run "
I was using the MS PowerToy for a while but moved on to the open source Open Command Prompt Shell Extension because of the key feature:
(copied verbatim from the website)
The ability to open a command prompt in the directory that you are currently in by right-clicking on any empty screen space in the directory. This eliminates the need to navigate up a level in order to open a command prompt in the current directory.
Having to actually click on a folder to open the command prompt using the MS tool was a annoyance for me... especially since I always need to run command line tools on my current directory at the time.