95
What's your favorite IDE right now?
(lemmy.dbzer0.com)
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
Follow the wormhole through a path of communities !webdev@programming.dev
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.
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).
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.
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 usefulwhich-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!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".
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.
learn how window jumping with stuff like
:vsplit
works in nvim, it works great!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!
learn by doing :D
Struggles:
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 usingwb
andtf
mainly anyways! (word, back, to, find).netrw
) is worth it!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
! Pressingj
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 withjk
. 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
Thank you! This is a wonderful post, I will take another shot this weekend and hopefully something will stick this time :)
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"
@remindme@mstdn.social 9 hours