Skip to content
Search Fedora

    Browse this documentation

    Neovim as an IDE: minimal built-in LSP on 0.12

    Neovim 0.12 ships LSP and treesitter built in — you get completion, jump-to-definition and diagnostics with zero plugins. Exhaust the built-ins first; add plugins only when they fall short.

    Terminal window
    sudo dnf install -y neovim
    nvim --version | head -1

    Measured NVIM v0.12.5. You also need a C compiler (treesitter grammars compile locally):

    Terminal window
    sudo dnf install -y gcc make

    ~/.config/nvim/init.lua:

    -- basic editing
    vim.opt.number = true
    vim.opt.relativenumber = true
    vim.opt.expandtab = true
    vim.opt.shiftwidth = 4
    vim.opt.termguicolors = true
    vim.opt.updatetime = 300
    -- LSP: the declarative config since 0.12
    vim.lsp.config('pyright', {
    cmd = { 'pyright-langserver', '--stdio' },
    filetypes = { 'python' },
    })
    vim.lsp.config('lua_ls', {
    cmd = { 'lua-language-server' },
    filetypes = { 'lua' },
    })
    vim.lsp.enable({ 'pyright', 'lua_ls' })
    -- keymaps on LSP attach
    vim.api.nvim_create_autocmd('LspAttach', {
    callback = function(ev)
    local map = function(keys, fn, desc)
    vim.keymap.set('n', keys, fn, { buffer = ev.buf, desc = desc })
    end
    map('gd', vim.lsp.buf.definition, 'go to definition')
    map('K', vim.lsp.buf.hover, 'hover docs')
    map('gr', vim.lsp.buf.references, 'references')
    map('<leader>rn', vim.lsp.buf.rename, 'rename')
    end,
    })
    -- diagnostics display
    vim.diagnostic.config({ virtual_text = true, signs = true })

    The config only declares how to connect; the servers themselves are separate installs:

    LanguageServerFedora repo
    Pythonpython3-pyright (or pip pyright)yes
    Lualua-language-serveryes
    Rustrust-analyzer via rustuprust-analyzer in repo
    C/C++clangdyes (clang-tools-extra)
    Terminal window
    sudo dnf install -y python3-pyright lua-language-server clangd

    Open a matching file and :LspInfo (or :checkhealth vim.lsp on 0.12) confirms attachment.

    :TSInstall python lua

    treesitter is built into nvim (:TSInstall works out of the box); grammars install and compile on demand — which is why gcc was on the install list.

    CapabilityVS CodeNVim 0.12 built-in
    completionpluginLSP + Ctrl-x Ctrl-o (omnifunc)
    definition/referencesF12/Shift-F12gd/gr
    renameF2vim.lsp.buf.rename
    inline diagnosticsnative UIvirtual_text enabled
    file treesidebarplugin (or built-in :Ex)
    fuzzy finderCtrl-Pplugin (telescope)

    The built-ins cover the core of LSP; file trees and fuzzy finding are where plugins earn their place.

    Not at the start. Manually require files under ~/.config/nvim/lua/. When you genuinely need telescope or a completion engine (blink/cmp), bring in lazy.nvim — by then you know exactly what you are missing.

    SymptomCause
    :LspInfo shows no clientserver not installed or not on PATH; which pyright-langserver
    treesitter install failsgcc/make missing
    completion never popsbuilt-in LSP ships no completion UI; Ctrl-x Ctrl-o manually or add a plugin
    init.lua edits ignoredrestart nvim or :source the file
    mojibake in filenamesterminal font issue, see terminals