-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinit.lua
More file actions
57 lines (45 loc) · 1.47 KB
/
Copy pathinit.lua
File metadata and controls
57 lines (45 loc) · 1.47 KB
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
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.signcolumn = "yes"
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.textwidth = 80
vim.diagnostic.config({ virtual_text = true })
vim.cmd.colorscheme("catppuccin")
vim.pack.add({
"https://github.com/nvim-treesitter/nvim-treesitter",
"https://github.com/saghen/blink.cmp",
"https://github.com/neovim/nvim-lspconfig",
"https://github.com/mason-org/mason.nvim",
"https://github.com/mason-org/mason-lspconfig.nvim",
"https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim",
}, { confirm = false })
require("nvim-treesitter.configs").setup({
auto_install = true,
})
vim.api.nvim_create_autocmd("FileType", {
callback = function(args)
local lang = vim.treesitter.language.get_lang(vim.bo[args.buf].filetype)
if lang and vim.treesitter.language.add(lang) then
vim.treesitter.start(args.buf, lang)
end
end,
})
require("blink.cmp").setup({ fuzzy = { implementation = "lua" } })
local lsp_servers = {
lua_ls = { Lua = { workspace = { library = vim.api.nvim_get_runtime_file("lua", true) } }, },
}
require("mason").setup()
require("mason-lspconfig").setup()
require("mason-tool-installer").setup({
ensure_installed = vim.tbl_keys(lsp_servers),
})
for server, config in pairs(lsp_servers) do
vim.lsp.config(server, {
settings = config,
on_attach = function(_, bufnr)
vim.keymap.set("n", "grd", vim.lsp.buf.definition, { buffer = bufnr })
end,
})
end