close
close

first Drop

Com TW NOw News 2024

Cracking the Code: My Journey from VS Code to NeoVim
news

Cracking the Code: My Journey from VS Code to NeoVim

In over a decade of web development, I’ve navigated the countless tools that have defined our industry. From my early days with Dreamweaver to the refined elegance of VS Code, I’ve tried them all. Almost.

Like many of you, I found comfort in the familiar, in tools that promised to make my workflow smoother, faster, more efficient. But recently, something changed. I discovered NeoVim — a tool I had long ignored, dismissed as an old relic, out of place in the modern world of sleek, GUI-based IDEs.

And yet here I sit, writing this article in NeoVim, wondering how I didn’t make this switch sooner.

The Comfort Zone: Working in VS Code

Let’s face it: VS Code is a fantastic editor. With its massive extension marketplace, easy-to-use interface, and powerful features, it’s no surprise that it’s become the go-to IDE for many developers. For years, I’ve been fine-tuning my VS Code setup: theme, extensions, keyboard shortcuts, all designed to maximize my productivity. It felt like home, and I felt comfortable. But sometimes comfort can breed complacency, and I quickly started wondering if there was a better way.

But comfort can sometimes lead to complacency. While VS Code had everything I needed on the surface, I started to notice the friction points: small inefficiencies that added up over time. The occasional slowness when loading large projects, the endless mouse clicks, and the constant context switching between code and mouse started to get to me.

A reluctant encounter: my first encounter with VIM

Like many developers, my first encounter with VIM was accidental, and it wasn’t love at first sight. I remember the panic as I tried to close a file, furiously searching for a way out like a trapped animal. Esc :q! became my mantra, a quick fix that would let me escape unscathed, but the experience left a sour taste in my mouth. Why would anyone willingly use this?

I avoided VIM so much that I even had a meme as my desktop wallpaper that perfectly captured the absurdity of the challenge of closing VIM. It was inspired by the movie Arrivalwhere Amy Adams’ character, linguist Louise Banks, holds up a sign that reads Esc :q!. The meme perfectly summed up my frustration and the absurdity of my struggle with VIM. For years it served as both a joke and a warning: “Proceed with caution, this editor is not for the faint of heart.”

The Turning Point: A New Perspective

It wasn’t until a colleague told me he’d switched to NeoVim that I started to reconsider. “You can be so much faster,” he said, “once you get used to it.” Faster? I was intrigued. Speed ​​has always been the key word in development. Could NeoVim really offer something that VS Code couldn’t?

Around the same time, I came across a YouTube video by ThePrimeagen demonstrating his blazing fast workflow using VIM gestures. Watching him fly through his code with precision and speed, I began to see the potential. Maybe, just maybe, I had been missing something all along.

The Gateway Plugin: VSCodeVim

To start my vim experience in my comfort zone, I installed the VSCodeVim extension. Then my descent into the rabbit hole began.

After three weeks in VSCode I decided to give NeoVim a fair try in the terminal. Installation was easy. On macOS there is a simple brew install neovim got me started. But it was clear that NeoVim isn’t just a tool you install and start using; it’s a tool you shape, mold, and configure to fit your workflow, like a well-tailored suit.

After a quick chat with my colleague, I started with NvChad, a pre-configured setup that promised a modern UI and essential plugins. It provided a solid foundation, but the real magic happened when I started customizing it to my needs.

Now, after ten days of working exclusively in the terminal with NeoVim, I can hardly believe that I am the one embracing this change. And it is so much fun! Who would have thought.

This VIM emulating extension for VS Code, which Microsoft should probably ban, has made me not want to use VS Code at all.

The Learning Curve: From Frustration to Mastery

I won’t sugarcoat it — learning NeoVim was, and still is, a challenge. My muscle memory, honed by years of VS Code, fought me every step of the way. The first few days were a frustrating mix of excitement and regret. But with each small victory — learning to navigate without a mouse, mastering basic commands, and configuring keyboard layouts — I felt a growing sense of empowerment.

