C++ Coding with Neovim - Prateek Raman - CppCon 2022

  Рет қаралды 52,436

CppCon

CppCon

Күн бұрын

Пікірлер: 81
@ruadeil_zabelin
@ruadeil_zabelin Жыл бұрын
I'm looking forward to this talk! I have used vim in the past years ago with varying amounts of success. I'd be interrested to see where things stand nowadays
@ultradude5410
@ultradude5410 Жыл бұрын
Neovim is absolutely amazing! Clangd is just the coolest.
@wuhanyu193
@wuhanyu193 Жыл бұрын
Vimer gets to cppcon finally
@toufikoran8416
@toufikoran8416 Жыл бұрын
they were always there
@teej_dv
@teej_dv Жыл бұрын
Thanks for the shout outs 😁
@vvnraman
@vvnraman Жыл бұрын
Thanks a lot for your videos 👍I binged them all in a week !
@michaelmueller9635
@michaelmueller9635 Жыл бұрын
great stuff
@vikingthedude
@vikingthedude Жыл бұрын
Thank you for kickstart
@unknownboi9084
@unknownboi9084 2 ай бұрын
omg the neovim legend himself 😭😭😭😭😭
@mockingbird3809
@mockingbird3809 Жыл бұрын
Thanks for the tip on the fuzzy find of symbols in a file. Loved that one
@sandrokakulia5112
@sandrokakulia5112 Жыл бұрын
Very interesting talk. But it would be really great if you can share your neovim config, especially the configuration of LSP and integration with clangd. It does not work out of the box and setup does not seams to be easy.
@VOLTRIZZZLE
@VOLTRIZZZLE Жыл бұрын
Instead of using "invoke" in terminal, you can use makeprg and vim-dispatch to run the build or test in the background and put the result in the quickfix list. I just type ":compiler " in command mode, and it looks in my .vim/compiler directory for a .vim script to execute. The scripts don't have to execute makeprg.... some of my scripts just set environment variables, that other compiler targets use (such as BUILD=debug/release). That would be an easy way to build and run unit tests for the current buffer.
@ritheshravikumar8314
@ritheshravikumar8314 9 ай бұрын
Thank you for this talk Prateek! Very insightful and I learnt a lot :)
@CharlesHogg
@CharlesHogg Жыл бұрын
I'm partway through the talk, and looking forward to the rest! But I think you could improve your keylogger settings. The "x2" is distracting and confusing. For example, at 13:46, compare "g+x2 he" to "g++ he": the latter would be far easier to understand at a glance.
@vvnraman
@vvnraman Жыл бұрын
I'm using the carnac utility for the keystrokes. It didn't seem like I could make it do what you're suggesting. Do you have any other utility I could have used?
@oschonrock
@oschonrock Жыл бұрын
I am an emacs user. I never use Vim or NeoVim. Just for the record, the experience in emacs with LSP is VERY similar. Merely the (obviously customisable) key bindings differ. It seems these two eco-systems are now on a par. Great to have alternatives.
@therealchonk
@therealchonk Жыл бұрын
I use both emacs and {n,}vim. I also use evil keybindings for emacs.
@stephenbrennan1903
@stephenbrennan1903 Жыл бұрын
I gave up on Doom Emacs because I couldn't get dap working with C++ :(
@vikingthedude
@vikingthedude Жыл бұрын
@@therealchonk which do you prefer?
@romangeneral23
@romangeneral23 19 күн бұрын
@@stephenbrennan1903 Same
@davidlu5921
@davidlu5921 Жыл бұрын
21:01 C++ WORKFLOWS WITH NEOVIM
@jcbritobr
@jcbritobr 11 ай бұрын
😂
@yuehuajia3176
@yuehuajia3176 11 ай бұрын
I have watched 4 times. learned a lot.
@darklightnessful
@darklightnessful Жыл бұрын
I think the invoke python is a bit unnecessary to build your project since cmake can do all what you have showed.
@mikhailfandyushin3326
@mikhailfandyushin3326 Жыл бұрын
Interesting method to use the invoke for setup cmake project. Is there topics about this?
@eddyecko94
@eddyecko94 Жыл бұрын
I have my own bash script that does all that cmake stuff. Invoke is a replacement of that, it seems cool
@spaxio
@spaxio Жыл бұрын
I'm not sure, I understand stress during presentation but editing in vim seems so very slow in this video.
@badsham227
@badsham227 Жыл бұрын
cant wait!!
@ashrasmun1
@ashrasmun1 10 ай бұрын
dotfiles? I cannot use vaf or vif in my neovim with LSP setting, so I wonder how did he set it up :O great talk!
@rls__
@rls__ Жыл бұрын
One hour to begin writing in a source file. One more to put a breakpoint.
@tissuepaper9962
@tissuepaper9962 Жыл бұрын
And compare that to dozens of hours spent fighting against settings menus and vague userland error messages in graphical IDEs. Text-interface tools take a lot of upfront investment of time, that's true. The return on that investment the ability to quickly perform complex tasks, automate them, customize them, etc. Try automating a graphical settings menu, it can be done with AHK but nobody would call that solution "elegant", would they.
@downed731
@downed731 Жыл бұрын
you're quite optimistic
@rls__
@rls__ Жыл бұрын
​@@tissuepaper9962 I generally donot struggle with menus and I suggest the quick search feature modern editors provide if someone does. I see the value in automation-ablity of text interfaces for certain things, but I donot see the value in integrating them in the editor itself. Most of the time I spend on is spent on editor and debugger. They are the tools I need to work 100% of the time. And if I need any command line-y tools, I simply switch to the terminal if I need to use them. It dosent happen every minute. The context switch cost is minimal.
@夕阳-n1h
@夕阳-n1h Жыл бұрын
Except you can just use a framework line lunarvim of spacevim. The video is just to explain the capabilities.
@alex_granny
@alex_granny Жыл бұрын
Thanks!
@mytech6779
@mytech6779 Жыл бұрын
I like kwrite or kate as an alternative to notepad++ when I want a basic editor window with some language highlighting. It can be used in a regular mode or in vim mode.
@DFPercush
@DFPercush Жыл бұрын
mhm. Kate has a LSP client and gdb integration, too. I really wish he'd talked about debugging with nvim though, that's what I'm currently stuck trying to figure out.
@littlecurrybread
@littlecurrybread 11 ай бұрын
@@DFPercush this is my current pain point. I want to debug inside of nvim, there’s a dap plugin but it’s buggy for me.
@mytech6779
@mytech6779 9 ай бұрын
​@@DFPercush That is good to know about kate. I tried some fancy nvim setup the other day with a bunch of coding assist plugins, It did not like the huge file I opened. Every modification would take seconds. vim was quick with the same file (But only syntax highlighting, no completion or suggestions), but vim did take a lot longer than nvim to save and exit. The file was around a million lines, I was experimenting with unrolling an iterative function to test both the optimizer and general performance. Both Clang and GCC aborted the compilation, clang just said "killed" and G++ claimed a segfault (Which may be a bug in GCC but I haven't bothered to report it yet). Each statement just had an add and a decrement.
@textverse
@textverse Жыл бұрын
is Neovim also single threaded ? I am longtime Emacs user but lsp performace is making me crazy in every editor ?
@jacksonludwig7848
@jacksonludwig7848 Жыл бұрын
neovim is single threaded but async reads from the external lsp servers. The lsp should never freeze/block your editor
@bobbills5312
@bobbills5312 Жыл бұрын
indexing the project is multithreaded, running diagnostics on an opened buffer is single threaded but that is because of how gcc/clang work when compiling a single file, but it is in a separate thread from the UI so you can continue working while the diagnostic is done.
@richardvonlehe4581
@richardvonlehe4581 6 ай бұрын
Is Neovim+tmux a viable path for Windows development? I can see Google telling me you can get it to work with git bash or Msys2, but does anyone do this?
@bonafontciel
@bonafontciel Жыл бұрын
Tmux + Vim user here for over 10 years. I’m here to see why should I move to neovim. I really don’t care about all the noise from the other tools he is using
@henryallenlaudemilk5161
@henryallenlaudemilk5161 Жыл бұрын
Because of Lua IMO. Lua is like a superpower for plug-in authors. Just compare vim plugins to their neovim equivalents written in lua.
@Tachi107
@Tachi107 Жыл бұрын
@@henryallenlaudemilk5161 vim now has vim9script, is Lua still that much better, and if so, why?
@tonystroemsnaes554
@tonystroemsnaes554 Жыл бұрын
@@Tachi107 Probably not, but the fact is most active plugin authors have jumped to neovim now, meaning vim will be lagging behind on new & performant plugins, with few authors that port lua plugins to vim9. Neovim is simply the better choice, as it supports both lua plugins and vimscript (now also vim9script).
@ruadeil_zabelin
@ruadeil_zabelin Жыл бұрын
The only thing I'm seriously missing is "Implement method(s)", and add overriding members automatically. Is this supported? So basically I hate typing. I want to type out my class interface and then just have the IDE generate most of the cpp file for the methods I just typed in the header. Visual Studio with resharper can do this amazingly.
@bobbills5312
@bobbills5312 Жыл бұрын
GPT or copilot will solve that for sure :)
@bew
@bew Жыл бұрын
Make an issue on clangd's repository, maybe they'll add it!
@min-eq5pr
@min-eq5pr Жыл бұрын
impressive
@NematjonAbdulloev-d1w
@NematjonAbdulloev-d1w Жыл бұрын
I can not setup this way of tooling. Is there any video or tutorial out there ?
@DFPercush
@DFPercush Жыл бұрын
Btw, you might also need the system packages 'xclip' (for x11) or 'wl-clipboard' (Wayland) for clipboard integration with the rest of the system. That gives you access to the "+ buffer.
@stormsoendergaard3023
@stormsoendergaard3023 Жыл бұрын
**Laughs in Visual Studio
@AleksanderHryniewiecki
@AleksanderHryniewiecki Жыл бұрын
Anyone knows what's this bash plugin? Looks pretty cool
@vvnraman
@vvnraman Жыл бұрын
The bash prompt is using powerline-go. Another alternative to achieve something similar is the starship prompt.
@MrEdwardSP
@MrEdwardSP Жыл бұрын
I would say combos of zsh + ohmyzsh + powerline10k will be the way to go~
@thegod3500
@thegod3500 Жыл бұрын
cool
@damiengerard1485
@damiengerard1485 Жыл бұрын
debian: apt install clangd. done :)
@romangeneral23
@romangeneral23 19 күн бұрын
Gif not Jif
@BS-my2ky
@BS-my2ky Жыл бұрын
Does neovim support intellisense for c++?
@henryallenlaudemilk5161
@henryallenlaudemilk5161 Жыл бұрын
Yes. Through LSP
@jcbritobr
@jcbritobr 11 ай бұрын
Not good. Very complicated talk.
@caret4812
@caret4812 Жыл бұрын
it's 2022, and nerds still think point debug in vim after 20 hours of copy pasting shit from everywhere is earth shattering....guys, get a proper IDE or use vscode or something, it's not the stone age anymore...you can get these "features" and much more for pretty much all languages in less time and less effort
@bobbills5312
@bobbills5312 Жыл бұрын
in the past year I have only opened a debugger less than 10 times, and it is mostly to see the backtrace from where abort was called. Just write your damn unit tests.
@夕阳-n1h
@夕阳-n1h Жыл бұрын
if you are too dumb to use neovim say so
@JayPatel-ce4jp
@JayPatel-ce4jp Жыл бұрын
There is a place, if I want to develop directly on embedded Linux devices I using regular code editors and IDEs are wayyy to laggy
@gulagz1549
@gulagz1549 Жыл бұрын
No config files. Down vote.
@josemonge4604
@josemonge4604 Жыл бұрын
I don't think it's worth the amount of time invested into learning such a tool. Plus I really don't like the different editor modes. I think it was poorly thought through from the developer and user experience POV, like moving cursor using letter keys(that's why you have the arrows for!). I've tried vim and neovim and I feel more comfortable using VSCode. The extensions are way faster to setup, I also prefer many of the default key-bindings,e.g. like shift-down to copy a line down instead using of typing "d" and the number of lines and then "p". I don't think TUI based editors aren't well suited when you want to work in tandem with web browsers,mobile apps or other GUIs. Also text editors shouldn't require almost an university degree to learn how to use them properly.
@mapron1
@mapron1 Жыл бұрын
These editors are can be worth investing if paid for code lines and write them a lot. Like 2000 lines per day or something. In my C++ job, I write 15-20 lines at average, I can write them using text-to-speech and still have same efficiency. Most time spent on navigating and understanding the code. That's why (for me) is more important to have proper code model tools (navigation, completion) and you just pick up IDE that suck less with it.
@xtra-medium
@xtra-medium Жыл бұрын
Modal editing isn't a poorly-thought-out workaround, it's one of the central tenets of vim's design. It's an extension of Unix philosophy and 'text as the universal interface'. Any text editing is communicated via strings (sequences of key presses) that describe the desired action, rather than a stateful approach of moving around cursors and inserting/deleting. The editing grammar is highly composable, which gives you a lot of mileage every time you learn (or add, via plugins) a new operator or text object/motion. It also makes repeating actions or recording macros a viable option - you're not stuck repeating the exact same character-for-character modifications, but instead a more abstract vocabulary of nouns and verbs. And because it's just text, you can spit your edit history into a buffer, make some modifications, copy it back into a register, and execute those actions again as if you typed it from scratch. The paradox of vim is that beginners are often unconvinced that it's worth the significant efforts to learn because it feels slow to them. Your first few weeks in vim are normal text editing, but with extra steps. It's only once you've started to master vim that its benefits start to become apparent, but by then you no longer need convincing. It's quite similar to C++ in the sense that it's super powerful but arguably hostile to novices. I do think the default keybinds are horrid, so I've remapped everything to make more sense to me. Moving 1 character/line at a time is quite slow; prefer more efficient ways to navigate text (the plugin hop.nvim is a personal favorite). But if you're using those keys properly (to just move one or two lines/characters away) then it becomes extremely valuable to have them right under your fingers rather than reaching for the arrow keys, or worse - the mouse. The compounding of all these small efficiencies is what makes vim so fast at editing text. And by extension, it's also what makes vim so slow for beginners because most people start off trying to use it like any other text editor. It takes a while before your net productivity turns positive again. It's understandable why some people turn back. But for those willing to make the mental shift and spend the time practicing, it pays huge dividends.
@sub-harmonik
@sub-harmonik Жыл бұрын
to each their own. However, the letters are only movement in normal mode when you aren't inserting anyways, so why not? Usually arrows are farther away and you have to move your hand. You're using the other letters for editing operations at the time after all. however, even in normal mode you can use the arrows to move by default so I'm not sure what the issue is.. Another nice thing is the knowledge that you could customize pretty much any behavior you might want. Of course some degree of customization is possible in any decent editor, but neovim is more than customizable. including different keybindings 😎
@rauldragu9447
@rauldragu9447 Жыл бұрын
I don't see why anyone who isn't already invested in such tools would switch to it either. I basically have the same setup using clangd, cland-format, clang-tidy, and cmake but inside vscode. I even have an integrated terminal one shortcut away, and while I don't use other languages that much, I'm sure the support for them is as good as anything vim has to offer. Hell, if you wanted to, there is even a vim extension for vscode. He hasn't presented a single feature that I don't already have access to inside vscode. So basically the only differences between them are the look, the unintuitive keybindings, the performance (electron does suck for that, but if your pc can compile c++, it can probably also run vscode), and the way in which people develop extensions (lua vs browser extensions). On that last one, i would expect vim to be more customizable, but if your end goal is a vscode-like editor, you can go straight to it.
@7xr1e20ln8
@7xr1e20ln8 Жыл бұрын
Hmm, so all the decades of development in Vi/Vim/nVim is poorly thought out?. And _Insert_your_ide_ is the perfect tool?.
@patlecat
@patlecat Жыл бұрын
vi and alls it's clones is only for masochists that have too much time.
@roseproctor3177
@roseproctor3177 Жыл бұрын
not all heroes wear capes
C++ Should Be C++ - David Sankel - C++Now 2024
1:28:49
CppNow
Рет қаралды 18 М.
0 to LSP : Neovim RC From Scratch
30:47
ThePrimeagen
Рет қаралды 1,3 МЛН
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
Пришёл к другу на ночёвку 😂
01:00
Cadrol&Fatich
Рет қаралды 10 МЛН
-memory-safe C++ - Jim Radigan - CppCon 2022
1:05:45
CppCon
Рет қаралды 22 М.
I tried Neovim Distributions so you don't have to
9:12
typecraft
Рет қаралды 163 М.
Deep CMake for Library Authors - Craig Scott - CppCon 2019
1:01:35
CppCon 2014: Mike Acton "Data-Oriented Design and C++"
1:27:46
Getting Started with C++ - Michael Price - CppCon 2023
57:55
You Should Use A Neovim Distro If You Are New
10:42
ThePrimeTime
Рет қаралды 162 М.
Neovim & Extensibility - My Talk from Jane Street
35:00
TJ DeVries
Рет қаралды 49 М.