macvim

how to map command key when configurate .vimrc?

放肆的年华 提交于 2019-12-02 07:21:04
问题 I use mac , and I want to configurate .vimrc , for example: :map <C-a> p means ctrl-a -> p now , I want to do this using command key on mac keyboard, how can I do this? I tried :map <D-a> p , but I failed . whick word represent command key? 回答1: The mapping should work. Unless macvim has already mapped that key to a menu. You first need to unmap it from the menu by adding something like the following into your .gvimrc NOT .vimrc . macmenu Edit.Select\ All key=<nop> to unmap <D-A> from Select

How to scroll up to view the output of system command in Vim

匆匆过客 提交于 2019-12-02 06:47:36
问题 I really like run some system command in vim like :!rspec but the annoying thing is I can't scroll up to see the output information I'm using Macvim in Mac 10.9, anyone know how to do this? 回答1: As far as I know, you can't scroll up in output that comes from an external source. Messages do have a simple scrolling facility but only for the messages over which Vim has full control. See :h messages. Looking at your screenshot though, I can tell you that you're doing it wrong. Running RSpec

how to map command key when configurate .vimrc?

 ̄綄美尐妖づ 提交于 2019-12-02 05:06:46
I use mac , and I want to configurate .vimrc , for example: :map <C-a> p means ctrl-a -> p now , I want to do this using command key on mac keyboard, how can I do this? I tried :map <D-a> p , but I failed . whick word represent command key? The mapping should work. Unless macvim has already mapped that key to a menu. You first need to unmap it from the menu by adding something like the following into your .gvimrc NOT .vimrc . macmenu Edit.Select\ All key=<nop> to unmap <D-A> from Select All. After that nnoremap <D-a> p will map <D-a> to p . 来源: https://stackoverflow.com/questions/28528151/how

How to scroll up to view the output of system command in Vim

不羁的心 提交于 2019-12-02 02:42:09
I really like run some system command in vim like :!rspec but the annoying thing is I can't scroll up to see the output information I'm using Macvim in Mac 10.9, anyone know how to do this? As far as I know, you can't scroll up in output that comes from an external source. Messages do have a simple scrolling facility but only for the messages over which Vim has full control. See :h messages . Looking at your screenshot though, I can tell you that you're doing it wrong. Running RSpec through :!rspec is inefficient. Vim has an RSpec compiler in its runtime. :compiler rspec :make Now RSpec output

Setting 2 fonts with different sizes in MacVim

久未见 提交于 2019-12-01 23:39:32
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 But :h12 part didn't work (while Monaco part worked). Is there a way to fix it? You can have a look at

Defining my own command

风流意气都作罢 提交于 2019-12-01 20:35:59
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? You need to provide the range before the command, like that: :3,5Com Anyway, I suggest you to check the NERD_commenter plugin. It's great for commenting source code. 来源: https://stackoverflow

set .vim home directory to something specific

淺唱寂寞╮ 提交于 2019-12-01 17:38:24
My projects are all under /Users/username/workspace/my_project where /Users/username/ is $HOME . I want macvim to always have the home as /Users/username/workspace/my_project instead of /Users/username/ . I understand set autochdir sets the home to whatever the current file's directory is, but this is not what I want. Also I'm using NerdTree if that helps. Do you want Vim's working directory to be ~/my_project ? Add cd ~/my_project to your ~/.vimrc . Do you want all your plugins and colorschemes to be loaded from ~/my_project , however silly it is? See :help runtimepath . 来源: https:/

VIM Unix commands printed in color

邮差的信 提交于 2019-12-01 16:52:56
I'm using MacVim and I would like to have ! commands printed in color. For example: In bash, the following echo statement prints Hello World in green (as expected): $ echo -e "\033[32m Hello World" Hello World However, in VIM the output is not color, and the escape codes are printed: :!echo -e "\033[32m Hello World" [32m Hello World How can one have VIM (and MacVim build 57 in particular) print the output of ! commands and honour ANSI color escapes. You can't. But you can suspend the editor and drop to a shell relatively quickly; Or you can use Ansi Filter to remove the escape sequences so you

Cursor color in vim terminal OS X Mountain Lion

不打扰是莪最后的温柔 提交于 2019-12-01 15:31:10
问题 I want to make the cursor and selected text easier to read in vim (white background, black foreground), so i've done hi Visual guibg=white guifg=black gui=NONE ctermfg=black ctermbg=white cterm=reverse hi Cursor guibg=white guifg=black gui=NONE ctermfg=black ctermbg=white cterm=reverse which gives me exactly what i want on MacVim. On the vim terminal, however, it defaults to the terminal preferences, which is very difficult to read and find...how can i override the terminal defaults? Edit: to

Vim 实用技术,第 1 部分: 实用技巧

时光怂恿深爱的人放手 提交于 2019-12-01 15:18:26
0. Vim 简介 作为开源世界最重要的编辑器之一(另一个是 Emacs),Vim 以其强大的功能和可定制能力被众多开发者所喜爱。不过,也许就是因为 Vim 的功能太强大了,要真正用好 Vim 并不容易。本文作者在多年的实际使用中逐渐掌握了一些实用技术,在此介绍给大家。——本文并不企图对 Vim 作全面而系统的介绍,但也绝非零星地点到即止;而是希望通过介绍一些重要特性和提供相关参考信息,引起大家的兴趣,去深入挖掘其能力,真正把这一强大的工 具用好。 下面首先对 Vim 做一下最基本的介绍,并给出一些参考信息,以方便对 Vim 不熟悉的读者也能够理解并自己查阅进一步信息。 与大部分其它编辑器不同,进入 Vim 后,缺省状态下键入的字符并不会插入到所编辑的文件之中。Vim 的模式(mode,可以简单地理解为“状态”)概念非常重要。需要知道,Vim 有以下几个模式: ●正常(normal)模式,缺省的编辑模式;下面如果不加特殊说明,提到的命令都直接在正常模式下输入;任何其它模式中都可以通过键盘上的 Esc 键回到正常模式。 ●命令(command)模式,用于执行较长、较复杂的命令;在正常模式下输入“:”(一般命令)、“/”(正向搜索)或“?”(反向搜索)即可进入该模式;命令模式下的命令要输入回车键(Enter)才算完成。 ●插入(insert)模式,输入文本时使用;在正常模式下键入“i”