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.
- PenguinCoder ( @Penguincoder@beehaw.org ) 27•1 year ago
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
- arandomthought ( @arandomthought@vlemmy.net ) 4•1 year ago
I see what you did there. 😅
- burrp ( @burrp@burrp.xyz ) 3•1 year ago
:%s/she/set/g
- rostriano ( @rostriano@vlemmy.net ) 3•1 year ago
To add to that: start with vimtutor. It teaches you vim from within vim itself which is a really nice way to learn the basics.
- Haus ( @Haus@kbin.social ) 2•1 year ago
There are so many editors with Vi emulation that it’s still very useful. When I actually used emacs all day every day, it was slightly superior to vi at the cost of a little overhead, and slight differences in different installations. But I think vi won the war by being universal Shift-A, Shift-I, Y, P, cw, c$, /foo… so much useful goodness baked into any emulator.
- toffi ( @toffi@feddit.de ) 2•1 year ago
Slightly off topic but I always preferred :x for quitting and saving.
On the topic: learning vim keybindings is narrow path between usefull and I want to, in my opinion. So if you want to nothing is stopping you.
Thanks, I think everyone unanimously agrees on this! Learning curve seems very steep but I’ll make it my daily driver for a few weeks
- zauberin ( @zauberin@beehaw.org ) 13•1 year ago
Learn vim and use it in vscode, kinda gives you the best of both worlds
- variouslegumes ( @variouslegumes@reddthat.com ) 4•1 year ago
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 🙂
- arandomthought ( @arandomthought@vlemmy.net ) 3•1 year ago
Agreed. Vim or Neovim can be set up to act like an IDE, but pretty much every IDE or editor worth their salt will have a plugin that allows you to use vim keybindings.
- interolivary ( @interolivary@beehaw.org ) 12•1 year ago
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.
- gerbal ( @gerbal@beehaw.org ) 3•1 year ago
If you find yourself thinking “I wish I could type/manipulate text faster” it might be worth it
- interolivary ( @interolivary@beehaw.org ) 1•1 year ago
Sure, but I’m just really not convinced that’s usually the case with programming.
- Ninmi ( @Ninmi@sopuli.xyz ) 10•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.
- crisisingot ( @crisisingot@beehaw.org ) 4•1 year ago
How different is neo vim from regular vim?
- Neotecha (She/her) ( @neotecha@beehaw.org ) 6•1 year ago
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
-
- Ninmi ( @Ninmi@sopuli.xyz ) 4•1 year ago
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.
- key ( @key@lemmy.keychat.org ) 9•1 year ago
Emacs is awesome, definitely learn to use it then learn to lisp. Vim mostly learn to exit before running
EDITOR=emacs
- kool_newt ( @kool_newt@beehaw.org ) English7•1 year ago
Reported to mods for recommending awful editor
- AdamBomb ( @AdamBomb@lemmy.sdf.org ) 8•1 year ago
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.
- IcedCoffeeBitch ( @IcedCoffeeBitch@beehaw.org ) 2•1 year ago
Vscodium with neovim works so freaking well. What’s nice about that one is that it’s genuinely neovim, meaning your vim config works there too.
- sincle354 ( @sincle354@beehaw.org ) 7•1 year ago
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.
- varsock ( @varsock@beehaw.org ) 7•1 year ago
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.
- sznio ( @sznio@beehaw.org ) 7•1 year ago
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.
- jackattackson ( @jackattackson@lemm.ee ) 4•1 year ago
Same - I regularly use vim on servers when I have to, but I can only remember some super basic commands. Most of my coding is done in a basic text editor like Sublime Text or Notepad++ or an IDE.
I do get the appeal of becoming fluent in Vim or emacs and theoretically attaining giant productivity gains. Although for me at least, text editing is not where all my time is wasted. I lose my productivity the old fashioned way: attending unnecessary meetings and wasting time solving the wrong problems.
- r2vq ( @r2vq@lemmy.ca ) 3•1 year ago
Relevant XKCD is relevant.
- sinnerdotbin ( @sinnerdotbin@lemmy.ca ) 2•1 year ago
It takes a while to get used to, but it is well, well worth it. The speed gains are far from negligible.
- rofoldos ( @rofoldos@lemm.ee ) 6•1 year ago
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.
- Dominic ( @Dominic@beehaw.org ) 5•1 year ago
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.
- StrayCatFrump ( @StrayCatFrump@beehaw.org ) 2•1 year ago
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.
- Jummit ( @Jummit@lemmy.one ) 4•1 year ago
I can recommend Helix as well, just be aware that it’s still in active development. Dropping the link for the lazy: https://helix-editor.com/
- lentilhoarder ( @lentilhoarder@beehaw.org ) 1•1 year ago
Helix is awesome - I’m very much a fan of having a usable editor right out of the gate after install.
- Sinfaen ( @Sinfaen@beehaw.org ) 6•1 year ago
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
- varsock ( @varsock@beehaw.org ) 2•1 year ago
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.
- pkulak ( @pkulak@beehaw.org ) 5•1 year ago
Vim is great because you can enable the bindings in nearly every editor.
- ollien ( @ollien@beehaw.org ) 4•1 year ago
And then painfully learn which subset of the bindings each editor supports :(
- pkulak ( @pkulak@beehaw.org ) 2•1 year ago
Haha. True. But some are really close.
- Lanthanae ( @Lanthanae@lemmy.blahaj.zone ) 5•1 year ago
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.
- slartibartfast42 ( @slartibartfast42@beehaw.org ) 4•1 year ago
Personally, I’m a vim guy, but I think either is fine. For most coding purposes, a graphical editor like VScode is fine, but knowing emacs or vim is essential if you ever want to edit files without a GUI, e.g. on a remote host over SSH.
- l3mming ( @l3mming@lemmy.fmhy.ml ) 4•1 year ago
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.
- pkulak ( @pkulak@beehaw.org ) 1•1 year ago
s/i3/sway