Questions tagged [buffers]

The representation of a file loaded into memory. Edits are performed on buffers.

43 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
506 views

Persistently fix the height of a split in vim

So I searched the web far and wide and I can not for the life of me figure out how to do this. I have the following key binding: nnoremap <leader>o :below 10sp term://.//$SHELL <cr> :set ...
4
votes
2answers
693 views

Is there a way to list recent buffer history?

I just started using buffers in Vim and I couldn't figure out how to list recent closed buffers. Is there a simple way (like :ls) to list those? Are they actually stored by Vim? Maybe I'm misusing ...
3
votes
1answer
844 views

Toggle fzf.vim if already open

I am trying to write a vim function to toggle the fzf window if it is already open using fzf.vim. The use case is if I am in the :Buffers view and I want to change to the :Files view if I try to ...
3
votes
0answers
58 views

Why do Powerline colors dim and stay dimmed when switching buffers?

When I first open vim, the Powerline plugin works as expected: If I then switch to another buffer, the coloring of powerline's status bar is gone and it remains that way even if switching back to the ...
2
votes
1answer
123 views

Session - start with buffer 1

Note: Possible fixed bug. See comments. A somewhat minor nuisance, but as the pedantic for these things :P When saving and opening a Session file the Session.vim file does: badd +1 file1 badd +1 ...
2
votes
0answers
113 views

display list of buffers `ls` without scrolling down

Is there a way to display output at the bottom of the screen like ls does, but without scrolling down to accomodate the output? The Vim Wiki (no https) has the following snippet :nnoremap <A-n>...
2
votes
0answers
124 views

How to block opening files in specified buffers

My working vim appearance looks like that: Sometimes I accidentally open file when I am focused on nerd tree buffer and I end up like this: So I would like to ask you if there is any way to set vim ...
1
vote
0answers
24 views

How can I track the event of opening a file in netrw in an autocommand?

I'm trying to solve this problem by creating an autocommand which will track when a new buffer is opened through netrw, and will then immediately close netrw once the buffer is closed. How can I track ...
1
vote
0answers
53 views

How to sort the list of buffers

How to sort the list of buffers Vim displays on entering :b <Tab> by most recent? I'm used to the Spacemacs ordering, which displays buffer filenames in separate rows (vertically) in the order ...
1
vote
0answers
17 views

vim - :b partial match mid filename even when matches start of filename

In vim, if I have 3 buffers open: test_io io_fsm test_mux I want to get to test_io by typing :b io Vim won't list test_io (iterating using tab) as it prefers io_fsm instead. If I type :b fsm it ...
1
vote
0answers
82 views

Using fzf inside vim with double star completion

I wonder if it is possible to use fzf inside vim the same way it can be used on the command line. So, on the command line I can do vim file** and it will use fzf to search 'file'. I wonder if this is ...
1
vote
1answer
141 views

Buffer list per window

How could I get something like a buffer/argument list or a filter for individual windows, with a chosen subset of the buffers? So I could have a window just for header files in C (files ending in .h)...
1
vote
0answers
355 views

Random characters appear in my buffer but they are not part of the current file

I really don't know what details to give except for some screenshots and my vimrc file, I think it is because of a plugin but I am really not sure. Random characters just appear. Note that they are ...
1
vote
0answers
35 views

Save :Man window in session

TL;DR: I want to persist :Man windows in sessions I am obsessed with sessions, and use tpope's vim-obsession for managing them. Coupled with a scripted tmux, sessions make for a perfect "quit, go ...
1
vote
0answers
61 views

How to pin a file to a window(/viewport)

When I have multiple files open in multiple splits, when I open a new file via quickfix ( or Ctrl-P ), it sometimes ends up placing the new file in a window that I don't want to be changed. Is there ...
1
vote
0answers
96 views

Strange behaviour when switching buffers in vim (syntax highlighting and keymaps cease to work until .vimrc source)

I have set up the following list of commands to switch buffers: (in a .vim file i source from my .vimrc to keep it organised) ...
1
vote
0answers
787 views

Why does "E89: No write since last change" error not occur when commands are joined with bar?

I have :set hidden set in my ~/.vimrc. First I did this: vim foo bar :bnEnter ihelloEsc :bpEnter :bd#Enter The :bd# command leads to this error: E89: No write since last change for buffer 2 (add ! ...
1
vote
0answers
119 views

:vsp sometimes making one split bigger than other and hiding NERDTree

So most of the time I have my standard layout like this: And every now and then I want to open a split in the main buffer using :vsp and most of the time that looks like this: And that is what I ...
1
vote
0answers
59 views

filetype plugin not loaded on files opened with edit command

I've turned on filetype indent and plugins on with the following in my vimrc file: filetype indent plugin on Everything is fine when I open a file from terminal, but if I open another buffer ...
1
vote
0answers
116 views

How do I prevent resizing of particular buffer?

I have these mappings in my .vimrc: nnoremap <s-j> <C-w>- nnoremap <s-k> <C-w>+ In a single buffer, Shiftj results in resizing my (pic1) buffer. Im not sure about that, but i ...
0
votes
1answer
49 views

Vim - mapping a text string to specific buffer

I like to know how I can connect/map a specific string to a desired buffer. Let's say I have the following text files: file1: Dog Cat file2: Milk Now, the 2 files are located at different dirs, and ...
0
votes
0answers
11 views

