Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6857865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:05:05+00:00 2026-05-27T02:05:05+00:00

I have my projects in /srv/http/dev folder. I generated ctags file for one project:

  • 0

I have my projects in /srv/http/dev folder. I generated ctags file for one project:

$ ctags -R --languages=php .

Now I set ctags path:

:set tags=/srv/http/dev/proj/tags

And it’s working fine.

But I have many projects in dev/ folder. How can I set ctags in .vimrc file? set tags=tags not working properly.

And I would like to generate tags file by pressing hotkey on selected NERDTree folder. I tried:

nmap <silent> <F4>
    \ :!ctags -R
    \ --languages=php .<CR>

But it creates tags file in home folder and shows warnings about scanning home folder..

EDIT:
As @Alexandru Plugaru advised I should use g:NERDTreeFileNode.GetSelected() function.

I am just newbie vim user, so I have one more question. I have added in my .vimrc file:

function createTags()
    let curNodePath = g:NERDTreeFileNode.GetSelected().path.str
    exec ':!ctags -R --languages=php ' . curNodePath
endfunction
nmap <silent> <F4> :execute createTags()<CR>

But by pressing on F4 I see:

E117: Unknown function: createTags
E15: Invalid expression: createTags

EDIT 2: Thanks to @Alexandru Plugaru I got this:

function CreateTags()
    let curNodePath = g:NERDTreeFileNode.GetSelected().path.str()
    exec ':!ctags -R --languages=php -f ' . curNodePath . '/tags ' . curNodePath
endfunction
nmap <silent> <F4> :call CreateTags()<CR>

And it works! By pressing F4 I get tags file in project folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:05:06+00:00Added an answer on May 27, 2026 at 2:05 am

    That is because the current directory of vim is the home directory. You either need to change the path or create nerdtree plugin. See nerdtree_plugin directory for an example. I think that you’ll find this function interesting:

    g:NERDTreeFileNode.GetSelected()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two strings: $a = '/srv/http/projects/name'; $b = '/projects/name/some/dir'; And I would like
I'm running wamp on Vista (Apache v2.2.11) and have projects setup such that http://localhost/projectx
I have 3 tables: projects, skills and project_skills. In projects table i hold project's
Problem domain We have Projects and Milestones Once created, a Milestone has a Project
I have 2 subdomains which use the same rules, as seen below: <Directory /srv/project/sites/project.hu/htdocs/>
I have a subversion server running with a repository at /srv/repos/project. What i like
I have projects set up as follows: Data - repository. Service Web I'm using
I have two projects, A and B Project A is compiled with: 1. Standard
I have two projects in my Visual Studio solution: The one is a WcfService
I have two projects, project A and Project B. Both are written in groovy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.