C# Vim Development Setup

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys as i was doing my better c-sharp series i got a little bit of interest in my setup for editing uh files and so i just wanted to do a quick video about that so i'm using neovim a hyper extensible bim based text editor uh bim is a modal text editor so you have different modes we're in all mode right now you can see at the bottom left this is insert mode where we're typing normal modis for moving around and the way you move around in vim is like with uh motions and motions can be a bunch of different things the important thing about vim is that words are kind of treated as objects um and not just words there's like paragraphs and lines and different things so you can like use motions to navigate objects basically so if i wanted to go two words up there you go i'm two words up if i wanted to go 10 lines up i can go 10 lines up so you can like combine numbers with motions like motions are like hjkl to move around and then like w is a word b is backward what else uh you can go to the top with double g and go to the bottom with capital g so those are motions and then you can do things with motion so you can like have commands that you do with motion so like uh like change inside word to change a word for instance um you can change a paragraph which is like a group of lines that are all touching which is kind of weird you probably don't use that one much encode you can change like inside curly brackets or inside a string or inside uh parenthesis so all of those are like useful motions that are like super awesome i think mainly though like the idea is that you can navigate around super fast using your hands without taking them away from your keyboard and the motions like get super like ingrained in your brain it's kind of like a game it's made editing really fun for me i've been using it about three years and i i don't think i'll ever go back and even in other editors like vs code there have been bindings you can get so it's like the same thing um you know down up with hjkl change inside curly brackets or change inside of string you know stuff like that so i'll always use bim key bindings no matter what editor i'm in um but yeah uh so but then by itself is just like a visual studio code with no plugins like it doesn't do anything special it's just the text editor so there are plugins that you can use to get all sorts of features for c sharp the main one i use is omnisharp bim which hooks up omnisharp to them and omnisharp is a language server that provides all the nifty features uh for c-sharp like uh it just gives like auto-completion refactoring tools stuff like that it's like semantically aware of a project and like all the like classes and stuff inside it so you can plug that into them using omnisharpvamp and that this is omnisharpvin it's pretty cool you can get you know completion run unit tests um all sorts of stuff find implementations like all the implementations of service collection uh that's a bad example uh find implementations of i config there's only one so it takes us to it um what else what if we want to find all the usages of add singleton uh it's collection no or singleton that's weird that it lives like that but anyway um all the usage is black maybe yeah that's a better example i can run tests for you it can do things like if you wanted to you want to bring in a using that you don't have you can use it to do that so you down there at the bottom left using system collections generic um it can do things like you know extract a method it can do uh renaming ads and stuff or whatever uh so it does all that kind of stuff all your normal like ide type stuff uh for c sharp specifically um and so up there on line 31 above us right here unnecessary using directive this leads us into the ale asynchronous lint engine uh which uses omnisharp as well um among other ways to provide a linting so normally it's like in the bottom left like it shows right here so like you you move your cursor over a line with an error and it'll like show you what the error is i have it set up to show right there in the buffer using i guess it's virtual text objects from neovim i don't think them has that right now but neovim does and so that's super useful um what else we have uh fuzzyponder fzf um so fzf is actually command line utility so fcf and what that is is like you can feed stuff into fzf and then it'll like let you use kind of fuzzy findings so if i want to go to music like that's you get back out of it standard out whatever the result is and fzf bim hooks up fzf to them and so you kind of see like a pattern here where like there's a command on utility or a server or something and it runs by itself and there's like a adapter that hooks it up to them so that's a very common pattern uh so yeah fcf bim you can use it to get around like uh like log brighter and you can see there's like a preview over there on the left i think there's some way to make that go down i don't know there's probably a hotkey for it but uh yeah you hit enter and you get there so that's fuzzy binding um with fcf nerd tree i use an error tree as well this is kind of like a tree view for whatever folder you opened up them in so it's super useful as well to be able to see like what's going on in your in your project and also a decent way to get around i use fcf as much as i can because it's faster um what else uh oh vimspecter so this is a d a way to hook up a debugger to them and so just like omnisharp is a provider of language servers using like there's a language server protocol which omnisharp implements to provide like all the cool stuff for c-sharp there's also a debug adapter protocol that like provides debugging stuff for different languages one of those is c-sharp c-sharp.net core does work um samsung has a net core debugger that hooks up to this thing you don't have to worry about that when you install it it it has like installation instructions you don't have to like worry about any of that stuff you just install it and it works um but anyway it hooks up to that using that debug adapter protocol and you can kind of see if we go to program.cs um it lets you set up like breakpoints and stuff so it's not set one there i'll set one in here um and then you can f5 and run if you have your hotkeys set up that way and then you know you get all your cool stepping and stuff oh i have modified this since the last time we ran so i should have built before doing that do you still get like your locals you can like look at local values and stuff like that so all your debugging needs are there um pretty cool um it has like an output terminal down there it's got the stack trace down there on the bottom left you can watch variables right there in the middle left and i'm pretty new to this so there's probably even more stuff that i don't know yet yeah so that's bim spectre so that's how you can get debugging and that like i just recently got that and it has been a game changer because i usually had to like open up visual studio code or visual studio to do debugging and that's super annoying so i think at this point i feel like them can be a full-blown uh editing experience for c-sharp and you're not like missing anything uh personally but like i said you can get them key bindings in visual studio and visual studio code as well so if you're more comfortable there by all means you know if you want to check that out check that out so uh i think that just about covers it i guess i will go into my vmrc uh see i think i had it open yeah upper one this is my vmrc it kind of like sets up all of your settings for them and like this is how you get your plugins and whatnot you just put them in here there's like settings for those plugins i'll just leave a link to mine i keep it in source control because i have it split across three different computers and i don't want to have to like copy and paste it so uh so yeah it's in source control i'll be going to that i think i have it built up yeah so this is it um i'll leave a link to that in the description as well so if you guys have any questions about it though feel free to ask um and uh yeah so i hope this has helped and i hope you guys will check out them it's super awesome yeah that uh if that helps feel free to drop a like and maybe uh subscribe if you're interested in the kind of stuff i'm doing here on the channel so thanks for watching bye
Info
Channel: Tony Dwire
Views: 5,025
Rating: 4.9705882 out of 5
Keywords: development, programming, C#, .NET, dotnet, .NET Core, dotnetcore, dotnet core, vim, neovim, omnisharp-vim, omnisharp
Id: qGl_Mb2C87c
Channel Id: undefined
Length: 10min 0sec (600 seconds)
Published: Sun Nov 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.