:chat!

Vi and Vim chat vi.stackexchange.com
Feb 7 10:22
0
Q: How can I improve treesitter's indentation when editing a multi-line string?

CodemonkeyI mostly edit php files, using neovim with kickstarter.nvim loading lazy, phpactor & nvim-treesitter. I believe nvim-treesitter is what ends up being responsible for auto-indentaion. Indeed if I change this (pre-configured) line under the nvim-treesitter config options: indent = { enable = true, ...

Aug 31, 2024 12:13
0
Q: Preventing cursor from indenting after a previously indented line

robertspierreI'm using neovim and a init.lua file. In what follows ▮ will indicate the cursor: for i in range(1,5): print(i▮ Then I press o: for i in range(1,5): print(i) ▮ Then I press backspace: for i in range(1,5): print(i) ▮ So far so good. Now I press o: for i in range(1,5): print(...

Aug 17, 2024 11:02
1
Q: Mapping ESC sequences doesn't work

gladesI'm using wezterm to forward Shift keypresses in the combination CTRL+SHIFT+c to nvim. This is my conf: ... { key = 'c', mods = 'CTRL|SHIFT', action = wezterm.action_callback(function(win, pane) if pane:is_alt_screen_active() then win:perform_action(act.SendString("...

Apr 12, 2024 23:26
0
Q: How do I switch modes inside a user-defined lua function?

SasgorillaI want to write a command to do the following: Make a visual selection. Call a command on the visual selection. By way of example, I'd like to call vat to visually select around the current tag, and then use Limelight to highlight it. Attempt #1: vim.api.nvim_create_user_command('HighlightTagBl...

Jan 15, 2024 00:06
1
Q: How to use coc-jedi to jump to definitions, and coc-pyright for everything else?

LondonRobI really enjoy coc-pyright and use it all the time for everything. But it can't jump to Pytest fixture definitions, and there are no plans to include such a feature. Pyright doesn't include any knowledge of third-party libraries beyond what is provided to it in type stubs or type annotations, an...

Dec 11, 2023 00:11
0
Q: How to search and replace the highlighted text from visual mode?

VladimirWhat works (normal mode): Search/highlight the word the cursor is on. Replace the word the cursor is on. Note that the word doesn't get erased when I get prompted to replace it, allowing me to make a small correction to the existing word. I obviously have a choice to erase it and input a desire...

Oct 9, 2023 11:12
0
Q: I need help updating complex code from vimscript to lua

Mega BangAbout three years ago, I had gathered chunks of code from the net and made my init.vim config file. Now, with Lua released, I am unable to convert it. And it's down to you folks whether you can help me. You are my last hope. Yes, I've read the documentation and whatnot. Still, I don't get it. Mos...

Sep 4, 2023 20:57
0
Q: Indentkeys Tab behavior

gruvwI want to have something similar to EMACS tab behavior (described in help indentkeys-format) but I still want to be able to input more tabs if I want. I thought that adding !0<Tab> to indentkeys/cinkeys would do the trick but it totally hijacks the Tab key even when it is not the first character ...

Aug 29, 2023 08:08
1
Q: Extremely slow with C++ LSP and fairly big project

ZhivajiHow do i troubleshoot what is causing below problem. Problem: neovim unresponsive for several seconds (10-30 seconds) for any keys Setup: Neovim 0.9.2 and neovim nightly workspace with > 900 files C++ files Clangd with Neovim NativeLSP using LazyVim My triage so far Disabled LSP (using LspStop...

Aug 24, 2023 23:02
0
Q: How to do fuzzy live grep on git files with telescope?

eyal karniProbably quite simple. But I am quite confused from all telescope's terms. There is https://github.com/davvid/telescope-git-grep.nvim which allow for non-fuzzy search, and there is live grep which allows for fuzzy search if you know how to use it. But it is on all files inside certain directory. ...

Aug 23, 2023 14:52
0
Q: Showing virtualedit status in lightline

EnlicoI've got such mapping in my vimrc: nnoremap <Leader>ve :call <SID>Toggle_ve()<CR> fun! <SID>Toggle_ve() if &ve == '' set virtualedit=all elseif &virtualedit == 'all' set virtualedit= endif endfun and I'd like to a component in the statusline if virtualedit is not unse...

Jul 7, 2023 14:17
3
Q: Working with large Visual Studio oriented codebase

BobMoraneI have been using Vim for about 2 years on my personal C++ project on Ubuntu with great success. I build using g++ and make, as my build system. In vim, I can build the project without problem using :make. My personal project has about 200 files. In my job, the project I'm working on has 7 millio...

May 1, 2023 13:42
0
Q: Hide the list of plugins show almost each time at a file open

ArtyomWhen I open some file I see a list of plugins shown on the whole window (screenshot below). I get tired of wasting my time to press few keys to hide this list: several times Space each time. No error then when the file opened or other bugs follows, only that list of plugins each time. How to hide...

Apr 25, 2023 01:02
0
Q: Remote neovim command that changes the selected range (python)

eyal karniI want a simple command that changes the range that the user selected to a string I set (with possibly differently number of lines) - or adds lines if it is more. The following code does nothing but randomly inserts newline. What went wrong? class Plugin(object): def __init__(self, nvim): ...

Apr 15, 2023 08:32
1
Q: Applying commands to buffer from Neovim command line with complex plugin managers

Marcus MüllerI come from the following problem: I'm using Neovim (0.8.3) with AstroNvim as plugin/everything-manager. I've successfully set up multiple LSP servers from within that, which use the right servers, interpreters, settings etc via the user configuration file. So, I'd like to not circumvent loading...

Jan 9, 2023 16:30
0
Q: coc-pairs not working

adamgyI've followed the instructions at https://github.com/neoclide/coc-pairs to install the autopair extension for coc: :CocInstall coc-pairs After running this command, I get the following message: Install finished ...

Dec 16, 2022 12:11
0
Q: Output of paste into vim truncated

user438383I am having issues with pasting text from the clipboard into vim (v7.4) on an HPC cluster using Centos, which I have logged into using MTPuTTY. I still get the same error when I'm logging in via MobaXterm. This is the result of pasting into e.g. sublime text: Which is what's correctly on the cli...

Dec 12, 2022 13:49
2
Q: Completion for ++flags in command-line mode

rampionIs there any way to turn on tab completion for the various ++[flag] flags that some commands take? For example, :e ++ff=unix whatever.txt overrides fileformat to unix for whatever.txt, but :e ++<Tab> just starts doing file completion for me. Single-plus completion for something like :new +<Tab> w...

Sep 20, 2022 22:25
1
Q: How to save quickfix list per neovim session using :mksession

Ariel FrischerI could not find this in :h sessionoptions. If this cannot be done is there another way to save quickfix list to some file and reload it?

Sep 19, 2022 05:05
0
Q: completion menu closes after typing more characters in substring matches

r_31415Let's assume you have the following completefunc defintion: vim9script const py_keywords = [ { 'word': 'pandas.api.extensions.ExtensionArray.argsort'}, { 'word': 'pandas.api.extensions.ExtensionArray.astype'} ] def PyComplete(findstart: number, base: string): any if findstart ...

Sep 6, 2022 07:55
1
Q: Add dynamic custom text to status line

user90726I use Vim with two keyboard layouts, English and Russian, and to be able to use Vim commands irrespective to the current layout, I have the following snippet in my .vimrc: " To switch between keyboard layouts, use Control+^ or Control+Space if g:os ==# 'Darwin' set keymap=russian-jcukenmac ...

Sep 5, 2022 15:09
1
Q: Go to last change not made on the current screen

scottkostyI love g;, but often I find myself repeatedly doing g; until the screen changes. The reason for this is that I am often editing in two different places in the file. If I think ahead, I should set marks at the two places, but I usually forget to do this. Also, I don't know how many edits I made at...

Sep 1, 2022 00:09
1
Q: create an index that lists topics in multiple help files

SteveI started writing a help file for various vim commands that I know I'll forget. Over the last 7+ years it's grown to ~1600 lines and is starting to become unwieldy I've been trying to split it into one file per topic, similar to the vim help files eg user01.txt. I copied one of the topics, calle...

Aug 27, 2022 22:40
0
Q: Move to the beginning of visual line; move to the last non-whitespcae character of visual line

user90726What are the commands to move to the very beginning and to move the last non-whitespace character of the current visual line? Do they exist at all? Commands for normal lines Commands for visual lines To move to the very beginning of a current line 0 ? To move to the very end of a curre...

Aug 13, 2022 22:36
21
Q: I Have a Problem with Premature Yanking

Lonnie BestIf I've already yanked 37 lines, is there any way to send them to the clipboard without having to select them again? I need to move those yanked lines into a GUI application.

Jul 29, 2022 09:38
0
Q: What is the reason to specify ':cANSI' (or another character set) for a font

user90726I often see that fonts intended to be used on Windows are defined with :cANSI. set guifont=Consolas:h11:cANSI The help is, of course, provide some explanation, but I don't really understand it. cXX - character set XX. Valid charsets are: ANSI, ARABIC, BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, ...

Jul 11, 2022 11:25
1
Q: How to change copy content of one register to another in vscode vim?

Maheer AliI am using vscode + vim. Consider a common scenario where I have to yank/delete some text from one place and replace it with some text anywhere else. But as I need to replace I have to first delete the other text. This results into lost of the previously deleted text. The solution I thought of it...

May 31, 2022 08:02
0
Q: How to display stdout/stderr of a program as overlay?

mtkHow can we display a program execution output from stdout or stderr as a overlay from inside VIM? I get that we can have keyboard shortcut mapping to compile and run, but I'm looking to display the output as overlay as shown in below videos stdout overlay example : https://youtu.be/cRPz405LWgE?&t...

Apr 9, 2022 14:50
5
Q: vim hangs when I open a typescript file

PabloI have a vim 8.2 on a Gentoo Linux running on a more or less 8 years old PC. I almost never have a performance issue with vim, unless you open a one-line huge xml oder json file, but those are vary rare cases. My team has started using typescript and so many of our javascript files have been tr...

Jan 8, 2022 06:15
0
Q: How to "match until"?

HarvI have a CSV filled with text messages, and I want to be able to easily filter by sender/receiver. The last field indicates "SMS", "iMessage" or "WhatsApp"; the previous fields may spill over multiple lines. E.g: "Sent","Aug 4, 2021 12:34:56","Some Person","+11234567890","Hello!","SMS" So I can e...

Jan 4, 2022 12:35
1
Q: Make Lightspeed work with Repmo

Tom HaleI'm trying to make the EasyMotion-like (cursor jumping) Lightspeed plugin work with Repmo which repeats a previous motion. So far, (and after many hours), I've come up with the following: let g:lightspeed_last_motion = '' augroup lightspeed_last_motion autocmd! autocmd User LightspeedSxEnter ...

Jan 3, 2022 07:36
2
Q: Characters from YCM completion menu not cleared in Vim

UtumbuI'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 auto complete menu goes away. Pictures are worth a thousand words so here's a demo: Step 1 - Typ...

Oct 22, 2021 10:28
0
Q: How to remove this weird default indentation?

WeakestTopologyIf I do gg=G on a file with the following text - 2018-2019 ICPC Northwestern European Regional Programming Contest (NWERC 2018) - 2020 ICPC Universidad Nacional de Colombia Programming Contest - 2018-2019 ICPC Southwestern European Regional Programming Contest (SWERC 2018) it becomes - 2018-20...

Sep 21, 2021 14:27
1
Q: Making Vim work with Unicode: what is the reason to use "setglobal fileencoding=utf-8"?

jsvThere is a tip on Vim Wiki about working with Unicode: if has("multi_byte") if &encoding !~? '^u' if &termencoding == "" let &termencoding = &encoding endif set encoding=utf-8 endif setglobal fileencoding=utf-8 set fileencodings=ucs-bom,utf-8,latin1 endif I spent a lot ...

Sep 17, 2021 16:40
4
Q: What does the 'z' flag for search() do?

FluxI was looking at the documentation for search() (:help search()). I noticed that there is a "z" flag: 'z'    start searching at the cursor column instead of zero When the 'z' flag is not given, searching always starts in column zero and then matches before the cursor are skipped. What does th...

Jul 11, 2021 02:40
0
Q: Delete key appears to remove two characters

HennyHI open a simple HTML file and navigate to a section of the file where I want to delete a character. I enter INSERT mode and press the DEL key, this seemingly causes two characters to be removed, however, if I save the file and view it I can see that only one character was removed (correct behavio...

Apr 18, 2021 19:29
0
Q: Disable spell checking for URLs in BibTeX

Rudolf AdamkovicI would like to disable spell checking for the URLs in my BibTeX (.bib) files. I was able to disable spell checking for the citation keys (author-year or author+year) as follows: autocmd FileType bib \ syntax match _key '\w\+[-+]\d\d\d\d' \ containedin=bibKey \ contains=@NoSpell For the URLs, I ...

Jan 30, 2021 17:54
1
Q: Complete text with one tap

eyal karniI use a plugin called supertab( ervandew/supertab) that provide completion options. A menu automatically appears after I type 2 characters. What I want to do, is to have a mapping that completes the phrase (using <c-x><c-n>) with one tap. What that means is that : If we are not in keyword mode...

Jan 18, 2021 01:10
1
Q: How to move to Markdown ATX-style headers?

Serge StroobandtHow can I move (navigate) between Markdown ATX-style headers? The Vim plugin https://github.com/gbgar/pandoc-sections.vim does so using the [ and ] keys, but only when there is no space between the opening # hashes and the header text. Unfortunately, above plugin is no longer maintained and the n...

Oct 23, 2020 08:10
5
Q: Can I cycle through buffers while skipping ones I've opened?

KitesLet's say I have a vertical split, and four buffers open. I'd like to be able to have one buffer open on the left, and cycle through just the other three on the right. Something like :bnext but skipping open/visible buffers.

Sep 23, 2020 17:55
3
Q: If one can diff from Vim without the need to boot `vimdiff` then why is it a binary program?

13260Before you start reading. Before having answers, I thought vimdiff was a binary program because I'm used to Debian's file, which seems not to honor POSIX (but I didn't knew); but then I used macOS 10.14 file, which seems to honor POSIX (without me knowing such). The original post. Read in this...

Sep 23, 2020 17:55
0
Q: moving through the doc, caret staying centered

13260I move around using the arrows ←↓↑→, never really got used to the hjkl thing. I know I'm supposed to use the hjkl thing. When hitting ↓, it reaches a point where the caret is on the lower side of the display, until I hit some ↑ hits. Most of the time I need more context down. How do you move th...

Aug 13, 2020 20:05
5
Q: Why does `<Bar>` behave like `|` in the `:command` command in Vim?

Lone LearnerHere is the list of experiments I performed that shows that <Bar> is treated as literal <Bar> in some commands but it is treated as | in the :command command. I am trying to understand why or what in the documentation dictates that <Bar> should be treated as | in the :command command. Case 1: :! ...

Aug 13, 2020 08:46
2
Q: Can this be done with Ultisnips?

noibeI use UltiSnips for many of my TeX snippets, and I'm trying to create one to automatically insert a new \item inside itemize or enumerate environments. The way it should work is the following: every time I'm done writing an \item, if I press the trigger key (<tab> for me) a function should be cal...

Jul 23, 2020 01:59
-1
Q: Replace nbsp with none string in utf-8 encoding in vim

showkeyThe nbsp(non breaking space)'s binary format in utf-8 encoding is c2a0. Create a sample.txt this way :input it is a test then ctrl+v+u a0,then you get the sample test file. xxd sample.txt 00000000: 6974 2069 7320 6120 7465 7374 c2a0 0a it is a test.... Now show the current encoding with se...

Jul 20, 2020 00:58
-1
Q: Un-tab the cursor

David542Is there a way in vim to move backwards a tab as it does move forward a tab? For example, if my line is: * * * * * * hello | = 4 ^ ^ cursor is here If I pressed [tab] it would go to the next tabstop, so: * * * * * * hello ...

Jul 4, 2020 11:26
1
Q: Run autocmd when creating/deleting a buffer

noibeI have two functions tex#PDFOpen() and tex#PDFClose() to automatically open and close the pdf file created by a TeX document. The way I assign them to autocommands is via the following autogroup in ~/.config/nvim/ftplugin/tex.vim augroup TeXGroup autocmd BufEnter <buffer> call tex#PDFOpen() a...

Jun 17, 2020 09:02
14
Q: Trying to move away from arrow keys in normal/insert/visual mode, but small text inserts are killing me!

CodemonkeyI've disabled my arrow keys, and am finally getting used to hjkl (for the longest time I'd always hit j and k the wrong way around - just seemed more natural for some reason). In normal mode I'm fine with it, but not being able to move the cursor in insert mode is killing me. Frequently I want ...

Jun 15, 2020 13:19
2
Q: Recording and playing macros with langmap activated

jazzfanThank you for your interest in this rather specialized question. This is a follow-up to this question : Mapping for expression register with langmap active I’m looking for the best way to associate two different keymaps in (Neo)vim, one to input text (bépo in my case) and US Qwerty for all the...

Jun 10, 2020 22:34
0
Q: Error when w!riting a file "Can't delete backup file"

MobergI'm having a problem when writing to a file created by another user. When I try to do :w I get the error message E506: Can't write to backup file (add ! to override) and when I do :w! the file get's written but I still see this: /share/home/file.txt" 161L, 9896C written E207: Can't delete backup...