Context
I like Neovim because it provides a Vim interface that’s implemented in Lua, so it’s modern and consistent, but also requires fewer resources when running on a low-power machine, like my old Chromebook running PostmarketOS.
Quickstart
I was recently working in VSCode and forgot how to orient myself in Neovim, so, a refresher:
- Open Neovim:
nvim - Verify LazyVim is up to date:
:Lazy - Use Telescope to browse around:
:Telescope - Press
<space> kto browse keymaps - Handy default keymaps:
Ctrl-i/Ctrl-ofor jumping back and forthCtrl-d/Ctrl-ufor half-page scrollingPageDown/PageUpfor full-page scrollingCtrl-f/Ctrl-bfor forward and backward (when tmux is not interceptingctrl-b)
Set Up
Install Neovim on Alpine/PostmarketOS:
sudo apk add neovimInstall the LazyVim plugin manager, using
~/.config/nvim/init.luaInstall Telescope, which provides an elegant consistency for browsing: “Find, Filter, Preview, Pick”
Define keymaps for common operations:
require("lazy").setup({ spec = { { 'nvim-telescope/telescope.nvim', ... config = function() local builtin = require("telescope.builtin") vim.keymap.set("n", "<leader>b", builtin.buffers, { desc = "Telescope buffers" }) vim.keymap.set("n", "<leader>f", builtin.find_files, { desc = "Telescope find_files" }) vim.keymap.set("n", "<leader>g", builtin.live_grep, { desc = "Telescope live_grep" }) vim.keymap.set("n", "<leader>k", builtin.keymaps, { desc = "Telescope keymaps" }) vim.keymap.set("n", "<leader>o", builtin.oldfiles, { desc = "Telescope oldfiles" }) end, ...Install Stylua and Black for Lua and Python formatting:
sudo apk add stylua blackInstall Conform for code formatting in Neovim:
require("lazy").setup({ spec = { ... { "stevearc/conform.nvim", opts = { formatters_by_ft = { lua = { "stylua" }, python = { 'black' } }, format_on_save = { timeout_ms = 2000, -- Black can take awhile lsp_fallback = true, }, }, },