Live data from Hacker News

Vim plugins I use

prakashdanish.github.io

41–50 of 93 posts

Re: Vim plugins I use

#41
post #39

This list is far from conservative. Vim isn't an IDE and shouldn't be made into one - effective vim users ^z out of vim and use Unix as their IDE. Here's my more conservative plugin list: https://git.sr.ht/~sircmpwn/dotfiles/tree/.vimrc fugitive: I use this for the sole purpose of :Gblame because the command line blame tool that ships with git is frustrating to use. ctrlp is there for opening files quickly in large c…

I don't see why being effective in vim means you ^z out of vim to run `ack` or `grep`, instead of pressing ^f (for example) to run Ack.vim on the and have the results displayed next to your code in a window that, when you select the item you want, opens that corresponding file in a buffer with your cursor already on the line in question. Certainly you don't need ack.vim, you could just ^z and do it the old fashioned…

>Certainly you don't need ack.vim, you could just ^z and do it the old fashioned way, but where is the utility in that?

Because ack.vim can't be piped into other tools. You can't, for example, limit your search to the last 50 files modified. Or only to executable files. You can't pipe the results into sed or make matching files world-readable. Sure, you could install ack.vim, slow down vim's startup and bloat your installation, or you could just hit ^z and use the unparalleled power of the Unix shell.

>How is that more in line with the unix philosophy than simply having vim shell out to those utilities for you?

Sometimes it's not. But vim has ! built in, you don't need plugins to run commands from it. I do it all the time.

Re: Vim plugins I use

#42
post #31
post #25

Earlier quoted context omitted.

Vim has a limited number of "modes" -- insert, normal, command and visual. These are not analogous to Emacs modes AFAICT. A vim package/plugin typically modifies/enhances behaviour in these modes. Where they can, useful operations are bound to a key combination. You spend most of your time in Vim (when editing) in normal mode, executing deft movements and register usage to behave as a surgeon upon the text, as it wer…

Right, I am an evil user myself. My question was about the vim equivalent of major modes in Emacs --- Does vim have a concept of major mode (a set of language specific functionality, one major mode per buffer)?

Not formally in the Emacs sense, but you can of course have configuration only load depending on the filetype so you end up with different keybindings (or other settings) depending on what sort of file you're in.

Re: Vim plugins I use

#43
post #21

I gave up trying to make Vim into an IDE. It's a text editor. It's an excellent one, but that's what it does. The plugins just aren't very good. NerdTree is not a good file browser. None of the autocomplete/intellisense works very well. It does work, but requires a lot of setup, and let's be honest, a TUI isn't the best way to interact with autocomplete dropdowns. Most of the IDEs have vim like features or plugins. I…

Vim is one editing interface in the IDE that is UNIX.

Re: Vim plugins I use

#45
post #39

This list is far from conservative. Vim isn't an IDE and shouldn't be made into one - effective vim users ^z out of vim and use Unix as their IDE. Here's my more conservative plugin list: https://git.sr.ht/~sircmpwn/dotfiles/tree/.vimrc fugitive: I use this for the sole purpose of :Gblame because the command line blame tool that ships with git is frustrating to use. ctrlp is there for opening files quickly in large c…

I don't see why being effective in vim means you ^z out of vim to run `ack` or `grep`, instead of pressing ^f (for example) to run Ack.vim on the and have the results displayed next to your code in a window that, when you select the item you want, opens that corresponding file in a buffer with your cursor already on the line in question. Certainly you don't need ack.vim, you could just ^z and do it the old fashioned…

Strictly speaking, one doesn't even need a plugin to use ack, ag or ripgrep from Vim. It is enough to set the "grepprg" option (perhaps also "grepformat") and then one can invoke the built-in ":grep" command.

For example, to use ripgrep:

    set grepprg=rg\ --vimgrep\ --no-heading

Re: Vim plugins I use

#46
post #21

I gave up trying to make Vim into an IDE. It's a text editor. It's an excellent one, but that's what it does. The plugins just aren't very good. NerdTree is not a good file browser. None of the autocomplete/intellisense works very well. It does work, but requires a lot of setup, and let's be honest, a TUI isn't the best way to interact with autocomplete dropdowns. Most of the IDEs have vim like features or plugins. I…

Text editors and IDEs are quite different.

For everz we've ben trying to shove one into the other.

Every IDE has a sort of shitty text editor.

Every text editor tries to make a shitty IDE.

Can someone please ackgnowledge that the reality is that neither is a good approach? I wish that I could have complete integration between VIM and JetBrains suite. Would be nice if the JetBrains platform could render a VIM inside itself as the actual text editor but kept 100% of its features as vim plugins to be installed. That way nobody has to re-invent the wheel on great text editing (emacs falls into this category too) and actually making intelligent IDEs.

