Questions tagged [vim]

Vim is a free and open-source modal text editor available for most major platforms. It allows high efficiency in many text editing tasks but has a steep learning curve. To learn the basics, run ":help vimtutor". For non-programming questions please use https://vi.stackexchange.com/ instead.

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

Is there any way to check which key combinations are not mapped to anything in neovim/vim?

Occasionally, I map a group of related actions (usually related to a plugin) to a group of key combinations. I try to use some mnemonics to ease remembering it. For instance, I added 3 mappings for ...
Gonzalo Matheu's user avatar
0 votes
0 answers
23 views

Urlencode a multiline string in VIM, so it can be used to query a search engine

In Vim, it would be cool to search for the currently highlighted text in a search engine of your choice. Especially with all the AI search engines that are appearing on the scene. This kinda works, ...
no_gravity's user avatar
0 votes
1 answer
25 views

Can You Make Vim Move to Next Line When Moving Cursor

If my cursor is at the end of the line and I press right again it will move to the next line like a normal text editor. Is this possible to do?
burner8268's user avatar
-1 votes
1 answer
29 views

Vim key sequence for editing git-rebase-todo

Suppose I want to squash a bunch of commits via interactive rebase git rebase -i HEAD~4 pick afecc5edbc5 lighten wording on menu pick b652f76b10f changelog pick a636683fea4 blah pick cafc0f09b62 ...
caduceus's user avatar
  • 1,432
0 votes
0 answers
34 views

How do I paste in copied vim commands into a vim terminal so that vim runs them [closed]

How do I paste in copied vim commands (e.g. :%s/find/replace/g) into a vim terminal so that vim runs them. My goal is to save several commands inside of a text file that can be opened in vim where I ...
John's user avatar
  • 1
0 votes
0 answers
24 views

Deleting outside the insert region in Vim

You can stop the backspace key from deleting characters that precede the start of the insert region using: :set backspace= Is there a similar setting that stops the delete key from deleting ...
August West's user avatar
0 votes
0 answers
24 views

Vimscript - Regex to match only open parentheses and not open/close pair

