Neovim Settings
How I set up Neovim for my Go and TypeScript workflow.
I used to use VS Code, but I wanted a more lightweight, terminal-based editor. I spent a lot of time tinkering with different setups and eventually landed on a configuration that works for my full-stack workflow.
My Setup
My configuration isn't something I wrote entirely from scratch. It's a mix of NvChad and LazyVim patterns that I combined with different plugins I found useful. I wanted something that was fast but still had the IDE features I'm used to, like LSP (Language Server Protocol) and auto-formatting.
How I use it
- LSP Integration: I use
nvim-lspconfigto manage my language servers. It's really helpful for Go and TypeScript because it gives me definitions and auto-completion without having to leave the terminal. - Go Support: I've optimized it for Go development, so it works well with
goplsand other Go-specific tools. - Plugin Management: I use
lazy.nvimto manage everything. It's really efficient and makes sure only the plugins I need are loaded.
Tinkering with Lua
One of the best parts of using Neovim is that the configuration is written in Lua. It took me a while to get used to it, but it's really satisfying to be able to script my editor.
-- A look at how I set up keybindings for LSP
local on_attach = function(client, bufnr)
local nmap = function(keys, func, desc)
if desc then desc = 'LSP: ' .. desc end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
end
What's next
I'm always tweaking my setup. I want to improve my Treesitter configuration for better syntax highlighting and maybe try out some new debuggers. It's a never-ending hobby.