Mercurial > vim-unreal
annotate plugin/unreal.vim @ 11:06af9916ba7c default tip
Generate compilation database for clang by default
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 29 Aug 2023 13:07:20 -0700 |
parents | 8d3cd3988229 |
children |
rev | line source |
---|---|
0 | 1 " unreal.vim - Work with the Unreal Engine in Vim |
2 " Maintainer: Ludovic Chabant <https://ludovic.chabant.com> | |
3 | |
4 " Globals {{{ | |
5 | |
10
8d3cd3988229
Add the usual vim plugin load protection
Ludovic Chabant <ludovic@chabant.com>
parents:
9
diff
changeset
|
6 if exists('g:loaded_unreal') || &cp |
8d3cd3988229
Add the usual vim plugin load protection
Ludovic Chabant <ludovic@chabant.com>
parents:
9
diff
changeset
|
7 finish |
8d3cd3988229
Add the usual vim plugin load protection
Ludovic Chabant <ludovic@chabant.com>
parents:
9
diff
changeset
|
8 endif |
8d3cd3988229
Add the usual vim plugin load protection
Ludovic Chabant <ludovic@chabant.com>
parents:
9
diff
changeset
|
9 let g:loaded_unreal = 1 |
8d3cd3988229
Add the usual vim plugin load protection
Ludovic Chabant <ludovic@chabant.com>
parents:
9
diff
changeset
|
10 |
0 | 11 if !(has('job') || (has('nvim') && exists('*jobwait'))) |
12 echoerr "unreal: this plugin requires the job API from Vim8 or Neovim." | |
13 finish | |
14 endif | |
15 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
16 let g:unreal_trace = get(g:, 'unreal_trace', 0) |
0 | 17 |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
18 let g:unreal_branch_dir_marker = get(g:, 'unreal_branch_dir_marker', '*.uprojectdirs') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
19 let g:unreal_branch_dir_finder = get(g:, 'unreal_branch_dir_finder', '') |
0 | 20 let g:unreal_auto_find_project = get(g:, 'unreal_auto_find_project', 0) |
21 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
22 let g:unreal_branch_projects = {} |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
23 |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
24 let g:unreal_branch_dir = get(g:, 'unreal_branch_dir', '') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
25 let g:unreal_project = get(g:, 'unreal_project', '') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
26 let g:unreal_platform = get(g:, 'unreal_platform', 'Win64') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
27 let g:unreal_config_state = get(g:, 'unreal_config_state', 'Development') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
28 let g:unreal_config_target = get(g:, 'unreal_config_target', 'Editor') |
0 | 29 |
30 let g:unreal_modules = get(g:, 'unreal_modules', []) | |
31 | |
32 let g:unreal_platforms = get(g:, 'unreal_platforms', [ | |
33 \"Win32", "Win64", "HoloLens", "Mac", "XboxOne", "PS4", "IOS", "Android", | |
34 \"HTML5", "Linux", "AllDesktop", "TVOS", "Switch" | |
35 \]) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
36 let g:unreal_config_states = get(g:, 'unreal_config_states', [ |
0 | 37 \"Debug", "DebugGame", "Development", "Shipping", "Test" |
38 \]) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
39 let g:unreal_config_targets = get(g:, 'unreal_config_targets', [ |
9
b5040cfea052
Tweak how configs and targets are parsed and handled
Ludovic Chabant <ludovic@chabant.com>
parents:
2
diff
changeset
|
40 \"Editor", "Client", "Server", "" |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
41 \]) |
0 | 42 let g:unreal_build_options = get(g:, 'unreal_build_options', [ |
43 \"-DisableUnity", "-ForceUnity" | |
44 \]) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
45 let g:unreal_auto_build_modules = get(g:, 'unreal_auto_build_modules', { |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
46 \"ShaderCompileWorker": ["-Quiet"] |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
47 \}) |
0 | 48 let g:unreal_auto_build_options = get(g:, 'unreal_auto_build_options', [ |
49 \"-WaitMutex" | |
50 \]) | |
51 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
52 let g:unreal_auto_generate_compilation_database = get(g:, 'unreal_auto_generate_compilation_database', 0) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
53 |
0 | 54 " }}} |
55 | |
56 " Commands {{{ | |
57 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
58 command! UnrealFindProject :call unreal#find_project() |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
59 command! -nargs=1 -complete=dir UnrealSetBranchDir :call unreal#set_branch_dir(<f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
60 command! -nargs=1 -complete=customlist,unreal#complete_projects |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
61 \UnrealSetProject :call unreal#set_project(<f-args>) |
0 | 62 command! -nargs=1 -complete=customlist,unreal#complete_platforms |
63 \UnrealSetPlatform :call unreal#set_platform(<f-args>) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
64 command! -nargs=1 -complete=customlist,unreal#complete_configs |
0 | 65 \UnrealSetConfig :call unreal#set_config(<f-args>) |
66 | |
67 command! UnrealGenerateProjectFiles :call unreal#generate_project_files() | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
68 command! UnrealGenerateCompilationDatabase :call unreal#generate_compilation_database() |
0 | 69 |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
70 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
71 \UnrealBuild :call unreal#build(<bang>0, <f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
72 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
73 \UnrealRebuild :call unreal#rebuild(<bang>0, <f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
74 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
75 \UnrealClean :call unreal#clean(<bang>0, <f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
76 |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
77 command! UnrealReloadBranchProjects :call unreal#set_branch_dir(g:unreal_branch_dir) |
0 | 78 |
79 " }}} | |
80 | |
81 " Initialization {{{ | |
82 | |
83 call unreal#init() | |
84 | |
85 " }}} |