# All Questions

9,735 questions
Filter by
Sorted by
Tagged with
12 views

### Changing cpoptions only work in commandline

So i tried to change the setting from cpoptions, so i did: set cpoptions=aABceF on the commandline, where s for the star is missing (on purpose) and it seems to work fine but only if i do it in the ...
16 views

### How to perform an action on search highlighted text like capilize?

How can I select on visual mode all search highlighted text(that is not the same words/chars, achieved by using \zs \ze) so that I can run a command on it or how can I run a command on all highlighted ...
18 views

### Change default character for comments

The assigned character for comments is " for vimscript. But i want to change it to some other character (like * or # for example). Based on this post, it seems like the string setlocal ...
15 views

### Ignore error on specific character in .vimrc

I'm using the accepted answer in this post, and as such, tried using the character * in my .vimrc, but it seems to generate E20: Mark not set as error, which i want to ignore (only for the instance ...
83 views

### Execute command for multiple files

I find myself often in the situation in which I want to run multiple vim commands on a multiple files. Consider file1.txt, file2.txt, file3.txt I would need to run :retab and then some :%s/ /, / for ...
27 views

### Evaluate an expression from visual selection in Python

I'd like to be able to select a part of a line, send it to a python interpreter, and have the selection replaced by the expression result. The use case is for doing math in Markdown documents: 1. Text ...
8 views

### Neovim steals line of screen

I try to switch to neovim because vim had turned slow. But neovim has the irritating habit of showing two status lines at the bottom of the screen. Is it possible to merge them into one? neovim: ...
28 views

### Weird powerline symbol background in iterm2

I am experiencing a weird background color of powerline symbol in iterm2, it doesn't match with that of status bar. however, in alacritty, the background color are matched. In iterm2: In alacritty: ...
15 views

### Escape for double quotes not working

I'm trying to search for quotation mark, but it seems it doesn't work: \v^\s"\zs\"+ is what i tried. Though I'm well aware it need to be escaped...I tried: \v^\s""\zs\""+...
10 views

### Unable to select templates with vim-latex

I have Vim on Ubuntu 18.04 and I have sucessfully installed the vim-latex package. When I open a .tex file, vim regognizes it as latex and the plugin kicks in (I have already struggled with this a few ...
18 views

### Is there a function which returns the filepath at the cursor?

I'm looking for a function(probably doesn't exist) which can return the filepath under the cursor. I know that there is a command/shortcut gf that helps me jump to that file if the file exists. But I ...
31 views

### Make fold feature act like Emacs's org-mode fold

In Emacs org-mode, folds use * at the start of the lines, and any * added consecutively, will add a level of indentation to the header. Furthermore, the header text placed after * or any number of it, ...
31 views

### Execute vimscript without saving first?

From my two previous questions, I learned about using :source %, @", and other tricks to execute vimscript. But as I noticed, :source % needs the file to be saved first, furthermore, @" and ...
32 views

### Is it possible to get vim-airline to make the statusline 2 or more lines high?

My statusline has too much information to fit on one line. It was already marginal, but now that I've rotated my monitor into portrait mode, it's a huge issue. I really like all the information ...
37 views

### text replace problem when target contains '&' symbol

