Все вопросы: [vim]

928 вопросов

3
голосов
4ответов
1234 просмотров

vim plugin FuzzyFinderTextMate error

I installed the vim plugin on many different ways. I try to start it with Ctrl-T but what I get is always that error: E492: Not an editor command: FuzzyFinderTextMate

11
голосов
4ответов
14038 просмотров

Vim omnicompletion for Java

I've read heaps of blogs on Vim's supposedly great omnicompletion, and yet no matter what I do I can't get it to work satisfactorily. It took me ages to figure discover that the version of ctags that is preinstalled on my system was the emacs one, and didn't have the --recurse option, but now tha...

6
голосов
2ответов
2693 просмотров

vim regex with meta-characters

I have the following in a text file: This is some text for cv_1 for example This is some text for cv_001 for example This is some text for cv_15 for example I am trying to use regex cv_.*?\s to match cv_1, cv_001, cv_15 in the text. I know that the regex works. However, it doesn't match anythi...

56
голосов
2ответов
88957 просмотров

How to insert a word/text in the beginning of each line

Just want to insert a word or text at the beginning of range of lines, or the entire file. How do it in vim?

108
голосов
10ответов
128887 просмотров

Working with huge files in VIM

I tried opening a huge (~2GB) file in VIM but it choked. I don't actually need to edit the file, just jump around efficiently. How can I go about working with very large files in VIM?

1
голосов
2ответов
405 просмотров

Project on remote drive in VIM

Is it possible to create a project based on a remote directory (on an ftp server) in VIM, using the Project plugin?

28
голосов
4ответов
5081 просмотров

Paste in Vim without moving the cursor

Often I need to paste something into several adjacent lines, at the same or similar positions. It's a pain to have to move the cursor back to the beginning of the pasted contents every time, when moving on to the next line. How can I paste (as in, the command 'p') without moving the cursor? Or, h...

4
голосов
3ответов
789 просмотров

vim: delete display lines instead of physical lines

When vim wraps long lines between words regular movements like j and k will jump from one physical line to the next. Mappings like "nnoremap j gj" as suggested here will do the trick of moving the cursor by display lines instead of physical lines. There's at least one problem with this approach ...

101
голосов
1ответов
88730 просмотров

Insert the carriage return character in vim

I'm editing a network protocol frame stored a file in Unix (\n newlines). I need to insert the carriage return character (U+000D aka \r). When I try to paste it from the clipboard ("+p) or type it using Ctrl+Shift+u-000d, the linefeed is inserted (U+000A). What is the right way to do it?

3
голосов
2ответов
557 просмотров

Organising vim plugins into separate directories

Is it possible to place each of my vim plugins in a separate directory within my ~/.vim directory? Unpacking everything into the same place seems kind of messy.

4
голосов
1ответов
309 просмотров

Vim: how to convert file name to path?

In Vim script, if I have a file name, how to get it's path? For example, I want to get a path of the temp directory Vim uses. I can get a name of temp file by calling tempname(). But how to extract path from name returned?

42
голосов
2ответов
4407 просмотров

Vim: create marks across files?

A feature I often use in Vim is mark and jump-to-mark (')… But they only work within a file. Is there any way to create a mark which works across files? For example, so I can create mark a on line 42 of foo.py, then jump to that mark while I'm editing bar.py?

2
голосов
1ответов
1703 просмотров

How to implement own tag jump in VIM with CTRL-]?

If :h is used in VIM, it will automaticall follow |links| via CTRL+], opening new help topics and maintaining tag jumps list (CTRL+T will go back in jumps history). How to implement such behavior in my own file format? For example, i want CTRL+] on text inside {} to open a file named something.tx...

2
голосов
1ответов
1504 просмотров

Incorrectly displayed characters in vim quick fix window

While compiling code using vim (not gvim) the output looks fine in the terminal window but when vim returns and displays the text in the quick fix window it has some incorrectly displayed characters. All other times in my terminal and in vim everything is displayed correctly. Any ideas? VIM - ...

35
голосов
5ответов
9675 просмотров

Why does Vim add spaces when joining lines?

I want to unwrap text in Vim. When I join lines I get an additional space between sentences. Why is that?

2
голосов
6ответов
3045 просмотров

Is this the right version of Vim for OS X Snow Leopard?

I'd like to try Vim. I'm using Mac OS 10.6.2 (Snow Leopard). I downloaded vim7.0.224.tar.bz2 from here. However, I have doubts. It's the newest version offered, but the heading says "OS X 10.4 (Tiger)". Is there another, preferable version I should know about?

