this post was submitted on 21 May 2025
95 points (94.4% liked)

Programming

20279 readers
578 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

I use vscode for my personal projects (c++ and a fully open source stack, compiling for both Linux and Windows).

I'm using the proprietary version of vscode (via the aur) for the plugin repository, but I've always envied the open source version...

Are there any tools that have made you excited?

Bonus points if they have some support for compiling with MSVC (or if you can convince me to ditch it for something else).

you are viewing a single comment's thread
view the rest of the comments
[–] astrsk@fedia.io 2 points 2 days ago (3 children)

Any advice? I’m trying to get a handle on it but I’m having trouble remembering anything or finding what to do in the first place.

[–] zweieuro@lemmy.world 4 points 2 days ago* (last edited 2 days ago) (1 children)

This advice will seem rather generic but this has worked for me. Background: I've been programming for a good 15 years in various languages and mainly in VSC and veeery long ago in the arduino IDE (I do not want to talk about those dark times).

  1. Get a pet project to try this against. Learning controls for the sake of it, is ... useless. If its just text, there is no intuition or goal. I chose to try and teach myself rust and go through the learnopengl tutorial again and change it to work with miniquad-rs. Maybe pick something you are familiar with! A new language is a rather tall order usually.

  2. Get a functional config and edit it. Personally kickstart.nvim is really nice for generic settings, but their setup of plugins, and especially LSP (language server config) is really hard to read and difficult to parse. My recommendation for setup:

2a. Copy thePrimeagen's config ( https://github.com/ThePrimeagen/init.lua/tree/master ) which he creates with this tutorial: https://www.youtube.com/watch?v=w7i4amO_zaE NOTE: The actual config is using lazy now instead of the plugin manager he has in the tutorial! the broad strokes are the same but e.g. there is no "after" for the plugins and some other details. What he says about general vim config is still correct tho. Also lazy is much simpler, no longer do you need like 20 different packages for each LSP. (edit: found what makes it work on my setup it https://github.com/nvim-lua/kickstart.nvim/blob/6ba2408cdf5eb7a0e4b62c7d6fab63b64dd720f6/init.lua#L487 its mason-tool-installer in kickstart)

2b. Make a subfolder like lua/theprimeagen e.g. lua/$USER.

2c. Comment out this line https://github.com/ThePrimeagen/init.lua/blob/158c9ccd652e5921cc6940205da6ed20776e7cc7/init.lua#L1 and instead require yours.

2d. open .config/nvim in VSCode (yes, it would recommend using something you know to edit)

2e. line by line, file by file, go through the config files and his video and add what you think is interesting. This took me a good 5h (a good days work) to get somewhat done.

2f. Also look at kickstart.nvim! Theprimeagen is a pro at this stuff so he has no descriptions for his keybindings! (Which you can add when you use e.g. vim.keymap.set("n", "<leader>pv", vim.cmd.Ex, { desc = "[p]roject [v]iew"}). ( The [] are just for niceness, no syntactic value). Why does this matter? -> Because kickstart.nvim has a config for the mind-blowingly useful which-key plugin ( https://github.com/nvim-lua/kickstart.nvim/blob/6ba2408cdf5eb7a0e4b62c7d6fab63b64dd720f6/init.lua#L302 ). Which shows hotkeys and their description while you play with em! Really good for learning!

  1. When making your config absolutely ignore anything that is not in the "top 10 things you do in any other editor". E.g. I really only need "go to definition", "go to file" (which is a telescope fuzzy find), "find references" or "rename". ThePrimeagen has really words of wisdom here "If its something you do rarely, fuck automating it, only automate it when its actually worth remembering the hotkey".

  2. In general you want to reduce friction between thinking, clicking and on-screen action. So anything like "oh what if I want to have a hotkey to rename a C++ header file AND its source file in one go" is a good deal too complex. Keep it super simple.

  3. learn how window jumping with stuff like :vsplit works in nvim, it works great!

  4. For Tmux, you only really need whatever this legend says: https://www.youtube.com/watch?v=vtB1J_zCv8I Sidenote: I made my first project a simple Tmux script that is exactly what fireship describes and launches pre-defined sessions. Works great!

  5. learn by doing :D

Struggles:

  • Moving with hjkl is painful at first, but believe me it is goddamn worth it. I deactivated the arrow keys and mouse clicking altogether so I don't accidentally do it. Also you will be using wb and tf mainly anyways! (word, back, to, find).
  • Learning the nvim internal file browser (netrw) is worth it!
  • Lua is nice but I have never used it before doing this a few days ago. After each plugin restart vim and check for any errors. If you copy something outdated or otherwise problematic you want to fail fast instead of end up with a tangled mess of configs that you need to throw out entirely.
  • Editing nvim configs while in nvim is dumb and really annoying. Just do it in VSC or something you are familiar with.

Random misc:

  • Insane plugins: UndoTree (which ThePrimeagen uses)

  • Insane keycombos: e.g. you are somewhere inside of "Some Really long string that you might wanna change or copy". normal mode. ' vi" '. -> v-> visual, i -> inside of, " -> whatever you wanna be inside of. It will select the entire string inside the ". Yes i know this is basic but this shit is SO useful. Works with ANY delimiter (afaik) like ([{

  • DuckDuckGo actually is navigate-able with hjkl! Pressing j to go down the results list is really useful. I am using hyprland so ctrl+tab focuses a browser window. Ctrl+t new window. Type in search. Enter. Go up and down down with jk. really nice, no mouse needed.

Links: The entire primeagen playlist: https://www.youtube.com/playlist?list=PLm323Lc7iSW_wuxqmKx_xxNtJC_hJbQ7R

kickstart.nvim: https://github.com/nvim-lua/kickstart.nvim/tree/master

Note: I would share my config but my dotfiles are on my own git server and have sensitive info inside I don't feel like cleaning out

[–] astrsk@fedia.io 1 points 1 day ago

Thank you! This is a wonderful post, I will take another shot this weekend and hopefully something will stick this time :)

[–] aquafunk 3 points 1 day ago

After being a vanilla vi then vim user for a long time before switching to neovim, I find folke's which-key plugin to be very helpful. If i begin a key shortcut combination (or press my leader key), it shows me all the keys I can press next, and again after each additional step of a multi key sequence, and what each key sequence does. it works for mappings Ive added (usually basically the defaults for a new plugin) but also the standard built-in preset keymappings (see the 'built-in' plugins for which-key) for things like window mamagement and motions, using/viewing the registers (what did I just yank?), even spelling corrections, which helps you learn and build muscle memory. Often I dont use a specific mapping for a while and this helps me find it, especially when I group mappings by plugin, and/or prefix all mappings for a particular plugin or task with an additional prefix letter, so they all appear as options when I get as far as rembering "all my debugging mappings start with my leader key, followed by d." By grouping tasks and plugins that way, I can press my leader key and see a list of where to go next, almost like browsing a menu hirearchy. "i dont remember which button to press after leader and d to toggle a breakpoint, but I know that's where I'll find it"

[–] CocaineShrimp@lemm.ee 2 points 2 days ago

@remindme@mstdn.social 9 hours