I am trying to set my default editor to Brackets in the Terminal. I tried with
export EDITOR="/Applications/Brackets.app"
and when I try to edit a function from the MongoDB Shell it complains that the editor is a directory. I tried giving different paths, but I cannot find the right combination. Please help, I don't want to edit in the Terminal :) :) :)
I'm not on a mac, but I was able to download and examine the contents of the Brackets installer and Brackets.app is indeed a directory. Have you tried
export EDITOR=/Applications/Brackets.app/Contents/MacOS/Brackets
or something similar?
Related
I open files in WebStorm from the terminal with the command webstorm . when I'm working in a directory.
Is there a way to change the command webstorm to anything more, like wstorm or something shorter to open files fluently?
I'm using macOS.
I Know one way but it's temporary, works untill you close the terminal.
-in your terminal
W=webstorm
then you can use $W in your command instead of webstorm.
Looks like the hint above is very good.
So assuming the shell script "webstorm" is working and your question is how to modify the command AND you want to do it fluently.
Make an alias (your shell may vary, mine is bash)
in the appropriate 'dot' file for your shell
add an alias for webstorm -e like this
alias we='webstorm -e'
now when I want to open a file quickly I type
we filename
And this opens Webstorm in LightEdit mode which opens faster and has a link to access full IDE.
Works like a charm. Also, you could make more than one alias so say ws for the full ide. Enjoy
I am trying to edit the "current directory" while I am in my integrated terminal in VS Code.
I am running macOS Sierra 10.12.6. VS Code 1.21.1.
Within the integrated terminal, I was able to change the directory by directly editing the PS1 variable, (aka, PS1='\w \u'), but when I save it, it only saves to that specific instance of VS Code. If I open up a new VS Code window, it reverts back to the original PS1 variable.
I checked other Stack Overflow questions and answers, and people tend to advise editing the .bash_profile or another .bash file found in the root. I was not able to find this file in my root, or any other file that helped.
Does anybody know where I can directly edit the PS1 variable, or where VS Code loads the bash profile?
Also, please note I am not trying to edit my actual Terminal settings, only the one that is loaded for VS Code.
Thank you.
I went to my ~/etc directory, edited the .bashrc file via sudo nano .bashrc, and edited the PS1 variable in there.
That .bashrc file was being referenced for both my MacOS Terminal, and the integrated terminal for VS Code. So changing anything in there affected both of those terminals. I hope this information helps!
I just wondering if is there a command in vim that shows you the folder where it's installed? I want something to useful for windows.
Thanks in advance.
$VIMRUNTIME points to a directory where most of the files needed by Vim are kept.
Try in vim :echo $VIMRUNTIME.
Thanks #romainl $VIM variable more to the point.
In Windows Explorer I can navigate to "\\servername\shared_directory". Is there any way I can navigate to the same directory using VIM and NERDTree?
Example:
:NERDTree \\servername\shared_drirectory
I think you might want to report this behavior to the NERDTree developer. I tried it myself and no, it does not work.
You could try pulling the current NERDTree from https://github.com/scrooloose/nerdtree or writing the developer.
I don't use NERDTree, but both :browse e \\servername\shared_directory and :e \\servername\shared_directory\filename.txt work fine for me in gvim.
Playing with this a bit more, I see that the forward-slash syntax seems to even work with tab-completion (after I get the server and initial directory right, of course).
If NERDTree doesn't want to work with either //servername/directory or \\servername\directory, you might want to try executing a :lcd //servername/directory first, followed by :NERDTree ..
This issue was fixed in this branch : https://github.com/actionshrimp/nerdtree .
Download nerdtree from https://github.com/actionshrimp/nerdtree/downloads
I want cscope to open files in MacVim instead of vim, so I'm trying to have the path to MacVim as the Value of the EDITOR environment variable which is used by cscope:
$ export EDITOR=/Applications/MacVim.app/Contents/MacOS/MacVim
If I'm now trying to edit a file from within ctags, it won't work and throws this error message:
$ MacVim[8384:10b] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
Calling MacVim from the commandline with
$ /Applications/MacVim.app/Contents/MacOS/MacVim
works, though.
How can I fix this?
Make sure you put the mvim script in your path, and try this out:
export EDITOR="mvim -f"
This was the ticket for me when using MacVim as editing git commit messages.
Have you tried export EDITOR=/Applications/MacVim.app?
Or wrapping MacVim in a small script that uses open to start the app?
It works fine for me when I set my EXPORT variable to exactly that, and start a git commit. What are you using that's calling it? Have you considered setting EXPORT to point to the mvim script that comes on the MacVim disk image instead?
<plug>
My launch tool is designed for this. It's like Apple's open, but allows you to get the path to an application bundle rather than launching it. For example:
% launch -ni com.apple.safari
/Applications/Safari.app
launch is in Fink and MacPorts too.
</plug>