All Questions

Filter by
Sorted by
Tagged with
9
votes
1answer
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 ...
10
votes
2answers
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 ...
8
votes
2answers
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) { ...
3
votes
3answers
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.
4
votes
1answer
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,...
6
votes
1answer
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 ...
6
votes
1answer
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, ...
1
vote
1answer
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 ...
2
votes
1answer
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 ...
3
votes
3answers
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....
3
votes
2answers
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 ...
1
vote
2answers
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 ...
1
vote
1answer
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.
1
vote
1answer
53 views

How to append a custom string at the end of the file?

I'd like to append a custom string at the end of the file. For example using :read command this works: :$r !echo my string however is there any more portable way of doing that (without executing ...
3
votes
1answer
550 views

Can I select and edit specific positions in lines while in visual block mode?

say for example, I have this text: <div class="test1"></div> <span class="highlight"></span> <nav class="tester"></nav> <aside class="wrapper"></aside> ...
2
votes
1answer
287 views

How to print a multi-line match?

I've a file where I would like to extract a multiline pattern in non-greedy way (similar to this scenario) by using ex editor. This example works fine: $ ex +'/aa/,/cc/p' -scq! <(echo -e "start\...
4
votes
1answer
655 views

How to print value of register to the standard output?

To print the whole buffer, you can use %p, how do I print value of register to the standard output? Here is example how I would print the whole buffer: $ ex +'norm dw' +'%p' -scq! <(echo foo bar) ...
1
vote
1answer
77 views

How to write literal for Tab key to use for motion?

I've the following dummy file created via: echo -e "a a\tb b\tc c" > file Is there any literal for space which I can use for motion argument? For example this works (which removes the 1st a a ...
1
vote
1answer
156 views

How to mark a buffer as intentionally temporary (i.e. not to be saved)?

I wrote this line into my .vimrc today: nnoremap <leader>rtp :below new \| execute append(0, &runtimepath) \| s/,/\r/ <CR> to display my runtimepath in a new buffer with one path per ...
2
votes
2answers
211 views

Examine swap file

I have no idea how swap files are formatted, but I'm wondering if the information in them can be directly examined somehow. I notice that trying to do this indirectly, by creating an empty file with ...
18
votes
1answer
4k views

How do I get the actual height and width of Vim?

winheight() and winwidth() return the number of columns/lines in the current window. What I'm looking for is something closer to the actual height and width of the editing area, or displayed area if ...
4
votes
3answers
2k views

matchpairs makes vim slow

I use set matchpairs+=<:> in my config (to help when editing HTML, for instance), but I just noticed it made vim very slow when editing emails. Is there a way to have this setting without ...
3
votes
1answer
587 views

How to detect the buffer number of new buffer

I would like to create a new scratch buffer in vim script. I would like to use this buffer to output the result of the execution of a scala script. I am creating the buffer with this function: ...
16
votes
2answers
2k views

Fix arrow keys displaying A, B, C, D in vi (not in vim)

I know that in vim I can add set nocompatible in .vimrc to avoid that arrow keys display A, B, C, D in insert mode. But I'm using vi Version 4.0 (gritter) 12/25/06. How can I obtain the same ...
2
votes
1answer
73 views

Navigate previous locations

I'm aware of the jumps list, and that you can navigate forwards and backwards through locations I've previously jumped between. But I'd like to duplicate the behaviour of many other editors (such as ...
5
votes
1answer
2k views

Add tab in front of each line

I'm working with python code. After some modifications, I want to update the identation but obviously, select everything and press '=' doesn't work, python being python. So, is there any other way to ...
1
vote
0answers
25 views

Parentheses off the page stop being recognized

I am using a recorded macro to manually wrap an extremely long string in a python script, like this: blah = ('blahblah ... blah blah') to blah = ('blahblah...' 'blahblah...' ... ...
2
votes
2answers
125 views

Ctrl-] to open relevant help straight from .vimrc

I am trying to get use the help files more, and therefore I would like to make so I can just put the cursor over a setting in my .vimrc and press Ctrl-] to open the relevant section in the help files. ...
20
votes
4answers
3k views

Quickfix support for Python tracebacks

Say I have a python script with a runtime error: $ cat example.py #! /usr/bin/env python3 a = 1/0 which gives: $ python3 example.py Traceback (most recent call last): File "example.py", line ...
1
vote
1answer
765 views

Swap file directory often ignored

I have this in my .vimrc: set directory=~/.vim/tmp-backup-swapfiles This directory is read- and writable by me, sensibly enough. It is part of the local filesystem and never inaccessible. However, ...
2
votes
1answer
395 views

Completion past special characters

When I used vim for programming I used cntrl+n/cntrl+p a lot for keyword completion. I switched from programming to reporting with vim and now I have some new needs, one of which is amazing LaTeX ...
3
votes
1answer
582 views

CtrlP should never index particular directories

My projects are in: /home/user/projectA /home/user/projectB However, at times I hit CtrlP and I haven't opened a file in a particular project, so my working directory is /home/user. CtrlP starts ...
1
vote
1answer
487 views

Pathogen won't load nerdtree or other bundles [closed]

How to troubleshoot pathogen? Using Mac OSX El Capitan. Vim 7.4 MacOS X version, not MacVim. Running from terminal. I can run nerdtree as a plugin, but won't work with pathogen. Same case with other ...
1
vote
0answers
54 views

filetype plugin not loaded on files opened with edit command

I've turned on filetype indent and plugins on with the following in my vimrc file: filetype indent plugin on Everything is fine when I open a file from terminal, but if I open another buffer ...
0
votes
1answer
192 views

Why I can't use a script variable as a function parameter in a mapping:

I have the following script variable and a mapping defined as follows: let s:tblgen_files = '-G \"\\.td$\"' nnoremap <leader>st :call <SID>PrjAck(expand('<cword>'), s:tblgen_files, "...
13
votes
3answers
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 ...
1
vote
1answer
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. ...
2
votes
1answer
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 ...
8
votes
1answer
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 ...
11
votes
1answer
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 ...
9
votes
1answer
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 ...
16
votes
3answers
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?
5
votes
1answer
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: ...
0
votes
1answer
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 ...
2
votes
0answers
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....
3
votes
1answer
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....
4
votes
2answers
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 ...
4
votes
1answer
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 ...
6
votes
1answer
266 views

Is there a way to paste text from a buffer into your command using just the keyboard?

Sometimes I copy text from the buffer in VM and I want to use it in an editor command. Is there some way to paste it from a register into the command text using only the keyboard?
0
votes
1answer
149 views

Is it possible to generate help tags with readonly '/usr'?

I have readonly /usr partition and :helptags returns an error about not being able to write to /usr/share/vim/vim74/doc. Is it possible to specify additional/another directory for help tags?

15 30 50 per page
1
150 151
152
153 154
180