All Questions

937 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
720 views

Unable to map ctrl-l

My _vimrc contains the following lines: set nocompatible source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin nmap <c-l> :w<CR> nmap <c-m> :w<CR> ...
2
votes
0answers
173 views

Relative line number colouring

I have relative numbering turned on. There's no immediate way of telling which direction I want to move, however. For example, sometimes I see line number "7" and move 7j (7 lines down) when I really ...
2
votes
0answers
52 views

Filename completion without suffix

By using suffixesadd I can navigate modules without file extensions. However, when I import modules by using path completion(<C-X><C-F>) the file extensions do not get omitted. Are there ...
2
votes
0answers
71 views

Color questions for macOS

I just got a mac and have been trying to setup Vim 8 on the built-in terminal. I am mostly having some difficulties with colors. 1) After set number, how do I change the line number colors? I tried ...
2
votes
0answers
73 views

why does cpo-=c cause perceptual “lag?”

I'm using a CursorMoved autocommand with searchpos to do highlighting of special words. I've been using set cpo-=c to handle possible overlapping matches, and I restore it afterwards. This set seems ...
2
votes
0answers
66 views

Alter how oldfiles are displayed

Is it possible to "preprocess" the oldfiles list so that it's easier to navigate visually? As far as I can tell, the contents of the oldfiles list are presented as ordinary absolute paths, but with ...
2
votes
0answers
117 views

getting coordinates of a visual block via Neovim python API

(This is a copy of my original question on stackoverflow) Hi! I am browsing through the list of available functions in Neovim Python Client API in search of a way to get coordinates of a current ...
2
votes
0answers
51 views

New text object for LaTeX subscript or superscript

Suppose in a latex file, I have a line $X_{i_{j}}$ and $Y^{i_{k}}$ My goal is to define a text object in VIM for the subscript, i.e. _{i_{j}}, and superscript, i.e. ^{i_{k}}. I was reading this ...
2
votes
0answers
64 views

vim cpp syntax contained region

I define four key words and two regions in vim scripts syn keyword KeywordA A nextgroup=rangeA skipwhite skipnl skipempty syn keyword KeywordB B contained containedin=rangeA nextgroup=rangeB ...
2
votes
0answers
272 views

Understand starstar-wildcard

I read :h starstar-wildcard, but I cannot understand some cases. (In the following examples, I am using the command :vimgrep pattern file where "pattern" is contained in the concerned files.) 1- If ...
2
votes
0answers
297 views

vim in tmux lose highlighting

I'm using vim 8.0 and tmux 2.5 on ubuntu. And I have set the TERM environment export TERM=screen-256color and run as tmux -2. Normally, nothing goes wrong. It's like the following picture: But ...
2
votes
0answers
39 views

Define region in region with same end match

Let's see an example: block property Property1 key: value end property Property2 key: value end end I would like to let property/end pair highlight only in block/end ...
2
votes
0answers
450 views

How to detect terminal enter in vim8

Vim8 now has a terminal feature, how can I detect when a terminal is started? Neovim has TermOpen and TermClose autocommand events, does vim8 has an equivalent?
2
votes
1answer
280 views

ruby syntax highlighting lost on long files

With a "long" ruby file (896 lines in my case) the ruby syntax highlighting is lost when I G to the bottom of the file. Once that happens and I go back to the top with gg, the syntax highlighting ...
2
votes
0answers
499 views

Prevent fold background color to override gutter

Here's what my colorscheme looks like: But when there are folds, it looks ugly like this: The fold background overrides the "gutter" color, but I would like the gutter to remain gray. Is there any ...
2
votes
0answers
134 views

Vim function somehow adds Ctrl-j to macro?

I've written a short vim function that allows me to edit the contents of vim registers: fun! RegBuff() let vimstuff = "/tmp/vimstuff" if !isdirectory(vimstuff) call mkdir(vimstuff) ...
2
votes
0answers
55 views

custom tab completion with whitespaces

I'm trying to write a custom completion function for filenames and sometimes they can have whitespaces. So far I've been using this command! -nargs=1 -complete=customlist,MyComplete MyFunc execute ...
2
votes
0answers
133 views

Comprehesive support for graphviz (linting/autocompletion/snippets)

