The name given to the OS X port of gVim, the popular editor.

learn more… | top users | synonyms

51
votes
4answers
19k views

The best way to make MacVim's vim (console, not mvim) the default instead of Mac OS X's vim?

I installed MacVim using homebrew. (brew install macvim). If I call mvim from cmd, it opens the GUI MacVim. I would like to make vim call the MacVim's Vim ...
27
votes
3answers
13k views

How do I open a blank new file in a split in Vim?

Must be something super obvious, but I can't figure out, and Google is not helping out either.
19
votes
6answers
1k views

How can I discard my undo history in vim?

Undo is nice to have in Vim. But sometimes, at a known good point, I want to erase my undo history - to be able to use u to undo individual changes, but only back to a certain point. (For instance, ...
16
votes
3answers
3k views

copy-paste not working in MacVim when launched in tmux

MacVim's copy-paste stops working when I launch it from a tmux terminal (on zsh). If I exit tmux and then launch MacVim copy-past works. Any idea how to fix this?
15
votes
1answer
4k views

Where does VIM (gvim/macvim) keep swap files for unsaved/unnamed buffers?

Where does VIM (gvim/macvim) keep swap files for unsaved/unnamed buffers? (If it does so at all). Background: Throughout a semi intense seminar I was taking notes in an unnamed/unsaved MacVim buffer ...
14
votes
2answers
6k views

How does one switch between windows on VIM?

I'm using both Vim and MacVim (or well, trying to). I installed the Tagbar plugin but find it impossible to switch to the actual Tagbar window to make my selection. I've been reading loads about ...
13
votes
2answers
3k views

How can I use the Homebrew Python with Homebrew MacVim on Mountain Lion?

I originally asked and answered this question: How can I use the Homebrew Python version with Homebrew MacVim? These instructions worked on Snow Leopard using Xcode 4.0.1 and associated developer ...
13
votes
1answer
4k views

How do you set the default window size in MacVim?

The default window size appears to be 24x80 but I'd prefer to set it so new windows appear in the size 50x90. Is there a way to set this default?
12
votes
2answers
2k views

vim scrolls very slow when a line is to long

I would never have thought that vim would be so slow. All I have is the following long line: I run vim (MacVim) under Mac OSX with the terminal app. Here is my vimrc. Hope that it has nothing to do ...
12
votes
1answer
3k views

MacVim: Re-map command key combinations like <d-f>

I can remap unused combinations like <d-1> (Cmd+1) in MacVim, but there are many combinations like <d-f>, <d-o> or <d-b> that are already bound to MacVim menu items. If I try ...
12
votes
1answer
3k views

How can I use the Homebrew Python version with Homebrew MacVim on Snow Leopard?

Note: For Mountain Lion, see: How can I use the Homebrew Python with Homebrew MacVim on Mountain Lion? I've installed Python 2.7 with Homebrew on Mac OS X Snow Leopard. When I install MacVim ...
11
votes
3answers
9k views

How do I move around and otherwise rearrange splits in vim?

So far, I've figured out swapping splits laterally via CTRL+W x, and that's pretty much it. How do I move a split anywhere in a viewport that contains multiple vertical and horizontal splits? How do ...
10
votes
2answers
1k views

Move cursor to beginning of non-whitespace characters in a line in Vim

In Vim, is there a way to move the cursor to the beginning of non-whitespace characters in a line? For instance, how can I move the cursor to the "S" in the second line below? First line Second ...
9
votes
8answers
5k views

$PATH in Vim doesn't match Terminal

I'm using MacVim and when I don't launch it from the Terminal (mvim) its $PATH does not include what I have set in my .bash_profile. It only seems to have the default values, ...
8
votes
3answers
779 views

Is there a way to “lock” the viewport in vim?

I recently started using Vim with NERDTree. The annoying thing is when I close the buffer, NERDTree expands to fill the rest of the screen, and I have to open another file and reopen NERDTree to get ...
8
votes
2answers
471 views

Vim across multiple monitors

Does anyone have an elegant solution for having MacVim or gvim span across multiple(potentially different resolution) monitors? Having 2 sessions doesn't work well due to separate buffers and swap ...
7
votes
2answers
2k views

textwidth=0 and wrapwidth=0 in .vimrc.local not being respected

I have the following lines at the bottom of my .vimrc.local: set textwidth=0 set wrapmargin=0 However, whenever I open a new file, both these values are set to their defaults (72 and 2, ...
7
votes
4answers
2k views

VIM - leaves .swp files after crash

I use MacVim (snapshot 51) to edit a the Python/HTML/etc files in moderately sized project. Every few months my system locks up or crashes, and Vim leaves a plethora of .*.swp files around. When I go ...
6
votes
5answers
2k views

Shortcut to switch tabs in MacVim

Are there any shortcuts to switch the Tabs from one to another in MacVim? Any tips to bind the shortcuts myself in .vimrc like āŒ˜ + 1 for Tab 1 and āŒ˜ + 2 for Tab 2. For example, like switching ...
6
votes
3answers
1k views

MacVim is not found by Spotlight

I'm a Mac Noob but generally a power Linux user. My new job handed me a fresh MacBook Pro with Lion installed. I installed MacVim successfully using homebrew. I'd love for it to be the default app ...
6
votes
1answer
2k views

How do I only dp or do just the lines, not the entire block in Vim diff?

I'm currently using MacVim (Snapshot 64) "Split Diff by..." menu option. The file is Django's my settings.py from version 1.3.1 to a fresh file from version 1.4. (Open the image on a separate ...
6
votes
2answers
2k views

Vim - Displaying Code Output in a New Window á la Textmate?

A few months back I switched from Textmate to Vim. Overall I really love Vim, but one of the things I miss from Textmate is using the ⌘R command to run Ruby code and having the results neatly ...
5
votes
2answers
10k views

Vim in OSX: How to do page-up/page-down/go to EOL through a vim file opened in terminal?

In putty, which is how I primarily used VIM, I could do the following: Page up/down : Using the native Page up/down key. In Mac, the alternative is Fn + Up/Down, which doesn't work in the terminal ...
5
votes
2answers
2k views

How can I make terminal Vim look as good as MacVim?

I'm using the same color scheme for Vim both in the Terminal and in MacVim, but they end up getting totally different colors. Terminal: and MacVim: Why is this happening? It does this with ...
4
votes
2answers
1k views

Switch buffers in MacVim

I want to be able to switch buffers (:bn! / :bp!) in MacVim, using shortcuts like Alt (Option) - Left Arrow Key/Right Arrow Key So far I wasn't able to do that. Here's my mapping for the keys, ...
4
votes
4answers
2k views

Is there a way to forward-delete in insert-mode in vim?

Is there a way to forward-delete in insert-mode in vim? I'm using a MacVim. I tried "Control-D", but it obviously doesn't work. I'm searching the official documentation, but cannot find. Any help ...
4
votes
1answer
906 views

How can I open the current HTML file in a web browser from MacVim?

From MacVim is there a command to open the currently edited HTML file in a web browser?
4
votes
1answer
783 views

How to configure MacVim to quit on exit?

When I close MacVim using the standard vim command :q, the MacVim window closes, but the program is still running. This causes trouble when other processes try to spawn an instance of MacVim, because ...
4
votes
2answers
1k views

How can I add some padding to the macvim text area

I would like to add some padding between my text and the left edge of the window (or the right edge of the line numbers).
4
votes
1answer
220 views

Vim - Viewing Command line history

Is there a way in vim to view the output of old commands. For example, if I do: :! ls Gemfile Gemfile.lock Rakefile autotest config.ru doc log ...
4
votes
1answer
5k views

How do you install plugins for MacVim?

Specifically, I'm trying to install NERDtree. I downloaded the 4.10 package from github, unzipped it into ~/.vim/, and restarted MacVim (version 7.3). Typing :nerdtree results in the following error: ...
4
votes
1answer
1k views

MacVim + tmux or: The Copy Paste Riddle [duplicate]

Possible Duplicate: copy-paste not working in MacVim when launched in tmux Now this is weird. Copied a chunk of a text from somewhere into clipboard. Ran mvim from a tmux buffer. Opened a ...
4
votes
3answers
1k views

How can I automatically adjust the Gvim/MacVim window to the width of my vertical splits?

My overall goal here is simple, but the specifics are complex: I want to maintain each vertical split in my MacVim window at exactly 115 columns, regardless of how many splits I add. The story: Iā€™m ...
3
votes
3answers
677 views

Minimizing the toolbar in MacVim on OSX Lion

In previous versions of OS X it was possible to minimize the top toolbar of most applications due to a small button in the top right of the window. In Lion however it seems that this has been replaced ...
3
votes
1answer
226 views

Height of window resizing on tab close for Vim

The tab bar automatically appear when there is more than 1 tab. When down to just 1 tab, the tab bar would disappear and the window resizes in height. The height is shorter by height of the ...
3
votes
1answer
128 views

Vim: don't move cursor when I scroll (via mouse)

When I scroll up/down and the cursor is in the visible region, it stays at that place. However, when I scroll and the cursor reaches the edge (bottom or top), it will move along with my scrolling so ...
3
votes
1answer
258 views

Is there any way to use multiple fonts simultaneously in Vim?

I'm looking to use Consolas and Helvetica (for example) within the same buffer.
3
votes
1answer
351 views

Change to normal mode when MacVim goes background

Is there any way to leave insert mode automatically once MacVim is put in background, so when I came back it's in normal mode? Often I change the foremost application an once I come back to MacVim I ...
3
votes
1answer
1k views

Getting (Mac)Vim to Work With RVM

I'm using RVM to manage Ruby installs and Gems, and MacVim to create and edit Ruby files. I have a key command in my ~/.vimrc mapped to evaluate a loaded Ruby file and print the output. It looks ...
3
votes
1answer
121 views

MacVim crash with Gundo

Every time I invoke gundo MacVim crashes with the following error. Vim: Caught deadly signal SEGV Vim: Finished. It works fine in Normal vim but I am not sure what the problem is I built the app ...
2
votes
3answers
102 views

Is there a clever way to underline a heading?

This isn't a particularly important, but it's something I've been curious about for a while. I write a lot of documentation using rST (Sphinx). This is how you write a heading: My Awesome Heading ...
2
votes
2answers
1k views

Installing Command-T breaks MacVim

I am trying to install Command-T on MacVim. I followed the installation instructions exactly but I get this error when trying to start MacVim (from a terminal via the mvim command line utility). ...
2
votes
1answer
69 views

Removing @'s in wordwrapped VIM text

Lines in VIM that wordwrapped on show @ on that line instead of the text if any part of the text is off-screen. How do I get it so I can see partial wordwrapped text like other editors? Before: ...
2
votes
1answer
375 views

Emulate Typewriter Scrolling in Vim

I've been using WriteRoom for a while for all my distraction free writing needs. But since I recently decided to move to Vim (or more specifically, MacVim) I've tried to reduce my usage of other text ...
2
votes
2answers
296 views

Prevent MacVim copying every visual selection to clipboard

Every time the visual selection changes in MacVim, it is copied to the system clipboard. Is this normal and can it be disabled?
2
votes
4answers
2k views

Snippets in Vim not working

I've been trying to get snippets to work with Vim (specifically, MacVim). I have tried both snippetsEmu and snipMate (preferred). Other plugins are working fine. I have been able to get snippetsEmu ...
2
votes
2answers
244 views

Second user vimrc file usage on vim running on Mac os X 10.8.5 (Mountain Lion)

I am using MacVim: :version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 17:49:20) MacOS X (unix) version I've executed :version in vim (to check what patches I had installed) and ...
2
votes
1answer
75 views

Why is Vim adding asterisks to my .css file?

I'm editing a .css file with Vim (MacVim, actually), and when I type * followed by a newline, it automatically adds another * at the beginning of the next line. What setting is this, and how can I ...
2
votes
1answer
534 views

How to specify shell for vim?

Can I specify my shell for vim? I'm running OS X and have zsh installed via Homebrew and am using MacVim. When I type shell in MacVim, the shell opens up as bash. How can I have it open as zsh?
2
votes
1answer
363 views

“Illegal starting char” error whenever opening MacVim

Whenever I start MacVim, through Finder or through Terminal, I receive the following error: E575: viminfo: Illegal starting char in line: c/gui_mac.txt Press ENTER or type command to continue I ...