In Vim Script, I'm trying to use regex to match a string that contains ( and not () pair. let s:OPEN_PAREN = '([^)]*' echomsg 'Hello (' =~? s:OPEN_PAREN echomsg '( Hello' =~? s:OPEN_PAREN echomsg '(' ...
markfw's user avatar
  • 683
-6 votes
0 answers
38 views

Why is vim file explore (netrw v173) really slow? [closed]

When ever I have a program that is writing to a file being ran and I try to use vims file explore, it will then run really slow. The file can be written anywhere on the machine. The rest of my machine ...
Cameron Monks's user avatar
0 votes
2 answers
39 views

Why nvim (vim) adds \< and \> to search pattern and what they means?

I use the * command to fill the search register (/) with the current word (under cursor) so I don't have to paste it into the substitute command. To do a find and replace I can do it quickly like so: :...
Alexandre Huot's user avatar
-1 votes
0 answers
36 views

vim: how do I enable mouse striping in Windows Terminal?

I am running vim in Windows Terminal and I am unable to select text with the mouse in an editor session. The docs say to set mouse=a at the prompt or in an rc file but doing so has no apparent effect. ...
Omortis's user avatar
  • 1,322
0 votes
2 answers
35 views

Unable to remove a line feed with VIM [duplicate]

When I edit a file in vim or nano on multiple terminal emulators it is adding a line feed to my files. xxd of file before edit: 00001880: 5645 5574 4c53 3074 4c51 6f3d VEUtLS0tLQo= xxd of ...
Doug Smith's user avatar
1 vote
1 answer
50 views

vimscript: how to reload buffer content without changing focus

I have the following function in my .vimrc: function s:get_errors() let term_buf = filter(map(getbufinfo(), 'v:val.bufnr'), 'getbufvar(v:val, "&buftype") is# "terminal"')[0] ...
Vinz's user avatar
  • 5,987
-1 votes
1 answer
53 views

Vim: Filetype plugin setlocal options for comments and commentstring not appearing in buffer

I'm using Vim 9.0 on Windows 10. I've created a new filetype called 'projects' but setting local options for comments is not working. Here is what I've done: I added the line :filetype plugin indent ...
user2962912's user avatar
0 votes
0 answers
32 views

nvim autocomplete menu, arrow selection. Invert left/right - up/down functions

When trying to select from a list, see image below, the left/right and up/down arrows are acting unintuitve (for me): The left/right move the selection up and down, while the down arrows selects it, ...
I.P's user avatar
  • 59
1 vote
1 answer
60 views

How to set VIM key binding in ZSH/terminal

In my normal use of Vim I have a key binding ("jj") to enter NORMAL mode. I accomplish this by setting a mapping configuration in ~/.vimrc -> :imap jk <Esc>. However this binding ...
Matt C.'s user avatar
  • 2,092
0 votes
1 answer
42 views

About gVim and Jetbrains Mono: How to stop gVIM to render text like (==, !=) in special way

I am using JetBrains Mono, but some text are rendered hard to recognize. In terminal, all looks fine: But if I open it in gVim, it will be: Sometimes, the = does not disp at all In gVim: If I use ...
Kera's user avatar
  • 73
0 votes
1 answer
40 views

Appending a new path to VIMRUNTIME variable

I have developed a custom syntax highlighter and syntax detector for a specific file extension. Currently, it works fine when I manually copy the necessary files to $HOME/.vim/syntax and $HOME/.vim/...
Moriss's user avatar
  • 325
0 votes
2 answers
45 views

vim block replace selection globally

After I select something using v (eg. foo), I want to be able to replace all occurrences of foo in the entire file. Is there a way to do that? If I use %s/\%V/bar/g it is only limited to that ...
ergonaut's user avatar
  • 6,901
0 votes
2 answers
52 views

Map vim mac key with alt

What I want to do I want to map <S-A-j> and <S-A-k> on a Mac keyboard to move selected lines up and down. So, I map: " Move selected lines xnoremap <S-A-j> :m'>+<CR>gv=...
MakiX's user avatar
  • 306
1 vote
2 answers
79 views

How to map `df` in vim to delete the file under cursor

I know gf opens the file under cursor, which is so nice. But I want delete the file under cursor. Here are two questions. Does df have any original(default) function in vim? How to map df to delete ...
Lex's user avatar
  • 135
-3 votes
1 answer
29 views

Vim: How do I treat wrapped lines as a separate line so that I can navigate to it with j or k?

Currently if my vim tab is small enough it will wrap the text like so. When I press j I want it to go to the line I visually see as the next line, which doesn't have it's own line number. However, ...
bigpotato's user avatar
  • 26.1k
0 votes
0 answers
45 views

Vim function calling system() returns unwanted escape characters in iTerm2

I have this function in my .vimrc: function! GitBranch() return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") endfunction But it's adding this sequence of ...
Jack's user avatar
  • 3
1 vote
1 answer
44 views

Dealing with universal-ctags, python builtins and poetry

I'm using universal-ctags to navigate among objects define in my projects and it works perfectly fines. However i'm struggling to find how to include python builtins objects and package dependencies ...
virgilol's user avatar
1 vote
1 answer
26 views

Can PyCharm fold specific code zones marked with vim fold markers "{{{" and "}}}"

When programming in PyCharm, I scroll a source file up and down, and some piece of code is long enough and it disturbs my attention. Example of code: some code some code ... some upper code at ...
Ashark's user avatar
  • 582
0 votes
2 answers
40 views

How to convert values of recurring elements row by row to columns?

I receive an output of some script that gives rows containing element and it's value. And there are only 3 elements that repeated with different values. Want to convert them to columns with element ...
Pavel.S's user avatar
0 votes
0 answers
17 views

How can I convince TSServer that I'm using lodash/fp instead of lodash?

I use lodash/fp in a personal project, and use Vim to edit and debug that code. To have diagnostics and type information, I use YouCompleteMe, which for JavaScript makes use of the TSServer engine. ...
Enlico's user avatar
  • 22.4k
0 votes
0 answers
40 views

Plugging in a custom command to vim/fzf

I have created a command that lists "interesting" files. The output is a list of file names separated with new lines (much like the output of grep -l). The command is called lif - for 'list ...
az5112's user avatar
  • 570
-1 votes
1 answer
41 views

How to reset or reinstall my vim installation? Deleting .vim and .vimrc doesn't work

On my MacOS, my vim(probably pre-installed) and nvim both never show the cursor as a block when in normal mode. It always shows a line like it's in the Insert mode. Even when I try starting vim as: ...
Varun Gawande's user avatar
1 vote
2 answers
42 views

Is it possible to automatically open vertical splits in vim?

I would like vim to detect when I am opening several files on the commandline, and automatically open them in (vertical) splits. I know that I can use the -O switch. But I sometimes forgot to add it, ...
rfs's user avatar
  • 81
2 votes
8 answers
129 views

awk/sed: repeat 1st column for each column

I am trying to append 1st column to every column as follows. existing A B C D E F required: B A C A D A E A F A I have tried this for a smaller set of columns as follows; cat file | awk '{print $2&...
Eashwar Gadanchi's user avatar
-8 votes
1 answer
175 views

How do I match angle brackets and everything inside with a regular expression? [closed]

I am trying to fix some data so I can store it in a SQL table by using some text editor, say Vim or Notepad++. I would like to match a pair of angle brackets and everything in between using a regular ...
fat penguin's user avatar
-1 votes
1 answer
28 views

When exit_cb is called when use job_start to execute a command? Is it called when command is finished?

function! Add_CsTag() echo 'call add tags' if filereadable("cscope.out") cs add . echo 'cs add' endif endfunction function! Do_CsTag() call job_start('...
peng chen's user avatar
0 votes
0 answers
30 views

per-directory netrw settings

Is there a way to have directory specific netrw settings in (neo)vim? I want to keep my default settings in my .vimrc but for some directories, I want netrw to use -- for example -- the tree view ...
Bastian Venthur's user avatar
0 votes
1 answer
48 views

VIM Rubocop Ruby duplication of prompts/comments after each row of code

It is default rubocop comments in each file after each row where there is rubocop issue. I have such rubocop behaviour for last three monthes and have no idea how to avoid comments like this. (please, ...
transfer's user avatar
1 vote
1 answer
80 views

How to stop a Vim search which is taking too long?

I am searching for a pattern in a file containing hundreds of millions of lines. Sometimes when I mistakenly enter incorrect search pattern, I am not able to stop that search. I need to wait till it ...
umeshr's user avatar
  • 35
7 votes
1 answer
88 views

How do I conceal RakuDoc (POD6) contents in vim?

I would like to use vim's conceal command to hide all my POD6. I've tried syntax match rakuPodPrefix /^=begin/ conceal cchar=> without success. Alternatively, what is a good foldexpr to fold away ...
Jim Bollinger's user avatar
1 vote
1 answer
34 views

Vim unable to find Python27.dll on startup but I'm on Python3.11

I'm looking to get comfortable with vim and I set up my system according to these two tutorials. https://realpython.com/vim-and-python-a-match-made-in-heaven/ https://github.com/VundleVim/Vundle.vim/...
Michael S.'s user avatar
2 votes
1 answer
36 views

Vundle plugin lingers after uninstall

I had previously installed the mkdx markdown plugin for vim, via Vundle. I later decided to switch to vim-markdown, and uninstalled it. Initially, everything seemed fine, but when I attempted to ...
cp1's user avatar
  • 163
0 votes
0 answers
52 views

How do I remove the truncation in my vim-airline status bar

I have vim set up with vim-airline and powerline. My problem is that my statusbar is truncated in the z-section. It appears that my column number is hidden behind some symbol and this persists even if ...
EwanMe's user avatar
  • 23
1 vote
0 answers
281 views

Git status icon like (staged, unstaged, renamed, . . . ) does not appear in nvim-tree?

I have nvim-tree/nvim-tree and nvim-tree/nvim-web-devicons plugins installed on my nvim lua based config. Git status icon does not appear. The status icon is usually located at the left handside of ...
Reynald Lamury's user avatar
0 votes
0 answers
46 views

How can I display lsp info of current file configured by coc-nvim extension?

I'm new to coc-nvim, and I am used to the combination lspconfig + mason. Before I switch to coc, :LspInfo command will show the enabled lsp for current file, while it does not show the one configured ...
realzhujunhao's user avatar
0 votes
0 answers
24 views

Resolve tagname1 to the address for tagname2

I have a large codebase with code written in $LANG and $DSL. The $LANG code is indexed by a library. I would like to index the $DSL so that the tags point to $LANG objects. But I would like to do this ...
maxhallinan's user avatar
  • 1,249
2 votes
1 answer
64 views

How to apply syntax highlight in a region?

We have this comment in a HTML file <!-- @startuml A --> B : DoWork B --> C : DoWork @enduml //--> It's PlantUML code in the comment. How do we have syntax highlight on PlantUML code in ...
Cody's user avatar
  • 599
0 votes
0 answers
33 views

vim: replace all character occurrences till other token

Is there anyway to replace all "-" occurrences by "_" till "=" character? Example: BO.MONTHS-TO-DELETE-REFERENCE=1 --> BO.MONTHS_TO_DELETE_REFERENCE=1 Any ideas?
Jordi's user avatar
  • 20.4k
0 votes
0 answers
21 views

code completion with clang gives wrong results

Consider the file foo.c: #include <stdbool.h> int six, bo; int main(void) { return six + b + sizeof(int); } Then clang can be used to suggest possible code completions in line 15 column 19 ...
Michael Lehn's user avatar
  • 2,854
2 votes
1 answer
30 views

vim crashes when quitting with a couple of files in buffer

I identify files with certain characteristics and shoot them into a vim session like ... grep -rl '{{[a-z]*}}' | xargs vim apart from a warning this works. I have 7 files open in vim. Edit them one by ...
vrms's user avatar
  • 197
-1 votes
1 answer
55 views

vim/gvim can not highlight .svh/.sv/.txt file automatically

I would like to use vim/gvim to automatically highlight my code file for example .svh/.sv/.txt file and here is my setting picture: and i source it. But it always failed to automatically highlight ...
Matthew MA's user avatar
1 vote
1 answer
74 views

How default neovim filetype=sshconfig for files in .ssh/config.d/?

I like to separate my ssh config files and include config files in a subdirectory .ssh/config.d/* as explained here. When opening .ssh/config in neovim I get syntax highlighting with filetype filetype=...
phinz's user avatar
  • 1,152
0 votes
0 answers
37 views

vim 9.0, windows 10, newbie - shell commands don't work

As preface, I am new to Vim and not expert on Windows OS. Maybe I am doing something incorrectly. I may not know how to express the issue correctly either: Vim works great, but I am learning. I run ...
JaredX's user avatar
  • 1
4 votes
2 answers
73 views

Remove "Cl." from file with bash without removing all Cl

I am trying to delete specifically Cl. without deleting Cl inside a file: Cl.CCC(N)(CC)C(=O)NC(CC(=O)O)c1ccccc1 CC(C)c1ncc(Cl)c(n1)C(=O)NCC(=O)O And give me back this: CCC(N)(CC)C(=O)NC(CC(=O)O)...
BRUNO DI GERONIMO QUINTERO's user avatar

1
2 3 4 5
559