All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
13 views

Syntax region only if at top of file

I have a syntax I'm trying do make. It's yaml embedded in markdown for use with Hugo. The yaml region is enclosed by --- and this must be at the top of the file. --- [yaml front matter stuff] . . . --...
2
votes
0answers
21 views

Do not delay mapped keys with common prefix

What I want to do is have two mappings. One mapped to <s-k>, and one mapped to <s-k><s-k>. What happens right now is that if I press <s-k> vim delays for timeoutlenms, and if ...
1
vote
1answer
27 views

Search backward for first line not matching a pattern?

Is there a way search backward from the cursor for a line that doesn't contain a pattern? For example, many of my lines match the regular expression ^ adding: \i\+. I want to find the first line ...
1
vote
1answer
17 views

How to turn on airline theme's background in vim?

I started using vim 1 day ago and i installed tpope/vim-pathogen and then vim-airline/vim-airline-themes plugin to use these themes. Then i changed my .vimrc to set up the papercolor theme, powerline ...
0
votes
0answers
8 views

Prioritize TabNine autosuggestion over Intelephense with Coc

I am trying to configure TabNine and Intelephense with coc. I like the autosuggestions offered by TabNine. But Intelephense plugin is enabled, I am seeing suggestions from only Intelephense and not ...
0
votes
2answers
25 views

How to start search `/` from a mapping?

I'm trying to do the following mapping in my vimrc: nnoremap <silent> / :call <SID>FooFunction()<CR><BAR>norm! / But when I press /, instead of running the function and then ...
5
votes
1answer
87 views

job_start() command only works with seemingly random job options

I am getting some unexpected behavior when trying to run the zip shell command using Vim's job_start(). As an example, suppose I have two images (im1.png and im2.jpg) in the directory /home/username/...
0
votes
0answers
15 views

How to display NERDtree buffer in a floating window

Thanks to a comment on reddit I was able to move my FZF search to a floating window and whilst it looks cool my main gain was that it's faster or at least it feels faster because it's no longer ...
1
vote
1answer
19 views

how to stop vim from shortening window title to terminal width?

after some tinkering with xprop and window resizing, I'm almost certain it's (neo)vim, not the terminal emulator or the window manager that's shortening the x11 window title name (one of these x11 ...
2
votes
1answer
66 views

How can I use a plugin mapping in my own mapping?

I often repeat the following commands when I edit code: yy - yank the line gcc - comment out the line (so that I can visually see all the changes later) p - paste back the copied version what I will ...
2
votes
2answers
39 views

Ctrl-6 doesn't switch to the last buffer (Neovim)

Just noticed that this doesn't work for me. I have to hit Ctrl-Shift-6 (Ctrl-^) to activate the shortcut. Launching up my Vim it worked just fine so it's not something weird going on with my machine. ...
1
vote
0answers
20 views

gVim 8.2, display problem

