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

  Рет қаралды 55,626

CppCon

CppCon

Күн бұрын

Пікірлер
@teej_dv
@teej_dv 2 жыл бұрын
Thanks for the shout outs 😁
@vvnraman
@vvnraman 2 жыл бұрын
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 5 ай бұрын
omg the neovim legend himself 😭😭😭😭😭
@wuhanyu193
@wuhanyu193 2 жыл бұрын
Vimer gets to cppcon finally
@toufikoran8416
@toufikoran8416 2 жыл бұрын
they were always there
@ultradude5410
@ultradude5410 2 жыл бұрын
Neovim is absolutely amazing! Clangd is just the coolest.
@ruadeil_zabelin
@ruadeil_zabelin 2 жыл бұрын
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
@mockingbird3809
@mockingbird3809 2 жыл бұрын
Thanks for the tip on the fuzzy find of symbols in a file. Loved that one
@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.
@davidlu5921
@davidlu5921 Жыл бұрын
21:01 C++ WORKFLOWS WITH NEOVIM
@jcbritobr
@jcbritobr Жыл бұрын
😂
@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.
@ritheshravikumar8314
@ritheshravikumar8314 Жыл бұрын
Thank you for this talk Prateek! Very insightful and I learnt a lot :)
@oschonrock
@oschonrock 2 жыл бұрын
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 2 жыл бұрын
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 3 ай бұрын
@@stephenbrennan1903 Same
@mikhailfandyushin3326
@mikhailfandyushin3326 2 жыл бұрын
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
@yuehuajia3176
@yuehuajia3176 Жыл бұрын
I have watched 4 times. learned a lot.
@CharlesHogg
@CharlesHogg 2 жыл бұрын
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 2 жыл бұрын
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?
@richardvonlehe4581
@richardvonlehe4581 9 ай бұрын
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?
@mytech6779
@mytech6779 2 жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
​@@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.
@ashrasmun1
@ashrasmun1 Жыл бұрын
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!
@textverse
@textverse 2 жыл бұрын
is Neovim also single threaded ? I am longtime Emacs user but lsp performace is making me crazy in every editor ?
@jacksonludwig7848
@jacksonludwig7848 2 жыл бұрын
neovim is single threaded but async reads from the external lsp servers. The lsp should never freeze/block your editor
@bobbills5312
@bobbills5312 2 жыл бұрын
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.
@darklightnessful
@darklightnessful 2 жыл бұрын
I think the invoke python is a bit unnecessary to build your project since cmake can do all what you have showed.
@AleksanderHryniewiecki
@AleksanderHryniewiecki 2 жыл бұрын
Anyone knows what's this bash plugin? Looks pretty cool
@vvnraman
@vvnraman 2 жыл бұрын
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~
@spaxio
@spaxio 2 жыл бұрын
I'm not sure, I understand stress during presentation but editing in vim seems so very slow in this video.
@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.
@ruadeil_zabelin
@ruadeil_zabelin 2 жыл бұрын
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 2 жыл бұрын
GPT or copilot will solve that for sure :)
@bew
@bew Жыл бұрын
Make an issue on clangd's repository, maybe they'll add it!
@badsham227
@badsham227 2 жыл бұрын
cant wait!!
@BS-my2ky
@BS-my2ky Жыл бұрын
Does neovim support intellisense for c++?
@henryallenlaudemilk5161
@henryallenlaudemilk5161 Жыл бұрын
Yes. Through LSP
@rls__
@rls__ 2 жыл бұрын
One hour to begin writing in a source file. One more to put a breakpoint.
@tissuepaper9962
@tissuepaper9962 2 жыл бұрын
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 2 жыл бұрын
you're quite optimistic
@rls__
@rls__ 2 жыл бұрын
​@@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 2 жыл бұрын
Except you can just use a framework line lunarvim of spacevim. The video is just to explain the capabilities.
@alex_granny
@alex_granny 2 жыл бұрын
Thanks!
@bonafontciel
@bonafontciel 2 жыл бұрын
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 2 жыл бұрын
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).
@min-eq5pr
@min-eq5pr 2 жыл бұрын
impressive
@stormsoendergaard3023
@stormsoendergaard3023 2 жыл бұрын
**Laughs in Visual Studio
@damiengerard1485
@damiengerard1485 Жыл бұрын
debian: apt install clangd. done :)
@romangeneral23
@romangeneral23 3 ай бұрын
Gif not Jif
@thegod3500
@thegod3500 2 жыл бұрын
cool
@Kerojey
@Kerojey 13 сағат бұрын
1 hour wasted. WOW, you can use text editor to edit text. I didn't know that!
@jcbritobr
@jcbritobr Жыл бұрын
Not good. Very complicated talk.
@caret4812
@caret4812 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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.
(Neo)Vim Made Me a Better Software Developer
40:27
vim-jp
Рет қаралды 39 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 17 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 18 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 3 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 21 МЛН
Back to Basics:  RAII in C++ - Andre Kostur - CppCon 2022
44:17
Using vim as an IDE for Perl
48:06
PhoenixPerlMongers
Рет қаралды 4,6 М.
Building Resilient Multi-Region Service Mesh with Istio and Vault
1:24:40
0 to LSP : Neovim RC From Scratch
30:47
ThePrimeagen
Рет қаралды 1,4 МЛН
-memory-safe C++ - Jim Radigan - CppCon 2022
1:05:45
CppCon
Рет қаралды 23 М.
TypeScript Origins: The Documentary
1:21:36
OfferZen Origins
Рет қаралды 298 М.
The Observer Design Pattern in Cpp - Mike Shah - CppCon 2022
1:02:17
Build a Retrieval-Augmented Generation (RAG) system in PHP - Enrico Zimuel, Elastic
1:00:25
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 17 МЛН