aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-03-25 22:08:14 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-25 22:08:14 -0300
commita6e53a3797a93fe060f807fe2e4c6361854b6c97 (patch)
treeb684785ba9c769491e6ebdac8e21495cf22dbdd3 /src/nvim/main.c
parentd2d99454e63c0e6649fddd52bbd9a10d27c2e347 (diff)
parent2aa2513b8e023a0d7bd2071299f0ea59a4d4ce25 (diff)
downloadrneovim-a6e53a3797a93fe060f807fe2e4c6361854b6c97.tar.gz
rneovim-a6e53a3797a93fe060f807fe2e4c6361854b6c97.tar.bz2
rneovim-a6e53a3797a93fe060f807fe2e4c6361854b6c97.zip
Merge PR #2076 'Builtin terminal emulation'
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 9f4bc22ae0..47bb2bc515 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -285,6 +285,17 @@ int main(int argc, char **argv)
input_start_stdin(fd);
}
+ // open terminals when opening files that start with term://
+ do_cmdline_cmd((uint8_t *)
+ "autocmd BufReadCmd term://* "
+ ":call termopen( "
+ // Capture the command string
+ "matchstr(expand(\"<amatch>\"), "
+ "'\\c\\mterm://\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
+ // capture the working directory
+ "get(matchlist(expand(\"<amatch>\"), "
+ "'\\c\\mterm://\\(.\\{-}\\)//'), 1, ''))");
+
/* Execute --cmd arguments. */
exe_pre_commands(&params);