free html hit counter
Posted on: Thursday, August 4, 2022 by Rajiv Popat

Making Neovim Work Like Visual Studio Code On Windows

I did a video on configuring Neovim on Linux to make it work like Visual Studio while doing .NET development. You know, intellisense, that nifty break point based debugging, the code refactoring options and everything else that you get with Visual Studio or Visual Studio Code, but only with Neovim on Linux.

My point? The OS space and the IDE space has been democratized. It’s a level playing field between companies and developers now have complete choice. Like vim or neovim for than Visual Studio? You don’t ‘have to’ use Visual Studio to do .NET Development. When that happens everyone wins, because having the freedom to choose, is a good thing.

Some folks who saw that video remarked that they love the idea of using neovim as a powerful IDE but aren’t ready to switch the OS and move completely to Linux yet. Like I said, the OS space is democratized. So if you want to mix and match and do .NET development on Neovim and still use Windows as your operating system, power to you. This post will give you some pointers in that direction.

You start by installing Neovim on Windows from here.

Like Linux you now have package managers in windows. Neovim is available both on chocolatey and winget  so whatever package manager rocks your boat, you should be able to install neovim using a single command. Instructions here.

Unlike Linux, the neovim initialization file in windows is @ C:\ Users\ [Your_User_Name_Here]\ AppData \Local \nvim \ init.vim (without the spaces).

The file for my configuration on windows 11 is here. You can download it, tweak it and place it in the folder above to quickly configure your neovim. Don’t forget to do a “:PlugInstall” to install all the plugins configured in the file automatically.

I’ll not cover the different components you need for .NET development on Nvim. This video already covers that. Let’s just focus on the changes when it comes to windows.

You’ll probably need to install python for Nvim for some of the plugins to work. You do that by installing python, pip and then doing:

pip install neovim

Once you do that, most plugins that depend on python should work.

Strangely enough, unlike Linux, McAfee on windows sees FZF as a virus and blocks it. I let the guys at FZF know, turns out they have worked on getting this whitelisted, but McAfee continues it’s little quirks; so your milage might vary. For me McAfee still has an issue and because my organization enforces McAfee, I had to move to ctrlp for searching files. The overall idea is the same, Fuzzy search for file names.

Then, I had to strip out Ag, because there seems to be no support for Ag on windows. The documentation for using Ag in windows is practically non-existent. So fuzzy search inside files is a problem and doing “search in entire solution” (like I often do in visual studio) is hard. We have to tackle this separately using something else. Enter Ack.

The plugin installation for Ack is here and the ack installation is here. The URLs have detailed instructions on how to install for windows. You have to install Perl for this to work if you don’t have that already. Once the Ack Plugin is installed you should be able to Fuzzy search contents inside all files in your current folder or solution by doing Ack [search_term]. For example below I am doing a search on the word manger inside my entire codebase using

:Ack manager

I see the line items (with files names) where the search item was found and I can navigate to each of the search result by using my arrow keys and preview it using enter / return key.

acksearch

So far if you’ve followed my entire series of videos on this topic and used my configuration file you should be able to write .NET code on neovim inside of windows. You should have full intellisense, code refactoring options like you have in visual studio, fuzzy logic based file navigation, fuzzy file search and even debugging.

Oh, and don’t forget to get a nice nerd font with ligatures to make that console and your Neovim based IDE prettier.

Again, if you haven’t seen the full video series on dotnet developing using neovim, I highly recommend you watch that here. Rest of the steps for setting up neovim as the IDE for .NET are the same in windows even though the videos use Linux.

With just the tiny tweaks described in this post .NET Development using Neovim pretty much works, even on Windows. All the richness of C#, familiarity of Windows and the productivity of Neovim. Enjoy.

posted on Thursday, August 4, 2022 3:14:25 PM UTC by Rajiv Popat  #    Comments [0]
Posted on: Wednesday, August 21, 2019 by Rajiv Popat

Fixing Gripes And Electric Shocks from Your New Television.

My wife and I are not into television and have not had a television for a very long time. A couple of months we bought our first new television in five years.

