All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
29 views

How to highlight multiple words that are unrelated

I need to highlight multiple words that are unrelated, eg: aaa bbb ccc ddd I would like to highlight aaa and ddd, and keep cursor at both of those words, so when I try to change the word for example ...
0
votes
1answer
20 views

automatically open TagBar

I set Tagbar automatically open when a new file in vim, it is ok and fine. but if open a new file as a tab in opened vim, Tagbar would not be opened, how to tell vim to keep open Tagbar open with a ...
0
votes
2answers
70 views

switch to tab if already opened

I'm not familiar with vim code. I tried to use vim as IDE, I setup NERDTree plugin.this is my problem: assume I opened 4 files as tabs. if I press t on opened file already on NERDTree plugin, the ...
2
votes
1answer
79 views

How to match this syntax group?

I'm trying to improve on the MySQL syntax highlighting, for my particular code base. I have a lot of this sort of thing FROM TBL_ENTITIES E JOIN TBL_RELATED_ENTITIES RE ON RE.entityFK = E....
1
vote
2answers
59 views

Is it possible to match vim and gvim colorschemes?

This was a nice little article that somewhat demystified vim colors to me. I downloaded and installed the Base2Tone vim colorschemes, and set the following in my ~/.vimrc: colorscheme ...
2
votes
1answer
29 views

Remapping `v` in netrw/calling NetrwSplit(5) directly

So I've created some helper functions to help work around netrw. They are some keybind simplifications that help with things like window/cursor management when opening files, where to open them, ...
1
vote
1answer
23 views

Autocomplete on command-line search pattern returns strange symbols of <09> and ^I

Using Neovim v0.4.3 on a just recently upgraded Linux Mint 19.3. Problem Description: After the upgrade, when typing / followed by first characters of any word below the cursor, in the buffer, and ...
2
votes
1answer
36 views

How is the fn key in written in vimscript?

How do I map the fn key in combination with another key to a macro? I know that the ctrl key in key combinations is written as a C (e.g., <C-c> for ctrl+c) in vimscript. So how would I do ...
7
votes
2answers
36 views

Possible to rename file and maintain undo?

Is there a way to rename/copy/move a file and maintain the vim persistent undo information? If I do :w new-file-name and then :e new-file-name I can't hit u to undo. Already at oldest change :-(
2
votes
0answers
23 views

Is there a way to get improved MySQL syntax highlighting over what vim offers out of the box?

Having spent a bit of time sorting out my colorscheme for my php files, I'd now like to "prettify" my sql. (I blame lockdown). My sql is spread liberally through my php files, but I've noticed the ...
2
votes
2answers
49 views

Plugin to edit whole datasets/projects

I'm using vim all the time for text editing these days, and have a particular use case: editing a dataset using successive commands. The main problem, as often, is fixing things, ideally rather ...
1
vote
1answer
49 views

How to add language highlighting tags to fenced code blocks in markdown

I'd like to create a vim function to automatically add the code highlight tags, e.g. ```python and ``` around fenced code blocks to have syntax highlighting in my markdown previewer (I'm using iamcco/...
1
vote
1answer
79 views

How to paste command into vim command line easily

I am using latest available version of NeoVim v0.4.3 and latest Arch build with kernel 5.6.4-arch1-1. To paste onto the vim command line I am using : ctrl+r " to paste the " register Is there an ...
2
votes
2answers
277 views

Is it possible to make “???” a keyword that can be highlighted?

Is it possible to make ??? (3 question marks) a keyword, and highlight it? I have tried the following in a syntax file. Other strings on the line are highlighted, but not ???. \?\?\? does not work ...
1
vote
1answer
31 views

Adding another language files if I already have `vim-polyglot`

Do I need to add other language files for syntax etc.. if I already have vim-polyglot which have pretty much every language. If I install another language package will they conflict with each other?
0
votes
0answers
20 views

open and close pdf file with tex

I write LaTeX in vim, with vim-latex plugin. Is it possible to attach a pdf file with vim so that the pdf file opens with the tex file and closes automatically when I close the tex ? Currently, I am ...
2
votes
0answers
37 views

Check valid values of an option (e.g. check if completeopt+=popup is valid)

I want to know if I can use the popup option for my completeopt in the running version of vim/neovim. The example is just for clarity, I'm looking for a solution that is generic. I know I can check ...
3
votes
2answers
61 views

