@@ -94,72 +94,77 @@ vim.g.maplocalleader = ' '
94
94
vim .g .have_nerd_font = false
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
- -- vim.opt .relativenumber = true
105
+ -- vim.o .relativenumber = true
106
106
107
107
-- Enable mouse mode, can be useful for resizing splits for example!
108
- vim .opt .mouse = ' a'
108
+ vim .o .mouse = ' a'
109
109
110
110
-- Don't show the mode, since it's already in the status line
111
- vim .opt .showmode = false
111
+ vim .o .showmode = false
112
112
113
113
-- Sync clipboard between OS and Neovim.
114
114
-- Schedule the setting after `UiEnter` because it can increase startup-time.
115
115
-- Remove this option if you want your OS clipboard to remain independent.
116
116
-- See `:help 'clipboard'`
117
117
vim .schedule (function ()
118
- vim .opt .clipboard = ' unnamedplus'
118
+ vim .o .clipboard = ' unnamedplus'
119
119
end )
120
120
121
121
-- Enable break indent
122
- vim .opt .breakindent = true
122
+ vim .o .breakindent = true
123
123
124
124
-- Save undo history
125
- vim .opt .undofile = true
125
+ vim .o .undofile = true
126
126
127
127
-- 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
128
+ vim .o .ignorecase = true
129
+ vim .o .smartcase = true
130
130
131
131
-- Keep signcolumn on by default
132
- vim .opt .signcolumn = ' yes'
132
+ vim .o .signcolumn = ' yes'
133
133
134
134
-- Decrease update time
135
- vim .opt .updatetime = 250
135
+ vim .o .updatetime = 250
136
136
137
137
-- Decrease mapped sequence wait time
138
- vim .opt .timeoutlen = 300
138
+ vim .o .timeoutlen = 300
139
139
140
140
-- Configure how new splits should be opened
141
- vim .opt .splitright = true
142
- vim .opt .splitbelow = true
141
+ vim .o .splitright = true
142
+ vim .o .splitbelow = true
143
143
144
144
-- Sets how neovim will display certain whitespace characters in the editor.
145
145
-- See `:help 'list'`
146
146
-- and `:help 'listchars'`
147
- vim .opt .list = true
147
+ --
148
+ -- Notice listchars is set using `vim.opt` instead of `vim.o`.
149
+ -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
150
+ -- See `:help lua-options`
151
+ -- and `:help lua-options-guide`
152
+ vim .o .list = true
148
153
vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
149
154
150
155
-- Preview substitutions live, as you type!
151
- vim .opt .inccommand = ' split'
156
+ vim .o .inccommand = ' split'
152
157
153
158
-- Show which line your cursor is on
154
- vim .opt .cursorline = true
159
+ vim .o .cursorline = true
155
160
156
161
-- Minimal number of screen lines to keep above and below the cursor.
157
- vim .opt .scrolloff = 10
162
+ vim .o .scrolloff = 10
158
163
159
164
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
160
165
-- instead raise a dialog asking if you wish to save the current file(s)
161
166
-- See `:help 'confirm'`
162
- vim .opt .confirm = true
167
+ vim .o .confirm = true
163
168
164
169
-- [[ Basic Keymaps ]]
165
170
-- See `:help vim.keymap.set()`
@@ -223,8 +228,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
223
228
if vim .v .shell_error ~= 0 then
224
229
error (' Error cloning lazy.nvim:\n ' .. out )
225
230
end
226
- end --- @diagnostic disable-next-line : undefined-field
227
- vim .opt .rtp :prepend (lazypath )
231
+ end
232
+
233
+ --- @type vim.Option
234
+ local rtp = vim .opt .rtp
235
+ rtp :prepend (lazypath )
228
236
229
237
-- [[ Configure and install plugins ]]
230
238
--
@@ -295,7 +303,7 @@ require('lazy').setup({
295
303
event = ' VimEnter' , -- Sets the loading event to 'VimEnter'
296
304
opts = {
297
305
-- delay between pressing a key and opening which-key (milliseconds)
298
- -- this setting is independent of vim.opt .timeoutlen
306
+ -- this setting is independent of vim.o .timeoutlen
299
307
delay = 0 ,
300
308
icons = {
301
309
-- set icon mappings to true if you have a Nerd Font
0 commit comments