add exception for nix files to use spaces instead of tabs

This commit is contained in:
2025-09-25 10:25:33 +02:00
parent 58d58b8b79
commit a74349fb87

View File

@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true
-- [[ Setting options ]]
-- See `:help vim.o`
@@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.o.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true
vim.o.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a'
@@ -150,7 +150,9 @@ vim.o.splitbelow = true
-- See `:help lua-options`
-- and `:help lua-options-guide`
vim.o.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
vim.opt.listchars = { tab = ' ', trail = '·', nbsp = '' }
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
-- Preview substitutions live, as you type!
vim.o.inccommand = 'split'
@@ -219,6 +221,14 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end,
})
-- Use spaces for nix files
vim.api.nvim_create_autocmd('FileType', {
pattern = 'nix',
callback = function()
vim.opt_local.expandtab = true
end,
})
-- [[ Install `lazy.nvim` plugin manager ]]
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'