58
голосов
12ответов
12562 просмотров

What are your suggestions for an ideal Vim configuration for Perl development?

There are a lot of threads pertaining to how to configure Vim/GVim for Perl development on PerlMonks.org. My purpose in posting this question is to try to create, as much as possible, an ideal configuration for Perl development using Vim/GVim. Please post your suggestions for .vimrc settings as w...

2
голосов
3ответов
1090 просмотров

How do I get perl-support.vim to recognize Perl files?

I installed perl-support.vim into ~/.vim (unzipped). When I create a new .pl file it shows me the default template, which means my installation is successful (I guess). I have already added filetype plugin on in ~/.vimrc & /etc/vimrc. How do I enter a perl-support command? The write up recom...

0
голосов
1ответов
473 просмотров

How to do brace expansion tab-completion, for filenames in vim?

In vim (and bash), you can specify alternatives in filenames, eg: :arga project/html/{index,sitemap}.html This expands to "project/html/index.html" and "project/html/sitemap.html" (the :arga appends them both to the argument list; you can get to them with :n). Now, vim already does some filen...

0
голосов
1ответов
1400 просмотров

Vim, Python and curses

I wrote a small python script for vim that uses the curses library. When I try to call the function curses complains about: Traceback (most recent call last): File "<string>", line 9, in <module> File "/usr/lib/python2.6/curses/__init__.py", line 33, in initscr fd=_sys.__stdout__.fil...

0
голосов
5ответов
1220 просмотров

Using vi, how can I remove all lines that contain [searchterm]?

I want to remove all lines in a CSS file that contain the word "color". This would include: body {background-color:#000;} div {color:#fff;} How would you do that using the :%s/ command?

27
голосов
7ответов
29475 просмотров

Delete first word of each line

How do I delete first word of each line in Vim? How about a pattern on each line?

0
голосов
3ответов
386 просмотров

I have a vim config. However, when I paste text

I do "set:paste" That will allow me to paste text into putty very nicely. However, my "smart indents" and 'auto tabbing' --which is in my original config..is gone!? How do I make it so that I don't have to do "set: paste" everytime I want to paste something and if I do have to do that...I...

1
голосов
2ответов
2160 просмотров

Color scheme in vim

I was trying to set 256 color for vim editor. I write C code using vim. In /usr/share/vim/vim72/colors directory I have many colourscheme script. When I tried to use any one of them using colourscheme command in .vimrc, it is working for all files with any extension. But when I am giving .pc ext...

2
голосов
1ответов
112 просмотров

Mapping of <ctrl-> characters</ctrl->

I've been trying to map certain sequences to parenthesis/bracket completion without any success. I've been trying the following commands to map certain control sequences but they don't seem to work. Does anyone know what I'm doing wrong here? :imap ( )hha :imap ( )hha

6
голосов
4ответов
863 просмотров

Vim indenting file for Treetop (Ruby parser)

Has anyone seen a vim indent file for treetop, the Ruby parser/generator? I've found a vim syntax highlighting file, but haven't seen one for indentation.

155
голосов
5ответов
42676 просмотров

Setting Vim whitespace preferences by filetype

At my work, I am required to follow the house style for indentation, which goes as follows: 2 spaces when coding html and ruby tabs when coding javascript, with tabwidth=4 recommended What is the best way to specify different whitespace preferences per filetype?

4
голосов
1ответов
212 просмотров

Is it possible to have a Vim syntax file command span multiple lines?

I'm trying to create a syntax file and I want to create some keyword groups for different colour highlighting (e.g. reserved words, operators etc. would be different colours). I can get this to work by doing one of the following two options: Option 1 syn keyword MyLangOperators operator1 operat...

10
голосов
5ответов
7773 просмотров

Copy and paste from external source

I use vim (Actually gvim on windows) as my main text editor. In my work flow I have to copy sentences to/from various external sources, therefore I use clipboard=unnamed to save me key strokes (p instead of "*p). I copy text from an outer source and I want to paste it over two different places in...

87
голосов
7ответов
23584 просмотров

Tab Vs Space preferences in Vim

Vim is very accommodating when it comes to tab Vs. space preferences. As I understand it, the tabstop setting indicates the width of a tab character. The shiftwidth setting specifies how many columns to increment/decrement when using the &lt;&lt; and &gt;&gt; commands, whereas the softtabstop set...