nvim/lua/user/options.lua
Prabhat Maurya 8b868ed944 feat: proper Go setup with gopls, formatters, and debugger
- Add Mason bin to Neovim PATH so formatters/linters are discoverable
- Add Mason ensure_installed for gofumpt, goimports, delve + stylua, black, yamlfmt
- Add Go filetype settings (tabs, tabwidth=4) in golang.lua
- Remove redundant Go keymaps — existing LSP and vim-test keymaps already cover everything

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-26 00:06:12 +05:30

75 lines
1.9 KiB
Lua

local opt = vim.opt
-- Suppress vim.tbl_islist deprecation (from packer.nvim / older plugins on Neovim 0.10+)
vim.deprecated = vim.deprecated or {}
vim.deprecated.tbl_islist = false
-- Line numbers
opt.number = true
opt.relativenumber = true
-- Tabs and indentation
opt.expandtab = true
opt.tabstop = 4
opt.shiftwidth = 4
opt.smartindent = true
-- Disable swapfile
opt.swapfile = false
-- Enable mouse support
opt.mouse = "a" -- put "a" to enable in all mode or "n" to enable on normal mode
-- Enable clipboard access
opt.clipboard = "unnamedplus"
-- Case insensitive searching unless /C or capital in search
opt.ignorecase = true
opt.smartcase = true
-- Appearance
opt.termguicolors = true
opt.background = "dark"
-- creates backup files
opt.backup = false
-- allows neovim to access the system clipboard
opt.clipboard = "unnamedplus"
-- more space in the neovim command line for displaying messages
opt.cmdheight = 2
-- highlight all matches on previous search pattern
opt.hlsearch = true
-- enable persistent undo
opt.undofile = true
-- faster completion (4000ms default)
opt.updatetime = 300
-- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
opt.writebackup = false
-- highlight the current Line
opt.cursorline = true
-- always show the sign column, otherwise it would shift the text each time
opt.signcolumn = "yes"
-- display lines as one long line
opt.wrap = true
-- companion to wrap, don't split words
opt.linebreak = true
-- minimal number of screen lines to keep above and below the cursor
opt.scrolloff = 8
-- minimal number of screen columns either side of cursor if wrap is `false`
opt.sidescrolloff = 8
-- Add Mason's bin directory to PATH (LSPs, formatters, linters, debuggers)
vim.env.PATH = vim.fn.expand("~/.local/share/nvim/mason/bin") .. ":" .. (vim.env.PATH or "")