From 68afce38678c8b680c1f1afd93056afa5310c2e2 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 8 Sep 2023 17:57:37 +0800 Subject: Update nvim config. --- configs/nvim/lua/open_project.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 configs/nvim/lua/open_project.lua (limited to 'configs/nvim/lua/open_project.lua') diff --git a/configs/nvim/lua/open_project.lua b/configs/nvim/lua/open_project.lua new file mode 100644 index 0000000..5228143 --- /dev/null +++ b/configs/nvim/lua/open_project.lua @@ -0,0 +1,17 @@ +local a = require'plenary.async' +:with +local context_manager = require "plenary.context_manager" +local with = context_manager.with +local open = context_manager.open + +local err, stat = a.fs_stat("./.project"); +assert(not error, ".project file does not exist, you should run this script at project root.") + +-- open nvim tree +local nvim_tree_api = require("nvim-tree.api") +nvim_tree_api.open() + +-- open terminal +vim.cmd("split") +vim.cmd + -- cgit v1.2.3