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
0 answers
14 views

Why neovim puts a start (*) before indents?

I use css and if I want to use * and then brackets it puts * in every line. This 'feature' works in every file type. How can I turn this off? * { * * } I asked chatGPT and it said me to change ...
maphy's user avatar
  • 1
1 vote
2 answers
31 views

Using expression register without <C-r> in vim script

I have a vim script that I am currently running with nvim -s commands.txt file.txt. I am trying to do something in the expression register with this script and I do not know how I can access it ...
Lucian Chauvin's user avatar
2 votes
3 answers
52 views

Vim - How to Select a Text In Between Double Quotes That Has Double Quotes Within It

If I have the text: var x = "Hello my name is Jim and I like ice-cream" It'd be pretty straight forward to use v+i+". But if my text is: var x = "Hello my name is "Jim" ...
DrDark's user avatar
  • 465
0 votes
0 answers
25 views

Which file format keeps as much information as possible when converted from docx while being easily editable in vim?

Logos is a Bible study software that allows you do upload your own personal books (https://support.logos.com/hc/en-us/articles/360015926452-Personal-Books), but it requires them in the docx format ...
Sweenu's user avatar
  • 1
1 vote
2 answers
64 views

vimscript for managing windows need some review

Could someone check my vimscript below. I tried to make a key mapping that does: 1. Closes tagbar and/or nerdtree if exist 2. Do <C-W>H or <C-W>J or <C-W>K or <C-W>L 3. Recover ...
Jumogehn's user avatar
  • 1,124
0 votes
2 answers
28 views

Can I place vim cursor into specific windows?

Let's assume that your vim window has been split into many windows horizontally and vertically. And your vim has the tagbar plugin window on the left and the nerdtree plugin window on the right. So ...
Jumogehn's user avatar
  • 1,124
1 vote
1 answer
34 views

TS2590: Expression produces a union type that is too complex to represent - VIM

I am using typescript-vim I have typescript installed globally npm install -g typescript My project's package.json shows "typescript": "^5.1.6" If I run :!tsc --version in vim, 5.1....
Aaron Parisi's user avatar
0 votes
0 answers
35 views

set mouse=a not working on Vim / Neovim in iTerm2

I am using iTerm2, running Neovim v0.9.1, but have same issue with Vim v9.0. I have set mouse=a enabled on Neovim and mouse functionality is not working. I am unable to resize windows, select tabs, ...
trozzel's user avatar
  • 488
0 votes
0 answers
35 views

gVim: colorscheme default has no sense in .gvimrc until I write :colo default

gVim starts up with a weird theme even though :colo returns "default". So I have to manually write :colo default to get my preferred colors (specified in colors/default.vim). This is weird! ...
SmilingKnight's user avatar
-1 votes
0 answers
30 views

How the way did vim copy into buffer?

I'm a new user vim. I overcome a :q! quite vim problem. So i got a new problem about copy and paste. Recently, I know about buffer concept. And I'm wondering when I copied something it was saved in ...
Giang Nguyễn Tuấn's user avatar
0 votes
0 answers
53 views

Problems with standard C++ libraries in YesCompleteMe

I decided to try Vim as an IDE for C++, I installed the YesCompleteMe plugin for autocompletion, but I encountered a problem, the plugin cannot find standard C++ libraries, for example "iostream&...
bin4ry's user avatar
  • 31
-4 votes
0 answers
28 views

vim cannot see my gopath settings in .zshrc [closed]

I changed the default GOPATH location, and updated the PATH environment variable in .zshrc. the command 'go run' works well in terminal, but in vim, the command '!go run %' will again download the ...
Mersper's user avatar
  • 99
-1 votes
2 answers
53 views

How to disable clipboard for cutting command like dd, daw etc, but keep for commands like yy, yaw etc? [duplicate]

Problem: I started to use Neovim. I like the flexibility of removing characters; however, it does not work with the following flow I have always used. Let's say I want to change the image source on &...
Muravyev Maxim's user avatar
-1 votes
2 answers
51 views

How frequently do you navigate from symbol to symbol using the f + <symbol> + ' command in Vim or Neovim?

Vim, as well as Neovim, allows you to navigate using specific symbols. How often do you use this approach? For example, to move to the character 'g', you can press fg', and to move to the next g, ...
Muravyev Maxim's user avatar
1 vote
0 answers
38 views

In Vim, how do I have the default behavior when opening a Python file be open all folds

I have this in my .vimrc autocmd FileType python setlocal foldmethod=indent so that I can use zr zR zm zM to see different levels of my Python files. The only thing is when I open a Python script, it'...
puddles's user avatar
  • 71
1 vote
1 answer
31 views

How can I get Vim to detect the filetype and do syntax highlighting for a new file right after pasting in its first buffer

I often copy text from a file, or from a web page that is formatted as html, or json or python. To work with it, I open an empty Vim buffer and paste it in (with ctrl-v). At that point I can ...
Anthony Albert's user avatar
1 vote
1 answer
66 views

xdotool not executing 'type' depending on how I start it from vim

I have the following script: #!/bin/bash # Find the Firefox window with a title containing 'Plan page' firefox_window_id=$(xdotool search --name "Plan page") echo "Firefox Id is" +...
Joe's user avatar
  • 4,405
1 vote
0 answers
27 views

Vimrc Method for forcing Vim to open in Command Mode?

I usually never had to worry about this issue on all vims I've come across previously, however, on a recent setup and configuration of my Windows Subsystem for Linux, I find that the vim which is ...
JWL's user avatar
  • 13.7k
-3 votes
0 answers
25 views

How to disable relevant numbering lines in SpaceVim?

I find the relevant lines inconvenient and want to disable them. If this is possible, then please tell me how to do this. I tried to find a solution to the problem in the settings, official ...
therealducky216's user avatar
0 votes
0 answers
26 views

Vim with Ack and "Silver searcher" - can not open file from result panel

I am on Windows and use git-bash. I have vim (the default one that comes with git-bash) with several plugins installed via vim-plug. When I use :Ag ... to search through the files in a project - I get ...
pesho hristov's user avatar
2 votes
1 answer
26 views

How do I map double quotes in Vim

println("Hello world!") ci( can be used to modify the contents of parentheses in vim, There's an easier way: cib,Because b is an alias for parentheses. ci" can be used to modify the ...
Dai Even's user avatar
1 vote
1 answer
51 views

How to develop a vim plugin which is compatible with vim-plug

I'm writing a simple plugin that consists of various files which I'm storing in the standard places: .vim/ftplugin, .vim/plugin, .vim/systax, etc. It's growing and I'd like to have all this sorted in ...
Pythonist's user avatar
  • 2,079
0 votes
1 answer
46 views

Spurious characters when populating the quickfix windows with ls command in Vim

I'm trying a simple custom command in Vim to populate the quickfix window with external commands. Currently just trying ls to get used to the tool. However when I run :cexpr system("ls") | ...
Pythonist's user avatar
  • 2,079
1 vote
1 answer
33 views

How do I retrieve a syntax file (nginx.vim) and load it in vim?

On one of my Ubuntu computers, Vim has syntax highlighting for nginx config files while it does not on the other one. Looking at /usr/share/vim/vim80/syntax/ I see one has nginx.vim while the other ...
geckels1's user avatar
  • 428
-1 votes
0 answers
31 views

How to get fzf.vim to index at startup

I do work on a very large mono-repo, so when I do :Files, there is always some indexing where it says something like 23423/45235543 bottom. Sometimes I type in the search string I wan't, but I have to ...
yasgur99's user avatar
  • 796
1 vote
1 answer
50 views

Vimscript syntax with use of registry [duplicate]

I am trying to copy in Vim that does not have clipboard support (xclip will be used, do not suggest to enable clipboard support somehow, please). I am just, lost with the syntax, adding in and ...
Ella H's user avatar
  • 11
-1 votes
2 answers
49 views

How do I get a pretty git editor experience on mac like I do in devcontainers?

I am an avid user of Visual Studio Code devcontainers and one of the reasons is that I can easily get a very pretty git editing experience for doing things like writing commit messages and rebasing. ...
jamiet's user avatar
  • 10.9k
0 votes
0 answers
41 views

How can I make fzf.vim split the window evenly when I use ctrl-x or ctrl-v?

When using the fzf plugin in vim, my configuration is as follows let g:fzf_action = { \ 'ctrl-e': 'edit', \ 'ctrl-t': 'tab split', \ 'ctrl-x': 'split'), \ 'ctrl-v': 'vsplit' } I want to use ...
dongwei's user avatar
  • 31
1 vote
0 answers
28 views

I ":so %"-d a vimball file, but opening vim gives a wall of errors [SOLVED - Lack of attention]

I wanted syntax highlighting for Haskell. What I did: I downloaded a .vba file from https://archives.haskell.org/projects.haskell.org/haskellmode-vim/. It was https://archives.haskell.org/projects....
Floof's user avatar
  • 41
1 vote
0 answers
54 views

How to make VIM automatically save the file when changing focus to :terminal?

I just started learning VIM. I was wondering if there's a any way to make VIM work similarly like VScode save "onFocusChange". Is there any thing I can do in .vimrc file? While working in C/...
Lowsky's user avatar
  • 11
-1 votes
1 answer
49 views

.vim/syntax/sql.vim: Error detected while processing BufRead Autocommands for "*.sql"

I tried saving this vim syntax file for sql but when I open a sql file in vim I get lots and lots of stuff like this: Error detected while processing BufRead Autocommands for "*.sql".....
spraff's user avatar
  • 32.3k
0 votes
2 answers
41 views

Mustache filetype in Helm template partials

In some Helm Chart examples, the template partial file _helpers.tpl contains the following first line: {{/* vim: set filetype=mustache: */}} Can you explain it ? How is mustache used in Helm ?
javaxiss's user avatar
  • 714
0 votes
0 answers
24 views

How to keep the output window of the command line window open in vim?

When I enter a command in neovim with : and then entering for example lua print(4) and pressing Enter the command runs. I want to keep this window open when I return the cursor to the file. It closes ...
Gabriel's user avatar
  • 9,072
1 vote
1 answer
31 views

Detect if There is A Bracket After Cursor in Vim For Autoclosing

I setup vim so when I put an open bracket it auto completes it and puts my cursor between them, I am having trouble finding how I could go to the end of the bracket when putting ']', currently it just ...
xyz's user avatar
  • 63
3 votes
4 answers
116 views

How do i change a VIM sedcommand to work in a bash script?

I have a very useful sed command in Vim that I want to put in a simple bashs cript. But I have tried many variation of it (googled like crazy) but it does not work... The sed string that works in Vim ...
Ron's user avatar
  • 39
0 votes
1 answer
59 views

how to show highlight in :g command in vim

Ideally I'd like to see some matching highlight when I do something like :g/string_to_match/p But it does not. Is there a way to make string_to_match highlighted?
Qiang Li's user avatar
  • 10.7k
1 vote
2 answers
45 views

Explicitely setting quote level colours for filetype mail in vim

In my system wide mail.vim syntax file for vim there are six quotation levels defined. However, it seems that there are only two different colours used alternately for even and odd levels. Is there a ...
diffset's user avatar
  • 185
0 votes
1 answer
48 views

vim ctags:tags not found if one space after lua function name

I have commentted out all of my vimrc file, in my macOS (22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64 arm Darwin), it cannot find ...
xiaochen's user avatar
  • 1,295
-2 votes
1 answer
37 views

How to Delete Swap vimrc file and PLuginInstall not a command in ArchLinux [closed]

not an editor command: PluginInstall As i am trying to setup VIM for python and tried to setup vim vundle, but it showed me few errors: not an editor command: PluginInstall In the second error i got ...
Shashank Shukla's user avatar
2 votes
2 answers
65 views

Vim: Replace a word with longer/shorter word without entering insert mode

I would like, for example, to be able to replace the word normal by the word short or longest without entering Insert mode. Would be practical for instance when renaming a variable int normal = 0; I ...
Youyou's user avatar
  • 23
1 vote
1 answer
75 views

vim not accepting mouse=a and unable to scroll

I'm using a Debian 11 VM on Google Cloud. I cannot get set mouse=a to work, and I can't scroll when I open any file with vim. I have already seen this question here and have tried everything suggested,...
thorium's user avatar
  • 197
1 vote
1 answer
50 views

How do I fix the current line color using solarized vim dark mode using Termdebug?

I'm using solarized with vim and when I'm debugging (using Termdebug), the current execution line is missing: I've been working around the issue by switching to light mode: If I go back to dark, ...
dromodel's user avatar
  • 9,733
1 vote
0 answers
45 views

Vim textwidth doesn't behave the way I would like [closed]

I would need to set a max width for every line but I need to tell vim that it can break the line at whatever character. What I mean by that is that the default behavior when I do :set fo+=t set tw=10 (...
Nihil's user avatar
  • 11
1 vote
1 answer
27 views

How to position the cursor on the previously opened buffer in netrw?

I like to "explore" and move around using netrw but one thing I don't like is whenever I come back to netrw, the cursor is always at the top. I'd like to have the cursor automatically ...
Romain Vincent's user avatar
0 votes
1 answer
81 views

Can this PCRE regex be converted to an equivalent Vim regex?

Can this PCRE regex be converted to an equivalent Vim regex? /(http\N+?),(\N+?),(\N+?),,(\X+?),(\N+?),(\N+?),0$/gm The regex was used on some test data at the wonderful https://regex101.com/ but I now ...
Android Control's user avatar
0 votes
1 answer
76 views

How to set a .vimrc file by default

On my linux i have a lot of .vimrc files. One of this in /etc/vimrc Second in ~/.vim/.vimrc so when i type echo $MYVIMRC there is nothing help me to set my ~/.vim/.vimrc by default so when i will open ...
exypn0x's user avatar
-1 votes
1 answer
64 views

Call a plugin function from init.lua or vimrc

I installed drawit plugin. In order to use it with the characters I need, I have to call a function once I've started the plugin. :DIstart :call SetDrawIt('|','-','+','\','/','+','*') What I need is ...
Sébastien's user avatar
0 votes
0 answers
56 views

Taking away Strikethrough in VIM

I have strikethrough working in vim, but I want to unstrikethrough a line after I put the strikethrough on it. Here's the line in my .vimrc command! -range -nargs=0 Strikethrough call s:...
Mark Scheck's user avatar
-1 votes
2 answers
46 views

VIM -- apply local vimrc file

I want to be able to have a file with some highlight choices local to the current directory, generally used to highlight certain phrases in a log file as I am analyzing it. I found this: if ...
Richard Hartman's user avatar
2 votes
2 answers
46 views

Vim regex: Match lines with different start than next line

I want to match lines that are followed by a line starting with a different number, as the third line does in this example. 1 foo 1 bar 1 foobar 2 Foo 2 Bar What is the best regex for this? Why do ...
Stalpotaten's user avatar

1
2 3 4 5
562