Setting the Search Path... global setting in MacVim - macos

Noticed an interesting GUI based setting in MacVim, that seems useful but I can't seem to find any official word on what it does exactly.
It is located at Edit Menu > Global Settings > Search Path...
Once there a dialog drops down with the following:
"Enter search path for files"
Separate directory names with a comma.
.,/usr/include,,
From that editable line I get the clue that this appears to be a header search path. Something I would hope works with ctags, etc. But the setting I put in there don't seem to stick between open and closing just MacVim windows with out even quitting the MacVim Application.
Searing Vim help only really turns up new-search-path which I am not sure how to use or set if it is even related?
Is this what I think it is? The header search path. If yes then how do I set the path in my .vimrc or where needed so that the changes to it are persistent.
If this is not a header search path then what does it do?

I think you are right about its purpose, the setting is simply called path: its default value (:set path?) is .,/usr/include,, just as in your question.
You can use it to tell Vim to look for files in specific places.

Related

how to change default settings in .minttyrc programmatically

I want to increase the default font Lucida Console from 9pt to 12pt and adjust the blue color quality. Currently the only way I can find to do it is by right-clicking the Cygwin window and selecting Options & Text and Apply as described in this answer.
I tried to edit .minttyrc to change the font size and color as suggested here. Settings are shown below. But when I relaunch the Cygwin shortcut the default window reappears.
C:\cygwin64\home>cat .minttyrc
FontHeight=12
Blue=127,127,255
BoldBlue=191,191,255
Is there a way to set .minttyrc programmatically ? Surely there is a way to change the default settings without doing this manually every time.
EDIT.
I have Cygwin configured like this ( a screen shot of the window opened by the DOS batch file).
Here is the code suggested by me_and
C:\cygwin64\home\Greg\Work\CMI>cat ~/.minttyrc
cat: '~/.minttyrc': No such file or directory
I can get .bashrc to find .CMI_functions in a sub-directory but I don't know how to get it to find .minttyrc in the same directory
CONCLUSION.
Best results came from editing the Cygwin batch file to relocate all .executable bash files, together with .minttyrc, into C:\cygwin64\home\%USERNAME%.
cd %USERPROFILE%\Desktop\Archive\UTIL
xcopy . C:\cygwin64\home\%USERNAME%\Work\CMI\UTIL /E /I
copy Misc\* C:\cygwin64\home\%USERNAME%\Work\CMI
copy Bash\.* C:\cygwin64\home\%USERNAME%
copy Scripts\*.sh C:\cygwin64\home\%USERNAME%\Work\CMI
The Super User question you've linked to talks about putting the .minttyrc file as ~/.minttyrc, which as a Windows path (at least with default settings) would be something like C:\cygwin64\home\Greg\.minttyrc, but you have it as C:\cygwin64\home\.minttyrc. That's the wrong place, so it's never going to work.
To change the settings for Mintty, you need to have the file in the right location, otherwise it won't be able to load them. Try moving the file to the correct location, and see if that resolves things for you.

How can I change a .py file to .pyw?

I tried to right click the file and rename it, but it won't even show me the extension so that I could delete it. I also tried going to properties and I couldn't do it from there either. I didn't code directly with the Tkinter of python, I used a custom made graphics library that came with my book.
You are on the right lines in that you just need to rename it - unfortunately modern versions of Windows hide the extension by default so you can't readily modify it.
I tend to set Windows to always display extensions (as this fixes this issue computer-wide), but if this is undesirable or not possible you can always use the command prompt:
cd C:\Path\To\File
ren MyPythonScript.py MyPythonScript.pyw
Hope this helps.

How do I add Ruby to the PATH variable on Windows?

