macvim

将文本粘贴到vim时关闭自动缩进

Deadly 提交于 2019-12-12 13:03:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我正在努力学习Vim。 当我从剪贴板将代码粘贴到我的文档中时,我会在每个新行的开头添加额外的空格: line line line 我知道你可以关闭自动缩进,但我无法让它工作,因为我有一些其他设置冲突或某事(在我的.vimrc中看起来非常明显,但是当我把它们取出时似乎并不重要)。 当我粘贴代码时如何关闭自动缩进但在编写代码时仍然有自动缩进? 这是我的 .vimrc 文件: set expandtab set tabstop=2 set shiftwidth=2 set autoindent set smartindent set bg=dark set nowrap #1楼 这适用于我(+寄存器的情况,我使用的像aps之间的交换缓冲区): imap <silent> <S-Insert> <C-O>:set noai<CR><C-R>+<C-O>:set ai<CR> #2楼 把它粘在你的〜/ .vimrc中并开心: " enables :Paste to just do what you want command Paste execute 'set noai | insert | set ai' 编辑:反思, :r !cat 是一个更好的方法,因为它很短,语义,并且不需要自定义vimrc。 改用它! #3楼

Why won't macvim always use ruby 1.9.3?

删除回忆录丶 提交于 2019-12-12 12:28:08
问题 I have installed yadr dotfiles, a set of vim, ruby, etc plugins. I have the following line of Ruby code in a file foo.rb : foo: bar Note I used the ruby 1.9.3 syntax for symbol assignment/definition. When I start macvim from command line using mvim foo.rb and save that file, everything works fine. However, when I open macvim using open -a macvim and navigate to and open foo.rb , when I try to save the file I get a ruby-vim syntax error on foo: bar . When I change it to :foo => bar I don't get

Open vim tab in new (GUI) window?

跟風遠走 提交于 2019-12-12 08:47:13
问题 I'd like to move the current tab into a new (visual/real) window in MacVim. It's probably difficult, as: there is nothing in the vim help and only very few - not helpful - hits on google MacVim does not support it (link, 2009) So I am wondering if someone has found a way to achieve this? 回答1: The closest I think you can come is using mksession This will have several drawbacks (like, initially the secondary session will open a few more buffers than ultimately desired). However, it will

How to exit alternate screen scrolling on iTerm2 Vim?

心已入冬 提交于 2019-12-11 15:19:13
问题 First, sorry if the title isn't precise. I'm in a weird situation, while using Vim on Mac iTerm2. More precisely, when I release two finger click it scrolls down 3 lines. Sort of same thing is mentioned at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683942 and its referred as "alternate screen scrolling". How do I came in this situation? Well, I was in a remote ssh session and just just closed macbook, put it on bag and went to lunch. When I came back I experienced this strange thing.

Vim Swap Files Not Deleting

纵然是瞬间 提交于 2019-12-11 11:42:08
问题 Vim is not deleting .swp files when I quit. I am using vim in iTerm (macvim) and quitting with :q or :wq or :qa . My swap files seem to be sticking around. I have had to ad *.swp *.swo *.swn to my .gitignore which is becoming frustrating to say the least and I'm sure it's confusing my clients and coworkers. They are filling my computer with needless files. And of course I have to step through the "Swap file exists" warning every time I open a file. I'd like swap files to delete on quit.

MacVim uses wrong Python Virtualenv

我与影子孤独终老i 提交于 2019-12-11 03:32:52
问题 I want to use the virtualenv's python to execute the current buffer using :!python % <Enter> . However, MacVim uses the system python instead of the virtualenv's python. I've implemented this answer, but :!python %<Enter> still doesn't behave properly. Here's an example of what I mean -- these commands have the virtualenv activated (managed with virtualenvwrapper, it that matters) In the shell: which python --> /Users/myuser/.virtualenvs/MyVirtualEnv/bin/python --> OK MacVim: :python import

Command - R like functionality in MacVim

孤者浪人 提交于 2019-12-11 03:09:39
问题 I'm on a Mac and when I am in TextMate editing a ruby file I can simply hit Command-R to execute the file and see the results in a new window. Is there something similar to this using MacVim? It's really important that I be able to open up a NEW window. Reason is because in the current window I might have more than one full page of info. If that happens I can't scroll through it. 回答1: You could create your own mapping to do it: map <D-r> :w<CR>:!ruby %<CR> % is the current file. If your file

Why does my YCM Server shut down?

不羁岁月 提交于 2019-12-11 01:39:42
问题 Whenever I open vim, I get the message that Ycm Server has shutdown with exit code -6. The log files contain the following info: 2017-12-23 21:25:50,550 - ERROR - Unable to connect to server Traceback (most recent call last): File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 217, in HandleServerException yield File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 237, in CheckIfServerIsReady

VIM - How to I make Undo put me back in what ever mode I was on previously?

会有一股神秘感。 提交于 2019-12-11 01:37:43
问题 I often go around editing things in normal mode only to realise my change was not intended, as such, I undo and then press K/L/J/H to continue but meanwhile I am already in insert mode, so I have to get out of it first. I would like to insert a rule on my .vimrc to put me back on the mode I was on just before any changes that I did. IE: shift+s (delete line and start editing) -> undo : Back in normal mode Bonus: ciw -> asdahsdasdh -> undo: Back in normal mode PS: I am actually using Undo with

VIM Flashing Issue

耗尽温柔 提交于 2019-12-11 01:19:33
问题 I'm SSH'ing in from my mac OSX (10.6.8) to a school server running centOS5 and when I attempt to use VIM, it won't stop flashing inside the mac terminal. Any idea's on how to fix this? Keep in my mind I do not have the authority to modify any /etc files or /bin files on the server, although I believe I can locally on my user. Also I would love to see anyone's really cool .vimrc config file they want to share. 回答1: I´ve just had the same issue. I solved it by disabling the setting "Allow