I want to talk about my initial Vim setup.

Srecko Kostic
3 min readApr 9, 2023

--

My project structure inside Vim
My project structure inside Vim

I was at my friend’s house a couple of months ago. I believe it was summer, and I saw him using Vim. I was amazed at how he could navigate and do everything using only a keyboard. I asked him questions like how he set it up, how he has a view like that, etc. I came home and tried to set up Vim. He helped me with some steps, like installation and a few others. We did that on my Linux operating system, Vim felt just odd, and I stopped using it after a couple of days. Then, a few days ago, I suddenly thought: “Use Vim.” So I did. I installed GVim using the Windows installer, fired it up from the PowerShell, and voila. I wrote a program of around 50 to 70 lines of code using C++, and it felt exhilarating to use Vim. The day after, I wanted to set it up to use two-space indentation, spaces instead of tabs, and two spaces for a tab. I wanted it like that because I got used to two-space indentation after doing javascript. The spaces instead of tabs are some convention I picked up somewhere quite some time ago. I find it odd that some people use tabs instead of spaces, but whatever works for them, code won’t care anyway. Anyway, yesterday I was messing with Vim on Windows and .vimrc configuration. I created the configuration inside the `$home` directory inside PowerShell `cd $home` or `cd %HOME%` inside the command prompt.

Once I created the `$home\.vimrc` file, I saw that the coloration of `set something=value` changed, and I figured… it overrides the defaults! However, I had ChatGPT come in and save my buttocks! I started to read the content of the `_vimrc` file and realized it extends the functionality of some `example_vimrc.vim` or something like that. I figured I could extend them from my `$home\.vimrc` file. The first line in the `_vimrc` extended the functionality, so I copied the contents of `_vimrc` to `$home\.vimrc` and documented the reasons. I was curious to know whether I needed that functionality. It won’t hurt anyone if I leave it as is. Once I see a better way, I can change it to use a better approach! Once the configuration file worked, I finally changed the three values I wanted to! However, I wanted to use plugins, specifically one for C++ syntax, .editorconfig, and more. That took another half an hour. However, thanks to their documentation, it was rather smooth. I documented every important detail as I was going through it. I believe it was too many comments, but better to add more context for later because I WILL forget what I was doing. Anyway, after that, I had Vim working alright-ish. Now I can get that plugin for C++ syntax :)

--

--

Srecko Kostic

I create content from my perspective on topics I learn. Some information may be incorrect, but I hope some find my content useful.