aboutsummaryrefslogtreecommitdiff
path: root/configs/nvim/lua/open_project.lua
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-09-08 17:57:37 +0800
committercrupest <crupest@outlook.com>2023-09-09 09:22:26 +0800
commit68afce38678c8b680c1f1afd93056afa5310c2e2 (patch)
tree428b1905085e48dace6b834a688a76f4ae1c8bdb /configs/nvim/lua/open_project.lua
parentcf4a0c5f4486702cf2f1e9314a9830129fea3709 (diff)
downloadcrupest-68afce38678c8b680c1f1afd93056afa5310c2e2.tar.gz
crupest-68afce38678c8b680c1f1afd93056afa5310c2e2.tar.bz2
crupest-68afce38678c8b680c1f1afd93056afa5310c2e2.zip
Update nvim config.
Diffstat (limited to 'configs/nvim/lua/open_project.lua')
-rw-r--r--configs/nvim/lua/open_project.lua17
1 files changed, 17 insertions, 0 deletions
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
+