You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a bit of an odd one, but I'm at odds with vim-script (which I'm not very good at).
So, we use Git worktrees, and we automated in a way that we can create multiple directories as worktrees of the main repo, and we can edit, build and test each one of them on separate terminals, depending on which environment variables we've set.
A simplified view of my current setup:
" Vim Project
set rtp+=~/.vim/ext/vim-project/
let llvm = $LLVM_SRC
call project#rc("")
Project llvm, 'LLVM'
call project#rc()`
For some reason, using "$LLVM_SRC" in there doesn't work, I needed a vim variable. Anyway...
That works when I start my Vim from the command line, where I have all the variables set, but not from my window manager's key binding (i3wm). So, I wanted to list all the directories in my worktree base and list them as projects, and not need any setup ($LLVM_ROOT is set in .bashrc).
Here's my feeble attempt:
" Vim Project
set rtp+=~/.vim/ext/vim-project/
let g:project_use_nerdtree = 1
let project_config = "call project#rc(\"\")\n"
for workdir in split(globpath($LLVM_ROOT, '*'), '\n')
let dir = fnamemodify(workdir, ':t')
if dir != "repos"
let project_config .= " Project '".dir."', 'LLVM ".dir."'\n"
endif
endfor
let project_config .= "call project#rc()"
echo project_config
execute project_config
This is a bit of an odd one, but I'm at odds with vim-script (which I'm not very good at).
So, we use Git worktrees, and we automated in a way that we can create multiple directories as worktrees of the main repo, and we can edit, build and test each one of them on separate terminals, depending on which environment variables we've set.
A simplified view of my current setup:
For some reason, using "$LLVM_SRC" in there doesn't work, I needed a vim variable. Anyway...
That works when I start my Vim from the command line, where I have all the variables set, but not from my window manager's key binding (i3wm). So, I wanted to list all the directories in my worktree base and list them as projects, and not need any setup ($LLVM_ROOT is set in .bashrc).
Here's my feeble attempt:
Which produces:
but vim-project says:
I'm guessing that the execute is serialising everything and project#config#project thinks that the base dir is everything after the call?
Is there another way of doing this?
The text was updated successfully, but these errors were encountered: