Repository navigation
Expand file tree
/
Copy pathinit.lua
More file actions
86 lines (76 loc) 路 3.57 KB
/
Copy pathinit.lua
File metadata and controls
86 lines (76 loc) 路 3.57 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
-- ============================================================================
-- FoxVim -- entry point (Neovim v0.12.4).
-- ============================================================================
-- Target / Current Neovim Version: NVIM v0.12.4
--
-- STARTUP ORDER (each step depends on the one before it)
-- 1. vim_options Editor options, filetypes, shell, PATH repair.
-- 2. keymaps Every keybinding, grouped by domain.
-- 3. lazy_init Bootstraps lazy.nvim and imports lua/plugins/*.
--
-- WHERE THINGS LIVE
-- lua/config/ Editor bootstrap: options, keymaps, plugin manager.
-- lua/fox/ Shared internal libraries (core, git, launch, lsp).
-- lua/plugins/ One lazy.nvim spec per file, grouped by area.
-- lua/foxnvim/ The foxnvimscript automation library (its own public API).
-- tests/ Unit specs (`nvim -l tests/run.lua`) and integration specs.
-- docs/ Architecture and feature documentation.
--
-- See docs/architecture.md for the full picture.
-- ============================================================================
-- Byte-compilation cache: cuts startup roughly in half on Windows.
if vim.loader then
vim.loader.enable()
end
vim.o.background = "dark"
require("vim_options")
require("fox.core.keymap_registry").install()
require("keymaps")
require("lazy_init")
-- Reload the configuration without restarting. Only top-level config modules are
-- dropped from the cache; plugins keep their state, which is what makes this
-- fast enough to use while editing keymaps.
vim.api.nvim_create_user_command("ReloadConfig", function()
for name, _ in pairs(package.loaded) do
if name == "vim_options" or name == "lazy_init" or name:match("^keymaps") then
package.loaded[name] = nil
end
end
require("fox.core.keymap_registry").reset()
dofile(vim.env.MYVIMRC)
vim.notify("Config reloaded", vim.log.levels.INFO)
end, {})
-- Run the test suite from inside the editor. The same specs run headlessly with
-- `nvim -l tests/run.lua`; see tests/run.lua for the runner itself.
vim.api.nvim_create_user_command("FoxTest", function(command)
local root = vim.fn.stdpath("config")
local runner = dofile(root .. "/tests/run.lua")
runner.run(root, command.args ~= "" and command.args or nil)
end, { nargs = "?", desc = "Run the FOX unit test suite (optionally filtered by spec name)" })
-- ============ NEOVIDE Exclusive config ==================================
if vim.g.neovide then
-- vim.g.neovide_window_blurred = false
-- vim.g.neovide_opacity = 0.96
-- vim.g.neovide_normal_opacity = 0.96
-- Cursor Motion & Trail Animation (Time in seconds)
-- Try setting to 0.25 for slow motion, 0.05 for super snappy, or 0.0 to disable.
vim.g.neovide_cursor_animation_length = 0.15
vim.g.neovide_cursor_trail_size = 0.8 -- Trail size length (0.0 to 1.0)
vim.g.neovide_cursor_animate_in_insert_mode = true
vim.g.neovide_cursor_animate_command_line = true
vim.g.neovide_cursor_unfocused_outline = true -- Draw outline cursor when window loses focus
-- Windows Exclusive Configuration
vim.g.neovide_title_background_color =
string.format("%x", vim.api.nvim_get_hl(0, { id = vim.api.nvim_get_hl_id_by_name("Normal") }).bg)
vim.g.neovide_title_text_color = "white"
vim.g.neovide_corner_preference = "round"
-- End Windows Exclusive config
-- Progress bar
vim.g.neovide_progress_bar_enabled = true
vim.g.neovide_progress_bar_height = 5.0
vim.g.neovide_progress_bar_animation_speed = 200.0
vim.g.neovide_progress_bar_hide_delay = 0.2
vim.keymap.set("n", "<C-S-f>", function()
vim.g.neovide_fullscreen = not vim.g.neovide_fullscreen
end, { silent = true })
end