I have a weird problem with VIM, both at work and at home (2 different computers): When I open a text in VIM, sometimes it is displaying it correctly, sometime not (I'd say 1 every 3 it works fine, ...
0
votes
0answers
22 views

Don't highlight entire line for highlight group

I'd like to change the highlight colors for the QuickFixLine highlight group (something like highlight QuickFixLine term=reverse ctermbg=DarkGrey). Sidenote: the QuickFixLine highlight group is the ...
0
votes
1answer
18 views

Rename neovim terminal buffer without breaking :mksession

Is there a "good" way to rename the terminal buffer in neovim? I know that renaming is possible with the :file command, and that works fine for current session. The problem with this approach is ...
1
vote
0answers
18 views

.viminfo is read-only even after chmod 744

I'm trying to clean out erroneous entries in my command history. Though I could (in theory) use :call histdel("expression") it would be easier for me to just delete the entries from the .viminfo file. ...
4
votes
0answers
32 views

VIMDIFF missing small differences

I have two nearly identical very large files (890,000+ rows of exactly 899 characters each fixed length file). On rows 289141-289148 one file has a pipe character in column 38, and the other file has ...
0
votes
1answer
56 views

How to ident the cursor to the indentation of the above or below line?

I want to move the cursor to the indentation of the line above or below. As seen from the example below, when I move the cursor down (j), it goes to the start of the line. This is both true for ...
2
votes
1answer
46 views

Change <up>/<down> to gk/gj in insert mode

I want to replace the default behavior of the arrows in insert mode, so that they behave like gk and gj, I have used: inoremap <up> <Esc>gka inoremap <down> <Esc>gja But this ...
3
votes
3answers
157 views

Is there a way to “move to the beginning of the next text object”?

Suppose I have a defined text object. For example, I have a ii text block which defines all the contiguous lines around the cursor at the same level of indentation or deeper. I know what it means to, ...
3
votes
2answers
63 views

Howto enable only one plugin to test?

I need to test a vim plugin. The problem: I already have my vim setup in current env, so ~/.vimrc is occupied. I want to issue a command like vim -u <blah..blah> that maybe specifies the plugin ...
0
votes
1answer
38 views

How to type snippet keywords when you need it

I am new to vim, I just wonder if I want to actually type the keyword in some cases, how do I do it? Do I need to disable the snippets? For example, if I use impd as keyword for import pandas as pd, ...
1
vote
1answer
14 views

How vimdiff links to vim

When i do a ls -l /usr/bin/vimdifff it shows following /usr/bin/vimdiff -> vim Does this mean vimdiff and vim are the same? I know that we can use vim for diff by giving -d. But how does linking ...
0
votes
1answer
44 views

Is there a way to change the message “press ENTER or type command to continue” to something else?

I would like to change it to make something like a separator between !python % Change this(my computer is in spanish): To something like: Hello World --------------- Hello World --------------- ...
1
vote
0answers
10 views

How to list the hex range of an a fileencoding in vim?

Is there any way to take a fileencoding setting (for instance utf8 or cp1252) that you might set and find out what it's valid hex range is? When a character falls outside the range, it is displayed ...
1
vote
0answers
24 views

Convert a binary dump back to text in vi?

Select text in vim and convert it to a hex dump... :'<,'>!xxd (Note 2 hex characters represent a single letter...in whatever encoding I did this in...) Select a hex dump in vim and convert it ...
0
votes
0answers
12 views

Showing full typescript definition with deoplete

When using nvim with deoplete in typescript code, I see autocompletions. I'm not using nvim-typescript, but will see typescript definitions, but the autocomplete box can only show so much. I've ...
1
vote
0answers
16 views

neovim: Keep :terminal active when I switch to other buffers

I use :terminal in neovim to run a dev server. But whenever I switch to other opened buffer(s), the terminal kills the process. Is there a way to keep the terminal running in neovim?
1
vote
1answer
18 views

Vim syntax group not stopping

I recently upgraded to vim 8.2.0100 on Mac, and the markdown highlighting appears to have changed to be buggy. Here is an example: Normal syntax *Highlighting has started* Highlight continues ...
1
vote
0answers
16 views

How can I :map a key to something containing spaces? [duplicate]

I want to :map <C-t> :some-ex-command with a space at the end so I can continue typing the command and execute it with enter. I cannot find the syntax for how to do this. I tried :map <C-t&...
0
votes
0answers
8 views

F3 prints [R in fzf prompt in Gvim in Windows10

So this is my env: Windows 10 fzf (installed via choco), and customized so F3 toggles preview gvim 8.1 Now...this does not work, I get the fzf prompt, but when I hit F3 to preview one file, I get [R ...
1
vote
1answer
25 views

Is there a way to use a wildcard with :tabnew

I often find myself wanting to open multiple tabs at the same time from within vim. I would like something like this: :tabnew src/Class.* which would open all matching files in separate tabs. Is ...
0
votes
1answer
19 views

How to prevent Vim from making a flashy screen effect when pressing `ESC` or `^[` in normal mode?

I often press ESC/^[ to ensure that I've left insert mode and entered normal mode. However, if I'm already in normal mode, Vim displays an annoying flashy screen effect: How can I prevent Vim from ...
1
vote
1answer
38 views

Why does this autocmd not work

I write this line to the ~/.vim/ftplugin/c.vim file, but nothing happens when I create a new C file: autocmd BufNewFile *.c read ~/skeleton/c Afterwards, I added this line to $MYVIMRC: autocmd ...
2
votes
1answer
59 views

Parsing winlayout() For Toggling Multiple Windows At Once

When working in vim, I like to have a toggle-able terminal window that I can bring with me from tab to tab. This works by tracking tracking a buffer, and opening it in a new bot split if it isn't ...
1
vote
0answers
9 views

How to disable this 'make text in clipboard into comment' feature with java file?

I am not sure why, but when I tried to create a new java file and paste some java code into it, vim turned them into comments and added additional indentation to the code. 16 // import com.myproject....
1
vote
2answers
357 views

Autocomplete incremental search behaviour

Consider the following scenario Content of the buffer: I saw the water in a thermal bath. Commands issued: :set incsearch /th^R^W^R^W^R^W^R^W Result thewaterIII Question What exactly is the ...
0
votes
0answers
24 views

Joining multi-line block selection

I have some text like: INPUT ID : <other stuff> NEWS : maybe blank PROFILE : who knows DEL : xxx END; Then somewhere else I want to put: Begin <stuff> create ...
0
votes
2answers
20 views

Appending multiple new lines to a buffer (instead of “^M”)

I'm trying to create a buffer for a specific purpose, and for that, I need to add newlines to it to get it to be the same height as my current window. My first idea, using call append("^", repeat("\r",...
2
votes
0answers
17 views

Using Mathematica in Vim produces errors when printing in TeXForm (double backslash, “ b'-/n' ”)

I've been trying to integrate Mathematica with my Vimtex set-up, inspired by this article: https://castel.dev/post/lecture-notes-1/ The basic idea is to use UltiSnips to run an operation in Wolfram ...
1
vote
0answers
32 views

Toggle Vim background transparency: how to setup?

I'd like to map a button to toggle Vim's background between transparent (to see stuff on other apps) and dark. My current settings I'm using onedark theme. There's currently no other background ...
0
votes
1answer
18 views

How do you disable automatic code folding?

I use foldmethod=indentbut I hate how it starts each file pre-folded. To get around this I put au BufWinEnter * normal zi in my vimrc. That had worked fine so far, but now that I started using CoC, My ...
2
votes
1answer
53 views

How to enable part of my vimrc to only apply in gVim?

I run Vim using both gVim and in terminal. Basically, I want to enable a certain colorscheme in my vimrc but only when in gVim, as the theme looks terrible in terminal. How do I accomplish this?
0
votes
1answer
36 views

Custom prompt message when saving file

The default message displayed on the prompt when one saves a file is "<file_name>" <nlines>L, <ncharacters>C written and it remains in the prompt until another message is to be ...
6
votes
4answers
754 views

Increment numbers in text

I have a markdown file like this: Irish Bands: 1. U2 2. The Cranberries 3. The Dubliners English Bands: 1. Queen 2. Duran Duran 3. The Beatles American Bands: 1. Nirvana 2. Blondie 3. The Doors I ...
4
votes
0answers
27 views

gvim: Make the mouse follow CTRL-W_j and CTRL-W_k

I run a Linux/GNOME laptop where the focus follows the mouse, and I have vim's mousefocus feature turned on, so the selected viewport follows the mouse, too. But when I try to switch viewports using ...
3
votes
1answer
32 views

Can I configure nvim-qt to look like a terminal?

In gVim there's guioptions which lets you disable the gui-specific features. I'm curious if I can configure this in Neovim somehow. If it can't be done across the board, what I want most is it be ...
1
vote
3answers
98 views

How can I create a command to remove non-consecutive duplicate lines?

I'm trying to remove (non-consecutive) duplicate lines in a file I have loaded in vim (without sorting them). In several places on the web I've found the nugget awk '!x[$0]++' as a pipe command that ...
2
votes
2answers
36 views

How to search and replace more than character and a string in vim

I know it should be easy, but somehow I don’t get it right. I've got a text with artist_id, album_id,... and want to replace them with just id. How do I do that? I tried :%s/[a-z]+_id/id/gc, but ...
2
votes
1answer
32 views

How do I trim whitespace automatically?

I've been doing this: au BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif The problem is that it moves the cursor sometimes when I save the file.
1
vote
0answers
24 views

Add to statusline

I'm using vim-airline plugin for my statusline. Now I want to install kite which suggests adding a section to the statusline. I tried adding using: set statusline+=%{kite#statusline()} but that ...

15 30 50 per page