-- The editor's options. Plain Neovim settings; lua/user/init.lua may change any of them. local M = {} function M.setup() local o = vim.opt vim.g.mapleader = " " vim.g.maplocalleader = "\\" -- What a file or a model writes is text, never settings or commands: no modelines, no -- per-directory configuration files. o.modeline = false o.modelines = 0 o.exrc = false o.number = true o.relativenumber = false o.cursorline = true o.signcolumn = "yes" o.termguicolors = true o.showmode = false -- the statusline shows it o.laststatus = 3 o.title = true o.titlestring = "%t%( %M%) — LLeMbas IDE" o.scrolloff = 4 o.sidescrolloff = 8 o.wrap = false o.linebreak = true o.list = true o.listchars = { tab = "→ ", trail = "·", nbsp = "␣" } o.fillchars = { eob = " " } o.pumheight = 12 o.shortmess:append("I") -- the dashboard is the start screen o.mouse = "a" o.clipboard = "unnamedplus" -- the system clipboard, where a provider is installed o.undofile = true o.swapfile = true o.updatetime = 300 o.timeoutlen = 400 o.confirm = true -- ask instead of failing on unsaved changes o.splitright = true o.splitbelow = true o.splitkeep = "screen" o.ignorecase = true o.smartcase = true o.incsearch = true o.hlsearch = true o.inccommand = "split" o.expandtab = true o.shiftwidth = 2 o.tabstop = 2 o.softtabstop = 2 o.smartindent = true o.shiftround = true o.breakindent = true o.completeopt = { "menu", "menuone", "noselect" } o.wildmode = { "longest:full", "full" } -- A session holds windows and buffers, not options or variables. o.sessionoptions = { "buffers", "curdir", "folds", "help", "tabpages", "winsize" } vim.diagnostic.config({ severity_sort = true, underline = true, virtual_text = { spacing = 2, source = "if_many" }, float = { border = "rounded", source = "if_many" }, }) local group = vim.api.nvim_create_augroup("llembas_ide_options", { clear = true }) vim.api.nvim_create_autocmd("TextYankPost", { group = group, callback = function() pcall(vim.highlight.on_yank, { timeout = 150 }) end, }) -- Back to where the cursor was when the file was last open. vim.api.nvim_create_autocmd("BufReadPost", { group = group, callback = function(ev) local mark = vim.api.nvim_buf_get_mark(ev.buf, '"') if mark[1] > 0 and mark[1] <= vim.api.nvim_buf_line_count(ev.buf) then pcall(vim.api.nvim_win_set_cursor, 0, mark) end end, }) end return M