All Questions

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

Adding prefix and postfix to matching regular expression

Dear fellow Developers, I would like to quote variables having @ inside like test@mail.org, but not starting with @ like @var1, @var2. Does Vi/Vim/Neovim have any option to inspect the matched pattern ...
0
votes
1answer
22 views

Quickfix and building a CMake project on windows

I'm trying to get to the point where I can build a CMake project in neovim and have it output a quickfix list that I can quickly step through. In Visual Studio, I would typically hit CTRL+b for build,...
1
vote
1answer
28 views

run vim without python3 suppport

I have python2 and python3 compiled into my vim vim --version VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 2 2019 14:25:42) Included patches: 1-2109 Compiled by user@enterprise Huge version ...
1
vote
1answer
34 views

How to change colors of Vim editor?

I tried to change colors of Vim editor by going to the screen properties and change the color of background and text. It did not work. I like to know how to change the colors. Thanks.
6
votes
2answers
976 views

How to patch add in Fugitive plugin

This screen I got after running the :Gstatus command Then I moved the cursor to init.vim file and pressed the p key, i.e. run git add –patch for the current file. Now I have this screen As you can ...
1
vote
3answers
26 views

vim : how to set current buffer to a string using `:python`

As example, my current buffer contains below lines di=01;34 ln=01;36 mh=00 pi=40;33 I want to join all lines with :, and set entire buffer to the joined string. How to achieve that, using :python ...
3
votes
1answer
52 views

How to open multiple files with cursor for all files being at the last line?

My experiments generate several log files, which I sometimes monitor manually. Some of the log files have an error message in the last line. I want to open all log files with the cursor located at ...
37
votes
3answers
2k views

How to disable horizontal scrolling?

I have some concealed characters in the buffer and horizontal scrolling kills the alignment big time. Is there any way how to disable it? I could not find any relevant options. Edit: Demo added. You ...
4
votes
3answers
231 views

Is there a workaround for Vim's Netrw :bprev bug?

This didn't get much love on stackoverflow (https://stackoverflow.com/q/48269793/2512141), but I think it's important so I'm reposting here. I think this could be a major barrier to people using Vim's ...
1
vote
0answers
16 views

YouCompleteMe GoToDefinition for java gives 'RuntimeError: Cannot jump to location' when used on classes from Maven Dependencies

I've been using ycm for Python and Go, trying to configure ycm to work with Java. I've installed java 8, maven, recompiled ycm with --java-completer and done mvn install in a repo that contains a ...
1
vote
1answer
18 views

Execute Vim command in terminal window and return to Terminal-Job mode

For a while, I'd been using :nnoremap <C-H> <C-W>h and :tnoremap <C-H> <C-W>h, et. al. to switch windows. This was working great, so when I started using tabs, I decided to ...
2
votes
1answer
397 views

Overriding highlighting style for one syntax

My colour scheme (morning) doesn't play nice with the quickfix window: I cannot read the selected item's location, because the foreground and background colours are the same. Because of this I want to ...
5
votes
3answers
2k views

How to go to previous open buffer from vim command line?

I am trying to write vim function which should make window to go to previous open buffer. How can I do it from command line? My first suggest was to find out some CTRL-O command line alternative.
1
vote
1answer
19 views

load quickfixlist into a specific window

I'm not interested in loading an item into a specific window. I'm interested in opening/loading quickfix list into a specific window/pane. Searched online everywhere, but couldn't find it. Does anyone ...
2
votes
1answer
37 views

How do I use a variable or return value in option, command, or mapping?

I have a variable foo with let foo='value', and a function F like function F() return 'value' endfunction and I want to use them in an option: :set option=foo, :set option=F(); or in a command: :...
1
vote
2answers
42 views

Perform change to all occurrences of multi-line selection

Scenario I would like to perform the following, Visually select some text that spans multiple lines and occurs multiple times in the file: V Yank to buffer: y Perform substitute with text from ...
15
votes
4answers
1k views

How can I search for a string between certain line numbers?

This is a problem I had recently. I have a file with several hundred lines of text. How can I search for a string between two specific line numbers? For e.g. I want to search between line numbers 100 ...
0
votes
1answer
36 views

