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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:02:32+00:00 2026-05-11T00:02:32+00:00

My usage-scenario may seem a bit unusual, but here it is: When using vim

  • 0

My usage-scenario may seem a bit unusual, but here it is: When using vim (it’s one of about 4 different editors I use regularly), I use it in two different situations. The first is via the GUI, in which I’ll have multiple buffers and have some settings different than when I use it from the command-line (by testing ‘if has('gui_running')‘). The other is when I need to do something short-and-quick, from the command-line, such as make a small change to a dot-file or other type of config.

What I would like to do, is have sessions enabled for the GUI, but have any command-line invocations ignore them. That is, I don’t want to bring up the full existing session on a CL invocation, nor do I want it (and whatever buffer/file it involved) to alter the session that the GUI is using. As I’m fairly new to the post-vi-functionality of vim, I’m not really sure how to pull this off.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T00:02:32+00:00Added an answer on May 11, 2026 at 12:02 am

    do your session magic in your .gvimrc and everything else in your .vimrc. The GUI will source both, but the CL version will only source the .vimrc.

    The session magic is to set up autocommands to write your session to a file on exit, and reload it by sourcing the file upon entrance.

    au VimLeave * mksession ~/.gvimsession au VimEnter * source ~/.gvimsession 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 261k
  • Answers 261k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes you are correct. You don't need both to function.… May 13, 2026 at 11:35 am
  • Editorial Team
    Editorial Team added an answer There is no framework for this because its trivial to… May 13, 2026 at 11:35 am
  • Editorial Team
    Editorial Team added an answer It says Language: Lazy Scheme;. I'm sure this means that… May 13, 2026 at 11:35 am

Related Questions

It may not be best practice but are there ways of removing unsused classes
I'm designing an application that receives information from roughly 100k sensors that measure time-series
Here's my question: Does calling free or delete ever release memory back to the
I had a heated discussion with a colleague on the usage of stored procedures

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.