· Joseph · review  · 4 min read

Switching from vim to Neovim!

I've been using Vim for a long time and finally switched to Neovim. The initial thought of switching came after the author of VIM passed away in August 2023, as I didn’t have the time to try other editors. After a year, “vibe coding” grew up, so I started thinking how to integrate AI into my editor and surveying how to use AI in Vim, which led to this journey.

TOC

Main differences

Tab vs. Buffer:

ref: https://www.reddit.com/r/neovim/comments/13iy0p0/why_some_people_use_buffers_for_tabs_and_not_vim/

In vim, I used vsp or tabnew to open or edit a file and mapped tabprevious command with Tab key to navigate between tabs. However, in Neovim, I used buffer instead of tabs and mapped BufferLineCyclePrev with Shift + h for switching buffers.

coc vs. native lsp:

I configured many coc settings to support TypeScript and JavaScript language servers, including linting and Prettier on save, go-to definition or reference, and codelens. After using Neovim, I converted all of these settings to nvim-lspconfig and mason, among others.

Lua supports:

Although I’m not familiar with Lua, it allows me to write more readable configuration files using modules, functions, and tables (objects) for Neovim.



AI supports:

Vibe coding! I found many plugins to integrate LLMs and finally selected three to use:

avante.nvim
  Let your Neovim be a Cursor AI IDE – it's undergoing rapid iterations and many exciting features will be added successively; it updates almost every day!
CodeCompanion
  CodeCompanion can customize workflows and prompts, and its Action Palette is a really useful tool.
gp.nvim
  GP means GPT Prompt, and it's an Neovim AI plugin. It helps me write prompts through Neovim's cmdline.

I usually switch between these plugins, and I'm still thinking about my 'vibe-way' to use them. Because of supporting Ollama LLM, all of them can be used offline.

For now, I've used Neovim for three months, and got to know Neovim. In my experience, Neovim is really more productive than vim.

Reference

AI in Neovim
How to set up Neovim for coding React
ZazenCodes Neovim

Rewrite by Avante + Ollama gemma3:4b ------

For a long time, I relied on Vim for my coding. However, after Bram Moolenaar’s passing in August 2023 – a significant influence in the Vim community – I decided it was time for a change. I began exploring alternative editors, ultimately settling on Neovim. This journey wasn’t just about switching editors; it was about integrating AI into my workflow and redefining my coding experience.

Key Differences: Tabs vs. Buffers

One of the first things I noticed was the shift from tabs to buffers in Neovim. In Vim, I frequently used vsp or tabnew to open or edit files, navigating between tabs with the Tab key and Tabprevious command. Neovim, however, utilizes buffers, offering a more streamlined approach. I configured BufferLineCyclePrev with Shift + h for seamless buffer switching, alongside nvim-tree/nvim-web-devicons and akinsho/bufferline.nvim.

Leveraging Language Servers with coc and nvim-lspconfig

I configured many coc settings to support TypeScript and JavaScript language servers, including linting and Prettier on save, go-to definition or reference, and codelens. Recognizing the power of language servers, I then converted all of these settings to nvim-lspconfig and mason.nvim, streamlining my development environment.

Lua Configuration for Readability

Although I’m relatively new to Lua, it allows me to write more readable configuration files using modules, functions, and tables (objects) for Neovim. Here’s a snippet of my configuration:



AI-Powered Productivity with avante.nvim, CodeCompanion, and gp.nvim

To truly elevate my coding experience, I integrated several AI plugins. I selected:

avante.nvim**: This plugin transforms Neovim into a Cursor AI IDE, undergoing rapid iterations and adding exciting new features daily.
CodeCompanion**: This plugin allows for customizable workflows and prompts, with a particularly useful Action Palette.
gp.nvim**: (GPT Prompt) – This plugin helps me write prompts through Neovim’s command line interface, leveraging folke/noice.nvim. Because of supporting Ollama LLM, all of these plugins can be used offline.

I’m still experimenting with how to best utilize these plugins – a “vibe-way” to coding!

Resources for Further Exploration

AI in Neovim
How to set up Neovim for coding React
ZazenCodes Neovim

I’ve been using Vim for a long time and finally switched to Neovim. The initial thought of switching came after the author of VIM passed away in August 2023, as I didn’t have the time to try other editors. After a year, “vibe coding” grew up, so I started thinking how to integrate AI into my editor and surveying how to use AI in Vim, which led to this journey.

TOC

Main differences

  1. Tab vs. Buffer:

ref: https://www.reddit.com/r/neovim/comments/13iy0p0/why_some_people_use_buffers_for_tabs_and_not_vim/

In vim, I used vsp or tabnew to open or edit a file and mapped tabprevious command with Tab key to navigate between tabs. However, in Neovim, I used buffer instead of tabs and mapped BufferLineCyclePrev with Shift + h for switching buffers.

  1. coc vs. native lsp:

I configured many coc settings to support TypeScript and JavaScript language servers, including linting and Prettier on save, go-to definition or reference, and codelens. After using Neovim, I converted all of these settings to nvim-lspconfig and mason, among others.

  1. Lua supports:

Although I’m not familiar with Lua, it allows me to write more readable configuration files using modules, functions, and tables (objects) for Neovim.

return {
  "akinsho/bufferline.nvim",
  version = "*",
  dependencies = "nvim-tree/nvim-web-devicons",
  opts = {
    options = {
      sort_by = "insert_at_end",
      numbers = "both",
      diagnostics_indicator = function (count, level, diagnostics_dict, context)
        local s = " "
        for e, n in pairs(diagnostics_dict) do
          local sym = e == "error" and " " or (e == "warning" and " " or " ")
          s = s .. n .. sym
        end
        return s
      end
    }
  },
  config = function (_, opts)
    vim.opt.termguicolors = true
    require("bufferline").setup(opts)
  end
}
  1. AI supports:

