All Questions

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

installing vimtex?

I am trying to install vimtex, and I am not how to do that. What plugin manager should I use? How do I combine it with "vim-surround"? "snipmate"? I went through the readme file, but could not ...
13
votes
0answers
248 views

Using <C-,> causes “<80>ü^D,” to flash in the showcmd area?

I've mapped <C-,> as well as some other special keys (<C-Enter>, <C-S-Space>, ...) in my vimrc like, :set <F13>=^[[44;5u :map <F13> <C-,> :map! <F13> <C-...
6
votes
1answer
121 views

Convert word to another substituting case (upper or lower) with same case

I am looking for a way to convert one word to another while "capturing" the case of the match that is substituted. An example: I have the text: Begin the beginning Now I want to convert this to ...
5
votes
2answers
8k views

Match everything before first occurrence of a character

I want to find all the characters upto the first occurence of the character "/". I tried using /.\{-}\/ but this included every character upto the last occurrence. for example, test/path/...
4
votes
2answers
162 views

Is there a no-op normal mode keystroke that I can use to positively terminate a timeout?

Sadly over time a few of my mappings have ended up overlapping. For example I toggle wrapping with \w but I later introduced a mapping on \wi. As a result, when I press \w, Vim waits for some time ...
4
votes
1answer
379 views

Visual block insert into multiple areas with no text with virtualedit=all

When I do a visual block insert with virtualedit=all I want to insert into all selected lines regardless of what text is already in those lines. Instead the behavior I get is that the line where I ...
4
votes
1answer
330 views

Why do I need to use unicode for a control character in a mapping using <expr> and a function?

