Switching Text Editors Yet Again
It’s time for a change-up: switching from Sublime Text to neovim.
Some of you might remember that back in 2022, I switched from Atom to Sublime Text. I’ve been using Sublime Text ever since, but lately, it has become clear to me that its development has slowed to a crawl. Which is annoying, because some serious bugs that drive me crazy haven’t been fixed ever since I’ve been using it again. So I had to start looking for a new editor. And no, I still don’t want to use VS Code. It’s too slow, too clumsy and they’re leaning way too hard into this AI bullshit for my tastes. I like software that is small, lean and elegant. Which is why, after some experimentation in recent days, I have now settled on neovim. I am already familiar with Vim anyway, it’s cross-platform and does everything I need in a very efficient package.
Of course, it’s so customisable, that you’ll easily get lost in the weeds. So I settled on a few quickstart packages and things to get this new tool up and running in a way that is aesthetically pleasing to me and doesn’t take days of fiddling with config files. I installed AstroVim, which is a quickstart config that uses the LazyVim packaging system and only needs minimal tweaking to get it to look and behave to my liking. What follows is a quick-and-dirty guide at how to install AstroVim with my config.
Windows Install
git clone --depth 1 https://github.com/AstroNvim/template $env:LOCALAPPDATA\nvim
Remove-Item $env:LOCALAPPDATA\nvim\.git -Recurse -Force
nvim
Linux Install
git clone --depth 1 https://github.com/AstroNvim/template ~/.config/nvim
rm -rf ~/.config/nvim/.git
nvim
Note: When nvim launches, the LazyVim package manager will install some stuff. Afterwards, reload nvim.
Configuration
Enable AstroCommunity in /nvim/lua/community.lua
and configure plugins:
-- AstroCommunity: import any community modules here
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
-- This guarantees that the specs are processed before any user plugins.
---@type LazySpec
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.lua" },
-- import/override with your plugins folder
-- my plugins
{ import = "astrocommunity.bars-and-lines.lualine-nvim" },
{ import = "astrocommunity.colorscheme.fluoromachine-nvim" },
{ import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.recipes.auto-session-restore" },
}
Enable the theme in /nvim/lua/plugins/astroui.lua
:
-- AstroUI provides the basis for configuring the AstroNvim User Interface
-- Configuration documentation can be found with `:h astroui`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astroui",
---@type AstroUIOpts
opts = {
-- change colorscheme
-- colorscheme = "astrodark",
colorscheme = "fluoromachine",
--[[
-- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
highlights = {
init = { -- this table overrides highlights in all themes
-- Normal = { bg = "#000000" },
},
astrodark = { -- a table of overrides/changes when applying the astrotheme theme
-- Normal = { bg = "#000000" },
},
},
-- Icons can be configured throughout the interface
icons = {
-- configure the loading of the lsp in the status line
LSPLoading1 = "⠋",
LSPLoading2 = "⠙",
LSPLoading3 = "⠹",
LSPLoading4 = "⠸",
LSPLoading5 = "⠼",
LSPLoading6 = "⠴",
LSPLoading7 = "⠦",
LSPLoading8 = "⠧",
LSPLoading9 = "⠇",
LSPLoading10 = "⠏",
},
]]--
},
}
And, lastly, customise Vim options in /nvim/lua/plugins/astrocore.lua
:
-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more!
-- Configuration documentation can be found with `:h astrocore`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
-- Configure core features of AstroNvim
features = {
large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
autopairs = true, -- enable autopairs at start
cmp = true, -- enable completion at start
diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
highlighturl = true, -- highlight URLs at start
notifications = true, -- enable notifications at start
},
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
diagnostics = {
virtual_text = true,
underline = true,
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
relativenumber = false, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number
spell = true, -- sets vim.opt.spell
signcolumn = "yes", -- sets vim.opt.signcolumn to yes
wrap = true, -- sets vim.opt.wrap
},
g = { -- vim.g.<key>
-- configure global vim variables (vim.g)
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
-- This can be found in the `lua/lazy_setup.lua` file
},
},
-- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
mappings = {
-- first key is the mode
n = {
-- second key is the lefthand side of the map
-- navigate buffer tabs
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
-- mappings seen under group name "Buffer"
["<Leader>bd"] = {
function()
require("astroui.status.heirline").buffer_picker(
function(bufnr) require("astrocore.buffer").close(bufnr) end
)
end,
desc = "Close buffer from tabline",
},
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
-- ["<Leader>b"] = { desc = "Buffers" },
-- setting a mapping to false will disable it
-- ["<C-S>"] = false,
},
},
},
}
Bonus
On Windows, I use the following Terminal colour scheme to make the rest of the terminal match my editor setup:
{
"background": "#200933",
"black": "#241B2F",
"blue": "#FFCC00",
"brightBlack": "#262335",
"brightBlue": "#CCA300",
"brightCyan": "#81E8FF",
"brightGreen": "#5BC193",
"brightPurple": "#CA147B",
"brightRed": "#FE6973",
"brightWhite": "#8BA7A7",
"brightYellow": "#CA147B",
"cursorColor": "#8BA7A7",
"cyan": "#61E2FF",
"foreground": "#8BA7A7",
"green": "#72F1B8",
"name": "Fluoromachine",
"purple": "#FC199A",
"red": "#FE4450",
"selectionBackground": "#463465",
"white": "#8BA7A7",
"yellow": "#FC199A"
}