How to split view multiple buffers in vim

Working with big projects, I often find myself needing to view/edit several files at once. If I have multiple buffers open, is there a way to split the window to view multiple files in one command? ...
1
vote
1answer
16 views

How to change the background colour of jedi-vim sugestion box in the jellybeans theme?

I am trying the jellybeans theme. colorscheme jellybeans The issue is that the jedi vim auto completion tips for functions appear with white text on white background: Here is how they appear when ...
2
votes
1answer
45 views

Go to Nth character in the file?

:goto goes to Nth byte of the file. I am looking for a way to go to Nth character. Given that Vim supports all kinds of multi-byte encodings, it would be odd if it did not exist, but I can't find one.
0
votes
1answer
16 views

How do you open text files exclusively for writing so that other applications cant access it at that time?

How can I restrict my other terminals from accessing one of my already opened file (within vim)? Sometimes I forget which one of my terminals has that particular file already opened and again open it ...
0
votes
0answers
19 views

How to use bash aliases in ftplugin files? [duplicate]

I want to be able to compile and run C++ files directly from inside vim. I have a custom compilation alias gmm defined in ~/.bash_aliases. I do not want to copy it over to my ~/.vim/ftplugin/cpp.vim ...
1
vote
1answer
30 views

How to properly hook an action on save in vim

