What is the difference between MacVim and regular Vim? [closed] - macos

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 months ago.
The community reviewed whether to reopen this question 12 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I'm reasonably new to OS X, but I'm familiar with Vim from using it in various *nix systems. I've seen many people recommend running MacVim over Vim in the terminal. Can anyone tell me what differences there are between MacVim and regular Vim?

MacVim is just Vim. Anything you are used to do in Vim will work exactly the same way in MacVim.
MacVim is more integrated in the whole OS than Vim in the Terminal or even GVim in Linux, it follows a lot of Mac OS X's conventions.
If you work mainly with GUI apps (YummyFTP + GitX + Charles, for example) you may prefer MacVim.
If you work mainly with CLI apps (ssh + svn + tcpdump, for example) you may prefer vim in the terminal.
Entering and leaving one realm (CLI) for the other (GUI) and vice-versa can be "expensive".
I use both MacVim and Vim depending on the task and the context: if I'm in CLI-land I'll just type vim filename and if I'm in GUI-land I'll just invoke Quicksilver and launch MacVim.
When I switched from TextMate I kind of liked the fact that MacVim supported almost all of the regular shortcuts Mac users are accustomed to. I added some of my own, mimiking TextMate but, since I was working in multiple environments I forced my self to learn the vim way. Now I use both MacVim and Vim almost exactly the same way. Using one or the other is just a question of context for me.
Also, like El Isra said, the default vim (CLI) in OS X is slightly outdated. You may install an up-to-date version via MacPorts or you can install MacVim and add an alias to your .profile:
alias vim='/path/to/MacVim.app/Contents/MacOS/Vim'
to have the same vim in MacVim and Terminal.app.
Another difference is that many great colorschemes out there work out of the box in MacVim but look terrible in the Terminal.app which only supports 8 colors (+ highlights) but you can use iTerm — which can be set up to support 256 colors — instead of Terminal.
So… basically my advice is to just use both.
EDIT: I didn't try it but the latest version of Terminal.app (in 10.7) is supposed to support 256 colors. I'm still on 10.6.x at work so I'll still use iTerm2 for a while.
EDIT: An even better way to use MacVim's CLI executable in your shell is to move the mvim script bundled with MacVim somewhere in your $PATH and use this command:
$ mvim -v
EDIT: Yes, Terminal.app now supports 256 colors. So if you don't need iTerm2's advanced features you can safely use the default terminal emulator.

EDIT: See comment from #Luke Davis.
Old answer:
The one reason I have which made switching to MacVim worth it: Yank uses the system clipboard.
I can finally copy paste between MacVim on my terminal and the rest of my applications.