Neovim: run cmd on write

I've got a file open in Neovim like so: neovim test.rb And a split open like so: :split ruby test.rb How can I rerun the split command each time I write a save in the original window? Update I'...
2
votes
0answers
75 views

(coc.nvim) RLS warning: …use crate_blacklist instead

I've got a warning on start: [coc.nvim] RLS configuration option use_crate_blacklist is deprecated: use crate_blacklist instead Probably I have to put into my coc-settings.json "rust.crate_blacklist"...
0
votes
1answer
41 views

Put many Perl-Filters into ~/.vim

I am pretty advanced in Vim. But one thing I am missing: how to put many Perl-Filters into Vim and run one of them over a selection. I was in former Times user of BBEdit, where I have set up many Perl-...
5
votes
2answers
296 views

How to make vim text bold?

In order to have my vim text always bold, I found this config in stackoverflow: :hi MyGroup cterm=bold :match MyGroup /./ But somehow, it has messed up search highlighting. It is no longer ...
2
votes
2answers
55 views

Multiple vimrc files for different file types in vim?

I'm a vim beginner. I want to handle multiple programming languages. I find great resources for how to perfect vim for one programming language by putting ton of stuff in one vimrc file. This is ...
1
vote
0answers
14 views

Don't trigger an expansion in Ultisnips

