diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-03-16 00:09:49 +0100 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-03-16 00:09:49 +0100 |
| commit | caaa902fc1aa225e23a066cb5cd669a68a721f6c (patch) | |
| tree | 9f6865f55e04700ee1d38eab2483bb1187c4f957 /nvim/lua | |
| parent | d29a9724a7c4404427dab4cad199c12f6b09e427 (diff) | |
| download | dots-caaa902fc1aa225e23a066cb5cd669a68a721f6c.tar.gz | |
nvim: Use relative numbers
Diffstat (limited to 'nvim/lua')
| -rw-r--r-- | nvim/lua/options.lua | 67 |
1 files changed, 47 insertions, 20 deletions
diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index a636e35..add7117 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -1,42 +1,69 @@ -- [[ Setting options ]] --- See `:help vim.o` +-- See `:help vim.opt` -- NOTE: You can change these options as you wish! - --- Set highlight on search -vim.o.hlsearch = false +-- For more options, you can see `:help option-list` -- Make line numbers default -vim.wo.number = true +vim.opt.number = true +-- You can also add relative line numbers, to help with jumping. +-- Experiment for yourself to see if you like it! +vim.opt.relativenumber = true + +-- Enable mouse mode, can be useful for resizing splits for example! +vim.opt.mouse = 'a' --- Enable mouse mode -vim.o.mouse = 'a' +-- Don't show the mode, since it's already in the status line +vim.opt.showmode = false -- Sync clipboard between OS and Neovim. +-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.o.clipboard = 'unnamedplus' +vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' +end) -- Enable break indent -vim.o.breakindent = true +vim.opt.breakindent = true -- Save undo history -vim.o.undofile = true +vim.opt.undofile = true --- Case-insensitive searching UNLESS \C or capital in search -vim.o.ignorecase = true -vim.o.smartcase = true +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +vim.opt.ignorecase = true +vim.opt.smartcase = true -- Keep signcolumn on by default -vim.wo.signcolumn = 'yes' +vim.opt.signcolumn = 'yes' -- Decrease update time -vim.o.updatetime = 250 -vim.o.timeoutlen = 300 +vim.opt.updatetime = 250 + +-- Decrease mapped sequence wait time +vim.opt.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Sets how neovim will display certain whitespace characters in the editor. +-- See `:help 'list'` +-- and `:help 'listchars'` +vim.opt.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live, as you type! +vim.opt.inccommand = 'split' + +-- Show which line your cursor is on +vim.opt.cursorline = true --- Set completeopt to have a better completion experience -vim.o.completeopt = 'menuone,noselect' +-- Minimal number of screen lines to keep above and below the cursor. +vim.opt.scrolloff = 10 --- NOTE: You should make sure your terminal supports this -vim.o.termguicolors = true +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- See `:help 'confirm'` +vim.opt.confirm = true -- vim: ts=2 sts=2 sw=2 et |