Skip to content

Commit dfacedd

Browse files
committed
adding formater
1 parent 0fb5e4d commit dfacedd

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
return {
3+
'stevearc/conform.nvim',
4+
opts = {},
5+
config = function()
6+
require("conform").setup({
7+
formatters_by_ft = {
8+
lua = { "stylua" },
9+
}
10+
})
11+
end
12+
}

env/.config/nvim/lua/theprimeagen/lazy/lsp.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
1+
local root_files = {
2+
'.luarc.json',
3+
'.luarc.jsonc',
4+
'.luacheckrc',
5+
'.stylua.toml',
6+
'stylua.toml',
7+
'selene.toml',
8+
'selene.yml',
9+
'.git',
10+
}
211
return {
312
"neovim/nvim-lspconfig",
413
event = { "BufReadPre", "BufNewFile" },
@@ -22,6 +31,7 @@ return {
2231
require("conform").setup({
2332
formatters_by_ft = {
2433
-- مثال: go = { "gofmt" },
34+
2535
},
2636
})
2737

env/.config/nvim/lua/theprimeagen/lazy/lsp/servers.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ return {
2121
lua_ls = {
2222
settings = {
2323
Lua = {
24-
-- اندمجنا مع الكود بتاعك اللي بيحدد "Lua 5.1" وكمان اللي عنده "LuaJIT"
25-
-- الاتنين تقريبًا واحد، لكن خلينا "5.1" زي ما حاطط في إعداداتك
26-
runtime = { version = "Lua 5.1" },
24+
format = {
25+
enable = true,
26+
-- Put format options here
27+
-- NOTE: the value should be STRING!!
28+
defaultConfig = {
29+
indent_style = "space",
30+
indent_size = "2",
31+
}
32+
},
2733
workspace = {
2834
checkThirdParty = false,
2935
library = {
@@ -34,10 +40,6 @@ return {
3440
completion = {
3541
callSnippet = "Replace",
3642
},
37-
diagnostics = {
38-
-- اللي أنت ضايفها
39-
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
40-
},
4143
},
4244
},
4345
},

0 commit comments

Comments
 (0)