-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
65 lines (59 loc) · 2.44 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
-- Setting package.path ensures that require() knows where to look for files.
local config_path = vim.fn.stdpath("config")
package.path = config_path .. "/lua/?.lua;" .. config_path .. "/lua/?/init.lua;" .. package.path
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Functions and options are set here. I want plugins to hijack these, as
-- any installed overrides would be intentional.
require('homebrew.functions')
require('homebrew.options')
require('homebrew.clipboard')
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " " -- using space as leader key
vim.g.maplocalleader = "," -- using comma as local leader
vim.g.loaded_perl_provider = 0 -- disable perl provider
-- So lazy.nvim is configured to autoload these files:
-- * lua/plugins/basic.lua
-- * lua/plugins/autoload/*.lua
--
-- plugins/basic.lua loads all plugins that don't require additional
-- configuration.
--
-- plugins/autoload/*.lua are files intended to contain a single plugin
-- per file, with additional configuration.
--
-- If the configuration is extensive, additional settings should be put in
-- plugins/config/*.lua and loaded from a plugins/autoload/*.lua file.
require("lazy").setup({
{ import = 'plugins.basic' },
{ import = 'plugins.autoload' },
}, {
change_detection = { notify = false },
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { vim.colorscheme } },
-- automatically check for plugin updates
checker = { enabled = true, notify = false },
ui = { border = "rounded" }
}
)
-- Some easier access to the Lazy dashboard.
vim.keymap.set('n', '<leader>L', ':Lazy<cr>', {})
-- Executed here so our maps always override any plugin maps.
require('homebrew.autocommands')
require('homebrew.maps')