vim

Automate Neovim configuration and scripting using core Lua APIs.

4|Updated Sep 25, 2024
One-click install
npx skills add https://github.com/khulnasoft/init.lua --skill vim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vim
Source: https://github.com/khulnasoft/init.lua/tree/main/skills/vim
Command: npx skills add https://github.com/khulnasoft/init.lua --skill vim

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Neovim configuration and automation tasks often require quick access to core Lua APIs like vim.api and vim.fn. This guide provides structured, ready-to-use references and patterns to help you automate editing, navigation, and plugin workflows in Neovim.

Core Features & Use Cases

  • Core API references: vim.api usage for buffer, window, keymaps, and autocommands operations.
  • vim.fn functions: access to legacy Vimscript functions for common editor tasks.
  • Custom Utilities: overview of a reload mechanism and lightweight automation helpers to speed up development workflows.

Quick Start

Use vim.api and vim.fn to automate a simple buffer query and modify lines in the current buffer.

Frequently Asked Questions about vim

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Lua to automate Neovim editing and navigation workflows?

Automate Neovim editing by scripting custom workflows with core Lua APIs like vim.api and vim.fn to manipulate buffers, windows, and key mappings programmatically. It provides structured references for building automated edits and custom navigation.

What is the difference between vim.api and vim.fn when configuring Neovim?

vim.api provides direct access to core Neovim functionalities for buffer, window, keymap, and autocommand operations, while vim.fn wraps legacy Vimscript functions for common editor tasks. Both are covered for comprehensive setup.

How do I create custom key mappings and autocommands in Neovim?

Create custom key mappings and autocommands by utilizing vim.api operations within your Lua configuration. This allows you to define automated responses and custom navigation triggers directly in your Neovim environment.

Can I access legacy Vimscript functions from a Lua configuration in Neovim?

Access legacy Vimscript functions from Lua using vim.fn. This enables you to call common editor tasks and integrate existing Vimscript utilities seamlessly into your new Lua-based Neovim automation workflows.

What is the best way to reload Lua modules during Neovim config development?

Reload Lua modules during development using a custom reload mechanism utility. This lightweight automation helper speeds up your workflow by allowing rapid iteration on custom configurations without restarting the editor.