aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 9fc82a75af..b73f5aad76 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -309,9 +309,6 @@ int main(int argc, char **argv)
init_highlight(true, false); // Default highlight groups.
TIME_MSG("init highlight");
- init_default_mappings(); // Default mappings.
- TIME_MSG("init default mappings");
-
// Set the break level after the terminal is initialized.
debug_break_level = params.use_debug_break_level;
@@ -340,21 +337,11 @@ int main(int argc, char **argv)
TIME_MSG("initialized screen early for UI");
}
- // open terminals when opening files that start with term://
-#define PROTO "term://"
- do_cmdline_cmd("augroup nvim_terminal");
- do_cmdline_cmd("autocmd!");
- do_cmdline_cmd("autocmd BufReadCmd " PROTO "* nested "
- ":if !exists('b:term_title')|call termopen( "
- // Capture the command string
- "matchstr(expand(\"<amatch>\"), "
- "'\\c\\m" PROTO "\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
- // capture the working directory
- "{'cwd': expand(get(matchlist(expand(\"<amatch>\"), "
- "'\\c\\m" PROTO "\\(.\\{-}\\)//'), 1, ''))})"
- "|endif");
- do_cmdline_cmd("augroup END");
-#undef PROTO
+ init_default_mappings(); // Default mappings.
+ TIME_MSG("init default mappings");
+
+ init_default_autocmds();
+ TIME_MSG("init default autocommands");
// Reset 'loadplugins' for "-u NONE" before "--cmd" arguments.
// Allows for setting 'loadplugins' there.