# All Questions

8,961 questions
Filter by
Sorted by
Tagged with
1k views

### Buffers vs tabs vs arglist vs windows

So many choices! So confusing! When should one be used in preference to another? How do these relate to each other? What are the differences between them, anyway? How do they affect commands you ...
2k views

### Is there a way to insert a single character and then exit insert mode?

When I'm going through text and, for instance, adding backticks around certain words or quotes or whatever, it is irritating that I have to press Esc or Ctrl-[ after each insert. The inserts (and ...
802 views

### Is there a way to conceal across lines?

Here is my use case: I have lots of code which because of style enforcement we write newlines after and before each open and close brace (respectively). Example: function func(args) { ...
555 views

### Is there a way to dump syntax highlighting to a .vim file?

If I set syntax highlighting rules manually (not in a file), is there a way to save them out to a file? Specifically, the goal is to source this file to restore the syntax highlighting rules later on.
330 views

### Add keyword to existing syntax file without changing the original syntax file

How should I ideally modify an already existing syntax file without touching the file itself (since it's normally not world writeable)? I want to add the keyword \autoref to TeX's syntax highlighting,...
968 views

### How can I repeat last Ex-mode command in normal mode?

I'm looking for something like . or @@ that will work in normal mode for repeating the last Ex-mode command. As per the rule of the XY problem, I'll also state the broader goal: I have a fancy regex ...
163 views

### Mathematical expressions in TeX files are displayed in a human-readable way

When I type some mathematical expressions in Tex files using Vim, e.g. a_{2} = a_{1} + a_{0}, it is displayed in a human readable way like a2 = a1 + a0. (Actually the numbers are of a smaller font, ...
45 views

### Is there a way to perform more than one Ex-mode action on the current visual selection?

This would be particularly useful for macros, i.e., select visually the exact lines I want to perform the macro on, and then run the macro. But currently when it finishes the first action, the visual ...
432 views

### Why is ZQ not exiting vim?

:q! and ZQ both fail. I had a file opened; I made a new tab with :tabnew (just for some register swapping); I switched back to my main file and wrote my changes to a new filename; I tried ZQ to no ...
2k views

### How to put custom functions at bottom?

I want to organize my vimrc better, so I want to put all the custom functions at bottom: "different setting between different os if MyDetectOS() ==? "windows" set rtp+=~/vimfiles/bundle/Vundle....
1k views

### What are differences between POSIX vi and minimal vi implementations, if any?

I have a few questions about vi and its current relationship with Vim. First of all, is Vim minimal (i.e. the default vi on Cygwin) basically a POSIX compliant implementation of vi? I believe POSIX ...
279 views

### how to remap help command to vert help? [duplicate]

I dislike the default way vim open the help window. I just want to open the help window vertically. So I want to remap the help command to vert help. What I put in vimrc is: :noremap h vert h ...
41 views

### Automatic folding based on bol

How might Ι automatically fold all paragraphs where every line begins with %%? Would be good for comments in TeX.
53 views

655 views

791 views

### How do I apply a set of keystrokes to every occurrence of a word?

If I want to delete every word, that is easy, because I would do something like this: :s%/WORD//g But what if I want to do xyz to every occurrence of "WORD"? For example, let's say I want to delete ...
278 views

### Is there a syntax file for TI's PRUSS assembly language?

Texas Instruments has a custom assembly language for its programmable real-time unit subsystems (PRUSS). TI provides syntax files for Notepad++ and Textpad, but I cannot find any syntax files for Vim. ...
666 views

### Remapping [ and ] is really slow

I have remapped [ and ] to easily cycle through my open buffers. I don't understand why when I use this shortcut there is a delay of almost a second before the buffer is switched. This doesn't happen ...
120 views

### How can I use consecutive numbers in an Ex-style substitute command?

For example, let's say I want to put a number before every line that starts with the word "Do". The command would look something like :%s/^(Do )/1. \1/, but what can I do so it will apply numbers ...
1k views

### How to achieve automatic list numbering in vim?

Contracts etc formal things need numbered lists. 1. Some text 2. More text 2.1. Sub-section text etc. The key is to eliminate the manual re-numbering when inserting or deleting a list item. Is ...
385 views

### Disabling partial HTML indentation in Vim

Caveat: I'm not a web developer. That being said, there are rare occasions where I have to edit HTML. When I do, I've noticed a behavior in Vim that I don't like, and hope that I can change via ...
365 views

### Can I make :s operate only on the last match of the line?

:s/pattern/replacement operates on the first match and :s/pattern/replacement/g on all. How to operate only on the last one?
139 views

### Applying an ex command to a visual selection or text object

Is it possible to apply an ex command to something smaller than a line? For instance, I tried to define a mapping that would remove an \emph{} from the enclosed word. The best I could do was: ...
479 views

### vi or vim: Mac/Iterm 2 highlight-paste [closed]

When editing with Vim on Macbook Pro with Iterm2 interface I can copy text by highlighting text with left-button double click on mouse, paste text by pressing center wheel on mouse. Instead of (2) I ...
245 views

### Enhancing Vim gf command for ruby: include module syntax

I am looking for a way to enhance vim gf command class Myclass include Mymodules::HardToFind end I have started with installing tpope/rails-vim: Easy navigation of the Rails directory structure....
2k views

### vi and vim does not show “insert” or “replace” popup

When editing with vi or vim "insert" or replace popup text does not appear when in insert or replace mode. This problem occurs both with Windows 7 and Putty interface and with Mac and Iterm2 interface....
209 views

### surround plugin and TeX quotes '

Is it possible to make the surround plugin work on TeX-style quotes' and TeX-style double quotes''? (Normally, if this is quoted'| and this', va' will select from the first closing mark to the ...
412 views

### How can I set expandtab but only for git commit messages?

Most of the time I'd like noexpandtab on because our corporate formatting uses tabs instead of spaces, so in my .vimrc I have this: " Set tab width stuff set tabstop=4 softtabstop=0 noexpandtab ...