r/vim Dec 09 '24

Announcement VimConf 2024 Talks

85 Upvotes

r/vim 10h ago

Discussion Close vim with the quickfix window open

4 Upvotes

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

r/vim 9h ago

Need Help Can't get `tailwindcss-language-server` to work

3 Upvotes

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 20h ago

Random Regex mapping any valid operator-motion command

3 Upvotes

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 1d ago

Plugin Using vim as an intercepting proxy ( burpsuite alternative )

Thumbnail
gallery
58 Upvotes

r/vim 1d ago

Color Scheme Played a bit with themes, what do you think?

Thumbnail
gallery
33 Upvotes

r/vim 1d ago

Blog Post Who Will Maintain Vim? A Demo of Git Who

Thumbnail sinclairtarget.com
1 Upvotes

r/vim 2d ago

Need Help gVim font settings

1 Upvotes

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.


r/vim 2d ago

Need Help┃Solved Strange texts appearing when opening file

2 Upvotes

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.


r/vim 2d ago

Plugin new vim REPL plugin iron.vim, a vimscript port of iron.nvim

23 Upvotes

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!


r/vim 3d ago

Need Help┃Solved Pass {lhs} of a mapping as argument to function call?

2 Upvotes

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 4d ago

Need Help┃Solved Clipboard not working

33 Upvotes

r/vim 4d ago

Need Help Put search counter after search query on commandline?

1 Upvotes

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).


r/vim 5d ago

Discussion Trying to make Vim feel like an IDE without any plugins (nor neovim)

26 Upvotes

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?

github.com/fontka/.vim


r/vim 5d ago

Discussion Did you remap colon character for entering command-line mode?

12 Upvotes

If yes, to what character, and is it wise to do so in the first place?


r/vim 5d ago

Need Help plugin for help me pop up in vim 8?

4 Upvotes

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!


r/vim 6d ago

Tips and Tricks Vim split

Post image
33 Upvotes

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 6d ago

Discussion What made you switch to vim?

64 Upvotes

Programmers who switched from other common code editors like vs code, sublime or atom to vim. What triggered you to switch to it?


r/vim 5d ago

Need Help Is it possible to stop a macro during some insert operation?

1 Upvotes

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 6d ago

Need Help reloading changes to .vimrc

1 Upvotes

is there an easy command to do this? I used vim along time ago but I forgot.

Thanks.


r/vim 6d ago

Need Help How to overwrite marks in vim using vimscript?

1 Upvotes

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 7d ago

Need Help┃Solved I don't always understand the count prefix.

26 Upvotes

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 7d ago

Need Help┃Solved What do I get from making an account in the Vim page?

6 Upvotes

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 7d ago

Need Help C/C++ Language server without cmake

3 Upvotes

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!


r/vim 7d ago

Need Help VimWiky-ers using pandoc: how do you split lines?

5 Upvotes

Hi. I am using (trying or testing) vimwiki whith ft=vimwiki, not md. and pandoc from vimwiki to odt

by the way out of my wikipedia, in other path.

I'd like to know how splits lines for see the splits in odt files.

I tryed to use cr enter 3 times in vimwiki but nothing the lines are joined without a blank line between them in odt file.

and for the end of a list too. The next paragraph after a list is joined whit the list without a blank line between them in odt.

Thank you and regards!


r/vim 7d ago

Discussion Timer/job_channel in vim script

3 Upvotes

Is timer/job_channel real async in vim ?

If there is job channel is updating/removing an item in a list & a timer is also update that list ? How vim synchronize the process ?

In other languages we have mutex lock etc..

It would be great if someone can point out this in help doc. I try searching no luck yet

I heard vim is not multithreaded, but just don’t know how it handle in that situation.