Let's say I've got the word foo in a file, I copy it in register a ("ayiw) and I define the following mapping: inoremap <expr> <F3> "<C-r>a" If I hit F3 while in insert mode it ...
7
votes
2answers
246 views

Changing how the jump section `[` and `]` command works

:help section states: The "]" and "[" commands stop at the '{' or '}' in the first column. This is useful to find the start or end of a function in a C program. Is it possible to change the [ ...
9
votes
2answers
2k views

How do I make Vim wait indefinitely after leader key has been pressed?

I'm trying to make Vim wait after the leader key indefinitely without messing with the timeoutlen of other keys. Currently I have this lines in my vimrc: let mapleader=" " set timeoutlen=2000 ...
4
votes
1answer
162 views

Is it possible to put vim comments in lines that include `iabbrev`

Is it possible to put vim comments in lines that include iabbrev, as in: iabbrev hte the " common typo
10
votes
3answers
309 views

Alternative to escape slashes in search and replace for long strings

Is there any alternative in vim search and replace for strings, than having to escape every special character in string. For example, If I want to match following string and replace with something [...
34
votes
2answers
4k views

Why is Y a synonym for yy instead of y$?

Is there a specific historical reason for this? Background — (you can skip this part if you already understand the question.) As intermediate/advanced vi users will know, y is the "yank" command—it ...
2
votes
1answer
910 views

Vim's dbext with postgres

Has anyone successfully configured a postgres database in vim's dbext ? I see only configurations for mysql or sqllite. I included the following code in .vimrc: let g:dbext_default_profile_mydb='...
4
votes
1answer
1k views

How to insert a file path with tab- or autocompletion relative to the current file's dir?

I am in vim in the .gitignore file. I now want to add a file path that already exists on the current dir, e.g. ./app/poit/narf/auth.json I don't want to type it though, I want to navigate to that ...
3
votes
1answer
895 views

How to make auto-indentation work correctly after macros ending with semicolons

I'm using cindent with C++ sources, and when I put some macro, which already ends with a semicolon, like Qt's Q_OBJECT, cindent doesn't understand it and makes an extra indentation on the next line. ...
2
votes
3answers
96 views

Why aren't :g/X/d changes saved in Ex?

I've the following file (which is a simplification of the hosts file): 126.0.0.1 127.0.0.1 128.0.0.1 and I'm trying to invoke the following command: ex +g/127/d -cwq file which is supposed to ...
6
votes
0answers
39 views

Expand strings into multiline strings on line wrap [duplicate]

This is a feature in Eclipse that I would love to find a solution for in Vim. I have Vim set up with tw=80 so that the lines wrap at 80 columns. When I'm in the middle of a string, and the line ...
3
votes
1answer
638 views

Special characters in iskeywords

I wonder how one can add characters such as (yes, space!), ' (single quote), " (double quote), etc., to iskeyword. This is not a theoretical exercise. The purpose is iabbrev for these. I noticed that ...
2
votes
2answers
1k views

How to test if Vim supports <C-g>U?

I would like to make some modification to the code of this plugin. It adds / changes some default keybindings. Among them are <C-b> and <C-f> which move the cursor one character to the ...
18
votes
3answers
2k views

How can I use Readline shortcuts in the vim command line?

When I'm editing a Vim command, I would like to use the same shortcuts as in Bash and every other REPL: M-b to go back a word, M-Backspace to delete a previous word, M-u to convert the word to ...
3
votes
1answer
632 views

How can I remove the argslist files from the buffer list?

When using the args list, Vim adds those arglist files to the buffer list. Once I'm finished with the argslist, I then have many unwanted argslist files in the bufferlist. They don't have a contiguous ...
4
votes
1answer
913 views

How to save previous cursor position inside a function which has received a range?

I have the following code in a file: function! s:TrimWhitespace() abort range " Save cursor position, because the following substitution will move it let save_cursor = getpos('.') " ...
6
votes
1answer
3k views

How do I convert a String to a Number, catching invalid strings?

I am trying to convert a String '1' to a Number (int) 1 in a vimL script. I have used the built-in command str2nr() so far, however I was not able to write this in an elegant and effective way. ...
3
votes
1answer
135 views

Make vim respect custom, defined paragraph when formatting text?

Let's say I have that text in my file: At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias ...
5
votes
2answers
596 views

How do I make Vim respect Markdown headers when formating text?

I want to use the combination gggqG to go to the top of the file and format the whole file from there, so that it fits into my 80 col textwidth border. But when I do, vim ignores my markdown headers. ...
6
votes
2answers
3k views

How to wait for user input in the middle of a mapping?

I want to make a mapping that does the following: nnoremap <F1> oHello, (user inputs their name. Ex. Jason). You have a very nice name.<ESC> This mapping should make a non-recursive map ...
13
votes
1answer
1k views

Where do custom highlighting rules belong?

Occasionally I want to override the default syntax highlighting colours and styles with my own preferences. I imagine the most appropriate way to do this would be to create my own colorscheme. ...
5
votes
2answers
732 views

how to perform multiple grep passes by using piping in external shell?

When I want to recursively search files for a text pattern I use :grep -R 'color:' . Vim then lists the results in a quicklist window for easy access. But now I need to perform another grep pass to ...
4
votes
1answer
566 views

Understanding :help set-termcap

I would like to define some mappings involving key combinations like <S-F1> or <A-d>. For example something like this: nnoremap <A-d> :echo "hello world!"<cr> However, on my ...
7
votes
4answers
2k views

Is it possible to populate the quickfix list with the errors of vimscript functions?

I often write functions in my ~/.vimrc or in ~/.vim/autoload/myfunctions.vim, which when executed result in an error such as: Error detected while processing function SomeFunction: line xx: ...
7
votes
2answers
3k views

Do a forward slash search but don't have vim immediately jump to the string?

When I do a /someStringtoFind in vim it immediately jumps to the closest matched string. Almost always this is what I want it to do. Sometimes though, I want to be able to enter a string to find and ...
4
votes
1answer
105 views

Can my mapping/function detect when count/range 1 is given instead of none?

I have a key mapped to a command which runs a function, and I would like to detect whether it has been passed a range (prefixed with a count) or not. The difficultly is that I need to be able to ...
2
votes
1answer
1k views

How to insert the square number symbol (small 2) in vim? [duplicate]

I need in vim input the following Numbers: 23²,66²,38³ How to insert this number?
2
votes
1answer
337 views

Minimal to effort to have a JS beautifier on vim

My research hints that there is no way to have a JS file properly formatted without going through installations. I wonder whether there is a minimal effort way of doing it in vim. What are your ...
12
votes
2answers
8k views

How to join all lines together which matching pattern?

I would like to join lines together only for lines which have certain pattern (such as ;), however when using g/;/j it doesn't work as expected unless called couple of times. For example the ...
2
votes
1answer
379 views

Scroll without changing the cursor position

Frequently when using vim I will hit a case where I am looking at a function that is half off the bottom of the screen, and I would like to see the whole thing. ctrl-D will generally solve the problem ...
5
votes
1answer
172 views

Text formatting CVS-friendly

I have seen this very interesting article: http://dustycloud.org/blog/vcs-friendly-patchable-document-line-wrapping/ --- basically it is a suggestion for hard-breaking lines of text (for example, in ...
1
vote
0answers
476 views

Location list, preview window, autocompletion

I have the following problem. If the location list is open (e.g., by Syntastic) and some other plugin opens a preview window (e.g., YCM or jedi-vim), the cursor goes in the location list. Example: ...
12
votes
2answers
3k views

Is Vim's default 'path' option redundant?

From Vim's help document (see: :help 'path'): 'path' String(default on Unix: ".,/usr/include,,") -To search relative to the directory of the current file, use: :set path=. -To search in ...
5
votes
2answers
227 views

How to set incremental marks?

I'm used to set marks with m<char> where <char> is any character I choose and then reaching the marks with ]` or [`. I'm wondering if it is possible to use a command to set a mark with an ...
5
votes
1answer
653 views

vimrc tab behavior when noexpandtab and softtabstop is less than tabstop

Questions In the following example: Why in the first line, a \t is inserted but only 4-col blank is displayed? Shouldn't it be 8 according to tabstop? Why the two <TAB> hits in the first line ...
22
votes
5answers
12k views

Is it possible to pipe vim commands to vim?

I want to run the following shell. wea-this is the end of the second word | vim j exit 0 Which I had hoped would pipe the key strokes w (move forward a word) then e (end of the word) then a (append) ...
4
votes
1answer
122 views

Mapping { with Vimscript

I have been trying to map { in insert mode to the following if the line contains any character other than blank or tabs: <CR>{<CR> and to {<CR> if the line is blank (contains at most ...
7
votes
3answers
163 views

mapping to enclose symbol under cursor with an expression that contains the symbol

Have been reading vim scripting posts for an hour, but I'm afraid I don't have the skills to apply these posts to my problem. Editing math in latex documents, I'm frequently wanting to replace math ...
3
votes
1answer
301 views

How to run a function without getting prompted to continue?

In order to keep my tags file up to date I wrote this function which runs ctags -R . whenever I save a file. function! UpdateCtags() " assume if a tags file exists - then current dir is ok if ...
8
votes
1answer
5k views

I can't move around the document while editing

I am working on a ChromeOS computer with both Vi and Vim. When I open up the editor to an existing document, I type A to begin editing. When I try to move around with my arrow keys, the following ...
1
vote
1answer
160 views

Why does the source code of Vim have a folder named farsi in the root directory?

While looking through Vim's source code, I notice that it contained a folder named farsi in the top directory, created 9 years ago. The commit message seems to be just updated for version 7.1a. Why ...
8
votes
1answer
324 views

How to escape significant keywords from syntax files?

I came accross this line in a syntax file.. it does not work: syntax keyword Type Transparent I guess this has something to see with the fact that transparent is a significant keyword for Vim. What ...
0
votes
1answer
59 views

can't find syntax highlighting for offlineimaprc

i can't find any syntax highlighting for offlineimaprc files. Because of vim has normally for everything syntax highlighting (even for esoteric programming languages!), this makes me wondering. Did ...
9
votes
1answer
2k views

Exuberant Ctags - Duplicate tags problem

Here is a file -- ChipBooter.cpp -- in my project(Omit some details that are not related to this question): class ChipBooter { public: void Boot() { this->DpDetect(); } void ...

15 30 50 per page
1
185 186
187
188 189
222