All Questions

Filter by
Sorted by
Tagged with
4
votes
1answer
337 views

Why does Vim force programming indentation when in “gitcommit” filetype?

I found that when I am using Vim to compose git commit messages (which I have been doing for a very long time now) that there are occasionally some quirks. For example today I wrote a commit message ...
8
votes
3answers
2k views

Make :edit {file} use current directory during :Explore

I often use :Ex or :Sex to explore the filesystem from an opened file directory, or just invoke vim passing a directory to start exploring the filesystem and then opening a file. In any case, while ...
15
votes
2answers
5k views

How can I change Vim's start or intro screen?

When I start Vim without any files, I always see this: VIM - Vi IMproved version 7.4.580 by Bram Moolenaar et al. Vim is open source and freely distributable ...
140
votes
7answers
182k views

How do I use vim as a diff tool?

I use vim as my primary editor. I would also like to use vim to diff files and modify the files while doing the diff to fix easy changes (rather than most diff techniques which are a cycle of diff/...
5
votes
2answers
4k views

How does one perform a multi-line copy and paste between two sessions in Vim?

I am familiar with the y, p method of copying and pasting a line within Vim; however, I have been unsuccessful in finding a straight forward method for copying multiple lines which have been yanked in ...
14
votes
1answer
1k views

What is a Vim plugin?

I understand that we can extend the power of Vim in order to add new features or modify existing ones and enhance our editing experience. Although being myself a Vim user for quite a long time, I am ...
4
votes
1answer
610 views

How can I specify a command-line command with options as an equalprg?

I am trying to set up the Node.js version of js-beautify as an equalprg command when I am editing a JavaScript file, so that the Vim = indent commands reflow my JavaScript at the same time. Initially,...
123
votes
7answers
175k views

How do I install a plugin in Vim/vi?

How do I install a plugin in Vim? Does it matter: Whether I use vi or Vim? Whether I use gVim? Which version of Vim I'm using? What my OS is?
24
votes
2answers
3k views

Swap function arguments

When refactoring code it would be useful to be able to swap function arguments. Changing for eg: func(foo[0], bar(), baz.spam) into func(baz.spam, foo[0], bar()) Is there some way to swap ...
6
votes
2answers
2k views

Bidirectional tag stack movement with cscope in vim

When using ctags, one can move back through the tag stack by using [count]CTRL-T or :[count]pop, and forward using :[count]tag However, when using cscope instead of ctags and setting 'cscopetag', ...
27
votes
7answers
6k views

Faster way to move a block of text

Here's how I usually copy a block of text or code: Select the block with Visual mode (V) and delete it with d; or if it's just a single line, just use dd. Go to where I want the text to be, I am too ...
13
votes
7answers
2k views

How to left-align two columns of text? [duplicate]

If I have a text file like this: alpha: 1 beta: 2 gamma: 3 delta: 4 epsilon: 5 Is there a way to align the numbers like so?: alpha: 1 beta: 2 gamma: 3 delta: 4 epsilon: 5
35
votes
3answers
12k views

Can I use a non-monospaced font in either Vim or gVim?

Is there any way to use a non-monospace font in either vim or gvim? I tried changing the font for gVim with: :set guifont=Dejavu\ Serif\ 12 But this gives me some rather ugly results: I get the ...
5
votes
1answer
914 views

Adding emmet plugin to Vim in Windows

I am using Vim in my windows PC . Currently I am working with a web project and I want to use Vim as code editor. I tried to download and add the http://emmet.io/ plugin to Vim editor from this site ...
2
votes
1answer
167 views

Does vim have a learning mode to help me get used to more advanced operations? [duplicate]

I have been using vim for over 5 years and I only ever use basic cursor movements and character/line replacements. I'm not using multiple windows or buffers or registers or splits. When I want to ...
19
votes
1answer
3k views

How to define a custom popup / menu in vimrc

Assigning every useful function to a key works well for frequently used tools, but there are some operations I use so rarely, that I would prefer to assign them to some popup menu defined in my vimrc. ...
6
votes
1answer
355 views

equalprg to use for Python

Python is whitespace dependent, and it can't be totally autoindented for that reason, but there are a lot of extra stuff that should be possible to do automatically to comply with PEP8. Things like ...
6
votes
1answer
807 views

Sharing vimrc options in different computers [closed]

Can I easily keep my vimrc files consistent across multiple computers? I have different computers (laptop, desktop home and desktop work) and I want to keep my Vim configuration consistent, ...
20
votes
3answers
14k views

Keeping lines to less than 80 characters [duplicate]

The code standard that I use indicates that lines should have less than 80 chars. I want to indicate this automatically while I write to avoid raising the error later. What is a good way of showing ...
19
votes
2answers
1k views

Can I use Vi or Vim with screen readers and/or Braille devices?

Can I use Vi or Vim with screen readers and/or Braille devices? If so, how would I go about it? Does it require any special setup?
56
votes
1answer
6k views

How much money has been raised for needy children in Uganda from Vim? [closed]

As it says under :help iccf… Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation for needy children in Uganda. Please see kcc below or ...
34
votes
2answers
2k views

Can I see the history of key presses in normal mode?

I know that Vim keeps history for ex commands, searches, jump locations, changes, and possibly others. With showcmd set, Vim also shows you what keys you have entered so far for a normal mode command,...
3
votes
1answer
269 views

How can I make the “gn” motion wrap to the beginning of the file?

gn is a very useful command that selects the next search result. For example, if I insert foo bar baz into a file, move to the beginning, type /[aeiou]., and press gn, it would select oo in a visual ...
20
votes
1answer
593 views

What is the correct capitalization of 'vim'?

What is the proper way to capitalize 'vim'? I have seen these variants being used: vim Vim ViM VIM Which is the correct one? Or are they all considered correct? If I look at the :help files, I see ...
16
votes
1answer
286 views

Prevent Vim from breaking up links mid-tag in markdown

Let's say I have this Markdown file: [Lorem ipsum dolor sit ](http://vi.stackexchange.com/many-links-are-often-very) Lookin' good. But the link isn't finished it, so I type -long, and now Vim breaks ...
11
votes
1answer
382 views

Map a sequence of letters in insert mode

I can already map a key combination in insert mode: :inoremap abc <do stuff> However, this has a few drawbacks: When typing a partial version of the sequence, such as ab, the characters aren'...
13
votes
2answers
424 views

Raise window holding swap file

From time to time while working on multiple projects, and / or what ever, it leaves me with (too) many Vim instances open – as happens, I open a file which already is opened elsewhere, leaving me with ...
41
votes
1answer
8k views

See the Unicode code point of the current character

How can I see the Unicode code point of the character where the cursor is? For example, if my cursor is on a ⌘ character, I'd like Vim to tell me that it is U+2318. Alternative information, such as ...
14
votes
1answer
4k views

Is it possible to easily work with .odt, .doc, .docx, .rtf, and other non-plain-text formats in Vim?

Occasionally someone sends me a .odt, .doc, and .docx file; opening them in OpenOffice is always a pain because, well, OpenOffice. Right now I use a variety of commandline tools (such as odt2txt) to ...
8
votes
1answer
447 views

Run shell commands on current file based on file extension

I'm currently doing a lot of work with both Ruby and JavaScript. I know that I can run my Ruby files with :! ruby % and likewise my JavaScript with :! node %, and that I can bind either of those to, ...
23
votes
5answers
1k views

GitHub for .vimrc and plugins

I know many people store their .vimrc on GitHub to make it easier to get right to work on new machines, and that makes complete sense to me. Including plugins, however, is problematic, because the ...
7
votes
2answers
2k views

Creating & maintaining flowcharts in Vim

Here is a simple text-based flowchart I made in Vim for a weblog post: [DNS request] | | [Adsuck] | ...
9
votes
2answers
4k views

Folding fails: vim can't find any fold

I'm trying to fold some PHP code, and I have included a cut-down version of some of the code I'm trying to fold at the end of the post. I've tried the following vim commands, but only the ex commands ...
6
votes
1answer
66 views

Is there any way to add to the help system without developing a plugin

I have somewhat customised vim to my needs what I would like to do would be to add a cheatsheet, documenting these customisations and other things I often forget to the vim help system. I know that ...
5
votes
4answers
328 views

Move vertically to a specific character on a different line

It is easy to move to a specific character on the same line with t or f. However often it is useful to move to the specific character that is positioned on a different line. Consider this example: ...
4
votes
1answer
74 views

Can the command-line window be entered without interrupting macro recording?

I'm having a problem using the command-line window (help cmdwin), which is extremely useful, but it doesn't play well with macros. cmdwin is invoked with q:, so if there is a macro being recorded, ...
9
votes
1answer
142 views

Can I force parentheses matching to show up across multiple windows?

I have a source file containing a long list of deeply nested heterogenous structures. Since the structures are long, I would like to: Use the :split command to split the screen into two. Scroll down ...
160
votes
6answers
89k views

How do I change the current split's width and height?

I am working on split (using ^w+v, ^w+s) buffers, but sometimes I would like to widen a current split or change its height. How can I achieve that?
17
votes
3answers
13k views

Can I issue an interactive shell in Vim window?

I know I can :! or :r! to execute external command and optionally insert its output into text. I can even perform :!sh and I'll spawn a shell that will live until I exit it - but while the shell is ...
42
votes
6answers
15k views

Can I justify text in Vim?

The only reason why I'd ever edit a text file in Pico or Nano, and not in Vim was its "Justify" command ^J. It would reformat a paragraph of text, creating line breaks at word breaks so that the text ...
9
votes
1answer
173 views

How can I easily get the length of a piece of text?

I sometimes want to check the length of a piece of text, for example in this example: str = 'Hello, world!' if len(str) == 13: print('Hello back to you!') I would like to know the length of the ...
4
votes
0answers
94 views

Return to previous buffer without going through every jumplist entry [duplicate]

When I've jumped from a buffer to another buffer I use C-o to return and after that I use C-i if I want to jump to that same buffer again. I think this is the common approach. The problem is that this ...
11
votes
5answers
1k views

Navigating multiple files

If I open vim with multiple files on the command line, for example vim debug.log* which loads debug.log, debug.log.1 and debug.log.2, can I navigate between them, assign them to multiple windows (:...
17
votes
1answer
3k views

More detailed comparison within a line

I use vimdiff to inspect differences between files, and some times it misses out a bit. for example, if I have the following two files: //a.c printf("Hello\n"); and: //b.c int i = printf("hello\n") ...
105
votes
5answers
101k views

How to replace tabs with spaces?

Is it possible to convert tabs to spaces, while maintaining text alignment? Simply replacing only works usefully when there are no leading characters.
10
votes
2answers
5k views

How do I install a .vimball Plugin?

I was given a plugin for Vim. It came in something called a .vimball. What am I meant to do with this exactly? Where do I put it? Do I need to be root to install it?
21
votes
1answer
587 views

Why aren't Vimballs commonly used?

I have seen that a lot of Vim Plug-ins don't seem to have Vimballs. Vimballs were/are basically a tarball for a plugin that vim knows how to install. They were/are thus slightly more convenient that ...
6
votes
3answers
6k views

How do I break a file into two?

I am writing some documentation (a user guide), in markdown in Vim. I now realise what I though should be one page, really should be 2. But I've already written alot of of both halves How can I split ...
36
votes
3answers
12k views

Can Vim interpret terminal color escape codes?

Many CLI programs output nicely-highlighted text. While most of them check if the output is going to a file, some include the terminal escape codes. I like the output with the escape codes, but ...
10
votes
2answers
2k views

Automatically creating functions out of function prototypes from header files

Intro When programming in C and C++ you usually split your function prototypes and actual functions into a .h/.hpp and .c/.cpp file. Sadly it's very tedious to transfer the function prototypes from ...

15 30 50 per page