for some reason my $VIM location on this Windows machine I am using points to /etc. Is there a way to change this? I don't know where it would be to change this so it is looking in the correct location. Thank you.
Vim will use an environment variable for $VIM, if one is defined. Check if you have a %VIM% environment variable defined. If you do, it may have been set by cygwin or a similar program, so be sure any Vim installation in there still works without this variable before removing it permanently.
Related
I have a setup on my ubuntu where I can setup different environments for different purposes, essentially ending up having a bunch of ~/.bash_env_... in my home directory.
Example:
~/.bash_env_1
~/.bash_env_2
~/.bash_env_3
~/.bash_env_4
I already set the terminal prompt to tell me which environment I am at.
Is it possible to also force the terminal to change theme depending on the env?
E.g. when I run source ~/.bash_env_1 I would like the terminal where I run this to change to "some theme", essentially changing the whole palette.
I could not find anything about this specific topic, any ideas?
Thanks in advance!
I feel like this is a silly question but I can't get node to run a .noderc file, not even to just log to the console and not even on linux where I would expect everything to work.
My use case is that for work I have to use Windows and npm has installed modules to a particular location (%HOME%\AppData\Roaming\npm\node_modules\), whereas the default module.paths in node does not include that directory. I am fine with the location, so I don't want to fix this on the npm end of things. I have easily fixed the issue by appending this path to modules.paths, so the real solution should be for me to add that to an rc file.
I tried making a .noderc in my Windows home directory, and to my surprise it seems to not be running. I did the same on my personal laptop running a linux distro (~/.noderc) and the same thing happens. A log to console or definition of a test var does not show up in the REPL.
Is there something obvious I am missing? Usually programs have a hierarchy they run through, with default configs, a system level config file (if it exists), and a user level config file (if it exists). In the case of a program like X, they are executed in order and overwrite options, where as in something like bash, they are checked in reverse order and the first one found is executed (it is common for the first line of a user level bash config to source the system level one). How does node function?
EDIT:
In the comments below where I link to an old SO thread I noticed that there is a bit of a hack involving an alias to get the .noderc to work. So I guess a better question is, how are things like module.paths configured in node? There must be a way not involving a full rebuild.
As there has been no answer for over 10 days, I am going to just post my workaround form the comment above. It looks like there is no node config file. Any further info on that welcome. In order to solve my particular problem, I used the NODE_PATH environment variable.
I personally prefer to use use config files and not environment variables for scripting issues that need to be addressed every time. Config files are always read automatically, while using an environment variable requires you to always remember to add the variable or to permanently add the variable to your environment (which clutters the environment). I prefer to restrict environment variables to specific variations from the default. However, as I said, I can't find a config file for node.
I am trying to mod Minecraft and the YouTube tutorial I'm watching is on Windows 10, I'm on Windows 8.1.
The thing is they're editing environment variables. So what? I think. They tell me to create a variable called JAVA_HOME, Done.
So, the problem? They're editing the PATH variable, and they get a window coming up, and they add a variable to the multiple others there. But when I try to, It comes up with a single line that is already taken, so I can edit that.
At the moment I can`t mod it because of that reason. Any help would be greatly appreciated.
Refer the first answer here. Environment variables for java installation
Make sure you resart your system for the system to recognize your environment variables changes.
I keep hearing this is a path issue with cygwin. It is prevent emacs from working within my cygwin. When I execute find on the cli (not bash/cygwin) I get the same error not matter what I type. I've read this is a problem with path creation within cygwin and that it should be prepending itself to the path. As you can see it is doing that.
Here is my /etc/profile
PATH=/usr/local/bin:/usr/bin:/bin:$PATH
export PATH
Problem is that as everyone else stated, emacs is using find.exe provided by windows. To change this, you need to change your %userprofile%.emacs file.
As nobody else states (even faq!), this file is not created automatically anymore. Go into Options > Save options the mini-buffer (one line at the bottom of emacs) will tell you where the file is being written to.
Go in there and add this line (You've installed cygwin at c:\cygwin, right?):
(setq find-program "C:\\cygwin\\bin\\find.exe")
You may need to restart Emacs for this to take effect.
Just add this line to you .profile
alias find='/cygdrive/c/cygwin/bin/find.exe'
Oddly-enough, I needed to use
(setq find-program "/bin/find.exe")
instead.
But thanks for the suggestion Drew.
Adding a setq find-program [msys2 or git path] in my init file, as suggested (I tried different forms), didn't work for me. "C:\Windows\System32\find.exe" is first in the path if I type where find in eshell and I didn't find how to remove it, only how to add others, which doesn't solve the problem.
So I share here the more radical, but working (also in Powershell), solution I used: replacing the find.exe in "C:\Windows\System32" with the one from "C:\msys64\usr\bin". I kept the old file in case, but so far so good. You need to change the permissions for this operation (see here how to gain full control, but I suggest only applying this to the file, not the whole folder, and putting things back after ;)).
When I load GVim from the Cygwin command line or when I'm not connected to the office network (mapped to U:/) it loads instantaneously. It takes a good minute or so to open when I'm on the network. What is going on here?
You probably need to set your $HOME directory to something other than U:/. Create a $HOME environment variable for Windows that points to My Documents or whatever and it won't try and use U:/. You may need to log-off/log-in to pick up the changes.
You should check what your $HOME directory is mapped to in each case. I bet that it is different depending on if you are connected to the network or not.
Do you have any custom .vimrc or other config files read at startup? If nothing else, vim will query your $HOME directory to look for such files. If your network is slow, it could cause your problem.
See ":help startup" inside vim for more details on the startup process.
It might also be a good idea to set the directory and backupdir options so they prefer a local directory. Something along the lines of
set backupdir^=C:/Temp
set directory^=C:/Temp//
The ^= syntax puts the directory at the start of the list of directories for each option. The trailing // for directory tells Vim to encode the full path to the file being edited in the swapfile's name. This allows for swapfiles to be created in one directory when editing multiple files with the same name, but different paths.