Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sessions]

The tag has no usage guidance.

1
vote
1answer
30 views

How to save modifiable and readonly states in session file?

I can’t find how to save modifiable and readonly states with :mksession. Is it even possible?
0
votes
1answer
67 views

In Vim, how to tag/enrich buffers with custom information (that persist naturally)

Gday, I am trying to persist some state about my buffers, specifically terminal buffers, over vim sessions with :mksession through the plugin 'vim-session' by xolox. The goal is to assign labels to ...
1
vote
1answer
42 views

Can capitalized marks be saved in session INSTEAD of viminfo?

Marks are saved in .viminfo I would like to have separate marks saved per session. Is there an easy setting to make this switch? I know I could write some vimscript to save my session marks ...
0
votes
1answer
69 views

how to set filetype after session restored with vim-session plugin

I used exvim as session manager, it uses a project file with extension .exvim. The session is auto-loaded when double click the .exvim, and auto-saved on exit. But there're bugs and the dev is ...
1
vote
2answers
84 views

How can I read a command-line argument in vimrc?

Here is a situation: I want to manage my working environment on multiple projects separately, and all of them should have its own session (Session.vim) to save and restore. So I would like to launch ...
2
votes
1answer
142 views

Vim Session keeping terminal state

I am currently using tmux to have two terminals on the left and vim on the right. One terminal is running Django server, and the other one is for general usage. I am trying to find out if I can ditch ...
0
votes
1answer
100 views

Persistent conceal settings through Vim / Neovim restarts

I can successfully toggle between different conceal levels in Neovim, which is rather handy when working with markdown documents. Also, when working with with multiple documents in a Neovim session, ...
0
votes
1answer
46 views

How to NOT create a view and session file when viewing man pages

I recently discovered the world of vim session files, and they are awesome for working with multi-file code projects. However, when opening a man page I don't need a session file created for viewing ...
3
votes
1answer
118 views

Can I retain and restore all the GUI windows and its files on launch on Vim?

I'm currently using the session saving to restore the state when the app (MacVim) is closed. nnoremap <leader>q :mksession! ~/.vim/Session.vim<CR>:wqa<CR> nnoremap <leader>...
0
votes
0answers
22 views

How to use a vim session with the same files on a different mount point?

I have a vim session that I used on a laptop, which was using a mount point remotely mounted using sshfs. Now I'm on another laptop, and I'd like to open the same session but at a different mount ...
0
votes
0answers
71 views

Open new fresh session

How do you create a new fresh session in Vim without restarting it? Sometimes when I'm working in an existing session, I'd like to switch to something new, for which I want to create a new fresh ...
2
votes
0answers
535 views

How to share the same buffer between multiple vim instances

I work with two displays. I usually open one instance of Vim in display #1 (let's call it Vim #1), which over time ends up having an open buffer for nearly every file in a project. Now I want to ...
0
votes
1answer
79 views

Do not reopen buffers of last session

When Vim starts, it always opens buffers of last session too. That is to say, when I leave Vim by closing all windows, but do not explicitly close buffers (by :bd), those buffers will be opened next ...
0
votes
1answer
34 views

Remapping of j as gj etc in .vimrc is not applied in a session

My .vimrc contains: noremap <buffer> <silent> $ g$ noremap <buffer> <silent> 0 g0 noremap <buffer> <silent> j gj noremap <buffer> <silent> k gk I've ...
3
votes
1answer
214 views

How could I preserve netrw :Lexplore in Vim sessions?

I use netrw :Lexplore as my file browser and I also use vim sessions. However, whenever I open a session file, :Lexplore is closed and I have to re-open. Is there a way to keep netrw :Lexplore open ...
3
votes
2answers
112 views

How to have different vim sessions open the same file seamlessly

from some time now I'm using vim very intensively. I'm connecting to my server with different screen sessions, one for my main PC, another for netbooks or mobile phone, tablets, ... All this time ...
2
votes
0answers
33 views

Persisting unsaved changes to untitled buffers in a session [duplicate]

Sublime Text has a killer feature I'd really like to get working in Vim. It's pretty much the only reason why I can't drop it in favor of Vim yet. The feature is that Sublime remembers unsaved ...
0
votes
1answer
37 views

Do sessions get loaded after vimrc, and is there a block to specify loading code AFTER a session is loaded?

set sessionoptions+=globals if !exists('g:EGbufs') if exists('g:EGbufsstring') exe "let g:EGbufs=".g:EGbufsstring else let g:EGbufs = {} endif ...
3
votes
1answer
64 views

