目录

Unreal NVIM

Scoop

普通权限打开 PowerShell

为了允许下载并运行安装脚本,你需要执行以下命令:

1
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

下载并安装 Scoop

1
irm get.scoop.sh | iex

安装到自定义目录

1
2
3
4
5
6
# 1. 先设置环境变量,指向你想安装的路径
$env:SCOOP='D:\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')

# 2. 再执行安装命令
irm get.scoop.sh | iex

验证安装

1
scoop help

安装extras库

1
2
scoop update
scoop bucket add extras

NVIM

安装 最新的nvim

1
2
scoop update
scoop install neovim

验证安装

1
nvim --version

增加系统环境变量,更换nvim默认路径

  1. XDG_CACHE_HOME:E:\Scoop\apps\neovim
  2. XDG_CONFIG_HOME:E:\Scoop\apps\neovim
  3. XDG_DATA_HOME:E:\Scoop\apps\neovim
  4. XDG_STATE_HOME:E:\Scoop\apps\neovim

Lazy.vim

直接输入

1
git clone https://github.com/LazyVim/starter $env:LOCALAPPDATA\nvim

随后打开命令行,输入 nvim,就开始自动安装插件拉

在nvim中输入checkhealth,随后有Error(也就是叉号),截图问问AI把,需要补一些环境

Unreal NVIM

在nvim plugin下,创建 Unreal.lua

  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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
return {
	-- UNL.nvim (基础核心插件)
	{
		"taku25/UNL.nvim",
		build = "cargo build --release --manifest-path scanner/Cargo.toml",
		opts = {},
	},

	-- UBT.nvim (编译工具集成)
	{
		"taku25/UBT.nvim",
		dependencies = {
			"taku25/UNL.nvim",
			"nvim-telescope/telescope.nvim",
		},

		opts = {
			presets = {
				{
					Platform = "Win64",
					Configuration = "DebugGame",
					IsEditor = true,
				},
			},
		},

		config = function(_, opts)
			-- 1. 正常初始化
			require("UBT").setup(opts)

			-- 2. 【万能拦截器】
			-- 不管是谁生成的命令,在发给系统执行前,我们在这里拦截并修正
			local success, runner = pcall(require, "UBT.job.runner")
			if success then
				local original_start = runner.start
				runner.start = function(name, cmd, start_opts)
					-- 针对不同的 cmd 类型进行处理(防止红屏报错)
					local final_cmd = cmd

					if type(cmd) == "string" then
						-- 如果是字符串,强行把带路径的 Target 替换成纯名字
						-- 逻辑:匹配任何以 /SimpleBetaEditor 结尾的路径,替换为 SimpleBetaEditor
						final_cmd = cmd:gsub("[^%s\"']*/SimpleBetaEditor", "SimpleBetaEditor")
					elseif type(cmd) == "table" then
						-- 如果是表格,遍历每一个参数进行替换
						for i, v in ipairs(cmd) do
							if type(v) == "string" then
								cmd[i] = v:gsub("[^%s\"']*/SimpleBetaEditor", "SimpleBetaEditor")
							end
						end
						final_cmd = cmd
					end

					-- 在控制台打印一下,让你看到我们确实修成功了
					print("拦截修正完成,准备执行编译...")

					return original_start(name, final_cmd, start_opts)
				end
			end
		end,
	},

	-- UCM.nvim (类创建工具)
	{
		"taku25/UCM.nvim",
		dependencies = {
			"taku25/UNL.nvim",
			"nvim-telescope/telescope.nvim",
		},
		config = function()
			require("UCM").setup()
		end,
		opts = {},
	},

	-- ULG.nvim (日志查看器)
	{
		"taku25/ULG.nvim",
		dependencies = {
			"taku25/UNL.nvim",
		},
		config = function()
			require("ULG").setup()
		end,
		opts = {},
	},

	-- UEP.nvim (项目增强)
	{
		"taku25/UEP.nvim",
		dependencies = {
			"taku25/UNL.nvim",
			"nvim-lua/plenary.nvim",
			"nvim-telescope/telescope.nvim",
			"ibhagwan/fzf-lua",
		},
		opts = {
			files_extensions = { "cpp", "h", "hpp", "inl", "ini", "cs", "uproject" },
		},
		config = function(_, opts)
			require("UEP").setup(opts)
		end,
	},

	-- UNX.nvim (综合扩展)
	{
		"taku25/UNX.nvim",
		dependencies = {
			"taku25/UNL.nvim",
			"taku25/UEP.nvim",
			"MunifTanjim/nui.nvim",
			"nvim-tree/nvim-web-devicons",
			"taku25/UCM.nvim",
			"taku25/ULG.nvim",
			{
				"nvim-treesitter/nvim-treesitter",
				build = ":TSUpdate",
				dependencies = {
					"nvim-treesitter/nvim-treesitter-textobjects",
				},
				config = function()
					require("nvim-treesitter").setup({
						ensure_installed = { "cpp", "hlsl" },
						highlight = { enable = true },
					})
				end,
			},
		},
		opts = {
			window = {
				position = "left", -- "left" or "right"
				size = {
					width = 60,
				},
			},
			vcs = {
				git = { enabled = false },
				p4 = {
					enabled = true,
					auto_checkout = true, -- Automatically checkout read-only files on edit
				},
			},
		},
		config = function(_, opts)
			require("UNX").setup(opts)
		end,
	},

	-- UnrealDev.nvim
	{
		"taku25/UnrealDev.nvim",
		ft = { "cpp", "c" },
		cmd = {
			"UDEV",
		},
		dependencies = {
			"j-hui/fidget.nvim",
			"nvim-telescope/telescope.nvim",
			"taku25/UNL.nvim",
			"taku25/UEP.nvim",
			"taku25/UBT.nvim",
			"taku25/UCM.nvim",
			"taku25/USH.nvim",
			"taku25/ULG.nvim",
			{
				"taku25/USX.nvim",
				lazy = false,
			},
		},
	},

	-- USX.nvim
	{
		"taku25/USX.nvim",
		opts = {
			-- Add your settings here (details below)
		},
	},

	-- blink.cmp
	{
		"Saghen/blink.cmp",
		dependencies = {
			{ "taku25/blink-cmp-unreal" },
		},
		opts = {
			sources = {
				default = { "lsp", "buffer", "path", "unreal" },
				providers = {
					unreal = {
						module = "blink-cmp-unreal",
						name = "unreal",
						score_offset = 15,
					},
				},
			},
			--... other blink.cmp settings
		},
	},

	{
		{
			"taku25/tree-sitter-unreal-cpp",
			opts = {},
			config = function() end,
		},
		{
			"nvim-treesitter/nvim-treesitter",
			branch = "main",
			lazy = false,
			build = ":TSUpdate",
			opts = {
				--...
			},
			config = function(_, opts)
				vim.api.nvim_create_autocmd("User", {
					pattern = "TSUpdate",
					callback = function()
						require("nvim-treesitter.parsers").cpp = {
							install_info = {
								url = "https://github.com/taku25/tree-sitter-unreal-cpp",
								revision = "e2b94d3bd3ce359ff732116cc21f34ecbecfca50",
							},
						}
					end,
				})
				require("nvim-treesitter").setup(opts)
			end,
		},
	},

	{
		"taku25/UDB.nvim",
		dependencies = {
			"taku25/UNL.nvim",
			"mfussenegger/nvim-dap",
			-- Optional: Recommended for a better UI experience
			"rcarriga/nvim-dap-ui",
		},
		opts = {
			-- Place UDB specific configurations here
		},
	},
}