Skip to content

LocalNest/LocalNest.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocalNest.nvim 🦉

Neovim   Lua   Local-first AI

LocalNest.nvim is a powerful, local-first AI coding assistant for Neovim. It brings state-of-the-art Large Language Model capabilities directly to your editor by connecting to your own local AI infrastructure.

This plugin is the IDE/Coding Assistant component of the LocalNest ecosystem.

Features

  • Fill-In-The-Middle (FIM): Dual-mode completions (Auto/Manual) that understand context before and after your cursor.
  • Dynamic Ghost Text: Sleek, non-intrusive suggestions with custom high-priority highlighting (LocalNestFimGhost) that won't conflict with other plugins.
  • Stateful Interactive Chat: A persistent, session-aware chat window. Ask follow-up questions and maintain deep context throughout your coding session.
  • Interactive Chat Controls: In the chat buffer, use r to respond/continue the thread and q to instantly close the window.
  • Slash Commands: Instant AI actions for selected code:
    • /explain: Get a concise breakdown of MUST-KNOW logic and performance.
    • /fix: Identify and resolve bugs with immediate corrected code blocks.
    • /refactor: Improve readability and efficiency with specific change logs.
    • /test: Generate comprehensive, edge-case unit tests.
  • Context-Aware: Intelligently gathers buffer content and project context, now optimized with industry-standard PSM FIM formatting.
  • Optimized for Qwen 2.5 & Qwen 2.5 Coder: Pre-tuned for elite local LLMs.

Installation

Using lazy.nvim:

{
    'LocalNest/LocalNest.nvim',
    config = function()
        require('localnest').setup({
            llama_server = {
                host = "localhost", -- Or your local AI box
                port = 8888,
            }
        })
    end
}

Keybindings

LocalNest uses which-key for easy discovery.

Fill-In-The-Middle (Insert Mode)

Shortcut Action
Auto Suggestions appear after a pause (Auto-Mode)
:LocalNestFimManual Trigger full FIM block generation (Manual-Mode)
<C-x> Toggle FIM on/off
<C-z> Accept suggestion
<C-d> Dismiss suggestion

AI Actions (<leader>a)

Shortcut Action
<leader>ae Explain code
<leader>af Fix code
<leader>ar Refactor code
<leader>at Generate tests

AI Chat (<C-o>)

Shortcut Action
<C-o>c Open Chat (Stateful History)
<C-o>x Ask about Selection
<C-o>f Analyze Full File
<C-o>t Ask via @this block
r (in buffer) Respond to the Assistant
q (in buffer) Close Chat Window
:LocalNestChatClear Reset Conversation History

Engineering Tools (<leader>)

Shortcut Action
<leader>db Toggle Breakpoint
<leader>ds Debug Start/Continue
<leader>dd Step Over
<leader>du Toggle Debug UI
<leader>tt Run Nearest Test
<leader>tf Run Current File
<leader>to Show Test Output
<leader>o Toggle Code Outline

Buffer Navigation

Shortcut Action
<S-h> Previous Buffer (Tab)
<S-l> Next Buffer (Tab)
<leader>bp Previous Buffer
<leader>bn Next Buffer
<leader>bc Close Buffer

Configuration

You can tune the AI's behavior in your setup function:

require('localnest').setup({
    fim = {
        enabled = true,
        auto_trigger = true,
        max_tokens = 128,
        temperature = 0.0, -- Deterministic completions
        top_p = 0.9,
    },
    chat = {
        max_tokens = 2048,
        temperature = 0.7,
        system_prompt = "You are a concise coding assistant...",
    }
})

🛠️ Integrated Development Environment

LocalNest is more than just an AI plugin; it's a fully-equipped IDE configured for high-performance engineering.

Language Support (LSP)

Full IDE capabilities for:

  • Rust (via rust-tools.nvim)
  • Go (via go.nvim)
  • Python, TypeScript/JS, Lua, Bash, YAML, JSON, Docker
  • Cap'n Proto (dedicated support)

Core Stack

  • Modern UI: tokyonight theme, lualine status, bufferline tabs, and dashboard-nvim splash screen.
  • Search & Navigation: telescope.nvim for fuzzy search, aerial.nvim for code outline.
  • Git Integration: vim-fugitive for management and gitsigns.nvim for inline diffs.
  • Tool Management: mason.nvim for automated LSP, DAP, and linter installation.
  • Debugger: nvim-dap with full UI and virtual text support.
  • Test Runner: neotest for integrated testing in Go, Rust, and Python.
  • Productivity:
    • which-key.nvim: Interactive command discovery.
    • toggleterm.nvim: Integrated terminal management.
    • auto-session: Persistent workspace sessions.
    • nvim-surround & Comment.nvim: Advanced text manipulation.

Quality of Life Tweaks

  • Buffer Navigation: Fast tab switching with <Shift-h/l>.
  • System Clipboard: Unified copy/paste with Ctrl-c and Ctrl-v.
  • Smooth Interaction: Hardware-accelerated scrolling with neoscroll.nvim.
  • Persistent History: Global undo history saved across restarts.
  • Split Management: Intuitive split behavior (right/below).

Requirements

  • Neovim 0.10+
  • llama-server (supporting /infill and /v1/chat/completions)
  • curl installed on your system

🦉 About LocalNest

LocalNest.nvim is built with privacy and performance in mind. No code leaves your local environment, keeping your proprietary logic safe while giving you the speed and power of modern LLMs.


Follow on X Live Coding Portfolio


About

mappings and lua files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages