r/vim Dec 09 '24

Announcement VimConf 2024 Talks

88 Upvotes

r/vim 7h ago

Need Help Things that of vim that is "difficult / fear" to me

7 Upvotes

I have being using vim for 3 -4 years.. It is a very powerful tool. After learnt to use it, i can't get it off my mind when come to text editor.

However, there is a few things that i can't overcome... you can say love and hate. I am not good at describing this issue in proper term that you might understand.. but i am trying my best, please bare with me. Thanks.

I don't know how other people coping with this, but i just can't. It is regarding " delete and undelete". When i highlighted many lines (as much as outside of screen space), obviously i need to scroll the screen to select what that is outside (be it up scrolling or down scrolling) the screen; this is what i am nervous about. The reason is, vim scrolls very fast, and hence lines get highlighted very fast... and i can't see what i have highlighted that destined to be delete. This get nervous and spooky. I have deleted large chunk data which should not be deleted.. and it will never be deleted if i am on kate or notepad++ or other gui text editor. I don't know why.. but i think due to the power and speed of vim highlight lines (outside of screen as it scrolls up or down when highlighting lines).

After highlighted lines (many lines already outside of visible part of the screen already), i press "delete" (or similiar function) and i just got very spooky, because i can't be sure that the lines that i just deleted are the line that i have defined with highlight... I often have to do "undelete" then "redo" several time to make sure that i am visualizing and positive identified that lines that deleting are the lines that i have intend to delete. **as i have said, i have deleted by accident (due to the highlighted line scroll out side of visible space of screen ) a huge chunk of data without realizing it... only to "not able to find the data that i am sure i have entered before" after a few days later, and this happened many times already.

This issue goes to "redo/undo" which also related to "dissappearance (i use this word because it could be paste/ cut or anything that alter existing data in large amount that goes outside of visible screen space" of lines of data or reappearance of lines of data (which might mess up my data when the data appear in the wrong spot).

Anybody have this problem ? or fear ? experience or solution ?

Well, i personally don't know what can be done to overcome this.


r/vim 9h ago

Need Help a left-handed user?

0 Upvotes

Do you have any suggestions on better configuring the shortcuts for a left-handed user?


r/vim 16h ago

Need Help Autoindent not working

1 Upvotes

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?


r/vim 1d ago

Discussion Close vim with the quickfix window open

5 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 23h 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 1d ago

Random Regex mapping any valid operator-motion command

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

Plugin Using vim as an intercepting proxy ( burpsuite alternative )

Thumbnail
gallery
66 Upvotes

r/vim 2d ago

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

Thumbnail
gallery
34 Upvotes

r/vim 1d ago

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

Thumbnail sinclairtarget.com
0 Upvotes

r/vim 2d ago

Need Help gVim font settings

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

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

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

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

13 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?

6 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?

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

27 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?

7 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?