All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

When I run :LanguageToolCheck, the output is the java -jar command in a new buffer

I've been trying to utilize Vim to do more writing so I tried to install LanuageTool and a related vim plugin: https://github.com/dpelle/vim-LanguageTool/ However, even after specifying the location ...
1
vote
1answer
20 views

Stop vim from highlighting "note" in yellow inside SQL comments

I am using vim under Ubuntu under the windows WLS. When I edit SQL files, only inside comments - the word "note" is always highlighted with a background yellow color. This includes, for ...
3
votes
1answer
712 views

What is the difference between "==" and "is" for checking the equality of strings?

What is the difference between == and is; ==# and is#; ==? and is? when checking whether or not two strings are equal? Sometimes I see foo is# 'bar', and I wonder whether or not it is always ...
1
vote
1answer
65 views

Can I replace two distinct old strings with two distinct new strings using a single :s command?

Suppose I have the following line of text in vim: hello, it will be sunny today and I want to change it to: goodbye, it will be sunny tomorrow I could put my cursor on the line and type :s/hello/...
1
vote
0answers
21 views

How to show line numbers only at fixed intervals?

I know how to show absolute as well as cursor-relative line numbers but I do not need to see each line number and they look too crowded. I would like to just see line numbers at an interval, say every ...
1
vote
1answer
19 views

Run a Command Upon Exiting a Filetype

I know you can run a command upon entering a filetype with... au! Filetype foo echo "bar" but what can I use to run this command when I leave this filetype?
2
votes
1answer
34 views

Can not move to other buffers unless I save the current one

I launch vim with two files. I can move from one file to the other by :bp or :bn quite happily. But as soon as I make a change to file1 it won't allow me to move to the other buffer unless I save the ...
0
votes
0answers
17 views

Open file from vifm in split view

I use vifm in split mode - it always shows two vertically separated windows each with a directory listing. From there I can open files using the right arrow. However when I open a text file, vifm goes ...
1
vote
1answer
32 views

