Files
.dotfiles/.config/nvim/init.lua

60 lines
1.9 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
require("config.lazy")
-- colorscheme
vim.o.termguicolors = true
vim.opt.winborder = 'rounded'
--vim.o.background = "dark" -- or "light" for light mode
--vim.cmd("colorscheme gruvbox ")
--vim.cmd("colorscheme retrobox")
vim.opt.clipboard = "unnamedplus" -- uses the clipboard register for all operations except yank.
vim.cmd("set nocompatible")
vim.cmd("syntax on")
vim.cmd("filetype plugin indent on")
vim.cmd("set number")
vim.cmd("set relativenumber")
vim.cmd("set expandtab")
vim.cmd("set shiftwidth=4")
vim.cmd("set softtabstop=4")
vim.cmd("set tabstop=4")
vim.cmd("set smartindent")
vim.cmd("set backspace=indent,eol,start")
vim.cmd("set colorcolumn=81")
vim.cmd("set textwidth=80")
vim.cmd("set wrap")
vim.cmd("set linebreak")
vim.cmd("noswapfile")
vim.cmd("set autoread")
vim.cmd("set complete-=i")
vim.cmd("set lazyredraw")
vim.cmd("au FileType python set fileformat=unix encoding=utf-8")
vim.cmd("au FileType markdown,tex set spell spelllang=en_us")
-- ------------------------------------------------------------------------
-- Autoreload buffers when files change externally
-- ------------------------------------------------------------------------
-- Ensure the option is enabled (already set above, but kept for clarity)
vim.cmd("set autoread")
-- Create a dedicated augroup to avoid duplicate autocommands if this file
-- is sourced multiple times (e.g., when using :source ~/.config/nvim/init.lua).
vim.api.nvim_create_augroup("AutoReload", { clear = true })
-- Run `checktime` for the following events:
-- * CursorHold, CursorHoldI idle cursor, typical for autocheck
-- * FocusGained when you return to Neovim from another app
-- * BufEnter when you jump to a buffer that may already be stale
vim.api.nvim_create_autocmd(
{ "CursorHold", "CursorHoldI", "FocusGained", "BufEnter" },
{
group = "AutoReload",
pattern = "*",
command = "silent! checktime",
}
)