@@ -98,73 +98,78 @@ vim.opt.linebreak = true
9898vim .opt .showbreak = ' ↳'
9999
100100-- [[ Setting options ]]
101- -- See `:help vim.opt `
101+ -- See `:help vim.o `
102102-- NOTE: You can change these options as you wish!
103103-- For more options, you can see `:help option-list`
104104
105105-- Make line numbers default
106- vim .opt .number = true
106+ vim .o .number = true
107107-- You can also add relative line numbers, to help with jumping.
108108-- Experiment for yourself to see if you like it!
109- vim .opt .relativenumber = true
109+ -- vim.o .relativenumber = true
110110
111111-- Enable mouse mode, can be useful for resizing splits for example!
112- vim .opt .mouse = ' a'
112+ vim .o .mouse = ' a'
113113
114114-- Don't show the mode, since it's already in the status line
115- vim .opt .showmode = false
115+ vim .o .showmode = false
116116
117117-- Sync clipboard between OS and Neovim.
118118-- Schedule the setting after `UiEnter` because it can increase startup-time.
119119-- Remove this option if you want your OS clipboard to remain independent.
120120-- See `:help 'clipboard'`
121121vim .schedule (function ()
122- vim .opt .clipboard = ' unnamedplus'
122+ vim .o .clipboard = ' unnamedplus'
123123end )
124124
125125-- Enable break indent
126- vim .opt .breakindent = true
126+ vim .o .breakindent = true
127127
128128-- Save undo history
129- vim .opt .undofile = true
129+ vim .o .undofile = true
130130
131131-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
132132vim .opt .ignorecase = true
133133vim .opt .smartcase = true
134134vim .opt .smartindent = true
135135
136136-- Keep signcolumn on by default
137- vim .opt .signcolumn = ' yes'
137+ vim .o .signcolumn = ' yes'
138138
139139-- Decrease update time
140- vim .opt .updatetime = 250
140+ vim .o .updatetime = 250
141141
142142-- Decrease mapped sequence wait time
143- vim .opt .timeoutlen = 300
143+ vim .o .timeoutlen = 300
144144
145145-- Configure how new splits should be opened
146- vim .opt .splitright = true
147- vim .opt .splitbelow = true
146+ vim .o .splitright = true
147+ vim .o .splitbelow = true
148148
149149-- Sets how neovim will display certain whitespace characters in the editor.
150150-- See `:help 'list'`
151151-- and `:help 'listchars'`
152- vim .opt .list = true
152+ --
153+ -- Notice listchars is set using `vim.opt` instead of `vim.o`.
154+ -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
155+ -- See `:help lua-options`
156+ -- and `:help lua-options-guide`
157+ vim .o .list = true
153158vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
154159
155160-- Preview substitutions live, as you type!
156- vim .opt .inccommand = ' split'
161+ vim .o .inccommand = ' split'
157162
158163-- Show which line your cursor is on
159- vim .opt .cursorline = true
164+ vim .o .cursorline = true
160165
161166-- Minimal number of screen lines to keep above and below the cursor.
162167vim .opt .scrolloff = 99999999
163168
164169-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
165170-- instead raise a dialog asking if you wish to save the current file(s)
166171-- See `:help 'confirm'`
167- vim .opt .confirm = true
172+ vim .o .confirm = true
168173
169174-- [[ Basic Keymaps ]]
170175-- See `:help vim.keymap.set()`
@@ -210,12 +215,12 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
210215
211216-- Highlight when yanking (copying) text
212217-- Try it with `yap` in normal mode
213- -- See `:help vim.highlight .on_yank()`
218+ -- See `:help vim.hl .on_yank()`
214219vim .api .nvim_create_autocmd (' TextYankPost' , {
215220 desc = ' Highlight when yanking (copying) text' ,
216221 group = vim .api .nvim_create_augroup (' kickstart-highlight-yank' , { clear = true }),
217222 callback = function ()
218- vim .highlight .on_yank ()
223+ vim .hl .on_yank ()
219224 end ,
220225})
221226
@@ -228,8 +233,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
228233 if vim .v .shell_error ~= 0 then
229234 error (' Error cloning lazy.nvim:\n ' .. out )
230235 end
231- end --- @diagnostic disable-next-line : undefined-field
232- vim .opt .rtp :prepend (lazypath )
236+ end
237+
238+ --- @type vim.Option
239+ local rtp = vim .opt .rtp
240+ rtp :prepend (lazypath )
233241
234242-- [[ Configure and install plugins ]]
235243--
@@ -244,7 +252,7 @@ vim.opt.rtp:prepend(lazypath)
244252-- NOTE: Here is where you install your plugins.
245253require (' lazy' ).setup ({
246254 -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
247- ' tpope/vim-sleuth ' , -- Detect tabstop and shiftwidth automatically
255+ ' NMAC427/guess-indent.nvim ' , -- Detect tabstop and shiftwidth automatically
248256
249257 -- NOTE: Plugins can also be added by using a table,
250258 -- with the first argument being the link and the following
@@ -300,7 +308,7 @@ require('lazy').setup({
300308 event = ' VimEnter' , -- Sets the loading event to 'VimEnter'
301309 opts = {
302310 -- delay between pressing a key and opening which-key (milliseconds)
303- -- this setting is independent of vim.opt .timeoutlen
311+ -- this setting is independent of vim.o .timeoutlen
304312 delay = 0 ,
305313 icons = {
306314 -- set icon mappings to true if you have a Nerd Font
@@ -494,8 +502,8 @@ require('lazy').setup({
494502 -- Automatically install LSPs and related tools to stdpath for Neovim
495503 -- Mason must be loaded before its dependents so we need to set it up here.
496504 -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
497- { ' williamboman /mason.nvim' , opts = {} },
498- ' williamboman /mason-lspconfig.nvim' ,
505+ { ' mason-org /mason.nvim' , opts = {} },
506+ ' mason-org /mason-lspconfig.nvim' ,
499507 ' WhoIsSethDaniel/mason-tool-installer.nvim' ,
500508
501509 -- Useful status updates for LSP.
0 commit comments