How to install vim on Cygwin - windows

First, I saw that you can install vim normally in the setup.exe, but I realized that I wanted to install vim with Ruby support. I downloaded the vim 7.3, untared it and ran
./config --enable-ruby-interp
and everything configured fine. Then I ran
$ make && make install
and everything installed ok, but it put a vim.exe in /usr/local/bin. I don't want a vim.exe, I want a vim, which I can run by typing
$ vim
in my Cygwin shell.
Is there a way to tell vim during the installation to install it like it would if I was on Linux? Meaning, to ignore the fact that I'm on Windows?
Now, when I type vim into the shell, it just does nothing. So it found it, but it doesn't do anything with it.

You can drop a Windows build of Vim that has Ruby support (like this one) into your PATH (add vim's folder to PATH before everything else) and then when you run vim from inside cygwin it will run that (the first vim.exe in PATH. should also work in cygwin's MinTTY)
Remember to close and re-open your shell after changing PATH from windows settings.

reinstall the cygwin, or re-install git-bash. (which also included the cygwin environment)

Related

Mac can't open system vim in terminal

I tried to upgrade my system Vim from 7.3 to a high version so I used macport to do that. This newer version is located in /opt/local/bin/. Later I decided to uninstall it due to some reason.
Now I can't open my system Vim in the terminal, the error message is -bash: /opt/local/bin/vim: No such file or directory. Somehow the machine still thinks the vim is located in /opt/local/bin/.
Then weird thing happens, when I type which vim, it shows my vim located at /usr/local/bin, and there is indeed a vim folder in that directory, but I can't open it by typing vim in the terminal.
So here is the situation: I have two working versions of Vim in my machine, a 7.3 version in /usr/bin and a 7.4 version in /usr/local/bin(I don't know how I got this one). Both working (I have to type the whole directory /urs/bin/vim or /urs/local/bin/vim), but can't be opened in the terminal by simply typing vim.
Updates:
now I can use vi or vim, but the problem is, the former opens 7.3 whereas the latter opens 7.4
At the current command window, type:
$ hash -r
then try running vim again. Or create a new window and try in that.
Bash remembered where vim was found, and expects to find it there again. When you removed vim, it got upset and complained (rather than try to find it again before complaining). Using hash -r vim forgets all previously hashed commands and then finds vim explicitly. Run hash with no options to see what it knows.
See the Bash manual on hash for more information.
The default Vim is /usr/bin/vim. There is absolutely no reason whatsoever to change it.
If you want a more up-to-date Vim, install MacVim and use the bundled mvim script instead of vim.

get vim working in mobaxterm

I have installed gvim and vim in mobaxterm 8 (using apt-get and mobapt respectively), and can't get either to work. nano works fine.
When I run the program, the cursor moves to a new line in the terminal but nothing happens.
I have also tried creating a .vimrc. Does anyone have any ideas? Thanks.
I installed the latest version of MobaXterm as up today which is 9.1 (http://mobaxterm.mobatek.net/download-home-edition.html) and the list of bug fixes includes the freezing problem you are are talking about. It works for me now and I no longer see that issue. The only thing is that after the installation is completed you need to download the CygUtils plugin and copy it to the same folder where the MobaXterm executable is located and then restart the application. It seems overall more stable now. Hope that helps.
I am using V9.4 which already has the vim. To configure the environment for your vim you may creat a .vimrc file in your home directory (go to the directory using cd command only).

How to install and use "make" in Windows?

I'm following the instructions of someone whose repository I cloned to my machine. I want to use the make command as part of setting up the code environment, but I'm using Windows. I searched online, but I could only find a make.exe file, a make-4.1.tar.gz file (I don't know what to do with it next) and instructions for how to download MinGW (for GNU; but after installing it I didn't find any mention of "make").
How do I use make in Windows without a GNU compiler or related packages?
make is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:
The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :
choco install make
Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you'll have a Linux distribution of your choice embedded in Windows 10 where you'll be able to install make, gccand all the tools you need to build C programs.
For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.
An outdated alternative was MinGw, but the project seems to be abandoned so it's better to go for one of the previous choices.
GNU make is available on chocolatey.
Install chocolatey from here.
Then, choco install make.
Now you will be able to use Make on windows.
I've tried using it on MinGW, but it should work on CMD as well.
The accepted answer is a bad idea in general because the manually created make.exe will stick around and can potentially cause unexpected problems. It actually breaks RubyInstaller: https://github.com/oneclick/rubyinstaller2/issues/105
An alternative is installing make via Chocolatey (as pointed out by #Vasantha Ganesh K)
Another alternative is installing MSYS2 from Chocolatey and using make from C:\tools\msys64\usr\bin. If make isn't installed automatically with MSYS2 you need to install it manually via pacman -S make (as pointed out by #Thad Guidry and #Luke).
If you're using Windows 10, it is built into the Linux subsystem feature. Just launch a Bash prompt (press the Windows key, then type bash and choose "Bash on Ubuntu on Windows"), cd to the directory you want to make and type make.
FWIW, the Windows drives are found in /mnt, e.g. C:\ drive is /mnt/c in Bash.
If Bash isn't available from your start menu, here are instructions for turning on that Windows feature (64-bit Windows only):
https://learn.microsoft.com/en-us/windows/wsl/install-win10
Download make.exe from their official site GnuWin32
In the Download session, click
Complete package, except sources.
Follow the installation instructions.
Once finished, add the <installation directory>/bin/ to the PATH variable.
Now you will be able to use make in cmd.
Install Msys2 http://www.msys2.org
Follow installation instructions
Install make with $ pacman -S make gettext base-devel
Add C:\msys64\usr\bin\ to your path
On windows 10 or 11, you can run the command winget install GnuWin32.Make in the command line or powershell to quickly install it. Than you can use the command cmake.
There is no need to install choco anymore.
The chances are that besides GNU make, you'll also need many of the coreutils. Touch, rm, cp, sed, test, tee, echo and the like. The build system might require bash features, if for nothing else, it's popular to create temp file names from the process ID ($$$$). That won't work without bash. You can get everything with the popular POSIX emulators for Windows:
Cygwin (http://www.cygwin.org/) Probably the most popular one and the most compatible with POSIX. Has some difficulties with Windows paths and it's slow.
GNUWin (http://gnuwin32.sourceforge.net/) It was good and fast but now abandoned. No bash provided, but it's possible to use it from other packages.
ezwinports (https://sourceforge.net/projects/ezwinports) My current favorite. Fast and works well. There is no bash provided with it, that can be a problem for some build systems. It's possible to use make from ezwinports and bash from Cygwin or MSYS2 as a workaround.
MSYS 1.19 abandoned. Worked well but featured very old make (3.86 or so)
MSYS2 (https://www.msys2.org/) Works well, second fastest solution after ezwinports. Good quality, package manager (pacman), all tooling available. I'd recommend this one.
MinGW abandoned? There was usually MSYS 1.19 bundled with MinGW packages, that contained an old make.exe. Use mingw32-make.exe from the package, that's more up to date.
Note that you might not be able to select your environment. If the build system was created for Cygwin, it might not work in other environments without modifications (The make language is the same, but escaping, path conversion are working differently, $(realpath) fails on Windows paths, DOS bat files are started as shell scripts and many similar issues). If it's from Linux, you might need to use a real Linux or WSL.
If the compiler is running on Linux, there is no point in installing make for Windows, because you'll have to run both make and the compiler on Linux. In the same way, if the compiler is running on Windows, WSL won't help, because in that environment you can only execute Linux tools, not Windows executables. It's a bit tricky!
I could suggest a step by step approach.
Visit GNUwin
Download the Setup Program
Follow the instructions and install GNUWin. You should pay attention to the directory where your application is being installed. (You will need it later1)
Follow these instructions and add make to your environment variables. As I told you before, now it is time to know where your application was installed.
FYI: The default directory is C:\Program Files (x86)\GnuWin32\.
Now, update the PATH to include the bin directory of the newly installed program.
A typical example of what one might add to the path is: ...;C:\Program Files (x86)\GnuWin32\bin
Another alternative is if you already installed minGW and added the bin folder the to Path environment variable, you can use "mingw32-make" instead of "make".
You can also create a symlink from "make" to "mingw32-make", or copying and changing the name of the file. I would not recommend the options before, they will work until you do changes on the minGW.
I once had the same problem. But I am surprised not to find one particular solution here.
Installation from GnuWin32 or via winget are good and easy options. But I only found make 3.8.1 there. This version lacks the very important option -O, which handles the output correctly when compiling multithreaded.
choco appears to offer make 4.3, currently. So one could expect recent versions there.
But there is also the option of self compiling. And if you have to install make, which is used for compiling, this should be a valid option.
head to https://www.gnu.org/software/make/ and download a version of your liking
unpack the tar.gz files (use 7zip and unpack the file twice to retrieve the actual content)
navigate to the created directory
open command prompt in that directory
run build_w32.bat gcc This will start the compilation with the gcc compiler, which you would need to install in advance. When running build_w32.bat without any option they try to use the MSVC compiler. Sidenote: I found it surprising that gnu does not use gcc as default but MSVC :-)
ignore the warnings created during compilation. The result should still be fine
retrieve your fresh gnumake.exe from the directoy GccRel (when compiled with gcc)
put this file somewhere where you like and rename to make.exe
add the location to the system variable %PATH%
As others have noted: This manual installation might cause conflicts if you have various make versions installed by other programs as well.
You can also install scoop, then run:
scoop install make
One solution that may helpful if you want to use the command line emulator cmder. You can install the package installer chocately. First we install chocately in windows command prompt using the following line:
#"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv
After chocolatey is installed the choco command can be used to install make. Once installed, you will need add an alias to /cmder/config/user_aliases.cmd. The following line should be added:
make="path_to_chocolatey\chocolatey\bin\make.exe" $*
Make will then operate in the cmder environment.
Install npm
install Node
Install Make
node install make up
node install make
If above commands displays any error then install Chocolatey(choco)
Open cmd and copy and paste the below command (command copied from chocolatey URL)
#"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

vim Mac OS X install with gui-support

I have Mac Pro, with OS X 10.9.4 (can't upgrade to Yosemite yet), and I'm trying to build vim7.4 with gui-support, or get any kind of gui-support. My current vim is version 7.3, I'm guessing, that's the default vim that ships with macs. I have the Terminal.app and iTerm2.app, my vim rc has the default
set term=xterm-256colors
or what have you.
What I have so far:
macvim
The colors look great, basically it's the same setup I had on my ubuntu system, but it's really annoying that it opens a new window. Is there a way to get it to open within my terminal? (not launch it from the terminal, open inside of it)
As I've said I have the regular vim7.3
And while I can use color-schemes, they look like garbage compared to my ubuntu system. I suppose this must be due to gui-support option? I tried, CSApprox but that gives me a weird error.
So I decided to simply build vim 7.4 and enable gui support, but I get random errors.
My basic config make looks like:
./configure --enable-gui=yes
make
At which point it complains about missing header file etc. , I figured this should not be that hard.
Any tips?
The basics of what I'm trying to do is:
Have a vim version installed with gui-support, or a work-around where my colors are all screwed up.
Thanks!
Building Vim on Mac OS X is a waste of time.
Step 1: Download the appropriate MacVim build from here.
Step 2: Put MacVim.app into the /Applications/ directory.
Step 3: Put the bundled mvim script somewhere in your PATH.
Done.
To run MacVim in your shell:
$ mvim -v filename
To run MacVim from your shell:
$ mvim filename
Building Vim with GUI on macOS using Homebrew:
brew edit vim.
Add a new line with option for GUI:
option "enable-gui", "Enable GUI mode"
Change from no to yes in the following line:
opts << "--enable-gui=no"
Install or re-install vim:
brew reinstall vim --enable-gui
Troubleshooting:
If you've errors related to Python 3, see: vim's GH-2754.
Checkout new Homebrew PR at GH-25785 with above patch.

How to add aliases for Windows netbeans terminal

I am using NB on windows and I want to add aliases for the netbeans terminal. Is that possible??I have cygwin and minGW32 installed on my computer. On cygwin, I added aliases in .bash.bash_rc and it works. On mingw32 it also works fine but I can't get it work on NB neither in GitBash.
Any solution?
I just found your question because I needed to solve the same situation.
Type cd to go to your home directory.
Then edit the file .bashrc using vi editor.

Resources