vim

Compiling vim with specific version of Python

时光总嘲笑我的痴心妄想 提交于 2019-12-20 08:40:34
问题 I'm working on several Python projects who run on various versions of Python. I'm hoping to set up my vim environment to use ropevim, pyflakes, and pylint but I've run into some issues caused by using a single vim (compiled for a specific version of Python which doesn't match the project's Python version). I'm hoping to build vim into each of my virtualenv directories but I've run into an issue and I can't get it to work. When I try to build vim from source, despite specifying the Python

How to write a VIM color scheme?

左心房为你撑大大i 提交于 2019-12-20 08:39:00
问题 I have been looking around for VIM color schemes and found some great ones out there (esp. by using http://code.google.com/p/vimcolorschemetest/), but I always want to change a few aspects of each one I find. So I've decided now that what I really want to do is make my own, or be able to customize the ones I find on the fly. Basically, what I want to know is: 1) How do I write a vim color scheme -- are there any good (quick) tutorials? 2) How do I add language-specific customizations? Like

How to write a VIM color scheme?

风流意气都作罢 提交于 2019-12-20 08:38:32
问题 I have been looking around for VIM color schemes and found some great ones out there (esp. by using http://code.google.com/p/vimcolorschemetest/), but I always want to change a few aspects of each one I find. So I've decided now that what I really want to do is make my own, or be able to customize the ones I find on the fly. Basically, what I want to know is: 1) How do I write a vim color scheme -- are there any good (quick) tutorials? 2) How do I add language-specific customizations? Like

Vim [compile and] run shortcut

不打扰是莪最后的温柔 提交于 2019-12-20 08:36:34
问题 Basically what I want is a keyboard shortcut in vim that lets me [compile and] run the currently being edited C, C++ or Python program. In psuedocode: when a shortcut key is pressed: if current_extension == 'c' then shell: gcc this_filename.c -o this_filename_without_extension if retcode == 0 then shell: ./this_filename_without_extension else if current_extension == 'cpp' then shell: g++ this_filename.cpp -o this_filename_without_extension if retcode == 0 then shell: ./this_filename_without

how to paste to vim when using putty

喜夏-厌秋 提交于 2019-12-20 08:31:36
问题 I am using putty to connect a remote host and editing via vim. I meet a trouble when I try to paste something to vim. That's, I copy something to clipboard in my local host and want to paste it to the vim in the remote host. How to do that? ps: I am using putty! So, I open a vim window via putty. The very need is that I want to copy something in my local host and paste it to the vim editor opened by putty. That's all. Thanks! 回答1: Try with Ctrl + Shift + V or with middle click with a 3 button

Opening files in the same folder as the current file, in vim

蓝咒 提交于 2019-12-20 08:27:53
问题 In vim, when I have a buffer open, I often need to load another file in the same directory that file is in, but since I don't usually cd into it, the pwd is a parent folder, so I have to retype the path every time. Is there a shortcut for this? or a way to change the pwd to the directory the file is in? example: cd /src vi lib/foo/file.js lib/foo has two files: file.js and file2.js in vi: :e file2.js # doesn't work 回答1: Newer versions of vim have a autochdir command built in, if not you can

vim colorschemes not changing background color

落花浮王杯 提交于 2019-12-20 08:25:34
问题 I try to apply various color schemes in vim that I have seen on the net. Whatever scheme I choose, the background remains white, even though screenshots of the applied scheme shows that the background should be colored. In some schemes, some of the background change color, but space right of lines containing text still remains white. I'm using Vim 7.2 on a mac. I have just started messing with non-gui applications, so everything should be pretty much as it was out of the box.. Does the

What's the most elegant way of commenting / uncommenting blocks of ruby code in Vim?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 08:24:25
问题 In VIM, at the moment when I need to comment out a section of Ruby code: I navigate to the first column in the row I want to comment out I press CTRL-v to enter visual block mode I navigate down till the place I want to end the operation I type r<space> if I want to uncomment the code or r# if I want to comment it out. This workflow seems ok to me, are there any ways of improving this process? Are there any other tricks for commenting or uncommenting ruby code sections in vim? 回答1: I do

Javascript syntax highlighting in vim

让人想犯罪 __ 提交于 2019-12-20 08:24:08
问题 Has anyone else found VIM's syntax highlighting of Javascript sub-optimal? I'm finding that sometimes I need to scroll around in order to get the syntax highlighting adjusted, as sometimes it mysteriously drops all highlighting. Are there any work-arounds or ways to fix this? I'm using vim 7.1. 回答1: You might like to try this improved Javascript syntax highlighter rather than the one that ships with VIMRUNTIME. 回答2: Well, I've modified Yi Zhao's Javascript Syntax, and added Ajax Keywords

Vim auto complete

↘锁芯ラ 提交于 2019-12-20 08:19:14
问题 So I know you can get Vim autocompletion with Ctrl - X , Ctrl - O but I'm wondering if you could rework it so it works with just pressing Tab (more like Textmate's snippets), or even just how I could remap it to something a bit shorter (even if I can't get fancy tab completion), as I find Ctrl - X , Ctrl - O a bit awkward. 回答1: Map Tab to Ctrl - X , Ctrl - O :imap <tab> <c-x><c-o> See this page from vim-wiki for a smarter Tab completion 回答2: I realize this question has been already answered,