Questions tagged [macvim]

Vim modified to run as a native OSX ("Cocoa") application. This is NOT the Vim that's included on OSX by default.

Filter by
Sorted by
Tagged with
92 votes
6 answers
48k views

Vim search replace all files in current (project) folder

One of the open questions I have about Vim is if there is a way to perform a search/replace in the current project (bear with me if I use this notion inherited from other editors). For instance, let'...
Simone Carletti's user avatar
29 votes
6 answers
7k views

What additional features do gVim and/or MacVim offer compared to Vim inside a terminal emulator?

I'm learning Vim by watching screencasts. And I'm wondering, why do a lot of people use gVim or MacVim? From what I can see, the GUI Vim version only have additional features that involves using ...
Aaron Shen's user avatar
  • 2,519
20 votes
1 answer
10k views

Get the current window/buffer/tabpage in Vimscript

In python, when using the vim module, it is incredibly simple to get the current window/buffer/tabpage: current_win = vim.current.window current_buff = vim.current.buffer current_tabpage = vim....
naiveai's user avatar
  • 365
15 votes
1 answer
5k views

Mapping Ctrl with equal sign

I am trying to map my Ctrl and plus sign together. This is what I am trying in my vimrc: nnoremap <C-=> : echo "Hello" <CR> However it seems like the mapping is not being triggered. ...
James Franco's user avatar
  • 1,101
13 votes
1 answer
764 views

Why is MacVim starting differently every other invocation?

I noticed when I sat down to do some work on my MacBook today that at some point recently something had gotten screwed up with respect to my .gvimrc settings: when I launched MacVim, everything seemed ...
user avatar
10 votes
1 answer
2k views

Mouse wheel scrolling inserts characters

I'm using macvim inside tmux inside iTerm2. Basically I just want to be able to scroll the buffer using the mousewheel. I've set set -g moude-mouse on in my .tmux.conf, and set mouse=a set ttymouse=...
DeX3's user avatar
  • 403
10 votes
1 answer
4k views

how to make vim properly render RTL (Right to Left) languages

I get this on my vim: but the arabic translation is showing all messed up (in reverse orderlike dessem pu) it should instead show like this (this is rendered in source tree:) How to I make this ...
abbood's user avatar
  • 733
9 votes
2 answers
10k views

Can you use neovim in a gui like mvim or gvim? (Mac OS X)

Maybe a stupid question but is it possible to run neovim on a GUI like gvim or mvim? I need some GUI to do remote work within Filezilla Thanks
Sebastian Tramper's user avatar
8 votes
3 answers
3k views

How to simply remove braces