Vim comes with some support (syntax highlighting) out of the box for the DOT language (graphviz) In addition, I found the plugin: https://github.com/wannesm/wmgraphviz.vim, which provides integrated ...
2
votes
0answers
118 views

Why are the vim line wise movement commands inconsistent?

While browsing index.txt looking for space to fit some custom keymappings, I noticed something. ^ - First CHAR of current line N- - First CHAR N lines higher N_ - First CHAR N-1 lines ...
2
votes
0answers
91 views

Manual fold issue on both Mac & Ubuntu

When I set foldmethod=manual and then I'm typing <zc> E490: No fold found is raising. Same story with set foldmethod=marker. The behavior is the same on Mac Sierra and Ubuntu 16.04. I ...
2
votes
0answers
50 views

Syntax highlighting depending on whether whole line is commented

Is it possible to have vim highlight folds differently depending on whether every line in a fold is only comments or whitespace? In that case, how?
2
votes
0answers
216 views

Using text objects with IJKL navigation keys

Like many people, I prefer a triangular or inverse-T navigation key format like IJKL instead of HJKL for ergonomic reasons. There's a pretty simple way to set this up in vim that I've used for years: ...
2
votes
0answers
46 views

LaTeX tabu package breaks Vim spell and syntax highlighting

The first line of this section of LaTeX code breaks syntax highlighting and spell check whenever I scroll to the area of the document that contains it: \begin{tabu} {*3{X[l$]}} col1 & col2 ...
2
votes
0answers
98 views

Prevent Vim from breaking up inline code blocks in (r)markdown

I edit R-markdown files a lot, and this entails writing inline code blocks, such as `r sum(mylongvectorname)` I usually have my text hard-wrapped at 80 chars, and this causes problems for the ...
2
votes
0answers
53 views

Possible to use `!` in `iskeyword`, but only at the end of a word?

