commit 8b50c517ae86e3a133f069dad76bfa5dae775a61
parent 662f0c5ed02fc701a3c0b1fb7648594dcdec4ce6
Author: Chris Bracken <chris@bracken.jp>
Date: Mon, 26 Aug 2024 20:27:38 -0700
vim: conditionally add flutter buildroot to path
If cwd is within the Flutter buildroot, add the buildroot to the vim path.
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
@@ -3,6 +3,7 @@ require('config.options')
require('config.keymaps')
require('config.colorscheme')
require('config.snippets')
+require('config.projects')
-- Package manager.
require('config.lazy')
diff --git a/.config/nvim/lua/config/projects.lua b/.config/nvim/lua/config/projects.lua
@@ -0,0 +1,9 @@
+-- Updates the vim path for Flutter engine development.
+local function update_path_for_flutter_engine()
+ local engine_dir = vim.fn.expand('$HOME/Developer/flutter/engine/src')
+ if vim.fn.getcwd():find(engine_dir, 1, true) == 1 then
+ vim.opt.path:append(engine_dir)
+ end
+end
+
+update_path_for_flutter_engine()