I have a code linter (https://github.com/symplify/easy-coding-standard) that I can run manually from the command line, but which I'd like to run automatically in vim whenever I save a file that I've ...
2
votes
0answers
17 views

Use different regex engine for different use cases/plugins

By default re=0, however I'm running into those issues: re=1 makes ctrlp.vim much faster re=2 makes vim-jsx-pretty much faster And somehow re=0 can't seem to get those right for me. Is there a way ...
2
votes
3answers
324 views

How to run multiple commands in command line, & place 1 comma at the end of each line and join all the lines

I am using latest available version of NeoVim v0.4.3 and latest Arch build with kernel 5.6.4-arch1-1. I'm having a problem with the following command in the NeoVim command line: 1 ...
1
vote
1answer
12 views

Starting vimtex plugin from within a vim session

I use Vimtex to edit LaTeX documents in Vim. If I open an existing .tex file, the Vimtex plugin will be initiated automatically. However, if I create a new .tex file, there's no way to initiate the ...
2
votes
2answers
83 views

How to activate bracketed paste mode in GNOME Terminal for Vim inside tmux

Edit this issue happens inside a tmux session. The original value of $TERM before starting vim is: echo $TERM screen The issue appears for example when pasting this kind of indented code: def ...
2
votes
1answer
69 views

What exactly does \%(…\) and \z(…\) do?

I know \(...\) is Vim's way to create a capturing group. It was listed under the atom entry in Vim's doc. There are two other forms of atom, \%(...\) and \z(...\). The document is not very clear on ...
2
votes
0answers
21 views

README.md (markdown) - jump to infile link

While reading a markdown file, specifically using GitHub markdown, vim interprets hyperlinks correctly. It seems like it would be able to jump to the corresponding section in the file. Is there a key ...
1
vote
4answers
26 views

Vim invert block of text over an axis

I was wondering what would be the most Vimish way to the following: I want to invert the text on the right side of the equal sign to the left (and the left to the right). For example, I want this: v1 ...
0
votes
1answer
19 views

How do I put the List returned from a 'heredoc' (:h Let-HereDocs) into a Dictionary in Vim? How do I also make this work in Neovim?

In :help let-heredoc it explains that one can set a variable to a 'heredoc' where each line of the heredoc becomes an entry in a list as follows: let text =<< trim END if ok echo 'done' ...
1
vote
2answers
19 views

Handle ambiguous map

I can make a map like this: nmap wr :write<CR> but then it clashes with another map: http://vimdoc.sourceforge.net/htmldoc/map.html#map-ambiguous http://vimdoc.sourceforge.net/htmldoc/motion....
1
vote
1answer
48 views

How to clear a vim register (vi/ex buffer)?

In the ex linage of editors, one can append to a register(vim)/buffer(ex,vi) by specifying the register name in uppercase. As an example g/pat/y A will append every line match pat to register a. But ...
1
vote
1answer
34 views

Substitution within substitution? Replace with the result of a substitution operation on matched group

I would like to turn a list like this these are custom regex expressions 4 syntax? syntax weird one 3 there are many many many many words in this line 3 into this these are custom {4}regex {4}...
0
votes
2answers
27 views

Vim 8.2 Plugin help. PlugStatus not loading some of my plugins

I need help with vim. Just starting vim but struggling with settings. I placed the below plugin in vimrc as this: Plug '~/my-prototype-plugin' Also, why are some of my plugins not loaded?
0
votes
1answer
23 views

How to set non changeable option?

I installed the cool plugin ("thaerkh/vim-workspace") that make autosession and autosave. But I noticed that when I enter into vim again after quit, some options are rewritable. For example set ...
0
votes
1answer
57 views

Ctrl keybindings not working in wsltty

I have the following mappings: nnoremap <C-,> :tabe ~/.config/nvim/init.vim<cr> nnoremap <C-/> gcc Neither of these mappings is working - they both do nothing. I have a plugin ...
1
vote
1answer
39 views

Is it possible to ignore J if only one line is selected?

Today I made a macro that involved selecting a few lines to join. The problem was that sometimes I only selected parts of one line and in this case two lines was still joined with J. Is it possible to ...
0
votes
0answers
20 views

GVim extremely slow with plugins for long docs

I am using gvim with vimtex (this) with UltiSnips (this) and with conceallevel set to 2. I use the above set-up to write my LaTeX documents. In general, this is slow but if my document is large then ...
2
votes
4answers
100 views

Clipboard is reset after first paste in Visual Mode

I am on Neovim. This is really annoying and weird. When I make a selection in Visual Mode and copy, then select a text and then paste, this paste only works once. For the next time, I again have to ...
0
votes
1answer
23 views

Is the pattern .\{-}\> equivalent to the move command e?

What is the appropriate way to make a pattern that matches up until the point where the move command e would have moved to? Consider this text: texttext%0s: cookie after performing /%<CR>ve the ...
0
votes
1answer
13 views

in macOS, shell escape to bash not zsh

On macOS I've set my login shell to bash instead of zsh, which became the default in Catalina (Terminal > Preferences > General > Shells open with: > /bin/bash). But when I shell escape from vi (from ...
1
vote
1answer
11 views

Problem pasting text with brackets when using auto-close functions/plugins

It's nice to have an auto-close plugin for brackets and quotes like coc-pairs. However, when I paste text from outside into vim insert (ctrl-C, ctrl-shift-v), the text seems to be pasted character-by-...
1
vote
1answer
26 views

How can I use the `:term` command without closing the current window on exit?

I often use the :term command in my projects to create new directories or perform other work. However, if I have multiple windows open, then executing :term from one of them will also close that ...
2
votes
1answer
63 views

Why doesn't this macro work? (expression register)

According to this: nnoremap Q @='n.'<CR>: The @ key tells Vim to execute a macro. Rather than using a named register we use the expression register, which lets us specify the contents in ...
1
vote
3answers
255 views

How can I “reload” a buffer that was previously unloaded using `:bd`, such that it will re-appear in `:ls`?

Suppose I have unloaded a buffer and deleted it from the buffer list using :bd. Now, it won't show in the buffer list (:ls) anymore, unless ! is specified in the command: :ls! How can I add the ...
1
vote
1answer
8 views

How to enable search highlight when I use `normal! n` in a function?

I've set hlsearch. When I type :normal! n, the target text is highlighted. But when I put normal! n in a function(Search) and call that function(:call Search()), the highlight doesn't take effect? ...
0
votes
1answer
33 views

Yank once then multiple paste [duplicate]

My cursor is on line 10. How can I yank line 5 and paste to lines 10,20,30,40, and 50? I know :5 yank then navigate to each line and then P, how else can I do this?
0
votes
0answers
24 views

Replace with another word on the screen

Sometimes I find it convenient to Search for text I want to replace /original Start writing a substitution to replace that :s/ Use C-r C-w to put the current word hovered into the command line :s/...
1
vote
1answer
40 views

How to remap command based on buffer type?

I have coc.vim installed and added suggested mappings, then I installed vim-fugitive and I want to remap the "Toggle an inline diff of the file under the cursor." fugitive_= to Tab but the coc.vim is ...

15 30 50 per page