Both my wife and I were not sure how much time we would actually spend in front of it and hence the decision to go Froogle. That and I wanted to be able to control my devices and something like a Raspberry Pi is much more customizable than a locked down android television. We settled for a regular, not smart Vu TV and then build our own media center using a Raspberry Pi.

The TV is a 49 inch Grade A+ panel. So the display hardware is not Ultra-HD but on the Full HD side it is as good as it gets. Pretty nice and does what we need it to at a price that's almost half that of a Sony. Very soon we run into a couple of bumps:

My TV is Shocking Me! Strange Electric Shock on the Television Frame:

I initially start with the assumption that this is an issue with my earthing and call an electrician who tells me that my earthing is just fine and the TV is flawed. He asks me to file a request with Vu and walks out.

I look up the forum and discover there are even more expensive TVs out there that have the same issue. I call up support and they replace the TV but the new one has the same issue. This time around they can give me a refund but aren't willing to help with fixing the issue.

Frustrated I end up deciding to put some basic electronics they teach you in class eight to use. The idea is that the TV missing grounding unit that would connect the current flowing with the grounding socket inside the TV but we can do that externally without even opening the TV.

So let's buy a 50 cent copper wire from a local electric shop. Next, we find a spot on the TV that has electric current running through it. In other words, the area that shocks you. You can test this with a regular tester. We tie one end of the copper wire to the frame that has the shock and screw it up securely behind a screw that holds the TV mount.

The other end goes to the earth pin. The  basic idea here is that since the TV does not provide for any grounding or earthing we earth the current running externally on the TV frame directly to the earth pin of the 3 point socket. This works for countries that support 3 pins and the 3rd pin is for grounding.

With the earth pin wound with the copper wire you ensure that any current running through the frame of the television runs through the copper wire, grounding pin and is eventually earthed effectively ensuring you don't get shocked which you touch the TV frame.

That actually works. I touch the TV and no more shocks. I guess Vu is skimping money by not grounding their circuits, but a 50 cent copper wire fixes that. We now have a really simple home made earthing on the TV frame. No more shocks. And the end product looks pretty elegant with the copper wire concealed behind the TV:

The overall result looks pretty neat and you can barely see the copper wire running from the back of the TV frame to the earth socket. Yes, the Pi and the Firestick and all those wires still need to be organized and concealed but the copper wire itself is that tiny green bit you see in the picture. Nothing objectionable.

I've seen a bunch of articles out there about TVs and monitors shocking people but no solution as such and I hope this helps someone who has a similar problem in future. It's simple class eight electronics you might have learned in your physics class put to some basic use.

Strange Skin Tone

The other day my wife and I were watching a stand-up comedy show and the skin tone of characters seems a little… artificial. Turns out this setting is controlled by something called 'Tint' in most TVs and the default Vu settings don't allow end-users to modify tint settings. The tint option is disabled by default, which means you can't change the setting:

When I first see the setting, I realize it's bumped up all the way to 100 and no way to lower it. I wear my nerd glasses and hop on to a special hidden service menu most Vu TV's provide which can be reached by going to the sound setting menu, clicking on sound balance and then typing 1969 on the number pad in your remote. For some reason the folks at Vu like the year on the moon mission and have picked that to open up secret service menus on the TV:

Notice that this mode is pretty powerful and pretty much allows you to control most tiny aspects of the TV a regular user may not even care about.

Once in, you can tell the TV to not use any special intelligence for skin tones by turning off the tint setting (which you are completely allowed to do in this secretly hidden service menu):

I turn the tint down to zero using the special service menu and the problem is gone.

The Backlight is still way too strong:

The backlight of the TV is still too strong and hurts my eyes. Vu doesn't give any option to change that. Even the service menu doesn't have any backlight settings. I panic and think of returning the TV.  But then service menu allows me to change the RGB gain on the LEDs which are all bumped up to 100 by default:

I realize if I bring those down proportionately I can control backlight of my panel. I do just that. The backlight goes much smoother and the strain on my eyes is gone.