I have Ruby installed, but I still need to add it to the PATH variable. I found something online for how to manually add it using the command line:
set PATH=C:\Ruby200-x64\bin;%PATH%
But before I try it, I want to be sure it's not going to overwrite what's currently in the PATH variable. (I have no experience with this stuff so I don't know what to expect).
Thanks in advance for your help!
first, notice that this question is not really about Ruby, rather about how to set a path in windows (it work the same way if you want to add an executable different from Ruby)
second, you are not overwriting the PATH environment variable because you add the existing content of the same to the new one you are setting in:
set PATH=C:\Ruby200-x64\bin;%PATH%
the %PATH% is the current content of the PATH variable.
Consider using
set PATH=%PATH%;C:\Ruby200-x64\bin
instead, this will make your OS search the original path before searching the ruby bin folder. Maybe it makes few difference on modern computers, but my old DOS days claim the second solution is better.
third and last point, in Windows you can set environment variables in control panel / system properties
How to get there depends on the version of your OS, but if you search for the ambient variables and system variables you should get there.
From the Desktop, right-click the very bottom left corner of the screen to get the Task Menu.
From the Task Menu, click System.
Click the Advanced System Settings link in the left column.
In the System Properties window, click on the Advanced tab, then click the Environment Variables button near the bottom of that tab.
In the Environment Variables window (pictured below), highlight the Path variable in the "System variables" section and click the Edit button.
Add or modify the path lines with the paths you want the computer to access. For ruby it will be:
;YOUR_RUBY_INSTALLATION_PATH\bin;
The operation with set PATH=C:\Ruby200-x64\bin;%PATH% is probably only temporary until you restart your computer.
I just wanted to let everyone know that when you install rubyinstaller on Windows and follow its steps, there is no option to 'add to path variables' because it automatically adds it.
Rubyinstaller trolled me hard because it said gem not found when I did gem install sass immediately after install.
Your path variable is probably already set if you used rubyinstaller.
The trick is to open CMD or I would imagine, PowerShell, ConEMU, etc, git bash, and type gem.
Press WINKEY and type cmd
Type gem install sass (or whatever else that is in the bin folder for Ruby)
I just went to add the PATH variable, and it was already set, so my problem was the garbage command line tool that opened after installing rubyinstaller.
You can also do these steps to add to the PATH variables:
Press WINKEY
Type view advanced system settings
Open that
Click Environment Variables
Click Path in the list
Click Edit
Check if C:\Ruby24-x64\bin is already there, if so, done
Click New and type in C:\Ruby24-x64\bin
Done
Yes, this is correct. In your example %PATH% will be expanded to the current value of the PATH variable, so this command is effectively adding a new entry to the beginning of the PATH.
Note that calling set PATH will only affect the current shell. If you want to make this change permanent for all shells, the simplest option is to set it as a user variable using the Environment Variables dialog box.
On Windows 8 you can open this dialog by hitting Win+s and searching for 'environment variables'. On earlier versions of Windows you can right-click 'My Computer', choose Properties, then Advanced system settings, then Environment variables. You can create (or update) a PATH variable in the user variables section and add whatever entries you need. These will be appended to the existing system path. If you take this approach you will need to open a new cmd shell after updating the variables.
Fear nothing, What you are doing is prepend C:\Ruby200-x64\bin to the existing %PATH%, this is what the command you posted does.
The path is a list of directories, separated by ;, in which the system will look for the command you execute.
In your case it's:
C:\Ruby200-x64\bin
%PATH%, if you print it on the command line, you'll find it's itself a list of directories separated by ;.
In case you want to make your change permanent, you have to change your PATH sytemwide.
For CLI, as noted elsewhere calling SET on the path variable only acts on the current window and closing it or restarting windows voids the change.
Example the transient Version selected as the answer:
set "PATH=%PATH%;C:\Ruby200-x64\bin"
To correctly set the path permanently in CLI use the path command:
PATH %PATH%;C:\Ruby200-x64\bin
This will persist between CMD windows and after reboots.
I know this is questions has the Windows tag, however it is one of the first DuckDuckGo results for "ruby gems add to path" so I just wanted to add this.
On Linux you can add this line to the end of your .bashrc in order to add it to your path:
export PATH=$PATH:~/.gem/ruby/2.6.0/bin

Where is ~/.config/MonoDevelop/ for MonoDevelop

I'm using Mac Snow Lepord and can't find "~/.config/MonoDevelop/" for the life of me. I have MonoDevelop (v2.2.2) up and running already, but when I tried to set up a template the IDE started having problems.
Namely, whenever I went to Monodevelop -> preferences-> Code Templates I would get an error saying "Argument cannont be null".
I tried removing MonoDevelop from my Mac and re-installing but that doesn't appear to fix this problem so I thought if I could find the above folder maybe I could remove that. However I am not sure how to find it. I put the address directly into Mac's "finder" search box and no results were returned.
Can anyone help?
Note: You are not going to see your .config directory in your user directory in finder unless you show hidden files. You are going to have to get there via bash in the Terminal.
The tidle ~ would normaly expand to your home directory, e.g. ~/foo.txt is /path/to/your_directory/foo.txt, depending on where 'home' is on any given system.
So, the file you are looking for is /Users/your_username/.config/MonoDevelop/ ...
Also, there are some shells / systems that simply do not support tidle expansion.
Since you are on a Mac, you'll actually have to go to ~/Library/Prefernces/MonoDevelop-2.x to do your install.

Files with the same name in a TextMate project

One of the few things that bothers me about TextMate is that it can be difficult to differentiate between files that share the same name in a project, e.g:
alt text http://img530.imageshack.us/img530/6791/bild1r.png
In this case, the file on the right is located in the project relative path model/realtimemodel.py, while the other file contains unit tests for that code. Sure, you can command-click the name in the title bar to see a directory list, but it feels sub-optimal. What I would like is something along the lines of:
alt text http://img240.imageshack.us/img240/1783/bild3.png
This gives a quick at-a-glance idea of what file you're working on. Has anyone seen any plugin or bundle that makes this possible?
Edit: Here is a ticket in Macromates tracker that requests this feature (although I would prefer a project-relative path).
This is a start: http://snipplr.com/view/11490/textmate-command-snippet--show-document-path-in-window-title/
I think vasi's solution is the closest you can get to what you want (+1 for him)
I don't think that the bundle can be automatically ran on open, and also, the title changes back to default when switching between tabs, so even if it could, it would be useless.
I've searched for a defaults key (like the one from Finder, _FXShowPosixPathInTitle editable with
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES)
but there isn't any. Here's the list of available keys for Textmate.
Maybe you can write feature request somewhere as it is very useful and not so hard to impletement.

Resources