Write the server's name to a file whenever Vim gets input focus
redir! > ~/.vim.active| echon v:servername | redir END
autocmd FocusGained * silent call NameToFileWhenActive()
The redir line simply writes the server's name to the file. It needs
to be in a function if we want to silence it (otherwise it pops ...
As discussed in the comments,
autocmd ExitPre ?* tabdo windo mkview
should do it. The event VimLeavePre may be better.
I confess I’m not sure why the pattern is ?* on this one.
Also, don’t forget to augroup.
Finally, I decided not to re-invent the wheel, and this problem seems to be more difficult than I think. So, I give Vem-Tabline a try and it works nicely, and the default settings of this plugin are good, so no need to put code into my .vimrc. Nice!
Now my MacVim looks like this, the prefix of buffer names are now skipped by default:
Issue solved on r/neovim:
A tab will close when the last window is closed. A window will close when the buffer currently occupying it is deleted. This is default behavior. Tabs are collections of windows, that's how Vim handles them, if you want to keep a tab open you must have one or more windows for that tab
As suggested in the comments, set switchbuf=useopen does not work with :find. What this means is that if you :find b with cursor in a, then b will be opened in a's window regardless of how switchbuf is set.
However, if from a, one issues :sb b, then indeed the focus shifts to b in the bottom window pane leaving a untouched.
Is it possible to set up a command that can be toggled, dimensions increased or decreased that allows one to view the display of a window in a tab not from column 0 but from, say, column 10 to the right like so?
There is no built-in way to do it afaik.
I tried using repeated zl's (scroll right) to reach my desired scroll position. The trouble, however, is ...
You've asked for it (tm). set nobl implies that buffer will NOT be shown in :ls output. See :h 'buflisted', :h :ls. Do not copy/paste so blindly.
By default vertical splits are opened with respect to :h 'splitright' option (defaults to unset). Either set splitright globally or overwrite it for a particular command with :h :rightbelow modifier.
vnew et al. ...
There are multiple ways to do this, I'm sure, but it seems to me that a very straightforward approach is to...
Close windows A and F (for example, just move the cursor to each one and do :close).
That'll leave you with:
B | D | E |
| | |
____| | |
C | ...
I have an alternate solution.
Basically, this will allow you to split the current buffer with the buffer you pass in. To see the list of buffers do:
Here's a working example of my current vim session:
1 %a "~/local/git-projects/personal/templategenerator/src/frontend/Makefile" line 5
3 a "package.json&...