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 8547151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:12:16+00:00 2026-06-11T13:12:16+00:00

I’m using python day to day and need to have an index of both

  • 0

I’m using python day to day and need to have an index of both my local project and every python module / egg found in my virtualenv

The below is a half working version of what I would like to see improved. Currently I can do one OR the other before the redraw command. With this approach I end up with a single .ctags file in the root of each project I work on and vim is aware making any lookup by class name/method name/etc quick and easy.

Is there a way to combine those 2 exe lines into a single line that still results in just one index file?

thank you in advance

set tags=./.ctags,.ctags;

" re-index the ctags file
map <leader>ri :call RenewTagsFile()<cr>

" search through the indexed ctags file for any class/method/etc
map <leader>fs :FufTag<CR>

function! RenewTagsFile()
    exe 'silent !ctags -Rf .ctags ' . system('python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"')''
    exe 'silent !ctags -Rf .ctags --extra=+f --exclude=.git --languages=-javascript 2>/dev/null'
    exe 'redraw!'
endfunction

UPDATE

For anyone who might stumble upon this question in the future I was able to append using the -a flag (so the renew tags file function would look like this instead)

function! RenewTagsFile()
    exe 'silent !ctags -Rf .ctags ' . system('python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"')''
    exe 'silent !ctags -a -Rf .ctags --extra=+f --exclude=.git --languages=-javascript 2>/dev/null'
    exe 'redraw!'
endfunction
  • 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-06-11T13:12:17+00:00Added an answer on June 11, 2026 at 1:12 pm

    You don’t need to. Vim is able to work with multiple tags files, just choose one location to place virtualenv tags file and include full path to it into ‘tags’ option.

    There is another possibility though: read man ctags. It is possible to make ctags add tags to an existing file by adding one switch. You still don’t need to combine these commands into one command.


    Note: there are some strange things in your code:

    1. set tags=./.ctags,.ctags;
      

      Do you really need to include .ctags; file with semicolon? Guess it is a typo.

    2. map …
      

      nnoremap …. First, there is nothing here you want to be remapped hence nore. Second, commands are not written to work from visual mode and I doubt you need them in operator-pending mode hence nnore.

    3. exe 'silent !ctags -Rf .ctags --extra=+f --exclude=.git --languages=-javascript 2>/dev/null'
      exe 'redraw!'
      

      You don’t need :exe at all here, just

      silent !ctags -Rf .ctags --extra=+f --exclude=.git --languages=-javascript 2>/dev/null
      redraw!
      

      . But you can completely avoid :redraw! by using system():

      call system('ctags -Rf .ctags ' . system('python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"'))
      call system('ctags -Rf .ctags --extra=+f --exclude=.git --languages=-javascript 2>/dev/null')
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the

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.