Empty first tab lost when using sessions

I'm creating a session with mksession, and when I restore the session, if the first tab was empty ([No Name]), it's gone in the restored session. Other empty tabs are restored fine; it seems to only ...
6
votes
1answer
113 views

Ignore word spelling on a per-file/buffer basis

I can add a word to the local dictionary or spellfile with zg. I can use zG to add a word to the internal spellfile, but this still affects all loaded files. How can I add spelling exceptions on a ...
4
votes
2answers
372 views

Make Vim sessions save the content of unnamed buffers

When saving a session with :mksession and :sourceing it back, the content of [No Name] unnamed buffers is lost. I like to sometimes write temporary throwaway code or notes on a unnamed or scratch ...
6
votes
2answers
143 views

Make Vim sessions save alternate files

When saving a session with :mksession and sourceing it back, I noticed that alternate files (accessed via C-^) are not persisted. The docs don't mention anything about persisting alternate files. Is ...
3
votes
1answer
1k views

Remember previous session [duplicate]

Editors like Sublime Text remember your session, so that whenever you open Sublime Text it is exactly how it was when you last closed it: All of the same files are open Your cursor is in the same ...
3
votes
1answer
45 views

Using '-c' when calling vim from terminal

My issue is with using the -c while calling vim from terminal like $ vim -c jk I want to be able to open the last session before quitting on typing viml in terminal For this I made a map to save ...
2
votes
0answers
37 views

:mksession session file includes nonprintable characters

I have been having some problems using UltiSnips with vim. It seems that :mksession is adding a bunch of nonprintable characters to my session file(s). When this is sourced to restore my session, ...
4
votes
1answer
91 views

Source vim session file: Track down unexpected sourcing of other file

I often save my session using the following: In vim: mksession! ~/session.vim In gvim: mksession! ~/sessionX.vim However, when I invoke vim with a sourcing of ~/session.vim, I'm finding that ~/...
9
votes
2answers
2k views

How do I restore a group of tabs? [duplicate]

I just learned about tabs, meaning I can open them via :tabe some/file :tabe yet/another/file :tabe foo and circle them via gt (activate right one) and gT (activate left one). Yet when I close my ...
2
votes
1answer
398 views

Make vim sessions adopt changes to vimrc file

I've made changes to my _vimrc (windows) file since creating a session. I'm finding it impossible (using :source) to apply these changes to the session; it sticks stubbornly to the values as they ...
0
votes
1answer
51 views

How can I save a session in a directory owned by root?

I quite often open linux system configuration files with vim and sometimes have a session with lots of tabs, splits, quicklists etc that I want to save to a session and restore again later. The ...
5
votes
2answers
883 views

Vim lost custom highlight settings after recovering from sessions

I defined some highlights in the vimrc file and it works well in gvim. However after I mksession and sourced it back, I found that some (maybe all) of the custom highlights were lost and vim used the ...
4
votes
3answers
80 views

Save functions in a session

I have a function I wrote specifically for a certain session in vim. Manually redefining it every time I load the session is tedious. Is there any way custom functions can be saved with the session? ...
1
vote
1answer
171 views

How do you open a session in an existing server?

I'm using the server mode in vim and already have an instance open with a couple of files in. I'd like to add the contents of a session file to this. However doing vim --servername vim -S ...
5
votes
2answers
2k views

How does one perform a multi-line copy and paste between two sessions in Vim?

I am familiar with the y, p method of copying and pasting a line within Vim; however, I have been unsuccessful in finding a straight forward method for copying multiple lines which have been yanked in ...
5
votes
1answer
72 views

How do I get rid of <filename>.project.vim files?

It seems like any time I edit a file with gvim it creates a litany of files I don't want or seem to need. I understand the <filename>.~ files are backups of the file before I started editing and ...
19
votes
2answers
2k views

Can I open a file in an existing Vim instance from an external command?

Some applications have the notion of a "session", where you can run a command to load a file in an existing instance of an application. For example, when I type: $ firefox http://vi.stackexchange....
50
votes
4answers
9k views

How to save window, split, and buffer layout?

I have several tasks I am working on in one repository. I would like to create "workspaces" for working on them. One "workspace" or "buffer layout" would have all files I need to work on open in the ...
6
votes
2answers
1k views

How can I restore the cursor position when opening a file?

If I edit a file with vim that I have previously edited, I'd like vim to jump to the position I was in when I last closed the file. How can I accomplish this?