Sometimes I want Ultisnip not to expand a snippet because I need this word as it was typed, even though is mapped to a snippet(of course in a perfect world of perfect snippets this wouldn't have ...
2
votes
2answers
43 views

vim incremental command history search

In bash you can easily search the current history entries by hitting <C-r> or <C-s>. This search feature is incremental, and once you hit return, you get a bash prompt auto-filled with the ...
17
votes
6answers
13k views

How to automatically turn off “hlsearch” after I'm done searching?

I love the "hlsearch" setting, but after I'm done searching, I find it obnoxious. Especially if I search for something that has a lot of matches. I know that I can turn this off with :set nohlsearch ...
284
votes
9answers
225k views

How can I copy text to the system clipboard from Vim?

Is there a way to copy a block of text to the system clipboard, so I can paste it in another program?
0
votes
0answers
25 views

How to remove blank line at the very bottom of the UI

To make things easier to explain, please see below a screenshot of VIM running on my computer. How can I get rid of that blank line at the very bottom, i.e. below the "n lines, p characters written" ...
1
vote
2answers
66 views

I am running into problems while using Gpush command from vim-fugitive plugin

I have recently started using the vim-fugitive plugin, and currently I am facing problem with the Gpush command. I tried :Gpush % which gives me errors in the quick fix window saying fatal: ...
0
votes
0answers
48 views

VIM suddenly highlighted the spaces in my file how do I turn this off?

I just recently used Vim as my code editor. It was working fine then suddenly when I opened a file to edit my code this happens. When I open the file nothing is highlighted. But when I start scrolling ...
9
votes
3answers
5k views

How to format JSON file in Vim

Given a file with a large JSON object all on one line like {"versions":[{"count":2,"version":""},{"count":1,"version":"1.1.1"},{"count":14,"version":"2.9"},{... How can I format this to be human ...
1
vote
2answers
24 views

How to use FZF to search directories and open new file in directory

Here's what I'd like to do, and I'm open to using any tool (not just fzf): I want to be able to open a new file quickly (with a horizontal split :sp) in a specific directory that I find using fzf. ...
1
vote
1answer
76 views

How to change string at specific byte index nicely?

I want to change 3rd byte of a string to x, i'm currently using this code: let s = s[:1] . 'x' . s[3:] It's a bit awkward, i wish i can do let s[2] = 'x', but that's not allowed. Are there any ...
20
votes
2answers
6k views

Extract the result of a shell command to a variable in a .vimrc file?

In my .vimrc file, I would like to store in a variable the result of an external command, in my case : $ echo $LANG So that my vimrc file would have : let language = output(!echo $LANG) if language ...
10
votes
2answers
6k views

What does “filetype plugin on” really do?

I understand that it loads the ftplugin.vim file, but what does it really do? Does it set options (depending on the filetype)? If I were to include this line at the start of my vimrc filetype plugin ...
0
votes
3answers
65 views

How to clear neovim terminal buffer

I have a terminal buffer with 10000 lines of previously executed output. In order to search for the particular sequence of words I have to go through all 10000 lines before getting to my last executed ...
1
vote
1answer
28 views

I can run :terminal in Neovim, but it thinks terminal is missing

I have NVIM v0.4.2 and can run :terminal. Despite that, echo has('terminal') gives 0. In addition, if I try to run a command of vimteractive, an error occurs with Your version of vim is not compiled ...
1
vote
1answer
22 views

Restore working directory in terminal windows when loading session

While using :mksession feature, I found that it works well with files and netrw, but not so much with neovim terminal windows. The problem is that, for terminal, it never preserves working directory ...
0
votes
0answers
8 views

Characters from YCM completion menu not cleared in Vim

I'm dealing with a cryptic issue in my environment which is annoying and I have no idea where to start debugging. Random characters on that aren't actually in the document appear on screen after YCM ...
1
vote
1answer
39 views

Why is the commit message inside parentheses wrapped so strangely?

I sometimes need to do some remarks in parentheses in my commit message's detailed part. But when the parenthesized text comes to the rightmost column and is line-broken, the next line for some reason ...
1
vote
1answer
43 views

How does g:terminal_ansi_colors affect the :terminal colors?

:term usually looks ugly in most colorschemes I've tried. At least on Windows, with light themes, these colors do not work and end up in an unreadable shade of yellow against my light background. I ...
19
votes
5answers
14k views

How to share config between vim and Neovim

I started using neovim and moved my .vimrc to .config/nvim/init.vim and other stuff is located in .local/share/nvim. What is the best way to share configs or even plugins between vim and Neovim? ...
2
votes
2answers
56 views

format sparse json files for legibility

Situation I have a large, hierarchical json file with many single entries, like so: { "tokens": [ "payload, a string" ], "values": [ { ...
2
votes
1answer
25 views

Gvim and Unicode indic characters

On my Linux system, if I try to type indic characters (specifically Kannada) in gvim (via ibus), the display is so garbled, I can barely see what has been typed. Is it the expected behaviour? Can Gvim ...
15
votes
8answers
6k views

Quickly calculate the total of a column of numbers

I'm writing down a markdown table which looks like this: | 13/05/15 | 09:30-16:00 | 6.5 | | 14/05/15 | 10:00-16:30 | 6.5 | | 16/05/15 | 15:30-01:00 | 9.5 | | 21/05/15 | 09:00-16:30 | 7.5 | | 22/...
1
vote
2answers
212 views

Fold special comments

I want to fold all special documentation comments, and only all special documentation comments. To do that I created a new syntax, doxygenComment and added highlighting (in red, just to test it). The ...
2
votes
1answer
92 views

Is there a way to start vim in terminal mode?

I often find myself Opening a terminal Running vim Starting a :terminal Is there a way to say vim --start-terminal and have Vim automatically run :terminal ++curwin as soon as it starts?
3
votes
1answer
26 views

search for pattern and insert text that precedes the pattern from pattern1 to pattern2 exclusive

basically I have a bunch of lines of code that all match the format .\module.variable (), .\module.variable2 (), I want to take everything between the backslash and the space, before the parentheses ...
0
votes
0answers
18 views

Auto-insert C++ comment only on <shift+enter>

The comment auto-insert feature is often very helpful and otherwise very annoying, depending on the kind of comment I am writing. Is it possible to bind the auto-insertion of // exclusively to <...
-2
votes
0answers
19 views

I have a possible bug in my vimrc that is preventing syntax highlighting from working [duplicate]

I have a possible bug in my vimrc (~/.vim/vimrc) that is preventing syntax highlighting from working. I get no error messages & if I rename the file highlighting works. Where do I start?
2
votes
2answers
37 views

Two consecutive identical calls to echo have different output

Question reposted on StackOverflow, where it's receiving more attention. Given the following function in the .vimrc file, fu! MyFun(count) echo a:count echo a:count if a:count > 0 ...

15 30 50 per page