News for hackers. Stuff that matters.
Re:I Still Use Vim by ogre_codes on Thursday November 12, 2020 @03:28PM (#25074504)
> My vim config is 600 lines. I have fixes for small annoyances. I have a bookmarking system set up in 45 lines. I have extra syntax highlighting for code snippets that are important to me because I’m doing things the original syntax maintainers never even considered. I create impromptu keyboard mappings and abbreviations and autocommands as needed for given tasks. I can move around in the design space at will.

I use VIM on and off, but I wanted to post the above because I think it exemplifies who might like using VIM.

VIM is ideal for people who find it worthwhile to spend the time building their configuration out. VIM is the productivity tool that gets better as you put the time and effort into building it out. If you aren't the kind of person who wants to put that time and effort in, it is still decent as a basic editor, but it doesn't really shine.

Re:I Still Use Vim by tombert on Thursday November 12, 2020 @03:41PM (#25074682)
I don't disagree with your thesis, but I should point out that I have been using Vim almost exclusively for almost six years now (well, NeoVim for 4 of those years), and my config is only about 40 lines, and most of it is just installing plugins for whatever languages I'm using.

Despite me not hacking it like crazy, I still think it really shines as an editor; Vim macros were sort of life-changing to me once they clicked for me. I also just think that modal editing is superior once you get past the initial learning curve.

Re:I Still Use Vim by ogre_codes on Thursday November 12, 2020 @03:57PM (#25074902)
Let me back up a step here.

I use VIM for almost all basic editing. Its muscle memory.

But for code editing, I generally end up on VSCode because it seems to have better language support. I've spent a fair amount of time with configuring VIM trying to get where I feel it needs to be. But whenever I shift to a new stack, it always seems to take an investment of time and effort to get VIM set where it's better than VSCode.

Re:I Still Use Vim by GrantZvolsky on Thursday November 12, 2020 @04:30PM (#25075347)
I share your experience, but it should only be a matter of time until the vim LSP clients[1] mature.

One notable exception is Go with its [vim-go](https://github.com/fatih/vim-go) plugin, which feels very mature to me as someone new to the language.

[1]: https://langserver.org/

Re:I Still Use Vim by deadbunny on Thursday November 12, 2020 @04:54PM (#25075620)
Re:I Still Use Vim by blandflakes on Thursday November 12, 2020 @04:59PM (#25075682)
Having to install node.js for a language server client is sort of a downer. For this reason I've been eagerly awaiting the built-in client in neovim, though it's definitely less polished and feature-complete than CoC today.
Re:I Still Use Vim by deadbunny on Thursday November 12, 2020 @05:05PM (#25075749)
Isn't the "built in" neovim language server lua? I personally can't see much difference between having to install nodejs runtime Vs the lua runtime.
Re:I Still Use Vim by igneo676 on Thursday November 12, 2020 @05:10PM (#25075821)
The difference is that the lua runtime is embedded (and wicked fast) into Neovim vs nodejs that has to go over the remote plugin interface
Re:I Still Use Vim by deadbunny on Thursday November 12, 2020 @05:15PM (#25075904)
Fair enough. I've been using coc for a while now and can't say I've ever had any speed issues that I've noticed. But if the neocvm language server is built in and "as good" as CoC then that'll be one less plugin I'll need to install when it's ready.
Re:I Still Use Vim by blandflakes on Thursday November 12, 2020 @05:46PM (#25076271)
Yeah I don't have any node.js speed concerns for it, I just would like to have the simplest editor microservice architecture, and putting the client to a service in a service was a bridge further than I wanted.
Re:I Still Use Vim by ogre_codes on Thursday November 12, 2020 @06:18PM (#25076661)
CoC looks neat (installing right now), but it's a perfect example of what I mean. Having to poke through and add several dozen lines to my config file to get it working.

I would love to have this functionality with just

  brew install ts-vim
And just be done with it.
Re:I Still Use Vim by sooheon on Thursday November 12, 2020 @11:46PM (#25078981)
I don't use vscode that much, but when I was checking it out I installed some extension which lets you edit text with true neovim (point it to a bianry) while vscode handles chrome and code understanding. Worked pretty well.
Re:I Still Use Vim by GrantZvolsky on Friday November 13, 2020 @03:45PM (#25087255)
You're probably talking about Neo Vim[1] by Alexey Svetliakov. I can't recommend this one enough for a (neo)vim experience in VS Code. It is relatively new and deserves a lot more attention.

[1]: https://marketplace.visualstudio.com/items?itemName=asvetlia...

Re:I Still Use Vim by sooheon on Friday November 13, 2020 @08:36PM (#25089542)
Yeah that’s the one. Love that it’s not a half baked vim emulation.
Re:I Still Use Vim by hwayne on Thursday November 12, 2020 @03:48PM (#25074779)
There are many ways to use vim and they're all valid! People who love barebones vim are cool. People who love configuring vim are cool. People who love embedding vim in larger programs are cool. We have way more in common than vim squabblers pretend!
Re:I Still Use Vim by Scarbutt on Thursday November 12, 2020 @03:59PM (#25074947)
Are evil users cool too?

BTW, your main point about using vim is emacs greatest strength.

Re:I Still Use Vim by hwayne on Thursday November 12, 2020 @04:04PM (#25075021)
You wound me greatly, but yes, evil users are cool too. I mean, I first learned vim keybindings from Kile.

(People keep telling me I'd love emacs, and I have nothing against it, I just happened to learn vim first.)

Re:I Still Use Vim by hsitz on Thursday November 12, 2020 @04:31PM (#25075354)
Along with Evil, Emacs org-mode is the thing that eventually lures a number of people like you over from Vim. Evil makes editing in Emacs close enough (very close) to editing in Vim. Org-mode gives useful functionality that you can't get in Vim.
Re:I Still Use Vim by mijoharas on Friday November 13, 2020 @05:55AM (#25081058)
So, I am now a longtime emacs (and evil, love vim-ey things) user, and I've dipped my toes in the org-mode water a few times, but it's never quite stuck.

Have you got any suggestions? The number of people that recommend it makes me sure that there's value to be had there, but it's never really become a habit for me.

Re:I Still Use Vim by Scarbutt on Friday November 13, 2020 @11:23AM (#25083867)
The important part is to find a method and then leverage orgmode for it. With out some system is hard to make it stick.
Re:I Still Use Vim by tzs on Thursday November 12, 2020 @07:00PM (#25077027)
About 40 lines sounds reasonable to me.

I've been using vim and before that other vi clones or actual vi as one of my main editors for 40 years, and my .vimrc is 60 lines.

20 of those are to automatically decrypt on read and encrypt on write .gpg or .asc files, which I copied from somewhere 20-25 years ago and haven't actually used in 15+ years, leaving only 40 lines I actually care about.

Re:I Still Use Vim by alwillis on Tuesday November 17, 2020 @02:28AM (#25121074)
Just as an FYI, Vim has built-in support for encryption: https://vim.fandom.com/wiki/Encryption
Re:I Still Use Vim by threatofrain on Thursday November 12, 2020 @03:42PM (#25074699)
My problem is that some of that building should've been sensible defaults, and the community tends to outsource those responsibilities to extensions.

Which means your Vim experience now has some risk of rot. Once and awhile my configurations/extensions rot and I have to go and update myself as to what happened in the ecosystem, or what is interacting with what. One day I decided I'm too tired and switched to VSC.

Also the author failed to talk about the #1 killer feature of VSC, the reason for its meteoric rise in popularity — intellisense.

Re:I Still Use Vim by pkage on Thursday November 12, 2020 @03:45PM (#25074741)
Thankfully, you can get LSP-powered completion with coc.nvim, just like in VSC. It's miles better than YouCompleteMe, plus it's much easier to install—you can just use vim-plug or similar to install it.

LSP is truly one of those "rising tide lifting all boats" projects.

[0] https://github.com/neoclide/coc.nvim

Re:I Still Use Vim by daotoad on Thursday November 12, 2020 @03:55PM (#25074873)
I was using YCM and ALE to handle completion, but having switched to COC I won't look back. It's just a much better experience.
Re:I Still Use Vim by scruple on Thursday November 12, 2020 @04:33PM (#25075388)
FWIW, neovim's built-in LSP (nvim-lspconfig -- written in Lua, currently in beta) is _outstanding_ and I have already replaced coc.nvim with it in my neovim set up. Set up is super simple, there are 2 extensions to install. Configuration is simple, I think I needed maybe 8 lines added to my `init.vim`. With that I get completion and in-line diagnostics and it's very, very fast, at least with solargraph, clangd, and tsserver.
Re:I Still Use Vim by ogre_codes on Thursday November 12, 2020 @03:49PM (#25074799)
> My problem is that some of that building should've been sensible defaults

Vim suffers a bit from the design equivalent of tech debt. Much of the defaults and common behaviors were created based on the limits of software/ hardware 30+ years ago. Those limits still affect current design.

> Also the author failed to talk about the #1 killer feature of VSC, the reason for its meteoric rise in popularity — intellisense.

Given a fairly small amount of configuration, you can get autocomplete which is nearly as good as Intellisense in VSCode. For Typescript anyhow, the autocompletion comes from the same source background process.

Re:I Still Use Vim by raverbashing on Thursday November 12, 2020 @03:47PM (#25074767)
Agreed (though I use nvim now and thoroughly recommend it)

Vimscript is weird. Sometimes the answer to "how to do this" comes in the form of "just install this package manager...". Stop. No.

Sure, I'm ok with adding a couple of lines to vimrc, copying some files, but don't push it.

I get much more out of the box from Vscode, PyCharm, etc. Why can't it be the same with vim?

Re:I Still Use Vim by bhaak on Thursday November 12, 2020 @04:09PM (#25075082)
Simple. Vim is not an IDE.

If you take a step back and look at software development as a whole then IDEs like VSCode and PyCharm take the top down approach.

Whereas Vim is one of the solutions which do it bottom up.

With both approaches you can theoretically arrive at the same functionality but in reality, there will always be something missing.

Some people prefer the bottom up approach as that gives them the illusion of knowing their tool completely whereas people with the top down preference think everything is curated for them.

Over time, both kinds of people notice this isn't quite true.

Re:I Still Use Vim by daotoad on Thursday November 12, 2020 @04:04PM (#25075022)
This is one of the motivating forces behind nvim. While nvim supports vim script, it provides Lua as its preferred language for extension. In addition, the internal APIs are documented and are intended to be accessible from any language via RPC.

https://neovim.io/doc/user/api.html

Re:I Still Use Vim by jeromescuggs on Wednesday November 18, 2020 @04:42PM (#25142807)
drawing from my own experience, i once found myself trying to work on a client website. thanks to a series of events i was using termux from a cellphone. i grabbed my vimrc from my dotfiles git repo and that was that. took all of 30 seconds to turn someone's cellphone into an interface identical to the one i use everywhere else
Re:I Still Use Vim by masa331 on Thursday November 12, 2020 @03:57PM (#25074913)
My .vimrc is around 80 lines including 15 plugins. It's mostly like that for last 8 years. And i don't have any problem using using unmodified vi/vim on servers, which is a big plus.

So no, vim shines and it's pretty bright

Re:I Still Use Vim by Osiris on Thursday November 12, 2020 @03:55PM (#25074860)
My vim config is empty. I use it periodically and know the basics. I prefer it over nano and pico by a mile.

600 lines seems pretty long to me. I don't even know what I would put in a .vimrc file. Obviously I don't use it enough to even have annoyances.

The nice thing about have no config is that I can hop into vim on any computer or server anywhere and be able to use the editor. I don't have to worry about having muscle memory of using keybindings/aliases that don't exist.

Re:I Still Use Vim by enriquto on Thursday November 12, 2020 @03:58PM (#25074922)
> My vim config is empty.

That's the way to go. Unfortunately, most humans are fallible and I had to add a single line:

    inoremap <tab> <esc>
Re:I Still Use Vim by nurettin on Thursday November 12, 2020 @04:00PM (#25074957)
Mine is 3 lines. Background dark, shift width and tab spaces. Been like that for around 18 years.
Re:I Still Use Vim by Osiris on Thursday November 12, 2020 @04:41PM (#25075464)
I should probably add that. I know I have had it at some point on a different computer.
Re:I Still Use Vim by iso947 on Thursday November 12, 2020 @04:16PM (#25075169)
Mine was empty until the defaults changed in vim 8 and broke a lot of sensible behaviour.
Re:I Still Use Vim by ybbond on Saturday November 14, 2020 @01:28PM (#25094356)
as much as I enjoy my current job, I really want to learn new programming language/paradigm, or new skills to let me have a job with vanilla Vim without vimrc as my daily driver.
Re:I Still Use Vim by ogre_codes on Thursday November 12, 2020 @03:58PM (#25074928)
VIM is fantastic for editing files on servers for this reason.
Re:I Still Use Vim by sumtechguy on Thursday November 12, 2020 @04:10PM (#25075104)
mine is empty because i jump between so many different machines and my config is not there. so i have to remember them.
Re:I Still Use Vim by alwillis on Tuesday November 17, 2020 @02:43AM (#25121135)
While I understand why you may want an empty config, at the same time, I don't get it. It's not a criticism.

I knew a guy that not only had no config, he didn't even use syntax highlighting, which I can't live without.

All of that power and configurability is there for a reason. My config is about 250 lines; a lot of that is just to have Vim operate like it's 2020 and not the 90's.

I'm not a C programmer, so I don't want /usr/include in my search path, which it is by default.

I want to ignore things I have no intention to edit, so I have

    set wildignore=*~,.DS_Store,.git,.hg,.svn,*.bmp,*.gif,*.gz,*.ico,*.jpeg,*.jpg,*.mp4,*.pdf,*.png,*.tar,*.webp,*.xz

Gotta have relative numbering while showing the absolute number for the current line:

    set number
    set relativenumber
I write a lot of HTML; having Emmet (see https://medium.com/vim-drops/be-a-html-ninja-with-emmet-for-...) enables me to write

     div#page>div.logo+ul#navigation>li*5>a <C-y>,
 
and get

   <div id="page">
        <div class="logo"></div>
        <ul id="navigation">
            <li><a href=""></a></li>
            <li><a href=""></a></li>
            <li><a href=""></a></li>
            <li><a href=""></a></li>
            <li><a href=""></a></li>
        </ul>
    </div>
Saves lots of time and keystrokes.

From .vimrc to .vim: https://vimways.org/2018/from-vimrc-to-vim/

Fabulous article that explains runtime files and why many modifications to most people's .vimrc should be in ~/.vim/.vimrc and other other runtime directories.

Lots of Vim users talk about using a minimal config because they need to access random machines that won't have their custom setup.

Or that it's some kind of badge of honor to not have any plugins, even if they could save you a ton of time and keystrokes.

Let's not forget: 1. Vim is great at remote editing, so you can use your config when updating files on servers, etc.

2. You could put your ~/.vim/.vimrc in a repo and install it anywhere you need it in like 5 minutes.

3. You could also rsync your local config to a machine if you needed to.

Of course I can use barebones Vim on some random server, but sometimes you need all the goodies with you.

The video Your Vim is only for you: (https://www.youtube.com/watch?v=6LPBpmkQdw8) reminds us that our Vim is just for us and if that means tricking it out so that it becomes our own custom editor, then so be it.

Re:I Still Use Vim by barumi on Thursday November 12, 2020 @06:31PM (#25076778)
> VIM is ideal for people who find it worthwhile to spend the time building their configuration out.

I've been using VIM for over a decade and currently my customized config consists of a half a dozen tweaks, such as YAML-specific settings stashed in ./.vim/after.

Re:I Still Use Vim by heelix on Thursday November 12, 2020 @08:59PM (#25077969)
If you can post it on a public repo, I'd love to see it. (same goes for the many others who use VIM as a daily driver)