unfortunately, with "mvim -v", ALT plus arrow windows still does not work. I have not found any way to enable it :-(

It's all about the key bindings which one can simply achieve from .vimrc configurations.
As far as clipboard is concerned you can use :set clipboard unnamed and the yank from vim will go to system clipboard.
Anyways, whichever one you end up using I suggest using this vimrc config
, it contains a whole lot of plugins and bindings which will make your experience smooth.

Related

What's the difference between iTerm2 and Terminal on Mac?

I have seen lots of programmers use iTerm2 instead the default Terminal on Mac. But, what's the difference between these two shell terminals on earth? For me, they are the same, I didn't see any difference except the different colors.
As of Lion's release, a lot of the features iTerm2 boasted for a while now are finally matched in Terminal. plus a more consistent full screen (Lion) support.
Check out this apple stackexchange question
https://apple.stackexchange.com/questions/25143/what-is-the-difference-between-iterm2-and-terminal
http://www.iterm2.com/#/section/features

What is the best way to use linux utilities under windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Linux utilities like sed, awk and other shell scripting features are awesome and life becomes a lot harder when I am developing on windows and cant use any of these.
People suggest to use cygwin for those who want the linux like tools under windows. But I feel cygwin will be an overkill for someone who only wants to use the handful commands.
Some say that Windows Services for Unix can also be a good alternative.
I have used none of these. Can some experienced programmer suggest best/simplest way to do this? of course apart from switching to linux itself.
I think the GnuWin32 project is exactly what you're looking for. Unix command line tools ported to Windows.
I've been using UnxUtils which are ports of common GNU utilities to native Win32 for ages.
I should add that I've also used Cygwin (et al.) and Microsoft's Services for Unix and neither of them were any good for me because they don't work as well as native versions from the command prompt, and using ksh/bash/whatever under Windows never really works right, even though I use ksh under unix all the time.
I tried something like this quite often, but to be honest, none of it really works well.
I therefore suggest using a virtual machine (such as VirtualBox) and install a small linux inside that. You can easily move files from and to the guest system with shared folders.
Judging by my experience, it is the best solution I used so far.
I tried Gow for some time, and it's nice. It offers 130 Unix-shell utilities for Windows. The contextual menu in the File explorer, to start a prompt in the current folder, is really handy.
There's a GNU port of many of the utils. I find that quite useful.
If you need Perl, I recommend Strawberry Perl.
The problem with most of the tools suggested here is that they don't get updated very often E.g. the last update GnuWin32 got was on 27 December 2010; UnxUtils was last updated on 01 March 2007.
I suggest MSYS2, a very good option which has a Win32 port of Arch's pacman package management system built-in. It's a spin-off from Cygwin like MSYS but much better than MSYS (lots of packages and gets updated almost daily) and (very light as opposed to) Cygwin.
It's a rolling release distribution that works under Windows and thus you get the latest and greatest of the packages. MSYS2 additionally has MinGW, provided in both x86 and x86_64 flavours. They've their own list of packages - MinGW packages.
Maintainers are very affable too.
MSYS is a common alternative for people who find CygWin excessive. It's still a special prompt, but it was originally intended to set up just enough Unix-compatibility to build programs using the MinGW compilers and the typical configure/make routine.
Using tools like sed and awk isn't going to work quite as expected in a normal Windows command prompt. It can be done to a point, but common usage involves command-line syntax that is normally interpreted by the shell, but which the Windows command prompt doesn't support. One example is wildcard file specifications. I've often found that Unix-centric tools aren't as usable on Windows as they assume the shell has expanded those wildcards into lists of files for them.
Install msysGit (netinstaller), it comes with a (msys/minGW) shell environment.
It also adds a "open shell here" in explorer.
It's faster than Cygwin, but at the sacrifice of unix compatibility.
Maybe it is stupid, but I usually search google for i.e.: "indent windows". You can select tools from mixed platforms. Lot of stuff from open systems has been ported on windows.

something similar to Emacs shell?

I'm looking for something similar to Emacs shell.
I want to be able to select text easily in my terminal, be able to manipulate the output.
Unfortunately, emacs is not always an option. I can't figure out how to make a few things (e.g autocompletion) work the way it does in gnome-terminal and it is a bit of a pain on remote system.
I would rather not spend the time fixing/configuring Emacs unless there is a cool piece of software out there doing something similar to gnome-terminal + let's me manipulate the output without touching the bloody mouse.
Thanks for your help,
-hbt
I'm not sure I completely understand the question, but if you're looking for terminal emulation inside of Emacs, there are at least four options bundled with Emacs 22+ that offer varying levels of xterm-like capability:
term
ansi-term
shell
eshell
eshell, IMO, is the most departed from the tradtional "xterm" experience, but also offers the most buffer-like experience, and it is cross-platform, which is a huge win.
I think shell might be the sweet spot for you if you're looking for term-like behavior, while retaining the editing capabilities.
Finally, term and ansi-term are very term-like, and will behave almost exactly like a xterm/konsole/gnome-shell session.
One other note: if you want scrollback access, copying, pasting, etc. and you don't have Emacs available, I highly recommend learning and using GNU Screen.
You should try the Emacs terminal emulator term(or its colored version ansi-term). There are other terminal emulators for Emacs around, but this is the most popular(and the only one bundled with the default installation).
Looks like you want to look into readline on bash (or if available on your favourite shell). A quick google gives a few links here (including a cheatsheet).
I was also looking for some kind of shell like emacs, with support to some feature like emacs buffers for example. That would be great.
I just found this one: Terminator
Have a look:
http://www.makeuseof.com/tag/5-applications-to-change-the-way-you-work-with-linux-terminal/

linux/bash tips for developers? [duplicate]

This question already has answers here:
Closed 13 years ago.
Possible Duplicates:
Favourite command line trick
useful linux commands for programmers?
What is your single most favorite command-line trick using Bash?
I have recently become accustomed to doing most of my development (in various languages) from the bash shell, using command-line tools and interfaces. I have discovered it is convenient to stay in the command line because you can do many things without leaving that interface, and it is fast.
What tools and tricks are you aware of that can make bash (perhaps in conjunction with an editor like vim or emacs) a more powerful development environment to work in?
Start with an X11 window manager that works well without needing a mouse.
Awesome
xmonad
After that:
screen
bash_completion
vim
cscope
ctags
remake
I rarely need to touch the mouse for anything.
You've probably done some or all of this, but for the record...
ctags/etags
plugins for vim and emacs
get to know the bash ! history substitution feature (but be careful! :-)
if using vi (over emacs) then get to know the :line mode
you might want to check out the id-utils package
if using bash on windows via cygwin, use rxvt instead of the default dos box
You also want to set up each tool in the programmer mode. Editors like vi and emacs can autoindent, show matching parens, etc. You need to read the help and turns these things on. Be sure that you run bash in the history mode that matches your editing reflexes. It defaults to emacs but for vi one does set -o vi.
First, I use intensively shortcuts. Then, I could obviously mention things like vim, grep, tail, head, find, sudo !!,... But one thing I really can't live without is Programmable Completion. Of course, this will depend on your habit, but here are some must have for me:
Ant Bash Completion
command line completion in GlassFish
Grails Bash Completion and/or Autocomplete Grails Script Names in bash/zsh
Maven Tab Auto Completion in Bash
Oh let's see... cut, sort, grep, find

What are the preferred versions of Vim and Emacs on Mac OS X? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend?
For Vim, there's Mac OS X Vim, MacVim, Vim-Cocoa.
For Emacs, CarbonEmacs, XEmacs, and Aquamacs.
Are there more? Which of these are ready for prime-time? If it's a tough call, what are the trade-offs? Are all of these still being maintained?
No discussion of Vim versus Emacs, if you don't mind, or comparisons with other editors.
MacVim works well and certainly looks more mature than Vim-Cocoa, moreover there is a Cocoa plugin architecture in the pipeline for MacVim (and someone is already working on a TextMate style file browser tray plugin which is a huge ++ IMHO).
There was also a Carbon version of Vim, but this didn't offer a great deal over the Terminal version. i.e. only allowed one window open, not very OSX in appearance...
Aquamacs is very usable and looks pretty good. Supports both traditional Mac OS style keyboard shortcuts (command-O, command-S) and the Control/Meta shortcuts for those raised on traditional Emacs. It is definitely more Mac-like than Carbon Emacs. It seems stable and fast, but I am not an Emacs guru so I don't stress it all that much when I use it. I can't speak to the extensiveness of the included elisp packages, either.
Someone syncs Carbon Emacs with the upstream tree quarterly I think. Aquamacs has a more irregular schedule, but it's seen some pretty major updates over the last year.
GNU Emacs for OSX can be found at emacsformacosx.com. In addition to the latest stable release, there are also pre-release test builds and nightly builds, and Atom feeds are provided for tracking all three release types.
I've tried Aquamacs and it's very usable and looks pretty good. Supports both traditional Mac OS style keyboard shortcuts (command-O, command-S) and the Control/Meta shortcuts for those raised on traditional Emacs. It is definitely more Mac-like than Carbon Emacs. It seems stable and fast, but I am not an Emacs guru so I don't stress it all that much when I use it. I can't speak to the extensiveness of the included ellipse packages, either.
Someone syncs Carbon Emacs with the upstream tree quarterly I think. Aquamacs has a more irregular schedule, but it's seen some pretty major updates over the last year.
I just download the Emacs source from the GNU site and build it myself. I don't like too many Mac-specific features, because I want Emacs behavior to be consistent on all the platforms I use.
I like the Nextstep-derived Emacs.app formerly at http://emacs-app.sourceforge.net/ now integrated in Emacs-23 CVS (as of August 2008).
Emacs.app feels more zippy than Aquamacs to me but its just bare CVS-Emacs and doesn't come with the same amount of stuff (you have to install your own AucTeX etc.).
Personally, I've been using fink to install xemacs. It requires X but I've been
using xemacs for so long that I need what it has.
Additionally, I have installed gnu emacs. It's nice because it is a completely
integrated mac os x application with a dock icon and everything. I find it useful
when dragging a file on top of the gnu emacs icon to open it.
Last, I should mention that mac os x uses the emacs keystrokes all over the place.
stuff like ^A for beginning of text, ^E for end of text, ^N next line, ^P previous
line, etc... These work in most text boxes throughout the OS.
I'm using MacVim on Mac OS X. It's very, very nice.
I get all my unixish/GNU support using Fink (which provides Debian-like package control) with the emacs22-carbon package which means I also get a clickable application. It does everything I expect it to do, and automagically starts using emacs extensions loaded with fink.
Good times.
Of the emacsen for Mac OS X, I have to say that after the console version of 22, CarbonEmacs is the most usable. Aquamacs just does too many non-standard, read unexpected, things with configuration. Aquamacs questions generally aren't answered in any sort of timely manner in #emacs on freenode for whatever that is worth. It seem to be held in disdain simply because it does such a terrible job of handling standard configuration options in .emacs.
Some time ago, I was searching for a text editor for my new Mac. Since this was some months ago, some points might have been corrected in the meantime.
I feel that Aquamacs is by far the best OSX-Emacs. However, it feels a bit too Mac-like in some areas. For example, it rather uses several windows instead of several buffers and the coloring schemes are not "normal" Emacs-style.
If you look for a more basic set, Carbon Emacs might do it as well, though you might want to add some additional packages to add PHP support or AucTeX.
Emacs.app feels broken in my opinion. It not even opens files using drag and drop.
I use the CarbonEmacs version on the Macports program. It installs all the dependencies with just one line:
sudo port install emacs
For anyone interested in Macports (www.macports.org)
I love CarbonEmacs because it sticks very close to the standard GNU Emacs distribution, while still fitting in nicely with the Mac desktop. To me, it "felt" like Emacs on my Ubuntu desktop even if it looked like a Mac application.
Emacs 22 has worked pretty well for me.
I prefer Vim built from the Subversion repository. I run it in the console where I don't need to use the mouse while editing.

Resources