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

  • Home
  • SEARCH
  • 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 8733345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:37:46+00:00 2026-06-13T09:37:46+00:00

I have mapped <Leader>ev to open .vimrc for editing using: nmap <Leader>ev :e $MYVIMRC<CR>

  • 0

I have mapped <Leader>ev to open .vimrc for editing using:

nmap <Leader>ev :e $MYVIMRC<CR>

I now wish to map <Leader>ec to edit currently used colorscheme file, and also map <Leader>es to edit current filetype syntax file. I don’t want to hard code the paths (or part of the paths) as I will be moving around between environments. It will help me quickly adjust color/syntax in middle of editing.

Any help?

  • 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-13T09:37:47+00:00Added an answer on June 13, 2026 at 9:37 am

    The paths from which Vim loads colorschemes, plugins, etc., are determined from the 'runtimepath' setting. The globpath() function can perform lookups from it. By taking the first match, we’ll get the path to the current colorscheme:

    :echo get(split(globpath(&runtimepath, 'colors/' . g:colors_name . '.vim'), "\n"), 0, '')
    

    Something similar can be done for filetype plugins; the current one is in &filetype.

    To insert the path into the mapping, you can use <C-R>= (insert register contents, used with the expression register):

    :nnoremap <Leader>ec :edit <C-R>=get(split(globpath(&runtimepath, 'colors/' . g:colors_name . '.vim'), "\n"), 0, '')<CR><CR>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mapped a file into memory using mmap . Now I would like
I have mapped the database in the edmx file from the database. Now how
I have mapped a network drive to a computer in my home network. Now
I m able to get values using JPA when i have only mapped one
I'm using Coldfusion ORM (Hibernate), and have a cfc mapped to a database table.
I have mapped a simple entity, let's say an invoice using Fluent NHibernate, everything
My site currently implements custom 404 pages which we have mapped in IIS. So
OK, I have mapped with annotations two tables with a bidirectional @ManyToMany relationship. Now
I am using Windows 2003. I have mapped a web application into a virtual
I have mapped my inheritance hierarchy in Hibernate using InheritanceType.Single_Table and discriminator columns to

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.