-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
95 lines (87 loc) · 1.91 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
vim.g.mapleader = " " -- Set map leader
-- Setup the package manager with plugins and configuration options
require("lazy").setup({
-- Default theme
"devraza/kagayaki.nvim",
"folke/which-key.nvim",
{
"nvim-telescope/telescope.nvim",
dependencies = { 'nvim-lua/plenary.nvim' },
},
-- Language servers
"neovim/nvim-lspconfig",
"VonHeikemen/lsp-zero.nvim", branch = "v4.x",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/nvim-cmp",
"williamboman/mason.nvim",
'williamboman/mason-lspconfig.nvim',
"romgrk/barbar.nvim",
"nvim-lualine/lualine.nvim",
{"ellisonleao/glow.nvim", config = true, cmd = "Glow"},
{
"max397574/better-escape.nvim",
config = function()
require("better_escape").setup()
end,
},
"rktjmp/lush.nvim",
{
'goolord/alpha-nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
},
"nvim-tree/nvim-tree.lua",
"akinsho/toggleterm.nvim",
{
'kaarmu/typst.vim',
ft = 'typst',
lazy = false,
}
})
-- nvim-tree.lua setup
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup({
sort = {
sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
-- Toggleterm
require("toggleterm").setup{
open_mapping = [[<M-[>]],
direction = 'float',
}
-- Imports from files
require 'core'
-- Language server configuration
require("mason").setup()
require('mason-lspconfig').setup({
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
},
})
require('lspconfig').gopls.setup({})
require('lspconfig').rust_analyzer.setup({})
require('lsp-zero').setup_servers({'gopls', 'rust_analyzer'})
local cmp = require('cmp')
cmp.setup({
sources = {
{name = 'nvim_lsp'},
},
mapping = cmp.mapping.preset.insert({}),
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
})