I regularly use Vim to write Ruby code, which allows ! as part of method identifiers and also uses it as logical negation. Currently, I configure iskeyword to include ! (using autocmd Filetype ruby ...
2
votes
0answers
77 views

No omnicompletion in Vim for python

So I got YouCompleteMe working for python autocompletion. Whenever I use a . operator such as: import sys sys. It shows the correct suggestions. Note that I didn't have to hit CtrlSpace. But when I ...
2
votes
0answers
148 views

Fuzzy Find C++ function definition

I am looking for a way to fuzzy find C++ function/method definition in NeoVim. A function definition can look like this: bool Cls::func() { bool func() { bool Cls::func(unsigned some, bool argument)...
2
votes
0answers
1k views

Getting ligatures to work outside of comments

I'm playing around with Fira-Code and am having a weird issue with its ligatures. They seem to only work within the comments and not within my actual code. I have no idea what's causing this or how ...
2
votes
0answers
1k views

Vim ^V Visual Block mode not working

I am running Vim version 8.0.563 on Solaris and when I run Vim, the CtrlV block selection works as expected, I type ^V and move the cursor and a block of text is highlighted by columns. So far, so ...
2
votes
0answers
240 views

syntax highlight function arguments

Trying to create a simple syntax highlighting for a special file type we use. within this file there are simple functions defined which I match using keywords: syn keyword Funcs foo bar baz hi def ...
2
votes
1answer
648 views

No Solarized Light in GVim (GTK3)

I manually installed the Solarized colour scheme from the Vim-only repository and adjusted my ~/.vimrc as indicated in the documentation, including using set background=dark. GVim 7.4 (GTK3) under ...
2
votes
0answers
130 views

Possible to exclude comments from textwidth?

I recently discovered the textwidth setting, which lets me configure vim to insert a "smart" whitespace-delimited carriage return as I'm typing when my line of text exceeds my specified limit. Is ...
2
votes
0answers
86 views

:sbr opens buffers with horizontal split, even with switchbuf set to vsplit

I've set switchbuf to vsplit but when I use :sbr, vim uses a horizontal split to open the new buffer. This seems directly contrary to what :help sbr says: :sbr[ewind] [+cmd] Split window and go ...
2
votes
0answers
433 views

Syntax highlighting: what is the difference between :syntax match and :match?

Simple question -- what is the difference between the two? When I try, for example, to highlight characters on every line after the 80th with highlight link OverLength Error (OverLength being an ...
2
votes
0answers
108 views

Retrieve the syntax id under the cursor, in all cases

How can I retrieve the syntax id under the cursor, in all cases? Indeed, the synID() function doesn't take into account highlightings due to the :match* commands or the matchadd() function. Example, ...
2
votes
0answers
219 views

syntastic not working on macvim, but works perfectly fine on the terminal

I have an issue where in MacVim, I don't get any syntastic/eslint related functionality. When I run !which eslint in macvim, I get "eslint not found" - eslint is definitely installed. If I run !...
2
votes
0answers
222 views

How to execute a function when a diff closes

I have a setting (namely highlight the 81st character on the line) that I would like to turn off when there is a diff. This is easy enough as a search through the autocmds results in: |...
2
votes
0answers
122 views

Autocorrect spelling mistakes using Google?

I found an automation script written in AutoHotKey very inspiring. It relies on the search result from Google to correct the wrongly spelled words. The script: ; Ctrl+Alt+c autocorrect selected text ...
2
votes
0answers
78 views

vim-latex suit forward search

First, sorry for the cross-posting. I have posted it in https://tex.stackexchange.com/q/345060 as well. I am trying to enable forward search in vim-latex. Since it is not working, I tried a vanilla ....
2
votes
0answers
442 views

How should I fold a shell script in vim? Is there an existing script or function for this?

I'm working on some shell scripts with a lot of: # Parameter: images.0.created_at if [ -z "$images.0.created_at" ] then echo "images.0.created_at is empty" else woostring="$woostring""...
2
votes
0answers
56 views

What generates .pz~ backup files from .py files?

I've been doing edit-save-run-bugfix-repeat on a Python test script, using vim as my editor. My directory now looks like this: -rwxrwxr-x 1 james james 458 Nov 29 23:02 test.pr~* -rwxrwxr-x 1 james ...
2
votes
0answers
224 views

Custom highlights not working in visual splits

I'm a tabs kind of guy, so I highlight leading and trailing white spaces with the following commands in my .vimrc: highlight whiteSpace_trailing ctermbg=red guibg=red highlight whiteSpace_leading ...
2
votes
0answers
389 views

How to configure cscope to select the BEST definition

On large projects, there might be many definitions over many different files and folders for a given symbol. Usually the one you want is the one that is unique to the local area you are working in. ...
2
votes
0answers
72 views

How to properly use the MDI window pop-in (-P parameter)

I've never in 5+ years of vim usage and writing all kinds of custom plugins been able to properly figure out how to use the gvim -P windowname command line option. According to vim's own ...
2
votes
0answers
310 views

How to display all line numbers in Vim?

In my .vimrc i have added this line set number But it only displays the line number for the lines that exist in the buffer, and not beyond this; after this it just shows ~. How can I show line ...
2
votes
0answers
97 views

How can I format objects wrapped inside curly braces?

It's pretty common for me to have code like this in Python and Javascript. my_obj = [ { id: 0, name: 'foo', age: 123 }, { id: 1, name: 'foo', age: 321 } ] What I'd like to automate is ...
2
votes
0answers
80 views

Why does reverse indent enter Hebrew?

Today I learned that you can use <C-_> in insert mode to toggle "Reverse insert" on and off, provided that :set allowrevins is set. This sounds like a useful feature (Albeit an obscure and ...
2
votes
0answers
109 views

Can someone explain the strange behaviour with indenting during reformatting?

Recently, someone noticed a strange behaviour with indenting during formatting with my LaTeX plugin, vimtex. I've researched it, and I've ended up creating a minimal example. Load the following code ...
2
votes
0answers
87 views

Syntastic checking for embedded handlebars code?

I'm editing some HTML, which has embedded handlebars templates. For example: <script id="rowTemplate" type="text/x-handlebars-template"> <tr> <td>{{ id }}</td> <td&...
2
votes
0answers
298 views

autocmd VimLeave event not firing

I had problem with YCMD server not shutting down properly, so I tried to kill it on VimLeave. After a couple tries I detected that VimLeave/VimLeavePre event not firing on vim exit. VimEnter is ...

15 30 50 per page