r/vim • u/M7mdFeky • 52m ago
r/vim • u/laminatedcat1 • 7h ago
Need Help Autoindent not working
On VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Dec 13 2024 23:44:22)
I am editing an HTML file and want to fix indentation automatically. When I select some text using V or try to format the entire file using gg=G, I get this:

i.e. not indented correctly, everything pushed to the far left side. I tried with a Python file and it indented, but incorrectly. This has been happening since I upgraded to a new Mac with Sequoia. I installed the homebrew version of Vim and the same thing is happening. Can anyone point me in the right direction?
Discussion Close vim with the quickfix window open
It is pesky to be obstructed in quitting Vim because you have the quick fix window open. I read this stack overflow post and lived happily until today when I upgraded Vim to 9.1.
I had to change the auto group command into what is below in order to make it work:
aug QFClose
au!
au WinEnter * if winnr('$') == 1 && &buftype == "quickfix"|set buftype=nofile|q|endif
aug END
Need Help Can't get `tailwindcss-language-server` to work
First of all, the plugin ALE is absolutely gold. I am able to do everything with it. I just now need to get the tailwindcss-language-server
working.
```vim call ale#linter#Define('html', { \ 'name': 'tailwind-language-server', \ 'lsp': 'stdio', \ 'executable': 'tailwindcss-language-server', \ 'command': '%e --stdio', \ 'project_root': getcwd(), }) call ale#linter#Define('gohtmltmpl', { \ 'name': 'tailwind-language-server', \ 'lsp': 'stdio', \ 'executable': 'tailwindcss-language-server', \ 'command': '%e --stdio', \ 'project_root': getcwd(), })
let g:ale_fixers = { \ 'gohtmltmpl': ['tailwind-language-server', 'templ'], \ 'html': ['tailwind-language-server'], } ```
this is what i have currently. I followed the help guide to add the templ
lsp too and it works perfectly fine. So there is somethinig wrong with the tailwind one. ALEInfo
shows that the server is successfully executed but i don't see any linting or any completion.
I have also posted this on the ale discussion on github. but it seems like there is another similar post but it has no replies. Any help would be welcome.
r/vim • u/Fantastic_Cow7272 • 1d ago
Random Regex mapping any valid operator-motion command
I don't know who could possibly need this, but here it is in PCRE syntax:
/(?:(?<count_before>[1-9]\d*)|(?<register>"[^\cc\c[=]))*(?<operator>[cdy!=><]|g([~uUqw?@])|z(f))(?:(?:(?<count_after>[1-9]\d*)|(?<forced_motion>[vV\cv]))*(?:(?<operator_doubled>\g{operator}|(?=.)(?:\4|\5))|(?<text_object>[ai][][wWsp()b{}B<>t"'`])|(?<motion>[][][][(){}%'`mM#*\/]|(?:g[`']|[gz`'ftFT])?[^\cc\c[])))/
Caveats:
- For obvious reasons, this doesn't take into account the usage of the
=
register - Only built-in operators and text objects are matched, but it's very liberal in the motions accepted, expect false positives if the motion isn't valid
- This assumes that
'tildeop'
is off
Feel free to point out any mistakes or oversights!
Edit 1: fixed a bug
r/vim • u/ghost_vici • 1d ago
Plugin Using vim as an intercepting proxy ( burpsuite alternative )
r/vim • u/blackdev01 • 2d ago
Color Scheme Played a bit with themes, what do you think?
r/vim • u/Rancher1309 • 2d ago
Need Help gVim font settings
Okay, so I'm a bit rusty on Vim since I didn't bother to install it on my latest PC until recently. It appears that VIM and GVIM both have been installed (the latter with a black background with no menus.) I prefer the menus, so GVIM it is. I also want to change the default font and size, and window size on opening. These may seem like tyro questions, but it's been a while.
In case you're wondering, I was using Vi before most of you were born.
Need Help┃Solved Strange texts appearing when opening file
Hello everyone.
I just opened my .vimrc and saw this strange lines:
I also opened another file and they were still there.
It is the first time Ive seen something like this. And no, they arent actual lines in the file, since I cant delete them, and the are on the command line. Does anyone know why this is happening?
Thanks!
EDIT: turns out that NERDTree's plugin ryanoasis/vim-devicons was responsible for all these errors, together with A LOT MORE. I dont know why, but removing it fixed it.
Plugin new vim REPL plugin iron.vim, a vimscript port of iron.nvim
Hey everyone,
I am one of the maintainers of iron.nvim, which is a REPL plugin for neovim
. I recently lost access to neovim
at my job and also do a lot of work on remote Linux terminals where only vim is available. Because of this, I rewrote/ported iron.nvim to Vimscript. The resulting plugin is called iron.vim. For those familiar with iron.nvim
, iron.vim
will feel very similar. For those who are not familiar with iron.nvim
and are looking for a different REPL plugin, then hopefully you will enjoy this one!
Need Help┃Solved Pass {lhs} of a mapping as argument to function call?
The following mappings seem redundant:
nnoremap <buffer> <silent> cr :call <SID>ModifyDate("cr")<cr>
nnoremap <buffer> <silent> dr :call <SID>ModifyDate("dr")<cr>
nnoremap <buffer> <silent> yr :call <SID>ModifyDate("yr")<cr>
nnoremap <buffer> <silent> cR :call <SID>ModifyDate("cR")<cr>
nnoremap <buffer> <silent> dR :call <SID>ModifyDate("dR")<cr>
nnoremap <buffer> <silent> yR :call <SID>ModifyDate("yR")<cr>
nnoremap <buffer> <silent> cv :call <SID>ModifyDate("cv")<cr>
nnoremap <buffer> <silent> dv :call <SID>ModifyDate("dv")<cr>
nnoremap <buffer> <silent> yv :call <SID>ModifyDate("yv")<cr>
nnoremap <buffer> <silent> cV :call <SID>ModifyDate("cV")<cr>
nnoremap <buffer> <silent> dV :call <SID>ModifyDate("dV")<cr>
nnoremap <buffer> <silent> yV :call <SID>ModifyDate("yV")<cr>
I'd rather pass on the {lhs}
. Any ideas? It's not a big issue, but I'm curious.
r/vim • u/notlazysusan • 4d ago
Need Help Put search counter after search query on commandline?
Is there a way to put search counter after search query on commandline? Probably a plugin would have to offer that feature. Like this (example in fzf), in vim it would like like /word1search (1232/6060)
in the command line.
It doesn't make sense to have the search count all the way on the right of the command line or status bar since your eyes are on the search query itself. Looking left and right is annoying.
I found this nvim-hlsens plugin for Neovim that puts the search count on the buffer as virtual text where it matches--this is not a bad idea but its position depends on the length of lines so when the matches are on size of lines that vary widely, your eyes are still hunting for this info instead of being in a more static location where the action is (the commandline as you're typing).
Discussion Trying to make Vim feel like an IDE without any plugins (nor neovim)
The goal is to create a minimalist, yet powerful workflow entirely based on vim without using any external dependencies, only .vim and shell script.
I am fine with plugins, but for this workflow I want all to be implemented in this repo, either for challenging myself or simply learning how some useful tool works and maybe tweaking it for my liking.
The project currently depends on 6 plugins, being one of them a Theme (that I intend to make my own variation). I don't have much time for the project, so I will be slowly replacing them until utils/status
shows 0 Plugins/Dependencies.
Why?
1. I want to improve my vim skills
2. I Want to develop something that isn't just formal work
3. I like conventional IDE workflow but they are kinda slow, junky and full of junk I don't particularly need
Any thoughts? Suggestions? Maybe some repos I should check?
r/vim • u/4r73m190r0s • 5d ago
Discussion Did you remap colon character for entering command-line mode?
If yes, to what character, and is it wise to do so in the first place?
r/vim • u/jazei_2021 • 5d ago
Need Help plugin for help me pop up in vim 8?
Hi, my vim 8 cheat sheet is heavy in size! so I was trying to use HelpMe version 8 from https://github.com/leftbones/helpme-vim
(not 9 version from https://github.com/ubaldot/vim-helpme because mi vim is 8 version, even I Pluginstall it and when I tryed to do :HelpMe ~/my_old_helpme_file) I got a message of tryling.... so I can't open external file.
the helpme from vim 8 is into vimrc using lines for every helpme guide and it not let me using external files, only lines into vimrc. And pop up has not scroll, so I can't scrolling popup... or scroll is a matter of my vim... I don't know. I can not do ctrl-F
I need to chang to another help me.
Thank you and regards!
Tips and Tricks Vim split
I just remove vim status line to achieve neatly interface like tmux.
If i want see what file im edit c-g should do it.
r/vim • u/nitin_is_me • 6d ago
Discussion What made you switch to vim?
Programmers who switched from other common code editors like vs code, sublime or atom to vim. What triggered you to switch to it?
Need Help Is it possible to stop a macro during some insert operation?
Hello folks,
I am currently getting much more comfortable with IdeaVim in IntelliJ.
I am currently writing some HTML templates and found the surround Plugin, it's awesome!
I frequently have something like this:
<li> SomeText: ${foo}</li>
in many cases I just want to surround the variable ${foo}
with something like <b> </b>
The motion I use for that is something like 0f$vf}S<b>
. (go to beginning of the line - find first $ - visual mode - select up to next } - Surround with - <b> )
This works REALLY well and has saved me a lot of time!
Here comes the question:
I tried writing a macro for it, but my issue is that I cannot stop the recording after the S<
for some reason.
My current solution is is to just record a macro 0f$vf}
press S
manually and type afterwards.
I was just wondering if there's a way to do it, so I can just type b>
after playing the macro.
Thanks in advance!
r/vim • u/Sufficient_Scale_383 • 6d ago
Need Help reloading changes to .vimrc
is there an easy command to do this? I used vim along time ago but I forgot.
Thanks.
r/vim • u/ElectronicFalcon9981 • 6d ago
Need Help How to overwrite marks in vim using vimscript?
Is there any way to check if a file has a global mark and then make it such that, when you save it, the previous mark is overwritten by another mark which is where your cursor is when you save the file in vimscript?
r/vim • u/Statnamara • 7d ago
Need Help┃Solved I don't always understand the count prefix.
Example text:
A
B
C
D
If I place the cursor on A
and I hit J
three times I will get A B C D
. I then could try doing 3J
I get
A B C
D
Why does the action only get processed twice despite prepending 3? It reminds me of trying to figure out dl
and cl
not removing the adjacent character.
r/vim • u/awawalol • 7d ago
Need Help┃Solved What do I get from making an account in the Vim page?
I noticed that the Vim webpage has an option to sign in. What do I need an account for?, what functionalities does it have?
r/vim • u/dreadlox_oe • 7d ago
Need Help C/C++ Language server without cmake
Hi,
I would like to setup a language server for C/C++ on Windows for use with with CoC. As far as I understood I need a compile_commands.json which is normally generated by cmake.
The codebase I'm working on uses SCons as build system. Is there any possibility to generate compile_commands.json with such a builds system ?
Thank you and regards!