Sorted.

The AI Is A Little Too Smart.

AI is the new thing and most TV's want to run the race of adding AI to their picture rendering. Companies like Vu however mostly do a mediocre job at it. The good part is they let you turn this off by disabling noise reduction setting to off.

Much better.

Love-Hate Relationship With My TV

At this moment I have a love-hate relationship with my TV. I love gadgets which I can customize and root into. Most phones I've owned thus far, are rooted. The service menu of Vu essentially gives me root access to the TV and is very powerful. I dig that about the TV.

The fact that I can hack into my TV and have complete control over my TV makes me feel powerful.

The fact that Vu doesn't handle this little gripes out of the box and expects end users to wear their nerd glasses on to fix these issues make me a little annoyed. Meh!

Either way, all my problems with my TV are sorted and I have a two year extended warranty during which I can return the TV if I face any additional issues. So for now, this will have to do.

If you are thinking of buying a Vu TV - here is my honest advice: Buy it only if you are willing to wear your nerd glasses on and do a little bit of tinkering with the TV, both on the hardware and software front. If you are expecting it to work out of the box like a flawless appliance, Vu isn't for you.

Having said that, the TV is a Froogle choice and once you've made the modifications you feel really happy about spending half the money than what you would have spent of other TVs and getting similar picture quality and overall experience.

Couple the dumb TV up with a Firestick TV (which I bought at discount on Amazon) and a Raspberry Pi 3b+ (bought locally) and you'll have a full-blown smart TV with a pretty decent media center, but that's a whole new post in itself.

Being a Nerd Helps.

This post was just about my gripes and issues with Vu TV and how to fix those. If you own a Vu (or any other TV) and are facing similar issues (particularly electric current running through the TV frame), feel free to use some of these fixes and let me know how it goes.

If your TV just works fine, you can still take solace in the fact that even though most of what you buy or download online today is broken it can be fixed with a little bit of tinkering and geeking.

There is value in being a nerd today. You can stop feeling bad about being a geek. Being a geek is no longer a curse. In today's world it is actually a blessing.

Now go fix something that's broken.

posted on Wednesday, August 21, 2019 9:16:26 AM UTC by Rajiv Popat  #    Comments [0]
Posted on: Monday, April 29, 2019 by Rajiv Popat

Moving Forward With Keystone Habits.

Have you ever wondered why your life, literally and physically, moves out of balance when you are going through a stressful time? Your diet is usually the first thing to go out of control. You stop cooking, and even when you eat out you stop taking the right decisions and start picking all the wrong foods.

Your closet, room and home is usually the next thing to go out of control.

Give me your diet journal for the last one month and I can probably tell you how productive or nonproductive your month was. Let me visit your home on a surprise visit and I'll probably tell you exactly which phase of life you're going through.

And then as these little things go out of control they create a cycle of more panic and anxiety in your life, which in turn leads to more things going out of control.

On the other hand, have you also noticed how doing just a few simple things, can have  a profoundly positive impact on your life and your self-confidence? For example, when you consistently wake up early in the morning, work productively (just for a couple of hours a day), when you consistently eat right, play music, workout; go for a run; or do whatever it is that you do; life feels so… awesome and even your work life and productivity begins to improve.

All of us has at least one thing which if we do right and consistently, we feel in control of our lives and when we don't do that one thing… that's usually a sign that we are losing control and going into a state of depressed helplessness.

That one thing can be different for different individuals. For some, it's waking up early. For others it’s making their bed after they wake up. For many others I know, their daily workout happens to be that thing. Everyone is different but most people have at least one thing which creates a perception of control for them. It makes them feel happy, makes them feel like they are in control of their lives and doing that one thing, makes them feel strong.

We are creatures of control. In an uncertain world where most of us have very little control over anything, including our survival, any perception of control that we can create for ourselves makes us feel safer and stronger than folks who are unable to create that perception.

In the larger scheme of universe where you are an insignificant speck of dust, who  could cease to exist because of a simple road accident, an illusion of control makes you believe that what you do matters and as a result of that, you matter.

