macvim

Setting 2 fonts with different sizes in MacVim

南笙酒味 提交于 2019-12-20 03:12:47
问题 I'm using Vim in MacVim on Mac OS X. I have following config in .gvimrc: set guifont=Inconsolata:h15 But I'd like to set to different font and font size for non-ASCII symbols (because Inconsolata didn't have russian symbols). Problem is that Inconsolata id visually a lot smaller, than Monaco that I'd like to to use for russian characters. In iTerm 2 I have following preferences: Regular font: 15px Inconsolata Non-ASCII Font: 12pt Monaco I'd tried to use: set guifont=Inconsolata:h15,Monaco:h12

Defining my own command

*爱你&永不变心* 提交于 2019-12-20 02:54:34
问题 I'm trying to define my own command in MacVim to turn a c statement or range of statements into comments. So I put this in my vimrc: command -range Com :<line1>,<line2>s?^.*$?/*&*/? It works fine if I just enter :Com to comment the current line. But if I enter something like :Com 3 5 in order to turn lines 3 thru 5 into comments I always get this error message: E488: Trailing characters Can anyone help? 回答1: You need to provide the range before the command, like that: :3,5Com Anyway, I

Ctrl + S is not working as a horizontal split in VIM when using CommandT

随声附和 提交于 2019-12-19 05:23:19
问题 I've been tweaking my ~/.vim quite a lot lately, and it seems that I broke something. I'm using the CommandT plugin, which when the search is open allows for the following: enter - open the file in current buffer Ctrl + S - open the file in horizontal split window Ctrl + V - open the file in vertical split window The problem is, that Ctrl + S suddenly stopped working in terminal VIM, only Ctrl + V is working. At first I thought I broke something in my general config, but then I tried it in

What is the difference between MacVim and regular Vim?

筅森魡賤 提交于 2019-12-17 15:01:12
问题 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? 回答1: 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

How to run mvim (MacVim) from Terminal?

假装没事ソ 提交于 2019-12-17 10:09:20
问题 I have MacVim installed and I am trying to set it up as the editor for Git (version control), but I can't run 'mvim' from the command line as it isn't recognised. How do I setup mvim so I can run it from Terminal? 回答1: There should be a script named mvim in the root of the .bz2 file. Copy this somewhere into your $PATH ( /usr/local/bin would be good ) and you should be sorted. 回答2: I don't think I'd to add anything to the path, did brew install macvim mvim -v should then open macvim in the

vim command after cd

假装没事ソ 提交于 2019-12-14 02:13:47
问题 I want to execute a command automatically after cd'ing to a new directory from within vim. For example, I open gvim and run: :cd ~/src/player I would like vim at this point to automatically source a file that is in that directory. Is this possible? 回答1: You can write an alias for that in your .vimrc: command -nargs=1 Mycd call MyCd(<args>) function MyCd(path) cd a:path e somefile.ext endfunction Then just type: :Mycd /some/path/ 回答2: Not exactly what you're asking for, but :au BufEnter

Side-by-side view in Vim of svn-diff for entire directory

风格不统一 提交于 2019-12-13 18:35:14
问题 I have a MacVim setup on my OSX machine so that the default Vim application (ie: /usr/bin/vim) is actually a symbolic link to the command-line version of Vim that ships with MacVim (ie: /Applications/MacVim.app/MacOS/vim), as it provides some key benefits over the stock Vim that ships with OSX10.6. I periodically need to prepare a diff between a set of files, and export it into a colorful side-by-side-view HTML file. This is commonly achieved via: vim -d file1 file2 (Within Vim): toHTML The

Is there a way to map Control + 6 or Shift + Control + ^ to a leader key?

扶醉桌前 提交于 2019-12-13 15:56:36
问题 Control + 6 or Shift + Control + ^ will switch between the current file and the alternate file in vim. Its useful but I hate using the Control key and try to avoid it if possible. However, despite searching and experimenting I can't seem to map to my leader key. I think the problem is with numeric keys and the caret. Anybody have any ideas to get this working? Thanks in advance 回答1: Both of these work. nnoremap <leader>f <C-^> nnoremap <leader>v :e #<CR> They are currently mapped to random

git rebase -i presents an empty MacVim file

时间秒杀一切 提交于 2019-12-13 12:25:36
问题 I'm trying to rebase a commit. However, any time I run git rebase -i f83eff3ffc8 , for example, a MacVim window opens, that's empty (there is no information in the file). Then once I write and close the file (even though it's empty), I get a Successfully rebased and updated refs/heads/clicktocall-hotfix message. The file name is .git/rebase-merge/git-rebase-todo . I also tried running it with sudo but this didn't make a difference. What could be the problem? I've never successfully completed

How can I get gg=G in vim to ignore a comma?

喜夏-厌秋 提交于 2019-12-13 01:24:26
问题 I have autoindent and smartindent in vim turned on, but nocindent turned off. I'm trying to indent some JSON text without pretty-printing the whole thing, which would be too intrusive: { "a" : "value1", "b": "value2", "c": "value3", ... Gets formatted by gg=G as: { "a" : "value1", "b": "value2", "c": "value3", ... What's the logic going on there, and what options can I set to fix it, if it's possible? I tried toggling options like autoindent, smartindent, and cindent (with their "no"