Option to prevent outer yank (ya') from yanking leading whitespace?

If i have something like foo( 'parameter' ) and I press ya' with the cursor somewhere inside the parameter string then the indentation space gets yanked too and I end up with 'parameter' in my * ...
0
votes
1answer
28 views

How to replace selected text T with some function(T), using a keyboard shortcut?

I want to annotate words /sentences for a "named entity recognition" purpose; inside a text file, I want to annotating words or sentences with this format [pattern](label): [a word where the ...
0
votes
0answers
49 views

Vim editor entities tagging/annotation tool

I'm looking for a word/sentence annotation tool/plugin to be used INSIDE vim editor. Specifically I'm looking for a cli tool NER (named entity) tagging. Any idea/suggestion/tip? By example, I would ...
1
vote
0answers
36 views

vim doesnt recognize html in string in filetype php. same thing with php code in filetype html

Ive had no luck solving these issues for quite a while now. Problem1 When writing HTML inside a string in a file with filetype=php, the HTML is not recognized (i.e., it has no highlighting or indent). ...
0
votes
1answer
14 views

How to use histadd() with a custom function

I've got the following in my vim config: map <leader>ot :call OT()<cr> function! OT() let fname = input("ot: ", "", "file") let res = system("ot ...
0
votes
1answer
23 views

How to map a surround command?

I'm trying to map commands that are used with the vim surround plugin. Using vim surround you can type ysiW], for example, while in normal mode and it will surround the word at the cursor with ...
-1
votes
0answers
37 views

How to scroll in built-in Terminal?

I want to scroll the Terminal inside NeoVim, but it looks like this: That is, since I opened NeoVim inside tmux, and in tmux it "scroll" entire pane. And is there any recommended shortcuts ...
0
votes
0answers
17 views

in vimscript how to write the code a CTRL-C to be executed

I run a sourced vimscript like this: exec 'g#' . WE_var_searchmode . ' ' . WE_var_pattertosearch . '#exec " A | B | C | make_CTRL-C | ... | LAST " ' The outer execute '...' is needed to ...
0
votes
1answer
20 views

Is there a way for Vim to re-source all the startup files without quitting and re-starting?

I write a lot of Vim plugins. When I make an edit to a plugin's .vim file, I'll often just quit Vim and restart it to test it. In some cases, I would like to avoid quitting and restarting Vim. I ...
0
votes
2answers
27 views

How to deal with two vim plugins having the same mapping?

I have two plugins (todo.txt-vim and vim-buffergator) that both map the <localleader>b command (for .txt files at least). One plugin ended up dominating the other. I solved this by removing the ...
0
votes
1answer
24 views

Make LanguageServer aware of requirements without activating virtual environment (Python)

I have a typical python project structure: ├── requirements.txt └── src.py where requirements.txt is holding the requirements of my project, and src.py has my code. In my minimal example, they look ...
1
vote
1answer
20 views

What does "any scanf non-assignable conversion" mean?

:help errorformat lists the basic items supported in 'errorformat' and one of them is: %*{conv} any scanf non-assignable conversion What does that mean and how can I use it? The fscanf ...
0
votes
0answers
34 views

vim problem when in "try" ... "catch" an "if" is between

When a vim script is to be watched for errors and interrupts, try is put somewhere near the beginning and catch after a long sequence of code. In this sequence of code it is very probable to have some ...
0
votes
0answers
21 views

How do I regain control of my Vim session when it hangs while saving a file via netrw?

I edit a lot of files using netrw in gvim. Sometimes, when I mash C-s to save, it will hang my vim session. I'm not sure if this is because of a network error, or because I also sometimes hit C-z at ...
2
votes
1answer
27 views

Prevent jumping when pattern matching

Is there a way to prevent cursor to search forward when using the * or /? I just want to highlight the word I am on & others, but not move to forward nor backward.
0
votes
1answer
26 views

Why runtime! is not working?

Add customise filetype setting file do.vim inside ftdetect folder. Edit gvim/8.2/share/vim/vim82/filetype.vim: runtime! $HOME/.vim/ftdetect/*.vim Open file, run verbose set ft?. From print, filetype ...
0
votes
1answer
22 views

How can I execute a piece of selected lines on terminal with a mapped command?

I've created the following script on my vimrc file: function! ExecuteOnTerminal() if (&ft=='javascript') :%terminal node elseif (&ft=='sh') :%terminal bash elseif (...
0
votes
1answer
15 views

How to get path in NetRW?

I want to override NetRW's response to <CR>. When I hit enter, I want to: get the path of the file or directory of the line with the cursor in the :Lex window test if path is a file if the ...
3
votes
1answer
55 views

Search and Replace on odd/even numbered lines using g

I was looking for ways to search and replace on even/odd numbered lines in vim and I came across some solution on google groups https://groups.google.com/g/comp.editors/c/xk9DMoszgq4. To search and ...
0
votes
2answers
80 views
+100

How to remove this weird default indentation?

If 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 - ...
1
vote
1answer
78 views

How to change the color of the vim ruler?

was hoping someone could help me in changing the color of the ruler in vim? Specifically, the opacity as I'm trying to make it match the rest of my vim opacity, but can't seem to pinpoint where ...
1
vote
0answers
46 views

Remapping Ctrl+backspace in insert mode to delete one word back

I want to bind Control+Backspace in insert mode to delete a word. I'm able to bind Control+Del in both insert and normal modes, but I can only seem to bind Control+Del in normal mode. I've checked ...
0
votes
1answer
20 views

how to install this? NerdTree visual selection

I've been trying to install this package called nerdTree-visual-selection. It is a package that 'defines key mappings that will work on nodes contained in a Visual selection in NERDTree'. It was weird ...
0
votes
1answer
29 views

Set cursor anywhere in window

How to setup Vim so you can f.e mouse click in the middle of new opened empty Vim window and place cursor exactly there ( f.e line 23 char 49), instead of line 1 char 1 because? Is there better way ...
0
votes
1answer
26 views

How to (1) get depth of execute-nesting and (2) interrupt the global command?

From a sourced file I am running my vim script. The aim of the script is to run :global. I am searching for \\%(pattern1.*/)\@<!pattern2 The patterns are variables, so I use execute; for the work ...
7
votes
1answer
336 views

How to prevent Vim from clearing the system clipboard (:reg +) on exit?

After copying text to the system keyboard clipboard in vim, I'm unable to paste the text after exiting vim. I find this behavior frustrating, since I often copy text in files to paste it on the ...
0
votes
0answers
19 views

how to copy text with mouse when nu and mouse=x is set in neovim

The only time the mouse does not select the numbers when mouse is set is if mouse is set to v. But you cant copy the text with right click or menu key.
1
vote
1answer
36 views

How can I create a shortcut that saves the file and executes a sequence of shell commands?

I know that I can create shortcuts on a vimrc file like the following: :map <C-W> :w<CR> However, let's say I have some different commands that I can execute on my shell: notify-send &...
0
votes
1answer
10 views

How can I leave completion mode keeping the completion result in a binding when there's no popup?

Currently: I have some key binding A → ^X^O (in insert mode) to omni-complete something I have some key binding B → ^Ogj to temporarily do something in normal mode (in this case, move down a display ...
-2
votes
1answer
107 views

Error while configuring nvim cmp

I am trying to configure nvim-cmp (https://github.com/hrsh7th/nvim-cmp), by adding the following lines to ~/.config/nvim/lua/lsp-config.lua. After this, when I start nvim, I get an error as shown in ...
0
votes
0answers
21 views

Ignore spell check for LaTeX commands with multiple arguments

I have read through a lot of the posts on spell checking LaTeX syntax - here, here, and here. I am sure the problem is my lack of regex understanding, but I am having trouble configuring it so that ...
1
vote
0answers
28 views

How to paste line but preserve the cursor position?

I want to achieve following. Imagine I have a line of code, say: std::cout << "STEP #0" << "\r\n"; Now I want to paste it somewhere else, but I want to stay cursor in ...
0
votes
0answers
32 views

Detect how vim was quit in autocommand

I have an autocommand on ExitPre like this: autocmd ExitPre * call PromptSaveSession() I'd like to avoid prompting to save the session if vim was forcefully exited, e.g. ':q!' or ':qa!'. Is there a ...
-1
votes
0answers
25 views

Move just a few blocks using visual block not the entire line [closed]

I did select a few blocks and wanted to move it but i could only move the entire line not just the block i selected. How do i accomplish it?
0
votes
0answers
17 views

After opening all args with :ba, go back to a single split

Generally when opening more than two or three files in vim, I use a single split, navigating between the files/buffers with :n/:N. Sometimes, however, I want to open all of them in visible splits at ...
0
votes
0answers
25 views

Use poetry shell in Vimspector

I'm using Poetry to manage my virtual environments for Python and I'm using Vimspector as a debugger plugin for Vim. How can I use the Poetry venv when starting debugging? I'm thinking that all that ...
0
votes
0answers
12 views

After LatexCompiling with \ll the source file is no longer displayed, but instead another file of the Latex library structure is displayed

Upon compiling a large Latex file with "\ll" inside Vim that contains on purpose an latex command typo (using $\relta$ instead of $\Delta$) I get 3 windows (with the Vim look and feel -- ...
-1
votes
0answers
53 views

How to run command when I first enter neovim?

I want to run some command-mode commands when I first open neovim. How to do it? For example the command I want to run is: :IndentBlanklineEnable
0
votes
0answers
37 views

Cursorline became black when cursor is moving

If I change the colorscheme by <option>+12345 :colorscheme newsprint Then when I will firstly got the expected result: But then if I move my cursor by j/k, the clean cursorline gone: I can ...
0
votes
1answer
24 views

foldmethod setting ignored when initializing vim

I have the following in after/ftplugin/vimwiki.vim setlocal foldmethod=expr setlocal foldenable set foldexpr=VimwikiFoldLevelCustom(v:lnum) I know this file is loading because if I put a syntax ...
0
votes
0answers
46 views

Online vim via browser, but with copy/cut/paste to/from Windows clipboard

I visited another city and forgot to bring my laptop. A friend offered to let me use his Windows 10 account, but without installing anything (including cygwin from a non-administrator account). It's ...
0
votes
2answers
55 views

How do I sort lines based on a text property?

I would like to tag lines with a certain text property and then sort all lines with that text property to come to the top. How can I sort based on having a text property rather than a pattern match?

15 30 50 per page
1
2 3 4 5
232