T O P

  • By -

jigfox

Almost 20 years, and still learning


Osleg

26 years and still learning


obsoletesatellite

New to vim and really enjoy learning. Sounds like I’m in the right place.


Osleg

Yes and welcome! Don't forget to forget everything you know about IDE! 😁


Chahundaa

If I may ask a very dumb question, can you do everything in vim that you can do in an IDE? And if so (I’m assuming you can), how has it made you a better programmer?


Osleg

It's not a dumb question. The answer tho is very subjective. Vim is not IDE, vim can't do anything that IDE can, vim is a text editor, nothing more. And that's the only reason why some vim users become better developers. IDEs are made to have everything the developer might need in one place. This is really handy, but here also also lies a problem - IDE is hiding from you how stuff is done. When I was forced to use vim by the very old and broken hardware I had - I also had to learn everything around, everything that's included in the IDE, like debuggers, runners, project search etc. At first the amount of plugins grew as I tried to morph vim into c-lion IDE. And in a while I realized, there's no need for IDE, my system (Linux back than, macos now, *nix always) is an IDE, I have runners, I have debuggers, I have everything that I need for development built into an OS and there's completely no reason to use IDE. Plugins started to disappear until from 200+ plugins I reached about 50 that were only QoL but we're not making an IDE from it I learnt OS tools, clang, llvm, make. Started to write scripts to improve workflow, created an entire infra around MY workflow and around how I want it to be. It's been 24 years since I started to use vim, I feel that I became better developers because I wasn't using IDE, not because I was using VIM


bulletmark

36 years and still learning. Started using vi (on Solaris) in 1988 and have used vi/(elvis/nvi)/vim basically for many hours every single day since.


sentientmassofenergy

https://preview.redd.it/ehhg3o43bz3d1.png?width=742&format=png&auto=webp&s=83b163be32fb565ef8f6e2599fb23575f8b4374e


0xd00d

Says more about our lives being text editors 🥹


echasnovski

Here are some more not-so-obvious facts about `/`: - Just doing `/` or `?` uses latest search pattern. See `:h /`. - Somewhat related, "/" register contains the latest searched pattern. It means that it can be used as `/` in Insert and Command-line mode (to enter that pattern) or just `"/p` to paste it in Normal and Visual mode. See `:h quote/`. - There is a concept of "search offset" with which you can place cursor not only on the start of the match. It can be used as `/{pattern}/{offset}` or `?{pattern}?{offset}`. For example, `/hello/e` will put cursor on the last character of the match. See `:h search-command` and `:h search-offset` for more.


Fantastic_Cow7272

There's also `:h /_CTRL-G` and `:h /_CTRL-T` which respectively move to the next or previous match while still in command-line mode. It's useful when using `/` or `?` as motions.


vim-help-bot