One of my friend told me that I can use the trick below to remove a pair of curly brackets. Put the cursor inside the curly bracket pair you want to remove. y i { to yank the text in braces , then v ...
MrDwZ's user avatar
  • 101
8 votes
1 answer
4k views

How to preview the result of markdown file edited in vim?

I use vim to edit latex, but latex is bit too heavy for taking notes casually on daily basis, so I decided to use markdown instead. So, I want to configure vim so that I could view markdown ...
Tom's user avatar
  • 379
7 votes
2 answers
967 views

MacVim - doesnt find programs in PATH when running commands using "!"

When I'm using vim in a terminal, it uses the PATH I have set, and I can run programs and scripts located in my ~/bin folder using ! For example :! some_bash_script.sh When I try this in MacVim, it ...
Brad Parks's user avatar
7 votes
1 answer
4k views

How do I convert a String to a Number, catching invalid strings?

I am trying to convert a String '1' to a Number (int) 1 in a vimL script. I have used the built-in command str2nr() so far, however I was not able to write this in an elegant and effective way. ...
mbilyanov's user avatar
  • 707
6 votes
2 answers
786 views

Repeating the last move using . (w followed by .)

I read that . is used for repeating the last command in Normal Mode. So if I used the command 2w move forward two words and then press . then I would expect to move two words more however this does ...
James Franco's user avatar
  • 1,101
6 votes
1 answer
234 views

What's the point of :promptfind after all

Not sure if it's an appropriate question. But I just can't help wondering, why would any Vim user find it necessary to invoke a GUI search prompt instead of search using / or ?, why would the designer ...
xji's user avatar
  • 214
6 votes
0 answers
3k views

Collapse all directories in NerdTree by default

I recently restored my computer to a clean install and copied over my dot files. MacVim behaves quite a bit differently than my previous install. One main thing is that NerdTree no longer collapses ...
Chad Fawcett's user avatar
5 votes
1 answer
5k views

How to move cursor in a specific column

I know that there is already a method to move the cursor to a particular line in vim like :25 and it moves to line number 25. But can I configure vim to move to 15th column in 25th line say something ...
Mayukh Sarkar's user avatar
5 votes
1 answer
4k views

Delay before running vim command?

This is probably just a bandaid for a greater problem, but I had the following code for MacVim (GUI mode) in my .vimrc autocmd GUIEnter * winpos 100 50 The problem is it's not working properly on ...
Tallboy's user avatar
  • 177
5 votes
1 answer
606 views

How can I disable all mouse functions in MacVim?

Is there a way that I can use the 'mouse' option to disable all mouse functions in MacVim?
Joshua Lee's user avatar
5 votes
1 answer
195 views

MacVim thinks I have unmatching parentheses, until I place cursor over each parenthesis

I am trying out MacVim for the first time and Vim seems to think I have a surplus of closing parentheses: However, Vim seems to change it's mind. Each highlighted closing parenthesis is no longer ...
WickedJargon's user avatar
5 votes
1 answer
482 views

Can I retain and restore all the GUI windows and its files on launch on Vim?

I'm currently using the session saving to restore the state when the app (MacVim) is closed. nnoremap <leader>q :mksession! ~/.vim/Session.vim<CR>:wqa<CR> nnoremap <leader>...
Blaszard's user avatar
  • 555
5 votes
2 answers
4k views

How to use Lua in Vim?

I'm using MacVim snapshot 134 (on Mac OS X 10.9.5), which has support for Lua: $ vim --version | grep lua +dialog_con_gui +lua/dyn +rightleft +writebackup I've got Lua installed and ...
8bittree's user avatar
  • 1,536
5 votes
1 answer
448 views

MacVim doesn't redraw screen properly [closed]

Sometimes when I do something like saving, opening another file or another tab, the screen isn't changing states properly. At first I thought it was just my computer being slow, but then I noticed ...
Akiiino's user avatar
  • 211
5 votes
0 answers
342 views

Encoding issue with filename in MacVim

Question In MacVim I type :tabe jäderberg.txt to open a buffer for that file. The file does not yet exist. My status line displays the file name jäderberg.txt. I do i<C-r>% to put the file name ...
jjaderberg's user avatar
  • 3,489
4 votes
3 answers
7k views

Scrolling down multiple lines with Ctrl+e

I know i can scroll down using ctrl+e and up using control ctrl+y. Any idea how I can scroll multiple lines with ctrl+e ? I am looking for a quick solution for scrolling down in vim ?
James Franco's user avatar
  • 1,101
4 votes
2 answers
2k views

How to change Vim's :hardcopy printfont?

I would like to be able to print in other than Courier font using the :ha command. Investigating more closely, I found that it is documented that the Courier font is always used: - 'printfont' - The ...
Wildcard's user avatar
  • 4,409
4 votes
2 answers
723 views

Where does MacVim send its printed files?

I found out about printing using the :hardcopy command, and on my Mac it opens up the output in a PDF named "0.pdf", then the next printing from that file opens "1.pdf", etc. I can save these files, ...
Wildcard's user avatar
  • 4,409
4 votes
1 answer
3k views

Are CTRL+C and <esc> the same?

I tried entering the key sequence <esc>+<n>+i+<some-char>+<esc> and it'll type <some-char> <n> times. But if I'm using a macbook keyboard there is no escape key, ...
leeand00's user avatar
  • 3,577
4 votes
1 answer
234 views

Visually selecting a line and then deleting does not copy to black hole register

I would like to not have vim copy items to the default register when I delete or change an item; for that, the following configuration seems to do the job perfectly. However I noticed that the only ...
James Franco's user avatar
  • 1,101
4 votes
1 answer
799 views

How can I force a page break in MacVim's printed output?

I've discovered the :hardcopy command, which is the equivalent of the Command-P command in MacVim. I've also found that it accepts ranges. For instance, in my markdown file, I can split the sections ...
Wildcard's user avatar
  • 4,409
4 votes
1 answer
267 views

When using macvim with symlinks, is opening vim just calling mvim -v?

I've installed macvim on OSX 10.11.6 using brew install macvim --with-override-system-vim. This worked fine. I now have some new aliases/symlinks (I'm not too familiar with the differences): . #in ...
user4396386's user avatar
4 votes
2 answers
669 views

Why is the cursorline always showing after the cursor moves over a line?

Can anyone can help me, my vim always shows the cursorline, like this: I have set nocursorline in the ~/.vimrc, but it has no effect. vim version is: 7.4.622 vim is run on OSX 10.10.3, how to ...
lutaoact's user avatar
  • 169
4 votes
2 answers
947 views

MacVim Text rendering problem when scroll up and down

This could be a rare issue related to individual environment. But it's so annoying that can't help me asking for help. Please have a look at following captured photos which is fine before scrolling ...
MGC's user avatar
  • 141
4 votes
1 answer
2k views

How to write message strings to a file using vim script?

I would like to create two functions, one for sending a message string to Vim's own messaging system and one to dump the message string to a file. Now, I have already progressed in figuring this out ...
mbilyanov's user avatar
  • 707
3 votes
3 answers
1k views

Indent line to the right with CMD + ] in insert mode