I tried to replace if(cond1) with if(cond1&&cond2) in vim, so I typed the command :%s/\Vif(cond1)/if(cond1&&cond2)/g but the result is if(cond1if(cond1)if(cond1)cond2) and not if(...
17 views

### Vim autocorrection problem

I am having a problem with vim autocorrection. I got this line from a website, which is: inoremap <C-l> <Esc>[s1z=]a The problem is that whenever I press Ctrl+l to correct something, it ...
22 views

### Key Registration Problem

I have a problem that sometimes happens when I do type in Neovim. It does not register keys or mouse clicks correctly, which causes me to restart the iTerm session and rescue the working file with ....
21 views

### How to paste text from other applications into Vim without incrementally indenting each pasted line? [duplicate]

I want to copy text from other applications into Vim, e.g. from Visual Studio Code, but the result is awful. In particular, each pasted line is being indented incrementally: Furthermore, visually ...
55 views

### Sync cursors of popup window and current window

I'm trying to sync the cursors movement of a popup window, and the current window. call range(50) \ ->map({_, i -> string(i)}) \ ->popup_create(#{ \ line: 1, \ col: 1, ...
17 views

### Scrolling down in popup window not working as intended

I have the following code: let text = range(50)->map({_,i -> string(i)}) let winid = popup_create(text, { \ 'line': 1, \ 'col': 1, \ 'minwidth': 1, \ 'minheight': 1, \ '...
29 views

### Search for symbols in tags from multiple projects

I am developing a Linux kernel driver so I have a git directory with my project. I have another git directory with the Linux sources. I am using neovim with gutentags with the setting of gtags_cscope ...
18 views

### Getting LSP running for Julia using Coc-Plugin

so I'm trying to get LSP working for Julia using the CoC Plugin. It works for python or HTML. So I'm using: Coc-Plugin: https://github.com/neoclide/coc.nvim CoC-Extension (coc-julia): https://github....
22 views

### Minimum window width will not change when using specific filetype

With most filetypes, I can resize font and my GVIM application window just fine. However, when I open a specific file type (.tex), the font is easily changed, but I am unable to shrink the application ...
23 views

### Where do filetype-specific autocommands live?

I have a plugin for a specific filetype (*.tex), and I'm wondering where I can find all the commands which are executed when I type :e examplefile.tex? In general, is there a standardized practice for ...
9 views

### netrw not open correctly, just open blank with noperm message

I am Neovim user and have serious problem with netrw I find netrw has a bug when trying to open the file, at first it only shows an empty buffer(1st picture), and right bottom corner, you can see [...
90 views

### How to change indentation in “case” with curly braces? [duplicate]

The default is this: switch(x) { case a: { y(); } } But I need this: switch(x) { case a: { y(); } } With :set cindent and :set cino={-s this is ...
273 views

### How to put partial command in command bar?

I am trying to do something like this, from a function: nmap <F5> :!python % Pressing F5 in this case causes the command :!python % to be left in the command line. This is preferred for me, ...
27 views

### Vim+Tmux unfocus airline when switching away

I'm using Vim with tmux and I wanted to know if there was a signal or something to 'deactivate' the vim window (like when you switch between vim windows) but also when you switch between Vim and Tmux. ...
87 views

### Indent current line by one space or two space character(s)

hopefully this is not obvious, but: I know how to indent and unindent multiple lines via: 3>> (shift right) and 3<< (shift left). The shift width is specified with 'shiftwidth'. How can I ...
40 views

17 views

### nerdtree: not allowed to enter a popup window

I'm using Vim8.2 with the plugin Nerdtree and some other plugins to work with Golang. Here is how I configure my vim: https://github.com/YvesZHI/Giraffa-vim All of configs can be found in the file ...
86 views

### Remove a pair of brackets without using plugins [duplicate]

I am looking for a way to remove a pair of brackets in the insertion mode without plugins. It's like (|) When I press the delete key only the first bracket get deleted |) But I want to auto-remove ...
14 views

### syn-keyword with control characters?

(I know the goals are dumb, and I know I could set ffs=unix,dos to not see ^M; I'm just trying to understand more about vim). I was playing around with vim keywords, because I want to conceal certain ...
54 views

### Any ways to sync the movement of the number column and another window?

I want to be able to control/sync the movement (scrolling) of the number column (usable with :set number) with another different window (which doesn't have :set number set). Any ways to do this?
23 views

### More intelligent automatic formatting

I use vim to edit latex files and the automatic formatting option (formatoptions+=a) works very well, since you can enter text anywhere in the paragraph and vim will reformat the entire paragraph. The ...
23 views

### Running function using <SID> on commandline not working

So i found the following vimscript code: let s:mappings = { \ 'k': {id -> s:scroll_line(id, -1)}, \ 'j': {id -> s:scroll_line(id, 1)}, \ 'd': {id -> s:scroll_page(id, ...
18 views

### vim terminal max ed on whole screen, refuse to be resize and budge [closed]

Vim terminal maxed the whole screen, it refuse to be move or resize... hogging the whole screen, worst still I clicked "remove terminal menu bar".. I am using endeavouros linux (arch based). ...
9 views

### manual folding of latex using vim-latex

In my vimrc, for vim-latex-suite I have used (as described here) let g:Tex_FoldedMisc = 'preamble,!!!' with the expectation that it will fold the text inside \noindent{%!!! .... %!!! I won't like ...
43 views

### Any way to execute vimscript beside yanking and doing @" on the commandline?

I'm used to just yanking and pasting the register @" into the commandline to execute vimscript, when I'm doing testing experimentation (since it's faster than pasting it into the .vimrc) Any ...
9 views

### “Could not pop the stack error” in vimwiki function

Got a vimwiki function: function! vimwiki#base#is_diary_file(filename, ...) abort echo a:filename let l:diary_file_paths = a:0 > 0 ? a:1 : vimwiki#diary#get_diary_files() let l:...
284 views

### What is {what} supposed to mean in the official documentation?

I keep seeing mention of {what} here and there, mainly in eval.txt, popup.txt, terminal.txt, syntax.txt, and channel.txt. From :h popup_create() popup_create({what}, {options}) Open a popup window ...
24 views

### How to display popup window on the left or right side

I looked into the :h popup.txt and unless i missed something, did not see any mention for setting a popup window on the left or right side. PS: I'm on Vim 8.2 (latest compiled as of now) Any example ...
26 views

### Vim-latex not starting automatically for .tex files

I have Vim on Ubuntu 18.04 and I am trying to use the vim-latex package. By typing :set rtp? on Vim I get the following output: runtimepath=~/.vim,~/.vim/pack/bundle/start/vim-latex-1.10.0,/var/lib/...
146 views

### How come the Vim cursor leaves one character at the end of the line?

It sounds like a bit of a silly question, but I couldn't find any answers. I've noticed that in the command mode, the Vim cursor doesn't go until the complete end of the line and stops at the last ...
56 views

### Vim LSP: change keybindings only if there is a LS attached to buffer

I do maintain there mappings in mv \$vimrc: augroup LSP | au! autocmd FileType go,json,yaml nnoremap <silent> <buffer> <c-]> <cmd>lua vim.lsp.buf.declaration()<CR> autocmd ...
17 views

### Case-sensitive search with smartcase set

I have set smartcase in my init.vim so searching with /lowercase is case-insensitive, which is usually what I want. However, I sometimes want to do a case-sensitive search where my target is all ...
23 views

### line-completion based on non-initial substring

Is there a way to perform a completion similar to <c-x><c-l>, but completes lines based on an arbitrary substring rather than a leading prefix of the line? I'm especially interested in a ...
29 views

### How to disable American spellchecking in vim, and switch purely to British?

I tried :set spell spelllang=en_gb in my vim, but I noticed that summarization is not highlighted as incorrect. Shouldn't it be wrong? How to fix this problem?