-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
101 lines (89 loc) · 2.34 KB
/
init.lua
File metadata and controls
101 lines (89 loc) · 2.34 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
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
96
97
98
99
100
101
-- Setup lazy
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader=" "
vim.env.Path = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and "; " or ":") .. vim.env.PATH
vim.cmd [[let $RUST_LOG="error"]]
require("lazy").setup({
defaults = { lazy = false },
spec = {
{ import = "plugins" },
},
checker = {
enabled = true,
notify = false,
frequency = 3600,
},
})
local lspconfig = require("lspconfig")
lspconfig.clangd.setup {
on_attach = on_attach,
capabilities = capabilities,
cmd = {
"clangd",
"-compile-commands-dir=./compile_flags.txt"
},
init_options = {
}
}
lspconfig.gopls.setup({
cmd = { "/Users/wonbinjin/go/bin/gopls" },
on_attach = on_attach,
capabilities = capabilities,
filetypes = { "go", "gomod", "gowork", "gotmpl" },
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedparams = true,
},
},
},
})
lspconfig.ruff.setup({
on_attach = on_attach,
capabilities = capabilities,
})
lspconfig.ts_ls.setup({
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = "/usr/local/lib/node_modules/@vue/typescript-plugin",
languages = {"javascript", "typescript", "vue"},
},
},
},
filetypes = {
"javascript",
"typescript",
"vue",
},
})
-- lspconfig.rust_analyzer.setup {
-- settings = {
-- ['rust-analyzer'] = {
-- procMacro = { enable = false },
-- cargo = { allFeatures = false },
-- checkOnSave = { command = 'check' },
-- diagnostics = { experimental = { enable = false } },
-- },
-- },
-- }
-- lspconfig.
local float = require("float")
vim.keymap.set({ "n", "t" }, "<leader>tt", function()
float.toggle()
end, { desc = "Toggle floating terminal" })
require("oil").setup({
view_options = {
show_hidden = true
}
})
require("config.mappings")
require("config.init")