This is a usual shortcut in other editors: indent the current line to the right with CMD+]. How can achieve this in MacVim without leaving the insert mode?
D Pinto's user avatar
  • 133
3 votes
4 answers
2k views

Using Vim/GVim for slideshow presentation

I came across this video about Vim. I would like to ask how can you create a presentation like in the video which seems to run inside Vim. On some slides there are also real pictures displayed. Check ...
yinyangero's user avatar
3 votes
1 answer
338 views

How to not close MacVim after the last tab is closed?

Can this be done by editing the .vimrc file? What I need is that after closing all tabs, a new tab is there like notepad++ does.
NeoZoom.lua's user avatar
  • 1,462
3 votes
1 answer
280 views

How can I drag a file onto MacVim and make it open in a split, not a new tab?

I have MacVim 7.1 (patch level 903). When I drag a file onto it from the Finder, desktop, etc., it opens in a new tab. However, I would prefer that it open in a split. According to :help drag-n-drop, ...
Andrew Ferrier's user avatar
3 votes
2 answers
665 views

Vimfiler (a plugin): how to open .doc file using MS Word

I have a question regarding a plugin called Vimfiler. What I want is to open a .doc/.docx file using MS Word from Vimfiler. For this, I added the following call vimfiler#set_execute_file('doc,docx', '...
T_T's user avatar
  • 189
3 votes
1 answer
287 views

remap "undo key" to no op

I have a keyboard with an undo key right next to the esc key. I often miss esc, hit undo, which causes the vim process to be stopped. How can I remap the undo key in vim such that it doesn't do ...
Brian Barnes's user avatar
3 votes
2 answers
10k views

NERDTreeTabs error message: E492: Not an editor command

I am using macvim Version 8.0.1098 (137) MacOS Sierra 10.12.6. I downloaded NerdTree tabs from here. I am using pathogen to manage my plugins. All the plugins work except this one. This is the error ...
Rajeshwar's user avatar
  • 379
3 votes
1 answer
3k views

How to match paragraphs of text ending with a character?

This problem that seems trivial is beating me real hard. I'm trying to create a couple of syntax highlighting directives for a custom language that is structured in paragraphs separated by at least ...
Jon Mod's user avatar
  • 33
3 votes
1 answer
171 views

Float YCM completion candidate list to make more of entry previews visible?

Using plugin YouCompleteMe, I get useful previews of entries. However, if the cursor is near the end of the line, the list gets out of sight. Screenshots below; the latter with pumwidth=75. (First ...
krissen's user avatar
  • 33
3 votes
1 answer
587 views

Specifying the line on which the cursor should start at

I am working on a project that could really benefit if I can open vim by specifying a line number/ match so that the file would open with the cursor positioned on that line. Is there a way to do that ...
Durga Swaroop's user avatar
3 votes
0 answers
84 views

Why did MacVim try to connect to Vimium server?

So, I have installed Vimium today, and when I first relaunched MacVim, my Little Snitch showed that it tried to connect to vimium.github.io, which it never did before. Why did it do that and how has ...
Akiiino's user avatar
  • 211
2 votes
2 answers
571 views

How do I enable Bash keyboard shortcuts while in Insert mode?

I like using the Bash shortcuts while at the command line to move around and edit text. A sample of some commands from the link can be seen below: Ctrl + a Go to the beginning of the line (Home) ...
mbigras's user avatar
  • 637
2 votes
1 answer
222 views

ctrl+o and ctrl+i don't work with line skip motion 10j

I was very excited to see the relative line number feature in vim. Now vertical navigation would be a breeze, and instead of typing huge numbers, I can simply do 10j to move 10 lines down. However, ...
James Franco's user avatar
  • 1,101
2 votes
1 answer
397 views

Assign shortcut to a Split window resize Ctrl+w+|

I can expand a vertical split screen to occupy most of the area using Ctrl+w+| Now I would like to map that shortcut to Ctrl+m. I tried the following but it failed. nnoremap <C-m> <C-W&...
James Franco's user avatar
  • 1,101
2 votes
2 answers
3k views

Why does peachpuff colorscheme looks completely different in terminal and GUI (MacVim)?

I've installed MacVim using Brew: brew cask install neovim I'm using the macOS's Terminal.app to run MacVim in Terminal mode. I've experimented with :colorscheme peachpuff, since many recommends that ...
Shuzheng's user avatar
  • 1,235
2 votes
2 answers
956 views

Can't get color output in MacVim's command line

When I try and trigger PHPUnit tests within MacVim, I can't see coloured outputs in my command line:
noobmaster69's user avatar
2 votes
1 answer
136 views

Going back to the [n] last edited position

I read the following on vim tips '`' ('' is a mark specifier): move to the position of the given mark) - mark '.' is the last edited position My question is suppose I have two line Line 1 Line ...
Rajeshwar's user avatar
  • 379