@@ -94,72 +94,78 @@ vim.g.maplocalleader = ' '
9494vim .g .have_nerd_font = true
9595
9696-- [[ Setting options ]]
97- -- See `:help vim.opt `
97+ -- See `:help vim.o `
9898-- NOTE: You can change these options as you wish!
9999-- For more options, you can see `:help option-list`
100100
101101-- Make line numbers default
102- vim .opt .number = true
102+ vim .o .number = true
103103-- You can also add relative line numbers, to help with jumping.
104104-- Experiment for yourself to see if you like it!
105+
105106vim .opt .relativenumber = true
106107
107108-- Enable mouse mode, can be useful for resizing splits for example!
108- vim .opt .mouse = ' a'
109+ vim .o .mouse = ' a'
109110
110111-- Don't show the mode, since it's already in the status line
111- vim .opt .showmode = false
112+ vim .o .showmode = false
112113
113114-- Sync clipboard between OS and Neovim.
114115-- Schedule the setting after `UiEnter` because it can increase startup-time.
115116-- Remove this option if you want your OS clipboard to remain independent.
116117-- See `:help 'clipboard'`
117118vim .schedule (function ()
118- vim .opt .clipboard = ' unnamedplus'
119+ vim .o .clipboard = ' unnamedplus'
119120end )
120121
121122-- Enable break indent
122- vim .opt .breakindent = true
123+ vim .o .breakindent = true
123124
124125-- Save undo history
125- vim .opt .undofile = true
126+ vim .o .undofile = true
126127
127128-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
128- vim .opt .ignorecase = true
129- vim .opt .smartcase = true
129+ vim .o .ignorecase = true
130+ vim .o .smartcase = true
130131
131132-- Keep signcolumn on by default
132- vim .opt .signcolumn = ' yes'
133+ vim .o .signcolumn = ' yes'
133134
134135-- Decrease update time
135- vim .opt .updatetime = 250
136+ vim .o .updatetime = 250
136137
137138-- Decrease mapped sequence wait time
138- vim .opt .timeoutlen = 300
139+ vim .o .timeoutlen = 300
139140
140141-- Configure how new splits should be opened
141- vim .opt .splitright = true
142- vim .opt .splitbelow = true
142+ vim .o .splitright = true
143+ vim .o .splitbelow = true
143144
144145-- Sets how neovim will display certain whitespace characters in the editor.
145146-- See `:help 'list'`
146147-- and `:help 'listchars'`
147- vim .opt .list = true
148+ --
149+ -- Notice listchars is set using `vim.opt` instead of `vim.o`.
150+ -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
151+ -- See `:help lua-options`
152+ -- and `:help lua-options-guide`
153+ vim .o .list = true
148154vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
149155
150156-- Preview substitutions live, as you type!
151- vim .opt .inccommand = ' split'
157+ vim .o .inccommand = ' split'
152158
153159-- Show which line your cursor is on
154- vim .opt .cursorline = true
160+ vim .o .cursorline = true
155161
156162-- Minimal number of screen lines to keep above and below the cursor.
157- vim .opt .scrolloff = 10
163+ vim .o .scrolloff = 10
158164
159165-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
160166-- instead raise a dialog asking if you wish to save the current file(s)
161167-- See `:help 'confirm'`
162- vim .opt .confirm = true
168+ vim .o .confirm = true
163169
164170-- [[ Basic Keymaps ]]
165171-- See `:help vim.keymap.set()`
@@ -209,12 +215,12 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
209215
210216-- Highlight when yanking (copying) text
211217-- Try it with `yap` in normal mode
212- -- See `:help vim.highlight .on_yank()`
218+ -- See `:help vim.hl .on_yank()`
213219vim .api .nvim_create_autocmd (' TextYankPost' , {
214220 desc = ' Highlight when yanking (copying) text' ,
215221 group = vim .api .nvim_create_augroup (' kickstart-highlight-yank' , { clear = true }),
216222 callback = function ()
217- vim .highlight .on_yank ()
223+ vim .hl .on_yank ()
218224 end ,
219225})
220226
@@ -227,8 +233,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
227233 if vim .v .shell_error ~= 0 then
228234 error (' Error cloning lazy.nvim:\n ' .. out )
229235 end
230- end --- @diagnostic disable-next-line : undefined-field
231- vim .opt .rtp :prepend (lazypath )
236+ end
237+
238+ --- @type vim.Option
239+ local rtp = vim .opt .rtp
240+ rtp :prepend (lazypath )
232241
233242-- [[ Configure and install plugins ]]
234243--
@@ -243,7 +252,7 @@ vim.opt.rtp:prepend(lazypath)
243252-- NOTE: Here is where you install your plugins.
244253require (' lazy' ).setup ({
245254 -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
246- ' tpope/vim-sleuth ' , -- Detect tabstop and shiftwidth automatically
255+ ' NMAC427/guess-indent.nvim ' , -- Detect tabstop and shiftwidth automatically
247256
248257 -- NOTE: Plugins can also be added by using a table,
249258 -- with the first argument being the link and the following
@@ -303,7 +312,7 @@ require('lazy').setup({
303312 event = ' VimEnter' , -- Sets the loading event to 'VimEnter'
304313 opts = {
305314 -- delay between pressing a key and opening which-key (milliseconds)
306- -- this setting is independent of vim.opt .timeoutlen
315+ -- this setting is independent of vim.o .timeoutlen
307316 delay = 0 ,
308317 icons = {
309318 -- set icon mappings to true if you have a Nerd Font
@@ -482,8 +491,8 @@ require('lazy').setup({
482491 -- Automatically install LSPs and related tools to stdpath for Neovim
483492 -- Mason must be loaded before its dependents so we need to set it up here.
484493 -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
485- { ' williamboman /mason.nvim' , opts = {} },
486- ' williamboman /mason-lspconfig.nvim' ,
494+ { ' mason-org /mason.nvim' , opts = {} },
495+ ' mason-org /mason-lspconfig.nvim' ,
487496 ' WhoIsSethDaniel/mason-tool-installer.nvim' ,
488497
489498 -- Useful status updates for LSP.
0 commit comments