If you can pick up one habit, and stick to it, even when life throws its shots at you, you are telling yourself that you take active deliberate decisions and your life runs on those decisions; not a random chain of events controlled by mere chance. You are taking a stand against helplessness.  This is why social scientists call these keystone habits.

This is why when you pick up a keystone habit your life starts to change. For example, most smokers who cultivate the habit of running quit smoking. Most folks who start working out or practicing a musical instrument get better at their work life.

You might say that the perception of control is just an illusion, and I might even agree with you, but that perception of control is exactly what allows us to get up in the morning and go to work. That perception of control is what allows survivors to fight dreadful diseases and even though this would sound a little cliché I would argue that this perception is exactly what powers most of our space programs and allows individuals to climb mountains. Of course rockets have exploded in the past and people have died while climbing mountains but that perception and illusion of control is what enables the astronauts and the climbers to roll the dice, take a chance and succeed.

I have a personal theory that as nerds most of us love programming because in an uncertain world, programing computers creates a perception of control and that perception makes us feel strong and empowered. Hey, we can't change everything, but at least we get to control what's behind the screen of that machine.

All my life, one of the most valuable things I’ve learned it is the idea of inching forward slowly and yet consistently using keystone habits and creating a perception of control is your only chance at that forward movement.

This is why every time I start feeling a sense of helplessness, I fall back to some of my keystone habits to regain that perception of control again. I start writing code each day; I start my daily work out session and I come back to this blog and start writing consistently. And I begin reading. These are four keystone habits that help me inch and claw out of dark and depressing times.

And before I know it, I feel empowered to change things and I'm control. I know the control is just a perception but it still works magically when it comes to taking me out of a state of helplessness and making me productive again.

What are your keystone habits? Did you do them today? Did you take a stand against the punches life throws at you, and actively take out time to do something you committed to? If not, please give yourself a moment today to think about which your keystone habits are and then make an active effort to execute on them.

I won’t say it’ll change your life, but if you are experiencing a sense of helplessness, there is a good chance it’ll pull you out of it and empower you to change things. One inch at a time. This is your way of telling yourself that you may not be in control but at least you are not completely out of control either.

Go on. Pick a few keystone habits and give them time, consistently. There is a high chance you may regain your perception of control and life will begin to come back in balance soon. If you haven't given keystone habits a chance, you should. I wish you good luck.

posted on Monday, April 29, 2019 3:41:20 AM UTC by Rajiv Popat  #    Comments [0]
Posted on: Sunday, May 27, 2012 by Rajiv Popat

Geek Awesomeness: The Power Of Progress.

"I was feeling sick when I came in! Now that I've got some much done I'm feeling some serious energy".

(Overhead at work).

The pleasure of being productive and making progress, is for lack of a better word, magical.

Pure Geek Awesomeness.

(Back to work now).

posted on Sunday, May 27, 2012 1:31:56 PM UTC by Rajiv Popat  #    Comments [0]
Posted on: Thursday, January 26, 2012 by Rajiv Popat

Geek Awesomeness: Deep Intellectual Conversations.

Geeks aren’t wired like the rest of the race. Even their awesomeness is different from the rest of the race. While you might love to party, your geek craves a deep intellectual meaningful conversation with just a couple of friends around small table in an open air food joint serving wholesome food.

No loud music. No distractions. No Dance. No risk of bumping into that socially awkward moment. That and a topic that is deeply intellectual and very intimate. That or just a ruthless battle of wits.

If socializing is what makes your geek more human, deep intellectual conversations with near and dear ones, are what make him who he is. If you really want to connect to your inner geek, find a friendly open air food joint with no distractions, invite a couple of close friends and trigger a deep intellectual conversation.

Watching hours melt away as you munch on wholesome food, enjoy the fresh air and enter into an inspirational or a deeply intellectual conversation with friends; pure geek awesomeness.

posted on Thursday, January 26, 2012 6:31:55 PM UTC by Rajiv Popat  #    Comments [1]