Vibe coding! I found many plugins to integrate LLMs and finally selected three to use:

  • avante.nvim Let your Neovim be a Cursor AI IDE – it’s undergoing rapid iterations and many exciting features will be added successively; it updates almost every day!
  • CodeCompanion CodeCompanion can customize workflows and prompts, and its Action Palette is a really useful tool.
  • gp.nvim GP means GPT Prompt, and it’s an Neovim AI plugin. It helps me write prompts through Neovim’s cmdline.

I usually switch between these plugins, and I’m still thinking about my ‘vibe-way’ to use them. Because of supporting Ollama LLM, all of them can be used offline.

For now, I’ve used Neovim for three months, and got to know Neovim. In my experience, Neovim is really more productive than vim.

Reference

----- Rewrite by Avante + Ollama gemma3:4b ------

For a long time, I relied on Vim for my coding. However, after Bram Moolenaar’s passing in August 2023 – a significant influence in the Vim community – I decided it was time for a change. I began exploring alternative editors, ultimately settling on Neovim. This journey wasn’t just about switching editors; it was about integrating AI into my workflow and redefining my coding experience.

Key Differences: Tabs vs. Buffers

One of the first things I noticed was the shift from tabs to buffers in Neovim. In Vim, I frequently used vsp or tabnew to open or edit files, navigating between tabs with the Tab key and Tabprevious command. Neovim, however, utilizes buffers, offering a more streamlined approach. I configured BufferLineCyclePrev with Shift + h for seamless buffer switching, alongside nvim-tree/nvim-web-devicons and akinsho/bufferline.nvim.

Leveraging Language Servers with coc and nvim-lspconfig

I configured many coc settings to support TypeScript and JavaScript language servers, including linting and Prettier on save, go-to definition or reference, and codelens. Recognizing the power of language servers, I then converted all of these settings to nvim-lspconfig and mason.nvim, streamlining my development environment.

Lua Configuration for Readability

Although I’m relatively new to Lua, it allows me to write more readable configuration files using modules, functions, and tables (objects) for Neovim. Here’s a snippet of my configuration:

return {
  "akinsho/bufferline.nvim",
  version = "*",
  dependencies = "nvim-tree/nvim-web-devicons",
  opts = {
    options = {
      sort_by = "insert_at_end",
      numbers = "both",
      diagnostics_indicator = function (count, level, diagnostics_dict, context)
        local s = " "
        for e, n in pairs(diagnostics_dict) do
          local sym = e == "error" and " " or (e == "warning" and " " or " ")
          s = s .. n .. sym
        end
        return s
      end
    }
  },
  config = function (_, opts)
    vim.opt.termguicolors = true
    require("bufferline").setup(opts)
  end
}

AI-Powered Productivity with avante.nvim, CodeCompanion, and gp.nvim

To truly elevate my coding experience, I integrated several AI plugins. I selected:

  • avante.nvim: This plugin transforms Neovim into a Cursor AI IDE, undergoing rapid iterations and adding exciting new features daily.
  • CodeCompanion: This plugin allows for customizable workflows and prompts, with a particularly useful Action Palette.
  • gp.nvim: (GPT Prompt) – This plugin helps me write prompts through Neovim’s command line interface, leveraging folke/noice.nvim. Because of supporting Ollama LLM, all of these plugins can be used offline.

I’m still experimenting with how to best utilize these plugins – a “vibe-way” to coding!

Resources for Further Exploration

Back to Blog

Related Posts

View All Posts »
Using Firebase and Firestore with NextJS and Docker - Part 1 - Setup firebase in docker

Using Firebase and Firestore with NextJS and Docker - Part 1 - Setup firebase in docker

Last year, I got a case to use firebase and firestore with Next.js. I've been fullstack many years, so I haven't tried to use firebase and firestore. There was a great chance to give it a try. In this article I'll show how to use firebase and firestore in Docker and Next.js. If you don't have backend support, or you don't want to build whole backend, database, and infrastructure, you would probably think this is a useful way.

Blockchain fullstack structure - Part 4 - React.js and Next.js

Blockchain fullstack structure - Part 4 - React.js and Next.js

Alright, the series of articles goes to frontend part. I post an article related to Blockchain with React.js and Next.js. If you haven't seen my previous posts Part 1 Introduction, Part 2 Hardhat, and Part 3 Golang Gin, please read them first. In this article, I demonstrate how to use React.js (Next.js) to interact with smart contract by Golang Gin API and hardhat RPC URL, and implement a simple Sign-in with Ethereum (SIWE) authentication and setGreeting to Solidity. Okay, let's start it. TOC

Blockchain fullstack structure - Part 3 - Golang Gin

Blockchain fullstack structure - Part 3 - Golang Gin

It's time to Blockchain with Golang. If you haven't seen my previous post Part 1 Introduction and Part 2 Hardhat, please read them first. Again, does Dapp need a Backend? reddit - You can pretty much make a dapp without backend, but there are some things that can't be done with a smart contract. - You need a backend among other reasons for off-chain or metadata that won’t be stored in the smart contracts. Have you ever thought about how Moralis works? Off-chain: Backend infrastructure that collects data from the blockchain, offers an API to clients like web apps and mobile apps, indexes the blockchain, provides real-time alerts, coordinates events that are happening on different chains, handles the user life-cycle and so much more. Moralis Dapp is used in order to speed up the implementation of the off-chain infrastructure. Moralis Dapp is a bundled solution of all the features most Dapps need in order to get going as soon as possible.