@@ -94,72 +94,76 @@ vim.g.maplocalleader = ' '
94
94
vim .g .have_nerd_font = true
95
95
96
96
-- [[ Setting options ]]
97
- -- See `:help vim.opt `
97
+ -- See `:help vim.o `
98
98
-- NOTE: You can change these options as you wish!
99
99
-- For more options, you can see `:help option-list`
100
100
101
101
-- Make line numbers default
102
- vim .opt .number = true
102
+ vim .o .number = true
103
103
-- You can also add relative line numbers, to help with jumping.
104
104
-- Experiment for yourself to see if you like it!
105
105
vim .opt .relativenumber = true
106
-
107
106
-- Enable mouse mode, can be useful for resizing splits for example!
108
- vim .opt .mouse = ' a'
107
+ vim .o .mouse = ' a'
109
108
110
109
-- Don't show the mode, since it's already in the status line
111
- vim .opt .showmode = false
110
+ vim .o .showmode = false
112
111
113
112
-- Sync clipboard between OS and Neovim.
114
113
-- Schedule the setting after `UiEnter` because it can increase startup-time.
115
114
-- Remove this option if you want your OS clipboard to remain independent.
116
115
-- See `:help 'clipboard'`
117
116
vim .schedule (function ()
118
- vim .opt .clipboard = ' unnamedplus'
117
+ vim .o .clipboard = ' unnamedplus'
119
118
end )
120
119
121
120
-- Enable break indent
122
- vim .opt .breakindent = true
121
+ vim .o .breakindent = true
123
122
124
123
-- Save undo history
125
- vim .opt .undofile = true
124
+ vim .o .undofile = true
126
125
127
126
-- 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
127
+ vim .o .ignorecase = true
128
+ vim .o .smartcase = true
130
129
131
130
-- Keep signcolumn on by default
132
- vim .opt .signcolumn = ' yes'
131
+ vim .o .signcolumn = ' yes'
133
132
134
133
-- Decrease update time
135
- vim .opt .updatetime = 250
134
+ vim .o .updatetime = 250
136
135
137
136
-- Decrease mapped sequence wait time
138
- vim .opt .timeoutlen = 300
137
+ vim .o .timeoutlen = 300
139
138
140
139
-- Configure how new splits should be opened
141
- vim .opt .splitright = true
142
- vim .opt .splitbelow = true
140
+ vim .o .splitright = true
141
+ vim .o .splitbelow = true
143
142
144
143
-- Sets how neovim will display certain whitespace characters in the editor.
145
144
-- See `:help 'list'`
146
145
-- and `:help 'listchars'`
147
- vim .opt .list = true
146
+ --
147
+ -- Notice listchars is set using `vim.opt` instead of `vim.o`.
148
+ -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
149
+ -- See `:help lua-options`
150
+ -- and `:help lua-options-guide`
151
+ vim .o .list = true
148
152
vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
149
153
150
154
-- Preview substitutions live, as you type!
151
- vim .opt .inccommand = ' split'
155
+ vim .o .inccommand = ' split'
152
156
153
157
-- Show which line your cursor is on
154
- vim .opt .cursorline = true
158
+ vim .o .cursorline = true
155
159
156
160
-- Minimal number of screen lines to keep above and below the cursor.
157
- vim .opt .scrolloff = 10
161
+ vim .o .scrolloff = 10
158
162
159
163
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
160
164
-- instead raise a dialog asking if you wish to save the current file(s)
161
165
-- See `:help 'confirm'`
162
- vim .opt .confirm = true
166
+ vim .o .confirm = true
163
167
164
168
-- [[ Basic Keymaps ]]
165
169
-- See `:help vim.keymap.set()`
@@ -205,12 +209,12 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
205
209
206
210
-- Highlight when yanking (copying) text
207
211
-- Try it with `yap` in normal mode
208
- -- See `:help vim.highlight .on_yank()`
212
+ -- See `:help vim.hl .on_yank()`
209
213
vim .api .nvim_create_autocmd (' TextYankPost' , {
210
214
desc = ' Highlight when yanking (copying) text' ,
211
215
group = vim .api .nvim_create_augroup (' kickstart-highlight-yank' , { clear = true }),
212
216
callback = function ()
213
- vim .highlight .on_yank ()
217
+ vim .hl .on_yank ()
214
218
end ,
215
219
})
216
220
@@ -223,8 +227,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
223
227
if vim .v .shell_error ~= 0 then
224
228
error (' Error cloning lazy.nvim:\n ' .. out )
225
229
end
226
- end --- @diagnostic disable-next-line : undefined-field
227
- vim .opt .rtp :prepend (lazypath )
230
+ end
231
+
232
+ --- @type vim.Option
233
+ local rtp = vim .opt .rtp
234
+ rtp :prepend (lazypath )
228
235
229
236
-- [[ Configure and install plugins ]]
230
237
--
@@ -239,7 +246,7 @@ vim.opt.rtp:prepend(lazypath)
239
246
-- NOTE: Here is where you install your plugins.
240
247
require (' lazy' ).setup ({
241
248
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
242
- ' tpope/vim-sleuth ' , -- Detect tabstop and shiftwidth automatically
249
+ ' NMAC427/guess-indent.nvim ' , -- Detect tabstop and shiftwidth automatically
243
250
244
251
-- NOTE: Plugins can also be added by using a table,
245
252
-- with the first argument being the link and the following
@@ -295,7 +302,7 @@ require('lazy').setup({
295
302
event = ' VimEnter' , -- Sets the loading event to 'VimEnter'
296
303
opts = {
297
304
-- delay between pressing a key and opening which-key (milliseconds)
298
- -- this setting is independent of vim.opt .timeoutlen
305
+ -- this setting is independent of vim.o .timeoutlen
299
306
delay = 0 ,
300
307
icons = {
301
308
-- set icon mappings to true if you have a Nerd Font
@@ -474,8 +481,8 @@ require('lazy').setup({
474
481
-- Automatically install LSPs and related tools to stdpath for Neovim
475
482
-- Mason must be loaded before its dependents so we need to set it up here.
476
483
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
477
- { ' williamboman /mason.nvim' , opts = {} },
478
- ' williamboman /mason-lspconfig.nvim' ,
484
+ { ' mason-org /mason.nvim' , opts = {} },
485
+ ' mason-org /mason-lspconfig.nvim' ,
479
486
' WhoIsSethDaniel/mason-tool-installer.nvim' ,
480
487
481
488
-- Useful status updates for LSP.
0 commit comments