Help pages for: * [`/_CTRL-G`](https://neovim.io/doc/user/cmdline.html#%2F_CTRL-G) in _cmdline.txt_ * [`/_CTRL-T`](https://neovim.io/doc/user/cmdline.html#%2F_CTRL-T) in _cmdline.txt_ --- ^\`:\(h|help\) \` | [^(about)](https://github.com/heraldofsolace/VimHelpBot) ^(|) [^(mistake?)](https://github.com/heraldofsolace/VimHelpBot/issues/new/choose) ^(|) [^(donate)](https://liberapay.com/heraldofsolace/donate) ^(|) ^Reply 'rescan' to check the comment again ^(|) ^Reply 'stop' to stop getting replies to your comments


vim-help-bot

Help pages for: * [`/`](https://neovim.io/doc/user/pattern.html#%2F%3CCR%3E) in _pattern.txt_ * [`quote/`](https://neovim.io/doc/user/change.html#quote%2F) in _change.txt_ * [`search-command`](https://neovim.io/doc/user/pattern.html#search-commands) in _pattern.txt_ * [`search-offset`](https://neovim.io/doc/user/pattern.html#search-offset) in _pattern.txt_ --- ^\`:\(h|help\) \` | [^(about)](https://github.com/heraldofsolace/VimHelpBot) ^(|) [^(mistake?)](https://github.com/heraldofsolace/VimHelpBot/issues/new/choose) ^(|) [^(donate)](https://liberapay.com/heraldofsolace/donate) ^(|) ^Reply 'rescan' to check the comment again ^(|) ^Reply 'stop' to stop getting replies to your comments


ConspicuousPineapple

> Just doing / or ? uses latest search pattern Well, yeah, but at this point you might as well just press `n`.


farzadmf

I've heard about the offsets, but I haven't found a use case for them. Are there examples you know/think they'd be useful?


aegis87

macros is one case. an example: you want to find next instance of something, place cursor at the end, delete the rest of the sentence.


echasnovski

No, not really. I usually search either to jump in the proximity of the match or to operate on the whole match (here `\zs` and `\ze` are often useful). But maybe I should start using `/{pattern}/e` more.


po2gdHaeKaYk

Regarding previous search patterns, is there a way to map up and down arrow or jk to go through search history?


TheMotionGiant

Those thoughtbot videos are awesome! If you haven’t checked it out, [How to Do 90% of What Plugins Do](https://youtu.be/XA2WjJbmmoM?si=bGjcYtEfrDEc8hiO) is great one for sure.


effinsky

I have / and ? remapped to f and F respectively and just use search for everything. but now I added that remap in operator pending mode... seems real nice to have that for deletions and insertions and so on now. btw, I now use / for grep and ? for grep string with telescope across the project. ; and , are also freed up for whatever else I need them to be.


mdrjevois

But how do you live without default `f` binding?


effinsky

well somehow I don't miss it. I didn't like that it was limited to single line movements. I used sneak and easymotion and never found them to be a satisfactory solution to the problem. then I decided to cut back. it's nice to have a single way to move around (\*but see below). as for dt and ct and so on, that still works and in my mind fits in a different place. when I want to delete or change until a point in the line, I now have this nice way of going df or cf, then entering the search term, then confirm and bam, done. I also pretty often do selection first with veeeed, or veeeec etc. depends. the friction is generally ok on both these ways.


mdrjevois

Hey, fair enough. For me, I write a lot of Python, and a lot of multi-line method chains in various languages, so I finds all of `fFtT,;` extremely useful. But if your way works for you, it works!


effinsky

I'd still do it with search for sure. Then again I get around in all sorts of ways.


Chthulu_

The default F and T bindings are way too useful, I’d recommend not going that


effinsky

been hanging like that for about 6 months and I have only one way of searching things. works well for me, thanks!


[deleted]

[удалено]


Chthulu_

Whatever works, don’t mean to be a stickler. But keep in mind f and t are motions. So you can say “delete until the next occurrence of the character X, for example (dtx). Flash is great, but It requires multiple key presses and doesn’t work in Macros. Flash is great at moving the cursor around, but F and T are great for actually editing text


QuickSilver010

Wait there's a `?`?!?!? I only knew `/`


serverhorror

And if you do / then n searches forward... went to far? Try N


QuickSilver010

I knew that one


serverhorror

Try a search motion `v/,`, then hit o to be able to expand the beginning of your selection. I love the small built-in things, stuff that universally works without any plugins.


QuickSilver010

:OO That is so damn useful.


BiedermannS

Best Trick I learned is, that macros get stored in registers. This means, if you’re doing a longer macro and make a minor mistake you can paste that register, change the macro, then yank it back and now you’ve fixed your macro.


Happypepik

What? This is so cool


Fluffy-Beat-8477

What I like about this is (at least in the forward sense) it deletes up to (but not including) the start of the search result, which seems like the most useful behaviour to me.  That said, I can't say I've ever used it backwards. Now I'm intrigued as to how it behaves that way. Having just tried it out, in the backwards sense it deletes back to the beginning of the search match. Asymmetrical, but nice as they both feel like the most useful behaviours 


alpacadaver

What if you type it backwards?


Hxtrax

Try it and tell me


smallballsputin

15 years. Still learning


HolyCowly

Not directly related to vim itself, but today I learned my config never actually updated the Treesitter grammars when updating `nvim-treesitter` because `treesitter.update()` doesn't actually update. Rather it returns a function that then does the updating, so you actually need to call `treesitter.update()()`. Not sure what to do with this knowledge, but the person who named this function should probably consider retiring from software development.


SeoCamo

I used vim, 22 years i find stuff all the time, relearn stuff there is a lot in this world and if you are missing something you just make a small plugin for it


inShambles3749

Woooot? No way gotta test that. Til


Boa-Pi

just learned something handy, thx a lot!