GoToDefinition used to show result in a split window, but now uses buffer

I have this mapping in my .vimrc: nnoremap gd :YcmCompleter GoToDefinitionElseDeclaration nnoremap gf :tab split \| YcmCompleter GoToDefinition<CR> When I press gd, it writes the command :...
0
votes
0answers
32 views

Display all the buffers in all the open vim Windows?

There's this really great feature in Firefox, where you can search all the open tabs by typing % and then typing what open tab you are searching for. Is it possible to do something similar to this ...
0
votes
0answers
69 views

What's the best way to auto hide a custom bufferline when there is only one buffer listed?

this is gonna be a lengthy question. I'm developing a neovim bufferline plugin which shows a list of all the buffers in the tabline. I'm trying to implement a auto-hide feature, where the bufferline ...
0
votes
0answers
28 views

Measurement/ tracking the time for editing a file (overall and statistics)

I use vim for coding and also for writing scientific articles and book chapters. It would be very interesting to know the time I spent on a file. For example how many hours or minutes the buffer was ...
0
votes
1answer
63 views

Useful script to manage buffer and window?

Given the scenario: I want to create a vertical split from current buffer for reference another file/the same file. After I've done with this split I don't want to see this buffer-for-reference in ...
0
votes
1answer
42 views

Call range argument to execute in python terminal embeded in vim

Initial window: My expectation: to copy whole or a part of python code in the right window into the left window's python terminal and execute. My .vimrc setting: function! CopyPasteBuffer() ...
0
votes
0answers
62 views

Print command output on terminal on vim exit

I am trying to run shellcheck upon exiting vim, however I do not get the output of the command I run. I've tested running something like touch foo instead, and I managed to see the file being created, ...
0
votes
0answers
47 views

Delete buffer only when a specific buffer is deleted

I've configured Vim to look like this: +------------------------------------+ | N | Code | | E | | | R | | | D |...
0
votes
0answers
41 views

Starting an interpreter and dumping the output to a new buffer

I am working on some Python code, and I would like to call an IPython interpreter from within a script. I have no problem doing this, however, I would then like to dump all of the output from both the ...
0
votes
0answers
19 views

running job disconnects from buffer

I'm trying to implement tail -f buffer via job_start. It works well unless I switch to other buffer (:bn). When I return to tail-buffer, it's empty. let job = job_start(['tail', '-f', 'some_log_file'],...
0
votes
0answers
110 views

How to set statusline for specific buffer

I want to use netrwm instead of nerdtree. I have my own statusline but I don't want it to be displayed in netrw. Nerdtree had it's own option for it (let NERDTreeStatusline="") which made it ...
0
votes
0answers
78 views

How to hide a buffer thru vimscript, with buffer number or buffer name

I'm trying to make a plugin that hide and show a terminal window on the bottom of the window, but i can't find a reliable way to hide a specific buffer, i tried using hide but you only can hide by ...
0
votes
0answers
48 views

NERDTree causes Vim exiting when open two buffers on same window

Here is what is happening: I open one file, either with o in NERDTree or with :edit file_a. I open another file, again with o in NERDTree or with :edit file_b, and the file opens at the same window ...
0
votes
0answers
40 views

Is it possible to make some animation in vim

This issue may be a kind of nonsense but I still want to know if it is possible to make some dynamic stuff in vim 7 or vim 8. For example, load a file and make if move from left to right (just like ...
0
votes
0answers
53 views

How to reload vim buffer

I built a cpp environment with YCM, EasyGrep and some other plugins. With YCM, I can jump to declaration/definition, with EasyGrep, I can grep a keyword easily. But I found something weird: Saying ...
0
votes
0answers
66 views

buffer name of opened directory in netrw disappears sometimes

I usually open a directory in vim with command :e path-of-dir. Because the plugin Netrw is included by default, this will be taken over by it and a netrw window will open with the content of the dir. ...
0
votes
0answers
348 views

Why is network latency becomes too long when edit in the sshfs mounted files

I mounted the remote server directory to my local machine mount point with sshfs. Thus I could use my local vim to edit my code, it is much faster than editing with the vim installed to the remote ...
0
votes
0answers
128 views

Open all but one buffer in a separate tab

I have following in my ~/.vimrc to make sure that nerdtree opens for every tab: autocmd VimEnter * NERDTree I also have this in the ~/.vimrc to make sure that every new buffer opens in its own tab: ...
0
votes
0answers
133 views

How to properly organize persistence of the vim state of all opened buffers?

Before switching to vim years ago I was using Sublime Text and it perfectly handled situations when I just close it and open again. Nothing is lost and at the place where I left it off. So I'm aiming ...
0
votes
1answer
245 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 ...
0
votes
0answers
45 views

Turning on syntax highlighting for test script output to new buffer

I'm using a plugin, bexec, to execute a test script. The plugin opens up a new buffer to the right of my code and it displays the output of the test script: I would like to have syntax highlighting ...
0
votes
0answers
95 views

Vim to behave like nvi when opening line in empty buffer

I want to Vim to behave like nvi when opening a in an empty buffer. This is an empty buffer: ---------------------------------------- ~ ~ ~ ~ ---------------------------------------- After typing ...