@proxysoul/soulforge 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/init.lua ADDED
@@ -0,0 +1,348 @@
1
+ -- SoulForge default neovim config (LazyVim distribution)
2
+ -- Only loaded when user has no ~/.config/nvim/init.{lua,vim}
3
+ -- Data isolated via NVIM_APPNAME=soulforge → ~/.local/share/soulforge/
4
+
5
+ local o = vim.o
6
+ local opt = vim.opt
7
+
8
+ -- ─── Leader key (must be set before lazy) ───
9
+ vim.g.mapleader = " "
10
+ vim.g.maplocalleader = "\\"
11
+
12
+ -- ─── Embedded mode: suppress all prompts before plugins load ───
13
+ vim.opt.shortmess:append("aAIcCFsWqtTo")
14
+ vim.o.more = false
15
+ vim.o.cmdheight = 1
16
+
17
+ -- ─── Bootstrap lazy.nvim ───
18
+ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
19
+ if not vim.uv.fs_stat(lazypath) then
20
+ local out = vim.fn.system({
21
+ "git", "clone", "--filter=blob:none",
22
+ "https://github.com/folke/lazy.nvim.git",
23
+ "--branch=stable",
24
+ lazypath,
25
+ })
26
+ if vim.v.shell_error ~= 0 then
27
+ vim.api.nvim_echo({
28
+ { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
29
+ { out, "WarningMsg" },
30
+ }, true, {})
31
+ return
32
+ end
33
+ end
34
+ vim.opt.rtp:prepend(lazypath)
35
+
36
+ -- ─── Mason tools (shared between mason.nvim and mason-tool-installer) ───
37
+ local mason_tools = {
38
+ -- Web (JS/TS)
39
+ "typescript-language-server",
40
+ "eslint-lsp",
41
+ "biome",
42
+ "tailwindcss-language-server",
43
+ "css-lsp",
44
+ "html-lsp",
45
+ "emmet-language-server",
46
+ "svelte-language-server",
47
+ "vue-language-server",
48
+ "graphql-language-service-cli",
49
+ "astro-language-server",
50
+ -- Python
51
+ "pyright",
52
+ "ruff",
53
+ -- Rust
54
+ "rust-analyzer",
55
+ -- Go
56
+ "gopls",
57
+ -- C/C++
58
+ "clangd",
59
+ -- Lua
60
+ "lua-language-server",
61
+ -- Shell
62
+ "bash-language-server",
63
+ -- Data / Config
64
+ "json-lsp",
65
+ "yaml-language-server",
66
+ "taplo",
67
+ -- Docker
68
+ "dockerfile-language-server",
69
+ "docker-compose-language-service",
70
+ -- Markdown
71
+ "marksman",
72
+ -- SQL
73
+ "sqlls",
74
+ -- Formatters
75
+ "prettier",
76
+ "shfmt",
77
+ "stylua",
78
+ "black",
79
+ "isort",
80
+ -- Linters
81
+ "shellcheck",
82
+ }
83
+
84
+ -- ─── Setup LazyVim ───
85
+ require("lazy").setup({
86
+ spec = {
87
+ { "LazyVim/LazyVim", import = "lazyvim.plugins" },
88
+
89
+ -- ── Disable GPL-3.0 plugin (incompatible with BUSL-1.1) ──
90
+ { "akinsho/bufferline.nvim", enabled = false },
91
+
92
+ -- ── Theme: Catppuccin Mocha ──
93
+ {
94
+ "catppuccin/nvim",
95
+ name = "catppuccin",
96
+ lazy = false,
97
+ priority = 1000,
98
+ opts = {
99
+ flavour = "mocha",
100
+ transparent_background = true,
101
+ integrations = {
102
+ bufferline = true,
103
+ gitsigns = true,
104
+ indent_blankline = { enabled = true },
105
+ mini = { enabled = true },
106
+ native_lsp = {
107
+ enabled = true,
108
+ underlines = {
109
+ errors = { "undercurl" },
110
+ hints = { "undercurl" },
111
+ warnings = { "undercurl" },
112
+ information = { "undercurl" },
113
+ },
114
+ },
115
+ neotree = true,
116
+ noice = true,
117
+ notify = true,
118
+ treesitter = true,
119
+ which_key = true,
120
+ },
121
+ },
122
+ },
123
+
124
+ -- ── Dashboard: SoulForge branding ──
125
+ {
126
+ "folke/snacks.nvim",
127
+ opts = {
128
+ dashboard = {
129
+ preset = {
130
+ header = table.concat({
131
+ "",
132
+ " ███████╗ ██████╗ ██╗ ██╗██╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗",
133
+ " ██╔════╝██╔═══██╗██║ ██║██║ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝",
134
+ " ███████╗██║ ██║██║ ██║██║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗ ",
135
+ " ╚════██║██║ ██║██║ ██║██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ",
136
+ " ███████║╚██████╔╝╚██████╔╝███████╗██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗",
137
+ " ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝",
138
+ "",
139
+ " ⚡ Graph-Powered Code Intelligence",
140
+ "",
141
+ }, "\n"),
142
+ },
143
+ },
144
+ },
145
+ },
146
+
147
+ -- ── Mason: ensure LSP servers + formatters + linters ──
148
+ {
149
+ "mason-org/mason.nvim",
150
+ opts = { ensure_installed = mason_tools },
151
+ },
152
+
153
+ -- ── Mason Tool Installer (headless bootstrap + auto-install on start) ──
154
+ {
155
+ "WhoIsSethDaniel/mason-tool-installer.nvim",
156
+ dependencies = { "mason-org/mason.nvim" },
157
+ lazy = false,
158
+ opts = {
159
+ ensure_installed = mason_tools,
160
+ auto_update = false,
161
+ run_on_start = true,
162
+ start_delay = 1000,
163
+ debounce_hours = 24,
164
+ },
165
+ },
166
+
167
+ -- ── Tree-sitter: ensure common parsers ──
168
+ {
169
+ "nvim-treesitter/nvim-treesitter",
170
+ opts = {
171
+ ensure_installed = {
172
+ "typescript", "tsx", "javascript", "json", "json5", "jsonc",
173
+ "html", "css", "scss", "graphql", "svelte", "vue",
174
+ "rust", "go", "c", "cpp", "zig",
175
+ "lua", "python", "ruby", "bash",
176
+ "markdown", "markdown_inline", "yaml", "toml", "dockerfile",
177
+ "sql", "prisma",
178
+ "vim", "vimdoc", "regex", "query", "diff",
179
+ "git_config", "gitcommit", "gitignore",
180
+ },
181
+ },
182
+ },
183
+
184
+ -- ── Gitsigns: custom signs ──
185
+ {
186
+ "lewis6991/gitsigns.nvim",
187
+ opts = {
188
+ signs = {
189
+ add = { text = "▎" },
190
+ change = { text = "▎" },
191
+ delete = { text = "▁" },
192
+ topdelete = { text = "▔" },
193
+ changedelete = { text = "▎" },
194
+ },
195
+ },
196
+ },
197
+ },
198
+
199
+ defaults = {
200
+ lazy = false,
201
+ version = false,
202
+ },
203
+ install = {
204
+ colorscheme = { "catppuccin", "tokyonight", "habamax" },
205
+ },
206
+ checker = { enabled = false },
207
+ change_detection = { enabled = false },
208
+ performance = {
209
+ rtp = {
210
+ disabled_plugins = {
211
+ "gzip", "tarPlugin", "tohtml", "tutor", "zipPlugin",
212
+ },
213
+ },
214
+ },
215
+ })
216
+
217
+ -- ─── Auto-close Lazy UI (embedded mode — user shouldn't need to press q) ───
218
+ -- Close the Lazy floating window after install/sync/update finishes
219
+ for _, event in ipairs({ "LazyInstall", "LazySync", "LazyUpdate" }) do
220
+ vim.api.nvim_create_autocmd("User", {
221
+ pattern = event,
222
+ callback = function()
223
+ vim.defer_fn(function()
224
+ for _, win in ipairs(vim.api.nvim_list_wins()) do
225
+ if vim.api.nvim_win_is_valid(win) then
226
+ local buf = vim.api.nvim_win_get_buf(win)
227
+ if vim.bo[buf].filetype == "lazy" then
228
+ pcall(vim.api.nvim_win_close, win, true)
229
+ end
230
+ end
231
+ end
232
+ end, 2000)
233
+ end,
234
+ })
235
+ end
236
+
237
+ -- ─── Post-plugin overrides (embedded mode + sane defaults for non-vim users) ───
238
+
239
+ -- Display — predictable line numbers, no relative (confuses non-vim users)
240
+ o.number = true
241
+ o.relativenumber = false
242
+ o.cursorline = true
243
+ o.signcolumn = "yes"
244
+ o.wrap = true
245
+ o.linebreak = true
246
+ o.breakindent = true
247
+ opt.breakindentopt = { "shift:2" }
248
+ o.showbreak = "↪ "
249
+ o.conceallevel = 0
250
+ o.cmdheight = 1
251
+ o.fillchars = "eob: "
252
+ o.pumheight = 12
253
+ o.scrolloff = 8
254
+ o.sidescrolloff = 8
255
+
256
+ -- Indentation — 2-space tabs (web-dev friendly)
257
+ o.tabstop = 2
258
+ o.shiftwidth = 2
259
+ o.expandtab = true
260
+ o.smartindent = true
261
+ o.shiftround = true
262
+
263
+ -- Search — case-insensitive unless uppercase used
264
+ o.ignorecase = true
265
+ o.smartcase = true
266
+
267
+ -- Behavior (embedded mode — suppress all prompts, clipboard integration)
268
+ o.swapfile = false
269
+ o.clipboard = "unnamedplus"
270
+ o.mouse = "a"
271
+ o.splitright = true
272
+ o.splitbelow = true
273
+ o.confirm = true
274
+ o.undofile = true
275
+ o.updatetime = 300
276
+ opt.shortmess:append("aAIcCFsWqtTo")
277
+ o.more = false
278
+ o.inccommand = "split"
279
+ o.completeopt = "menuone,noselect,popup"
280
+
281
+ -- Make window separators visible
282
+ vim.api.nvim_set_hl(0, "WinSeparator", { fg = "#333333", bg = "NONE" })
283
+
284
+ -- ─── VS Code muscle memory keybindings ───
285
+
286
+ -- Save with Ctrl+S (works in all modes)
287
+ vim.keymap.set({ "n", "i", "v" }, "<C-s>", "<cmd>write<CR><Esc>", { silent = true, desc = "Save file" })
288
+
289
+ -- Undo with Ctrl+Z in insert mode
290
+ vim.keymap.set("i", "<C-z>", "<cmd>undo<CR>", { silent = true, desc = "Undo" })
291
+
292
+ -- jk to exit insert mode (beginner escape hatch)
293
+ vim.keymap.set("i", "jk", "<Esc>", { silent = true, desc = "Exit insert mode" })
294
+
295
+ -- Stay in visual mode when indenting
296
+ vim.keymap.set("v", "<", "<gv", { silent = true })
297
+ vim.keymap.set("v", ">", ">gv", { silent = true })
298
+
299
+ -- Move lines up/down in visual mode (Alt+j/k)
300
+ vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { silent = true })
301
+ vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { silent = true })
302
+
303
+ -- ─── SoulForge autocmds ───
304
+
305
+ -- Auto-reload files changed on disk
306
+ vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold" }, {
307
+ pattern = "*",
308
+ command = "silent! checktime",
309
+ })
310
+
311
+ -- Highlight on yank (visual feedback when copying)
312
+ vim.api.nvim_create_autocmd("TextYankPost", {
313
+ callback = function()
314
+ pcall(vim.highlight.on_yank, { higroup = "IncSearch", timeout = 200 })
315
+ end,
316
+ })
317
+
318
+ -- Restore cursor position when reopening files
319
+ vim.api.nvim_create_autocmd("BufReadPost", {
320
+ callback = function()
321
+ local mark = vim.api.nvim_buf_get_mark(0, '"')
322
+ local lines = vim.api.nvim_buf_line_count(0)
323
+ if mark[1] > 0 and mark[1] <= lines then
324
+ pcall(vim.api.nvim_win_set_cursor, 0, mark)
325
+ end
326
+ end,
327
+ })
328
+
329
+ -- Trim trailing whitespace on save
330
+ vim.api.nvim_create_autocmd("BufWritePre", {
331
+ callback = function()
332
+ local ft = vim.bo.filetype
333
+ if ft == "diff" or ft == "mail" then return end
334
+ local pos = vim.api.nvim_win_get_cursor(0)
335
+ vim.cmd([[silent! %s/\s\+$//e]])
336
+ pcall(vim.api.nvim_win_set_cursor, 0, pos)
337
+ end,
338
+ })
339
+
340
+ -- Notify SoulForge on buffer write (repo map live updates)
341
+ vim.api.nvim_create_autocmd("BufWritePost", {
342
+ callback = function()
343
+ local path = vim.api.nvim_buf_get_name(0)
344
+ if path and path ~= "" then
345
+ pcall(vim.rpcnotify, 0, "soulforge:file_written", path)
346
+ end
347
+ end,
348
+ })