Re: Vim plugins I use

#47
post #39

Earlier quoted context omitted.

I don't see why being effective in vim means you ^z out of vim to run `ack` or `grep`, instead of pressing ^f (for example) to run Ack.vim on the and have the results displayed next to your code in a window that, when you select the item you want, opens that corresponding file in a buffer with your cursor already on the line in question. Certainly you don't need ack.vim, you could just ^z and do it the old fashioned…

>Certainly you don't need ack.vim, you could just ^z and do it the old fashioned way, but where is the utility in that? Because ack.vim can't be piped into other tools. You can't, for example, limit your search to the last 50 files modified. Or only to executable files. You can't pipe the results into sed or make matching files world-readable. Sure, you could install ack.vim, slow down vim's startup and bloat your in…

> "or you could just hit ^z and use the unparalleled power of the Unix shell."

Or I could use both, when the need arises, which frankly it never has for me. Ack.vim does not preclude using ^z when you have a special need, it optimizes the common case. And Ack.vim is much nicer than !ack

> "install ack.vim, slow down vim's startup and bloat your installation"

Well I don't run vim on a z80, so the difference would be pretty hard to measure ;). The way modern well-coded vim plugins like Ack.vim work involves lazyloading using 'autoload' (which is poorly named.) Ack.vim includes plugin/ack.vim (p/av) and autoload/ack.vim (a/av). p/av loads when you start vim, but is a light-weight file that only contains keybindings and settings variables. The actual code of Ack.vim, the function definitions, exists in a/av which is loaded lazily, when one of those functions is called by a keybinding created in p/av.

The result is a truly negligible startup impact.

https://github.com/mileszs/ack.vim/blob/master/plugin/ack.vi...

https://github.com/mileszs/ack.vim/blob/master/autoload/ack....

Re: Vim plugins I use

#48
post #15
post #2

Here are some I find invaluable: * FZF. Perhaps the best fuzzy finder for Vim https://github.com/junegunn/fzf/ * ALE. Asynchronous Linting Engine, totally awesome. https://github.com/w0rp/ale * Polyglot. A "best of" language pack. https://github.com/sheerun/vim-polyglot * Plug. IMHO the best plugin manager going https://github.com/junegunn/vim-plug . * Fugitive. The best git wrapper there is https://github.com/tpope/…

Those were my favourite neovim plugins as well. Oni is still a bit rough around the edges, and rendering is a little bit slow at times, at least on my machine. I now use doom-emacs [1] and haven't looked back. [1] https://github.com/hlissner/doom-emacs

Do you know how doom-emacs compares to spacemacs?

Re: Vim plugins I use

#49
post #44

I personally use no plugins [1]. Zero friction moving from host to host. Vim is a great text editor, not a great IDE. For anything more sophisticated I prefer just switching to something like VS Code (with Vim bindings of course). [1] https://github.com/hoffa/dotfiles/blob/master/.vimrc

Same. I had quite a lot some time in the past, but also made the "using vim on some foreign machine and being confused as hell" experience by trying to use hotkeys or commands that didn't exist. Also just keeping the config synched between my own hosts was more annoying than I anticipated. Not to mention resolving conflicts between different plugins, or random stuff breaking when updating anything.

Nowadays I have a vimrc that just tweaks vanilla features the way I like, plus some highlighting for certain keywords regarding a C codebase I occasionally work on. The only plugin I use is a modified version of DetectIndent.

Re: Vim plugins I use

#50
post #44

I personally use no plugins [1]. Zero friction moving from host to host. Vim is a great text editor, not a great IDE. For anything more sophisticated I prefer just switching to something like VS Code (with Vim bindings of course). [1] https://github.com/hoffa/dotfiles/blob/master/.vimrc

Same. I had quite a lot some time in the past, but also made the "using vim on some foreign machine and being confused as hell" experience by trying to use hotkeys or commands that didn't exist. Also just keeping the config synched between my own hosts was more annoying than I anticipated. Not to mention resolving conflicts between different plugins, or random stuff breaking when updating anything. Nowadays I have a…

> "Same. I had quite a lot some time in the past, but also made the "using vim on some foreign machine and being confused as hell" experience by trying to use hotkeys or commands that didn't exist."

I've found that setting a custom colorscheme in vim averts this problem completely. If I see my colorscheme, my muscle memory is primed for my config. If I see the default vim colorscheme, my muscle memory reverts to default vim.

If somebody gave me a copy of otherwise vanilla vim to use that had my colorscheme, that would certainly throw me for a loop. But so far nobody has been that diabolical.

Post reply on HN