-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
87 lines (73 loc) · 1.99 KB
/
Copy pathinit.lua
File metadata and controls
87 lines (73 loc) · 1.99 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
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
function _G.open_split_terminal_and_resize()
vim.cmd("split | terminal")
vim.cmd("resize -12")
vim.cmd("startinsert")
end
require("config.keymaps")
local wk = require("which-key")
require("plugins.snippets")
-- add custom key binds
wk.add({
{
"<leader>t",
":lua open_split_terminal_and_resize()<CR>",
desc = "Open Split Terminal",
},
})
local format_group =
vim.api.nvim_create_augroup("PythonFormatOnSave", { clear = true })
vim.api.nvim_create_autocmd("BufWritePre", {
group = format_group,
pattern = "*.py",
callback = function()
-- Run Ruff to fix issues before saving
vim.cmd([[silent! !ruff --fix %]])
end,
})
local lspconfig = require("lspconfig")
lspconfig.gopls.setup({
cmd = { "gopls" },
filetypes = { "go" },
root_dir = require("lspconfig").util.root_pattern("go.mod", ".git"),
settings = {
gopls = {
usePlaceholders = true,
completeUnimported = true,
staticcheck = true,
},
},
})
lspconfig.clangd.setup({
cmd = {
"clangd",
"--header-insertion=never",
"--log=verbose",
},
filetypes = { "c", "cpp", "objc", "objcpp", "hpp", "h" },
root_dir = lspconfig.util.root_pattern("compile_commands.json", ".git"),
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.ml",
callback = function()
vim.lsp.buf.format({ async = false })
end,
})
lspconfig.vtsls.setup({
on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false
end,
})
require("conform").setup({
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
json = { "prettier" },
markdown = { "prettier" },
html = { "prettier" },
yaml = { "prettier" },
},
})