Skip to content

Commit bfc5af1

Browse files
oriori1703ests
authored andcommitted
Replace vim.opt with vim.o (nvim-lua#1495)
* Replace vim.opt with vim.o Because it offers a nicer interface and info on hover. For now leave vim.opt when using the table interface (until vim.o with tables is implemented) * Add type hint for vim.opt.rtp * Add a comment about using vim.opt instead of vim.o
1 parent 501167d commit bfc5af1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

init.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ vim.keymap.set('x', 'p', '"_dP')
4646

4747
-- views can only be fully collapsed with the global statusline
4848
vim.o.laststatus = 3
49+
-- Sync clipboard between OS and Neovim.
50+
-- Schedule the setting after `UiEnter` because it can increase startup-time.
51+
-- Remove this option if you want your OS clipboard to remain independent.
52+
-- See `:help 'clipboard'`
53+
vim.schedule(function()
54+
vim.o.clipboard = 'unnamedplus'
55+
end)
4956

5057
-- Enable break indent
5158
vim.o.breakindent = true
@@ -75,6 +82,14 @@ vim.o.splitbelow = true
7582
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
7683
-- See `:help lua-options`
7784
-- and `:help lua-options-guide`vim.o.list = true
85+
-- Sets how neovim will display certain whitespace characters in the editor.
86+
-- See `:help 'list'`
87+
-- and `:help 'listchars'`
88+
--
89+
-- Notice listchars is set using `vim.opt` instead of `vim.o`.
90+
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
91+
-- See `:help lua-options`
92+
-- and `:help lua-options-guide`
7893
vim.o.list = true
7994
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
8095

0 commit comments

Comments
 (0)