NeoVim is not just an editor; it is a way of thinking about code. It forces you to slow down, to be deliberate in your actions. And paradoxically, this deliberate approach ultimately leads to greater speed and efficiency.

Why NeoVim? The Unseen Benefits

So, what does NeoVim offer that other editors don’t? The answer lies in its philosophy and design:

  • Speed ​​and efficiency: NeoVim is built for keyboard navigation. Once you internalize the commands and gestures, you can navigate your code faster than ever. The lack of mouse dependency means fewer context switches and a more focused workflow.

  • Amendment: With NeoVim, you are in control. From key bindings to plugins, everything is customizable to your exact needs. The addition of Lua scripting for configuration offers a level of flexibility that is hard to match.

  • Lightweight and fast: Unlike many modern IDEs, NeoVim is incredibly lightweight. It opens instantly, even with large projects, and never slows down your system.

  • Extensibility: The plugin ecosystem around NeoVim is huge and active. Plugins like telescope.nvim to find vague, nvim-lspconfig for language server protocol support, and treesitter For advanced syntax highlighting, NeoVim takes it to a level of functionality comparable to, and often even surpassing, other IDEs.

My Setup: A NeoVim Configuration for Web Developers

For those interested in making the switch, here’s a peek into my current/beginner NeoVim setup:

  • Plugins: I trust telescope.nvim for searching files and text, nvim-lspconfig for robust language support, and treesitter for syntax highlighting. I also added fzf for a blazing fast file finder and prettier for automatic code formatting.

  • Keyboard layouts: I have reassigned jk Unpleasant Escwhich makes exiting insert mode faster. Or use the vs code to move entire lines by just typing J or K. And some other small changes.
    These simple changes have already made my workflow smoother. What’s in your keymap? I’d love to hear about your configurations in the comments.

  • Custom assignments:I’ve created a number of custom commands to streamline repetitive tasks, such as quickly creating a new buffer or searching through files with a single keystroke.

The Verdict: NeoVim is Worth It

After using NeoVim exclusively for a few days, I can confidently say that it has been a game-changer. It’s not just about speed — although that is a big part of it — it’s about a deeper connection with my code. NeoVim’s minimalist, distraction-free environment allows me to focus completely on the task at hand.

Switching from a full-featured IDE like VS Code to a terminal-based editor like NeoVim may seem daunting, but the rewards are worth it. If you’re looking for a tool that will make you a better, more efficient developer, NeoVim is the rabbit hole to go down.

Ready to make the switch?

If you’re curious about NeoVim, I encourage you to take the plunge. Start small with a basic setup and you’ll quickly discover how it can take your development workflow to new heights. The learning curve may be steep, but trust me: the view from the top is worth every step.

Have you made the switch to NeoVim? Share your experience in the comments — I’d love to hear how it’s transformed your workflow.

The next chapter: Transforming my Obsidian setup with Vim

As I delved deeper into the world of Vim, I realized that the principles of efficiency and keyboard-centric navigation extend beyond coding. Inspired by my success with NeoVim, I set out to transform my entire workflow to embrace Vim’s philosophy, starting with my note-taking and knowledge management tool: Obsidian.

For those unfamiliar, Obsidian is a powerful, markdown-based tool that I rely on to organize my thoughts, ideas, and project notes. It’s highly customizable, and naturally I started wondering: could I bring the same Vim-powered efficiency to Obsidian?

The answer is of course yes. Obsidian’s support for Vim key bindings has allowed me to create a seamless, consistent experience across all my tools. Whether I’m coding in NeoVim or jotting down ideas in Obsidian, my workflow remains fluid and uninterrupted.

In my next article, I’ll dive into the details of how I configured Obsidian to match my Vim setup, and share tips and tricks that made my note-taking process faster and more intuitive. If you’ve ever wanted to unify your digital environment under the Vim banner, stay tuned — I’m excited to share what I’ve learned.