@@ -16,65 +16,66 @@ vim.g.maplocalleader = '\\'
16
16
vim .g .have_nerd_font = true
17
17
18
18
-- [[ Setting options ]]
19
- -- See `:help vim.opt `
19
+ -- See `:help vim.o `
20
20
-- NOTE: You can change these options as you wish!
21
21
-- For more options, you can see `:help option-list`
22
22
23
23
-- new in 0.11+
24
24
-- vim.o.winborder = 'rounded'
25
25
26
26
-- Make line numbers default
27
- vim .opt .number = true
27
+ vim .o .number = true
28
28
-- You can also add relative line numbers, to help with jumping.
29
29
-- Experiment for yourself to see if you like it!
30
- -- vim.opt .relativenumber = true
30
+ -- vim.o .relativenumber = true
31
31
32
32
-- Enable mouse mode, can be useful for resizing splits for example!
33
- vim .opt .mouse = ' a'
33
+ vim .o .mouse = ' a'
34
34
35
35
-- Don't show the mode, since it's already in the status line
36
- vim .opt .showmode = false
36
+ vim .o .showmode = false
37
37
38
38
vim .opt .completeopt = { ' menu' , ' menuone' , ' noselect' , ' noinsert' , ' popup' }
39
39
40
40
-- Use system clipboard for copy/yank operations, but don't override it when pasting
41
41
vim .opt .clipboard :append ' unnamed' -- use * register
42
- -- vim.opt .clipboard:append('unnamedplus') -- use + register (not needed on macOS as * and + are the same)
42
+ -- vim.o .clipboard:append('unnamedplus') -- use + register (not needed on macOS as * and + are the same)
43
43
44
44
-- Preserve clipboard when pasting in visual mode
45
45
vim .keymap .set (' x' , ' p' , ' "_dP' )
46
46
47
47
-- views can only be fully collapsed with the global statusline
48
- vim .opt .laststatus = 3
48
+ vim .o .laststatus = 3
49
49
50
50
-- Enable break indent
51
- vim .opt .breakindent = true
51
+ vim .o .breakindent = true
52
52
53
53
-- Save undo history
54
- vim .opt .undofile = true
55
- vim .opt .ul = 500 -- undolevel
54
+ vim .o .undofile = true
55
+ vim .o .ul = 500 -- undolevel
56
56
57
57
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
58
- vim .opt .ignorecase = true
59
- vim .opt .smartcase = true
58
+ vim .o .ignorecase = true
59
+ vim .o .smartcase = true
60
60
61
61
-- Keep signcolumn on by default
62
- vim .opt .signcolumn = ' yes'
62
+ vim .o .signcolumn = ' yes'
63
63
64
64
-- Decrease update time
65
- vim .opt .updatetime = 250
65
+ vim .o .updatetime = 250
66
66
67
67
-- Decrease mapped sequence wait time
68
- vim .opt .timeoutlen = 300
68
+ vim .o .timeoutlen = 300
69
69
70
70
-- Configure how new splits should be opened
71
- vim .opt .splitright = true
72
- vim .opt .splitbelow = true
73
-
74
- -- Sets how neovim will display certain whitespace characters in the editor.
75
- -- See `:help 'list'`
76
- -- and `:help 'listchars'`
77
- vim .opt .list = true
71
+ vim .o .splitright = true
72
+ vim .o .splitbelow = true
73
+
74
+ -- Notice listchars is set using `vim.opt` instead of `vim.o`.
75
+ -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
76
+ -- See `:help lua-options`
77
+ -- and `:help lua-options-guide`vim.o.list = true
78
+ vim .o .list = true
78
79
vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
79
80
80
81
vim .opt_local .tabstop = 2
@@ -85,10 +86,10 @@ vim.opt_local.expandtab = true
85
86
vim .api .nvim_create_autocmd (' FileType' , {
86
87
pattern = ' go' ,
87
88
callback = function ()
88
- vim .opt_local .tabstop = 4
89
- vim .opt_local .shiftwidth = 4
90
- vim .opt_local .expandtab = false
91
- vim .opt .listchars = { tab = ' ' , trail = ' ·' , nbsp = ' ␣' }
89
+ vim .o_local .tabstop = 4
90
+ vim .o_local .shiftwidth = 4
91
+ vim .o_local .expandtab = false
92
+ vim .o .listchars = { tab = ' ' , trail = ' ·' , nbsp = ' ␣' }
92
93
vim .cmd ' iabbrev dl :='
93
94
end ,
94
95
})
@@ -97,45 +98,45 @@ vim.api.nvim_create_autocmd('FileType', {
97
98
vim .api .nvim_create_autocmd (' FileType' , {
98
99
pattern = ' json' ,
99
100
callback = function ()
100
- vim .opt_local .tabstop = 2
101
- vim .opt_local .shiftwidth = 2
102
- vim .opt_local .expandtab = false
101
+ vim .o_local .tabstop = 2
102
+ vim .o_local .shiftwidth = 2
103
+ vim .o_local .expandtab = false
103
104
end ,
104
105
})
105
106
106
107
-- But Ruby is no better
107
108
vim .api .nvim_create_autocmd (' FileType' , {
108
109
pattern = ' ruby' ,
109
110
callback = function ()
110
- vim .opt_local .indentkeys :remove { ' .' , ' 0{' }
111
+ vim .o_local .indentkeys :remove { ' .' , ' 0{' }
111
112
end ,
112
113
})
113
114
114
115
-- Preview substitutions live, as you type!
115
- vim .opt .inccommand = ' split'
116
+ vim .o .inccommand = ' split'
116
117
117
118
-- Show which line your cursor is on
118
- vim .opt .cursorline = false
119
+ vim .o .cursorline = false
119
120
120
121
-- Minimal number of screen lines to keep above and below the cursor.
121
- vim .opt .scrolloff = 10
122
+ vim .o .scrolloff = 10
122
123
123
124
-- ests sefalsettings
124
- vim .opt .directory = ' /tmp/vim/swap'
125
- vim .opt .writebackup = true
126
- vim .opt .backup = true
127
- vim .opt .backupcopy = ' auto'
128
- vim .opt .backupdir = ' /tmp/vim/backup'
129
- vim .opt .undofile = true
130
- vim .opt .undodir = ' /tmp/vim/undo'
131
- vim .opt .viewdir = ' /tmp/vim/viewdir'
132
- vim .opt .conceallevel = 0
125
+ vim .o .directory = ' /tmp/vim/swap'
126
+ vim .o .writebackup = true
127
+ vim .o .backup = true
128
+ vim .o .backupcopy = ' auto'
129
+ vim .o .backupdir = ' /tmp/vim/backup'
130
+ vim .o .undofile = true
131
+ vim .o .undodir = ' /tmp/vim/undo'
132
+ vim .o .viewdir = ' /tmp/vim/viewdir'
133
+ vim .o .conceallevel = 0
133
134
-- hybrid relativenumbers
134
135
vim .o .relativenumber = true
135
136
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
136
137
-- instead raise a dialog asking if you wish to save the current file(s)
137
138
-- See `:help 'confirm'`
138
- vim .opt .confirm = true
139
+ vim .o .confirm = true
139
140
140
141
-- [[ Basic Keymaps ]]
141
142
-- See `:help vim.keymap.set()`
@@ -187,12 +188,12 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
187
188
188
189
-- Highlight when yanking (copying) text
189
190
-- Try it with `yap` in normal mode
190
- -- See `:help vim.highlight .on_yank()`
191
+ -- See `:help vim.hl .on_yank()`
191
192
vim .api .nvim_create_autocmd (' TextYankPost' , {
192
193
desc = ' Highlight when yanking (copying) text' ,
193
194
group = vim .api .nvim_create_augroup (' kickstart-highlight-yank' , { clear = true }),
194
195
callback = function ()
195
- vim .highlight .on_yank ()
196
+ vim .hl .on_yank ()
196
197
end ,
197
198
})
198
199
@@ -205,8 +206,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
205
206
if vim .v .shell_error ~= 0 then
206
207
error (' Error cloning lazy.nvim:\n ' .. out )
207
208
end
208
- end --- @diagnostic disable-next-line : undefined-field
209
- vim .opt .rtp :prepend (lazypath )
209
+ end
210
+
211
+ --- @type vim.Option
212
+ local rtp = vim .opt .rtp
213
+ rtp :prepend (lazypath )
210
214
211
215
-- [[ Configure and install plugins ]]
212
216
--
@@ -279,7 +283,7 @@ require('lazy').setup({
279
283
event = ' VimEnter' , -- Sets the loading event to 'VimEnter'
280
284
opts = {
281
285
-- delay between pressing a key and opening which-key (milliseconds)
282
- -- this setting is independent of vim.opt .timeoutlen
286
+ -- this setting is independent of vim.o .timeoutlen
283
287
delay = 0 ,
284
288
icons = {
285
289
-- set icon mappings to true if you have a Nerd Font
@@ -466,8 +470,8 @@ require('lazy').setup({
466
470
-- Automatically install LSPs and related tools to stdpath for Neovim
467
471
-- Mason must be loaded before its dependents so we need to set it up here.
468
472
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
469
- { ' williamboman /mason.nvim' , opts = {} },
470
- ' williamboman /mason-lspconfig.nvim' ,
473
+ { ' mason-org /mason.nvim' , opts = {} },
474
+ ' mason-org /mason-lspconfig.nvim' ,
471
475
' WhoIsSethDaniel/mason-tool-installer.nvim' ,
472
476
473
477
-- Useful status updates for LSP.
0 commit comments