Questions tagged [buffers]
The representation of a file loaded into memory. Edits are performed on buffers.
65
questions with no upvoted or accepted answers
9
votes
0
answers
656
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
0
answers
60
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 ...
3
votes
0
answers
480
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 ...
3
votes
1
answer
1k
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 ...
2
votes
0
answers
52
views
`E93: More than one match` when `<C-d>` shows only one match
When jumping between buffers in Vim, most the time things work quite smoothly.
I like to jump to buffers by writing :b something1*something2, checking if the match is unique by invoking C-d, and if so ...
2
votes
0
answers
156
views
CTRL-^ work in Vim but not in Neovim
I'm reading Neovim's usr_07.txt.
When I start Neovim like neovim t1.txt t2.txt t3.txt, and then issue :next, the shortcut CTRL+^ is supposed to bring me to the previous file (i.e., the alternate file)....
2
votes
1
answer
220
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
0
answers
145
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
0
answers
151
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
0
answers
32
views
Run macros in background while doing something else
I have a macro that calls APIs to fetch data based on information in a buffer. Is it possible to have the macro continue execution while I move to another window and work on other buffers?
1
vote
1
answer
53
views
How to restrict tab-completion to the file name when opening a buffer
I know that I can do:
:b home<tab>
and vim will autocomplete to all buffers with the word "home" in them. My problem is that this includes all buffers that have "home" ...
1
vote
1
answer
35
views
Move between buffers of a certain filetype
scenario: I have a bunch of programs that generate output, the programs and output are open in buffers and the programs are one filetype eg .r and the output is another filetype eg .txt
I want to ...
1
vote
0
answers
32
views
How to move buffer list from bottom to top of UI?
When I invoke the buffer list (via: :ls), a selection window appears at the bottom of my UI. Is there a way to move this selection window to the top of my UI?
Any suggestions would be welcome.
1
vote
0
answers
57
views
Is there an autocommand event after buffer is deleted?
help BufDelete
BufDelete Before deleting a buffer from the buffer list.
This is close to, but not what I am looking for: After deleting a buffer.
1
vote
0
answers
156
views
How to split view all buffers in vim with equal distribution vertical horizontal
How can I split view all buffers in vim with a distribution between vertical and horizontal? Is there a plugin?
I know how to make all buffers appear in either horizontal or vertical splits:
:ball
:...
1
vote
0
answers
78
views
How to customize how neovims "shell command buffer" is shown?
I am wondering about the behavior of the buffer that appears in the bottom of the terminal when running a shell command in neovim.
How can I make it appear the right side instead?
How can I make the ...
1
vote
0
answers
98
views
Macro doesn't run properly when executed with :bufdo or :argdo
I have a macro that looks like:
:reg a
Type Name Content
c "a /^where^MkV%yGo^M-- Some typing...:^[pVG:!/tmp/t.sh^M
It works fine from any starting position in the file when I replay it ...
1
vote
0
answers
150
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
0
answers
44
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 ...
1
vote
0
answers
294
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, ...
1
vote
0
answers
63
views
Delete buffer only when a specific buffer is deleted
I've configured Vim to look like this:
+------------------------------------+
| N | Code |
| E | |
| R | |
| D |...
1
vote
0
answers
140
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 ...
1
vote
0
answers
19
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
0
answers
271
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 ...
1
vote
0
answers
131
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 ...
1
vote
0
answers
220
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
0
answers
163
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.
...
1
vote
0
answers
729
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
0
answers
42
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
0
answers
503
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 ...
1
vote
0
answers
143
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
0
answers
139
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
0
answers
918
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
0
answers
47
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 ...
1
vote
0
answers
109
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 ...
1
vote
0
answers
138
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
0
answers
73
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
0
answers
128
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
1
answer
32
views
How do I create key mappings for Windows and/or nano Shortcuts?
Having used text editors (mainly Notepad/++) and some IDEs on MS Windows, I've become familiar with their Alt and Ctrl shortcuts to the point that I use them automatically. Having used nano on a GNU/...
0
votes
0
answers
22
views
How do I instruct plugin BufExplorer to open a buffer in an existing window?
How do I instruct Vim plugin BufExplorer to open a buffer in a specific existing window rather than open the buffer in a new horizontal (key f or F) or vertical (key v or V) window?
0
votes
0
answers
35
views
How can I stop Vim from quitting when the last buffer is a `:help` buffer?
I think there is an option that governs this behavior, but I cannot find it.
0
votes
0
answers
28
views
Buffers not close automatically by Vimspector
I have been using Vimspector for debugging Python but like 8-10 months now, the Python terminal buffer that is opened by Vimspector when the debugger runs, is not automatically closed when the ...
0
votes
0
answers
53
views
How to "keep" Lexplore/Rexplore/Explore position?
When navigating large projects, in IDEs like intellij, I keep opening and closing the navigation/file tree tab and moving around files.
On vim I tried to create a similar functionality, adding to my ~/...
0
votes
0
answers
24
views
":bufdo cd ~/Some/Folder/Path" doesn't affect all files
I have about 15 files in my buffer list [1]. In my one and only tab, I have three modifiable subwindows, none of which have unsaved changes. I issue :bufdo cd ~/Some/Folder/Path, and Vim lists each ...
0
votes
1
answer
29
views
How to search hidden buffer during insert-mode completion?
I am trying to write a completion function which has as its source a 386k line (CSS) file.
Initially I read the file into a list with readfile() and used a for loop to iterate over each line, matching ...
0
votes
2
answers
1k
views
Setup Telescope to save and close all buffers, when opening a new file
I'm following a Neovim tutorial on LaraCasts from Jess Archer, setting up Neovim.
I've used Vim for a while, but I'm new with Neovim.
You can see Jess Archers dotfiles here: Jess Archers Dotfiles.
I ...
0
votes
1
answer
71
views
Read viminfo when argc() > 0
Does Vim read the viminfo when called with a file argument?
How can I force Vim to restore the buffer list in that case?
Use case & context
What I want is:
When called as vi: enable read/write ...
0
votes
0
answers
767
views
Disable TreeSitter highlighting in inactive buffers
How can I disable TreeSitter highlighting in inactive buffers?
I currently have all inactive buffers blurred and their syntax disabled, but I can't figure out how to disable the TreeSitter ...
0
votes
0
answers
66
views
A counterpart for BufUnload,BufDelete event but gets fired after a buffer is unloaded
I've defined an autocommand that essentially checks for the remaining buffers' filetype, and for now by relying on BufUnload or BufDelete, the unloaded buffer still gets detected as being present at ...
0
votes
0
answers
27
views
How to add new command to a buffer by buffer number
-buffer flag in :command adds a command to the current buffer but how can I add command to a buffer by a given buffer number.