Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New menu command: Run a system command in this directory. #1214

Merged
merged 7 commits into from
Jan 31, 2021
Merged

Conversation

PhilRunninger
Copy link
Member

@PhilRunninger PhilRunninger commented Jan 31, 2021

Description of Changes

Closes #1211

Invoking this menu option - m, s - will prompt the user for a command to run in the selected directory (or the file's directory). If the command produces any output, it is echoed back to the screen.


New Version Info

Author's Instructions

  • Derive a new MAJOR.MINOR.PATCH version number. Increment the:
    • MAJOR version when you make incompatible API changes
    • MINOR version when you add functionality in a backwards-compatible manner
    • PATCH version when you make backwards-compatible bug fixes
  • Update CHANGELOG.md, following the established pattern.

Collaborator's Instructions

  • Review CHANGELOG.md, suggesting a different version number if necessary.
  • After merging, tag the commit using these (Mac-compatible) bash commands:
    git checkout master
    git pull
    sed -n "$(grep -n -m2 '####' CHANGELOG.md | cut -f1 -d: | sed 'N;s/\n/,/')p" CHANGELOG.md | sed '$d'
    git tag -a $(read -p "Tag Name: " tag;echo $tag) -m"$(git show --quiet --pretty=%s)";git push origin --tags

let l:directory = l:node.path.isDirectory ? l:node.path.str() : l:node.parent.path.str()
execute 'cd '.l:directory

echo "\n".join(systemlist(input(l:directory . (nerdtree#runningWindows() ? "> " : " $ "))), "\n")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[vint] reported by reviewdog 🐶
Prefer single quoted strings (see Google VimScript Style Guide (Strings))

let l:directory = l:node.path.isDirectory ? l:node.path.str() : l:node.parent.path.str()
execute 'cd '.l:directory

echo "\n".join(systemlist(input(l:directory . (nerdtree#runningWindows() ? "> " : " $ "))), "\n")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[vint] reported by reviewdog 🐶
Prefer single quoted strings (see Google VimScript Style Guide (Strings))

let l:directory = l:node.path.isDirectory ? l:node.path.str() : l:node.parent.path.str()
execute 'cd '.l:directory

echo "\n".join(systemlist(input(l:directory . (nerdtree#runningWindows() ? "> " : " $ "))), nr2char(10))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[vint] reported by reviewdog 🐶
Prefer single quoted strings (see Google VimScript Style Guide (Strings))

let l:directory = l:node.path.isDirectory ? l:node.path.str() : l:node.parent.path.str()
execute 'cd '.l:directory

echo "\n".join(systemlist(input(l:directory . (nerdtree#runningWindows() ? "> " : " $ "))), nr2char(10))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[vint] reported by reviewdog 🐶
Prefer single quoted strings (see Google VimScript Style Guide (Strings))

PhilRunninger and others added 3 commits January 30, 2021 23:16
systemlist() was introduced sometime in Vim 8+, so I switched to
system() for 7.4 compatibility.
@PhilRunninger PhilRunninger merged commit c8be945 into master Jan 31, 2021
@PhilRunninger PhilRunninger deleted the i1211 branch January 31, 2021 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom actions in NERDTree menu
1 participant