Technology
This is the official technology community of Lemmy.ml for all news related to creation and use of technology, and to facilitate civil, meaningful discussion around it.
Ask in DM before posting product reviews or ads. All such posts otherwise are subject to removal.
Rules:
1: All Lemmy rules apply
2: Do not post low effort posts
3: NEVER post naziped*gore stuff
4: Always post article URLs or their archived version URLs as sources, NOT screenshots. Help the blind users.
5: personal rants of Big Tech CEOs like Elon Musk are unwelcome (does not include posts about their companies affecting wide range of people)
6: no advertisement posts unless verified as legitimate and non-exploitative/non-consumerist
7: crypto related posts, unless essential, are disallowed
view the rest of the comments
Alternatively you can use and support a true community-driven editing environment dedicated to preserving your freedom, like vim/neovim or emacs.
But that's something new to learn and configure. I just want to code why should I spend my time learning another text editor when vscodium is fine
Careful. You're in a linux-heavy audience. They're the kinda people who would spend a few weeks setting up systems to use it for a few minutes.
That's simply outrageous!!! As soon as I finish tinkering with my system, I'll prepare a proper reply...
On a more serious note though. Don't overlook the role of procrastination in the endless tinkering many put on their boxes. I'm speaking from experience.
Who uses a system for only few minutes?
Well, it's because after using the system for only a few minutes, I realise it's not quite right, and I'll have to spend a few weeks to set it up again!
I'm a full-time Vim and Linux user when writing code. I agree with the statement that "simply switching" editors is very naive. I'm my personal opinion, you should decide on an editor that makes sense to you and learn to be very good at it. If VS Code is that answer, then great. Not everything points to Vim or Emacs.
Who doesn't want to go through learning of text editor and pain of configuring instead of actually coding?
Well...obviously them.
That's fine too. Use whatever does the job for you, but give alternatives a try if you ever have the time.
Vim and EMACS require tons of plugins and a brain transplant to feel confortable using them.
And the new personality tends to be somewhat evangelical about the editors 😄
Personally i find emacs plugin packs like Doom Emacs to make it infinitely nicer, no brain transplant needed
The plural of anecdote is not data.
But isn't atom and vscodium almost the same stuff?
Well, if you learned emacs, you could do everything in it and won't have to change ever again! /s kinda
Same reason why a carpenter should learn to properly use hand tools, or a teacher should keep up on literature. In other words, master your tools. It doesn't matter which tool you use, provided you can use it to its full potential.
I occasionally use VSCode, but I mostly use ViM because that's my tool of choice.
For another reason, if your ever in the situation where you need to work on something on a remote server or an unfamiliar machine, knowing ViM means you can at least be somewhat productive when you don't have your normal tools available.
I know vim. I'm using vscodium with a vim plugin. I was coding in pure vim for half a year because my Laptop with 4 gigs of RAM couldn't handle vscode. I just don't want to configure vim so it does all the stuff VScodium does for me
That's fine, use what works best. I think there's value in getting at least the basics working, such as syntax highlighting and linting in case you want or need to use it again.
The question was why one should learn to use something like ViM or emacs, not why anything else is a poor option. Master your tools, regardless of what they are.
I would love to use emacs, unfortunately coding in TypeScript is much more pleasant to me than coding in elisp or lua.
Not to say Typescript is a good experience either, I always feel like fighting the language than actually coding. Just saying they are better than elisp or lua.
Also I find vscode has better mouse interaction, but maybe emacs got better with time.
Are you talking about configuring the editor? Ideally, that's not a common task, so it really shouldn't matter much if it uses TypeScript, elisp, vimscript, or lua.
And if you're primarily using the mouse, you're missing most of the point of editors, especially emacs and ViM. The real power of those editors comes from keyboard shortcuts and combos, not from plugins and menus.
Yes, ideally a editor would work without any configuration, but unfortunately I haven't met any emacs user with sub 200 line dot files.
I personally cannot remember more than 20 hotkeys to save my life.
Also I find the most time-consuming part of my work is actually thinking, not clicking around with a mouse. so I don't really need to spend month to remember all the hotkey just to save 2 seconds clicking. In fact, slow down and click couple buttons to commit gives me a bit to rest and enjoy the moment when I have finished a task...
It's not about optimizing code entry, but optimizing reading code, since you read code a lot more than you write it.
I'm not super familiar with emacs, I'm a vim person, but here are a few examples of mouse vs keyboard navigation.
Search for text in a file:
Mouse:
Shortcut:
Vim:
*
on the word you wantn
for next,N
for previousFind matching brace/bracket/parenthesis:
Mouse:
Shortcut: not sure
Vim:
%
Navigate to the top/bottom of the file:
Mouse: scroll or click the sidebar
Shortcut: not sure
Vim:
gg
for the top of file,G
for the bottomGo to a specific line:
I.e. If from output from a script, like a test failure.
Mouse: scroll or if you have a plugin, click on the red part (i.e. test or lint failure)
Shortcut: in VSCode, Ctrl + click on file name
Vim: G or
:
And so on. Vim is optimized for code navigation, a mouse is optimized for intuitive navigation (but slower), and shortcuts kinda fill in the gaps.
If you just want to get up and running quickly, something like VSCode is a good option. That's what I did when I decided to help my team out with some FE TypeScript code, when I normally use something else. I actually installed a vim plugin for VSCode to get the best of both worlds.
But if you really want a fluid code navigation and editing experience, master something like ViM or emacs.
Oh, and I didn't mention one of the most powerful things in both ViM end emacs: macros. I use them a ton when manipulating text, such as converting JSON to a class/struct, or doing repetitive syntax changes that are just out of reach of a regex.
Proper VS Code shortcuts for the above cases...
Find next: Ctrl-f, F4
Find matching brace: Ctrl-]
Navigate to Top or Bottom: Ctrl-Home Ctrl-End
I think it's the same number of keys pressed as vim in every case.
Probably, and we could go back and forth based on features. My main point was that using the keyboard is generally more efficient than using the mouse, especially since my hand is already there.
So for software you use every day, master it. Master the keyboard shortcuts, learn how to customize things, etc. Maybe VSCode has an option for macros, IDK (I've used them with the ViM mode, so that's at least one option). Using the mouse should be a fallback, not the first option.
You raise a valid point. Personally, I used to read and write a lot of code, but I no longer do that. I still maintain a open source project, but my job no longer involves writing code that runs.
IIRC, the most useful functionality I used to use are:
I am quite curious on why go to beginning or end of the file useful? Also I am not sure that the basic find/replace is more useful than find usage/refactor.
Plugins are available for most popular languages. I rarely need to see the type of a value, and if I want to see the signature of a function, I usually want to go to the implementation as well.
I just use
grep
. I'm already in a terminal, so I have all of those features available. Since I use tmux, I just switch over to another pane and run my search there. For changing the name of a function (which is very rare), I just usesed
or do the change manually withvim $(grep ...)
if it's more than just a name change (usually I'm changing the signature too).I use a plugin for that, and it works really well.
Beginning of file: look for an import/constant
End of file: add new function, or a shortcut to the last brace to jump to the start of the class/function. I try to keep files small and single-purpose, so it's usually what I want (jump to end and match braces).
And yeah, I occasionally miss context-aware search/refactor, but again, it's so rare that it's not a big deal. I save far more time with macros than I lose doing manual renames. If I know I'll be doing a lot of that (and usually it comes in bursts), I have VSCode installed as well. But I don't launch it very often.
My whole workflow is very command-line oriented, so using a GUI tool just gets in the way for me.
That is valid man, we all have different workflow, hence different priorities.
Yup, use what works. Most of my coworkers use VSCode, and I'm the oddball with ViM (though I have VSCode installed w/ ViM extension).
Whatever you use, master it. I recommend learning some CLI editor in case you end up needing one.
That is great advice. Vim was actually the first editor I properly learned. I find many of the keybinding very nice and useful especially for cursor movement.
I eventually moved away from it since I find I spend more time learning it than using it. I personally dont use that many feature of a editor, I find IDE features more important to me.
But I still have many global keybinding inspired by vim, like ctrl + jkhl;^ for cursor movement. They are absolutely essential for me at this point.
Hjkl is the one core ViM feature that I actually rarely use. I use Dvorak keyboard layout, so those keys are in an awkward location, so I use other movements instead.
I have just enough IDE features in ViM that I don't feel the need to switch for most tasks, and if I ever did, there are plugins that fill in the gaps.
So I guess we're just opposite sides of the same coin. :)
You can also use Debian 1.1 but the makes zero fun as well.
Why make your own life hard for no reason. VIM is really really outdated when it comes to ease of use.
There is not a single thing where vim is better in any way. The argument that it is faster is the biggest lie ever.
Example: I write a few hundred lines of python code and execute it but sadly made formal mistakes. VIM does not help a bit. It might take hours of bugfixing with help of a command line.
Python addon and some others would have instantly found those mistakes saving myself a lot of headache.
That’s the same comparison as the senior developer and the normal dev. The dev might type twice as fast but making 5 times the mistakes he still needs a lot more time than the slow index finger typing senior.
Vscode is written in JavaScript and running in a web browser. Vim is written in C and runs at a console. Of course Vim is faster. Vscode is a hobbled cripple by comparison.
The rest of your comment suggests you are ignorant of vim with plugins and command line tools. I've tried vscode and while it looks nice, I am far faster when developing with vim and a couple of open terminals.
IDEs like VSCose are only powerful because they integrate coding tools like LSPs and completion enginea. Those tools are also available on neo/vim or Emacs, so you can be as proficient as you were with VSCode. Hell, even GitHub's Copilot is available on vim!
And frankly, having started coding on Atom before switching to neovim, I find a keyboard centric, mode-based coding much more efficient than a usual mouse-centric workflow.
It really boils down to personal preference, but I'm eager to find some objective arguments proving that "vim is outdated when it comes to ease of use", because that's not what I experienced.
This is incorrect. Vim and neovim can reach the same level of functionality as VS Code through plugins and extensive configuration. An experienced vim user with plugins is as fast as an experienced VS Code user with plugins.
Getting vim experience and customizing it has a much steeper initial investment. That’s where the disconnect is.
There is an argument to be made that completely mouseless development is faster. This also requires a steep initial investment to pan out.
What features are available in vim that aren't in vscode? Genuine question, trying to decide if I should make the switch
This is probably going to sound a bit silly, but legitimately the fact that it's installed on most Linux systems by default (and if not full blown
vim
, thenvi
- or rather,vim-tiny
often). VSCode has the Remote SSH extension, but the last time I checked it automatically installed the VSCode server (?) binary on the remote system. Often times I'm administrating systems that aren't mine, and do not want to leave random bits of VSCode onto it. Even if that weren't the case, its a lot easier for me to just open a file in vim since I'm already at a shell, rather than having to open VSCode, then wait for it to initialize (though it is quick!), activate Remote SSH and connect to the server which triggers the same initialization since it has to start the server-side component.Another probably silly sounding reason is that the keybinds are the same ones that you use in a lot of POSIX tools like
man
,less
/more
, Firefox even uses/
to activate quick-find (while you're not in a text field of course) though admittedly I believe that is the only one, hell even bash itself if you useset -o vi
(by default its in Emacs mode - this is actually a feature of the readline library that bash uses as far as I understand).Though admittedly, those mostly are Linux/Remote Administration reasons and doesn't apply to everyone - but those were some of my initial motivations.
vim is not outdated, it was easy to use to begin with and could not be optimized any further. Yes, there are plugins/extensions/... to add more features, but on a basic install of vim you have everything you need to navigate source code and config files.
Emacs isn't super great for C#. The language server is a bit hit and miss.
Am I going to be judged for admitting I use KDE Kate on here?
Kate is outstanding
Are there extensions for Kate as there are for VS Codium?
Not remotely as many, but yes. I find that for the work I do It's more than adequate.
Nah Kate is fine if it works for you :)
Personally though, I use Kate. Ain't got time to learn new keybindings