macvim

Vim swp files interfere with repository vimdiff

ぃ、小莉子 提交于 2019-12-06 04:04:54
My setup is to use vim (specifically MacVim in graphical mode) to edit source files and then I do (mercurial) repository diffs using vimdiff (in graphical mode again). Sometimes, when I do a diff, vim gives me the error: Swap file "~/nn/src/imm/model/injector_node/.values_table.py.swp" already exists! How do I fix this? Can I command vim to stop making swp files, or the vimdiff to ignore them, or write its swp files to a different place? Yes, (maybe), and yes. To turn off swap files: set nobackup set nowritebackup set noswapfile To change location of swap files (my preferred choice): " Set the

How can I get vim to point to macvim? Where can I find macvim?

不羁的心 提交于 2019-12-05 20:25:54
I would like vim to point to macvim :) Probably through an alias. vim is here: whereis vim /usr/bin/vim macvim I can't find, e.g. whereis macvim returns nothing romainl My answer is kind of the opposite of michaelmichael's and I've made it quite a few times : MacVim comes with a CLI executable that you can use in place of Mac OS X's default Vim if you add a single alias to your ~/.bashrc / ~/.profile . No need to compile anything, no need to put MacVim in a special place, no need to overwrite default programs with symlinks This way, you can stay in CLI-land and enjoy the power of a powerful

MacVim: how do I set a left gutter (margin) for my buffers?

那年仲夏 提交于 2019-12-05 16:27:15
问题 In MacVim the text that I'm editing in all buffers is jammed up hard against the left hand side of the buffer. I find this quite visually jarring, especially if I'm looking at a vertical split. It looks like there is only one pixel between my text and the window border. Is there a setting that will allow me to add, say, a character width as a gutter or margin? 回答1: I use line numbering for that reason ( :set number ). But if you want a margin without the numbers, use: :set foldcolumn=<width>

Can't Map <S-CR> in Vim

 ̄綄美尐妖づ 提交于 2019-12-05 11:30:28
Got my first Mac over the weekend, and I'm trying to get adjusted. This line in my vimrc, which worked on my windows, won't work with vim through iTerm inoremap <S-CR> <Esc> I'm wanting Shift-Enter to act as Escape in insert mode. I've tried using Enter and Return, but that requires me to use the Fn key on my Macbook, which is just as annoying as the escape key. I Appreciate the help! The problem here is with the terminal emulation. Most terminals cannot distinguish between non-printing keys [1] and those keys combined with modifier keys. However, you can still make the desired combination

Trouble with vimrc file recognition with MacVim

陌路散爱 提交于 2019-12-05 05:01:03
问题 I'm having difficulty getting MacVim (7.3-64) to recognize my .vimrc and .gvimrc files since upgrading to OS X 10.7.3. Previous, I've simply symlinked my .vimrc and .gvimrc using these commmands: $ ln -s ~/.vim/vimrc /usr/local/Cellar/macvim/7.3-57/MacVim.app/Contents/Resources/vim/.vimrc $ ln -s ~/.vim/gvimrc /usr/local/Cellar/macvim/7.3-57/MacVim.app/Contents/Resources/vim/.gvimrc However, when I currently symlink my rc files, I can not get MacVim to recognize them. I've installed MacVim

Macvim won't load specific color scheme by default

余生长醉 提交于 2019-12-05 03:42:19
I'm having a problem similar to VIM Color scheme not loading by default Except I am having the problem with the gentooish theme found here http://www.vim.org/scripts/script.php?script_id=2474 For some reason macvim refuses to load this colorscheme by default. My vimrc file is as follows, I do not have a .gvimrc file. :set term=xterm-256color :set t_Co=256 set background=dark colorscheme gentooish But once I have macvim opened if I do :colorscheme gentooish it will load fine. Also it does load by default if I type vim on the command line. It just won't load by default in macvim. Any ideas?

VIM: exit insert mode with :normal command

我与影子孤独终老i 提交于 2019-12-05 00:51:32
When I go into insert mode with the :normal command ( :normal i ) for example, how do I exit insert mode? If I press <Esc>, or <c-c>, or <c-[>, VIM exits command mode and I can't run my :normal command. I put imap <c-e> <Esc> in my .vimrc but when I type <c-e> in command mode, nothing gets inserted. I can't figure out how to enter a "control e" in command mode. <c-o> works, for example :normal Ihello<c-o>Aworld but sometimes I want to do more than one command in normal mode. I know I can use a macro, but I want to know how to do it with :normal. To add a literal <ESC> to your command, press

git rebase -i presents an empty MacVim file

淺唱寂寞╮ 提交于 2019-12-04 23:46:38
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 a rebase. Kevin Burke I was using Macvim and needed to run mvim with the -f option, as documented here:

Can vim commands be mapped to key combinations with >1 modifier (e.g. ctrl-alt-v)

爱⌒轻易说出口 提交于 2019-12-04 23:11:58
Is it possible to map a vim command to a combination of keys involving more than one modifier? For example: ctrl-alt-v . As far as I can tell, the only modifier key that can be used in combination with another is shift. e.g. <C-v> and <C-V> . Or am I missing something? chaos Yeah, you would map <C-A-v> or <C-M-v> (A, Alt, and M, Meta are equivalent concepts). See :help key-notation . There's also this script ( arpeggio ) that allows you to use two or more simultaneously pressed keys (any keys, not just modifiers keys like shift, alt, etc.) in your mappings. They can be combined just fine, like

Opening a directory in vim

大城市里の小女人 提交于 2019-12-04 22:35:13
I'm a mac user giving vim a serious try. Most of the GUI editors I'm used to allow me to open a directory as a "project" by executing a command like: edit ~/www/example.com/ The vim equivalent vim ~/www/example.com/ will show me a list of files in the directory, and I can open them. But it does not set vim's working directory to that path, I have to run :cd . to set the working directory. Is there some way, perhaps with a shell script, to open vim and have it's working directory set to a given path? I'm actually using MacVim, if that makes any difference. Thanks to @sehe's suggestions, I came