macvim

Eliminating lag when remapping 'd' key in VIM

筅森魡賤 提交于 2019-12-10 18:35:41
问题 I use a Dvorak keyboard layout, and so I've made a few adjustments to the default VIM mappings-- one change I've made is to remap the right-side home row keys to noremap d h noremap h j noremap t k noremap n l So that movement keys are conveniently positioned, as they would be for a QWERTY user. h , t , and n do their job fine and are very responsive. d , however, lags for a moment before moving left the way its supposed to. I think this is because there are key-sequence commands that start

Vim/MacVim: when I scroll with mouse, the text cursor moves too!

北战南征 提交于 2019-12-10 12:42:38
问题 I've been getting used to Vim/MacVim for the last few weeks. One of main problems I seem to be having is when I scroll around using the mouse (especially when I'm trying to select large portions of text) the text insertion cursor moves too and doesn't stay where it was (like in TextMate for example). This means I've selected a large piece of text, when I scroll back up to review my selection the cursor will move which messes with the selection that I've made. I do realise I should get used to

Vim swp files interfere with repository vimdiff

柔情痞子 提交于 2019-12-10 10:12:24
问题 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? 回答1: Yes, (maybe), and yes. To turn off swap files: set

Spanish spelling checker for MacVim?

落花浮王杯 提交于 2019-12-10 02:16:00
问题 How do I add the Spanish spell-checker for MacVim? I read that this is a useful link, but apparently it is not working ... what should I do? 回答1: I don't know about MacVim, however I just tested the following in vim 7.2 on Windows 7. Set the spelling language to Spanish and switch on spell checking: :set spelllang=es :set spell At this point Vim tells you: Cannot find spell file for "es" in utf-8. Do you want me to try downloading it? If you say yes, vim will download these two files into the

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

二次信任 提交于 2019-12-10 01:00:32
问题 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? 回答1: Yeah, you would map <C-A-v> or <C-M-v> (A, Alt, and M, Meta are equivalent concepts). See :help key-notation. 回答2: There's also this script (arpeggio) that allows you to use two or more simultaneously pressed keys (any

Is there a way to list all the default normal, visual and insert mode bindings in vim?

五迷三道 提交于 2019-12-09 15:55:51
问题 When you use the :map command without any parameters, it seems that it only lists custom and plugin bindings. Is there a way to view ALL bindings? It would be nice to know if a custom binding would conflict with one of the defaults. Alternatively, is there a decent online reference? 回答1: There is a list of all of the standard key bindings that you can get by typing :help index . Those are in addition to the custom ones printed out by :map . 来源: https://stackoverflow.com/questions/4778715/is

MacVim and Mercurial check-in

守給你的承諾、 提交于 2019-12-08 17:00:39
问题 I'm trying to use MacVim as a default editor (on my Mac, obviously). I'd like to have MacVim to edit commit messages when I hg ci . Unfortunately when I do so (either by setting EDITOR=mvim or alias vi='mvim' ) MacVim pops up with an empty message (i.e. none of the boilerplate in the bottom half), and when I save that commit message I get the error "abort: empty commit message". Is there a way to use MacVim (presumably via mvim ) to edit the commit messages when checking in changes with

Remapping 'wq' to save and close buffer instead of save and quit

*爱你&永不变心* 提交于 2019-12-08 16:15:45
问题 Vim newbie here. when I ':wq' I want it to save and delete the buffer instead of save and quit. Similarly hitting ':q' would execute ':bd' instead. Any suggestions? Thanks! 回答1: Vim allows to add key mappings for commands in all of the modes including command line mode, so you can define these mappings (in your .vimrc ): :cnoreabbrev wq w<bar>bd :cnoreabbrev q bd The commands tell Vim that pressing w q in command line must be expanded into w|bd and, similarly, q into bd . See :help key

How to setup Syntastic as python3 checker instead of python2

北战南征 提交于 2019-12-08 15:40:41
问题 In MacVim, I save following code as test.py print "Hello world! python2" , which is apparently wrong with python3, but after I run :w to save the file, there is no error message for it, Following is a part of ~/.vimrc, which is all about Syntastic: " Syntastic "" Recommended settings set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 ""

VIM Single Compile command from insert mode

送分小仙女□ 提交于 2019-12-08 08:10:31
问题 I'm following Mapping keys in Vim - Tutorial (Part 1) - 6.2 Insert mode maps, and there it says: The <C-R>= command doesn't create a new undo point. You can also call Vim functions using the <C-R>= command: :inoremap <F2> <C-R>=MyVimFunc()<CR> I'm trying to use this to call SingleCompile#Compile() like: map! <F5> <C-R>=SingleCompile#Compile()<CR> It's working, but the problem is that when I get back to insert mode, a 0 character is inserted as a side-effect. Why is this and how can I avoid it