Im considering spending some serious time learning one of the above. Two principle engineers I work with exclusively use them, and watching them work is incredible, the speed they move and get things done is pure wizadry. Can anyone learn this skill? For what it’s worth, the alternative is learning VScode. I’ve exclusive used Android Studio in my career.

  • Definitely. vim is hard to get used to, but after you do, it’s damn powerful especially with plugins. Always nice to be able to do typing and coding entirely on the keyboard and not needing to move your hands to the mouse for something. Also, if you do any Linux cli stuff, you almost always have access to vi at LEAST. So being familiar with the tool she the gui and something like nano isn’t available, is invaluable.

    :wq

    • Vim still has some stuff going for it that isn’t (at least built into) vscode.

      • The vscode vim plugin is still very slow compared to vim (running a global normal command on a few lines makes it chug iirc. Not to mention macros are pretty slow comparatively)
      • The vscode tab behavior is frustrating to use coming from vim. Why are tabs specific to each split? How do I switch between buffers with just the keyboard?
      • Vim has built in utilities to process the contents of a buffer through any program on your path. Think formatting a buffer with jq.
      • some Vim plugins are just really good. Fugitive for git for example.

      Is any of this worth learning vim for? I don’t know 🙂

  • I may be the odd one out here, but I don’t think that the editor you use is really going to make all that much of a difference for your efficiency. Text manipulation is rarely your bottleneck when coding, so I’d just go with an IDE / editor you feel comfortable with.

    I used to be a hardcore vim user but nowadays I just use VSCode with a heavily customized keymap.

  •  Ninmi   ( @Ninmi@sopuli.xyz ) 
    link
    fedilink
    10
    edit-2
    1 year ago

    I think anyone who does programming should at least give Neovim a good shot. Like, dedicate a few months to get a feel for the basic controls, use relative line numbers to jump to lines, f and F to jump to spots in lines, ciw ci" etc. to change stuff. If it’s not your thing then fine, but learning Neovim is like switching from clicking file -> save to ctrl+s, but with everything.

    You really don’t need a mouse at all and in the end you’ll get to make changes as fast as you can think. It’s a language you speak through your keyboard to your editor and things just happen once you get fluent. E: checking if editing helps this thread federate better.

      • Neovim is a rewrite of the vim project. From a high level (or from the perspective of a beginner to both), there’s not much difference between the two. That is, basic usage will be the same regardless of which ones you choose. Like, the model philosophy and default key bindings are basically identical.

        You start seeing major differences with more advanced usage and under the hood.

        • Neovim is built to support async processing, while Vim is entirely synchronous

        • Neovim offers native Language Server support while Vim requires plugins to do so. (Language Server Protocol is part of what makes VSCode so powerful)

        • Vim plugins are written with a custom script called “vimscript” while Neovim plugins are written in Lua but also supports vimscript.

        There are more differences, but this should cover the basic differences. I haven’t used neovim in an age, so I’m up for any corrections if anyone has any

    • This thread stopped federating for some reason so I’ll reply to myself:

      How different is neo vim from regular vim?

      Functionally it’s pretty much identical. For the user the difference is in the added features and development model. Neovim’s development model is not centralized to one person and makes real progress. Vim on the other hand is much more a pet project of its creator and seems to get new features only if it starts losing users over to Neovim. Using Vim you’re always going to be behind the curve and under the whims of Bram’s decisions. Neovim integrated Lua as a first-class language for configuration and it was then that Bram had to do something about vimscript, but opted instead to create a new, backwards incompatible version of vimscript, another bespoke language. I very much advocate making Neovim the norm instead.

  • Yes, for me the happy medium is to learn and use Vim emulation within your IDE of choice. Purists will object that Vim emulators offer inconsistent levels of support, but in my experience they all offer support for the core functionality plus varying extras. For those who already have Vim fully configured for their workflow and preferences, there is no substitute. But for anyone else, Vim emulation in an IDE is a great way to level up your text editing powers.

  • When you get into Vim, you love it. There’s so many buttons for movement and editing that you never have to mash the arrow keys ever again. But that’s because you must customize Vim for how you like it. As you use Vim and accustom to the crazy binds, you will find situation where you think “I want to do this movement over and over and faster”. Then you learn about the dot (repeat) key, the “copy(y) within quotes”, the “jump to next function” button, the “jump to definition” button, etc… And if you don’t find a button for what you need? YOU MAKE YOUR OWN BIND. I have a button combo that does “take the current word under the cursor and grep it for every file with the same current filetype down the directory tree”. I use that button 50 times a day. Pure bliss.

    It’s a text editor where you can program in your favorite movements.

  • Just to help you differentiate: vim is a text editor with a huge ecosystem of plugins and its own “language” where you can make the vim program into a sophisticated IDE. Vim also has very clever key bindings to help you interact with text more efficiently. My advice is that keyboard navigation using vim key bindings are worth learning, not necessarily sinking time to creating an IDE in vim for yourself with plugins.

    vim key bindings make it incredibly easy and efficient to manipulate text, after putting effort into learning it. Most text editors, IDEs, Note taking apps (Joplin, Obsidian, etc.) have VIM mode where you can interact with text same way as in vim. Hell, I wish Word had vim key bindings!

    To make VIM useful as an IDE you have to spend time to find plugins you need/want, customizing, tweaking, troubleshooting, etc etc.

    personally, in my professional software eng career, I don’t have time to troubleshoot VIM plugins or customize my setup and I need an env that is frictionless and basically pay others to maintain it and make improvements. I use IntelliJ IDEs and VS code with vim binding enabled.

    I do hobby around with it in my free time, making tweaks here and there but it is a huge time sink. Also, my squishy brain cannot always take the overhead of keyboard navigating an IDE. On days I am mentally drained of chasing evasive bugs, having a GUI that where i can click through menus without having to invoke a command really helps with mental fatigue.

    I would suggest enabling vim keyboard navigation and getting the hang of that first while still using android studio so you don’t lose all your IDE features. Looks like your editor has a vim plugin. Then, if you like navigating with a keyboard, you can slowly build your own IDE using plugins and switch over.

  • You should learn basics of Vim just for quickly editing config files on servers.

    For programming I don’t think the speed gains are worth it. It would take more time to learn it than I would shave while using it.

  • It is really a good idea to learn vim. It’s everywhere, particularly useful when connecting to remote servers.

    In order to use it for all your development needs, you’ll probably resort to multiple plugins. The advantage: wizardry, the disadvantage: you get used to it, and won’t work on vanilla remote installations.

    I like to use vim for every day scripts and remote text editing, while using helix as main code editor.

    Helix is not yet as popular, but it comes with batteries included. Many of the plugins that you’d install in vim come as a feature in helix. It is also a modal editor, and it varies slightly in it’s use, but a nice addon to your toolbelt.

    • Seconding the recommendation for Helix.

      As you noted, it’s batteries-included. For me, the hard part of using vim/Neovim is choosing and configuring all of the plugins that you need to have an IDE-like experience. Helix doesn’t have a plugin system, so it’s not as powerful or flexible as Neovim, but it gives you 90% of the features of a fully-configured Neovim setup with 10% of the work.

      I also like Helix’s approach to modal editing. It’s a little more intuitive to use motions and then actions (e.g. select the next 3 words, delete them) than the other way around.

      • I use tmux instead of a bunch of vim plugins. What I can’t do inside the editor, I hop over to the other half of the terminal to do with tools in bash. The great part is that tmux can run in just about all the places vim can, and you also run ssh within it instead of the reverse. Whereas getting all your vim plugins onto each server you want to work in is a major PITA.

        You can get a similar experience with a split vim screen and the :term command, but tmux offers more versatility IMX.

  • Engineer here who has had to work on many machines that were off-network, without a monitor or with a crappy one, with no ability to install random software:

    There’s a very good chance that vim is installed. Getting good at it certainly helped my productivity working in those environments

    • I agree with you, knowing vim for keyboard navigation is very benifitial in the majority of time when working with computers. To that point, most IDEs have vim keybindings/mode so you can edit inside the IDE using vim keymaps.To OPs question, replicating IDE functionality using vim plugins is a huge timesink.

  • I think it’s worth it mostly because it’s really not hard to get to a point where you’re equally as efficient as you were before, and from there the sky’s the limit.

    It’s also really nice not to have to open a full gui to make quick edits to files.

    For me though, it’s not even the efficiency which brought me to it, it’s that it just feels so much nicer to use. Someone once told me it’s like using a really nice pen: it’s not going to make you a better writer but it will make writing a hell of a lot more enjoyable.

  • Learn vim, but learn it well. Not enough people take advantage of it’s macros feature. Once you’ve tried that, you’ll never go back.

    Also, while you’re at it, spend some time learning i3. Then you’ll be able to show your principle engineers a thing or two.