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 [vim-windows]

A Vim window is a view of a buffer. A tab page comprises one or more windows. For questions about interaction with the Microsoft operating system, use [microsoft-windows]. For questions about interaction with the desktop windowing system, use [window-management].

0
votes
0answers
27 views

How to make Gvim run output shell commands inside split/inner terminal

Sometimes Gvim uses cmd.exe and terminal pop up or blinks in few miliseconds as a external window. How to force Gvim to use internal terminal in split? This behaviour causes anoying blinking or ...
1
vote
1answer
36 views

Binding horizontal scroll in a function with feedkeys

I'm trying to create a function to make editing TSV files easier. The function changes spacing settings, turns off wrapping, and creates a 1 row tall split at the top so that the column headers are ...
0
votes
0answers
22 views

stop updating screen until function finishes or manually call redraw

Does vim/neovim have the ability to manually disable screen updating? I run a function that jumps between a few tabs, update the content, and then go back to the original tab. The screen then flash ...
2
votes
2answers
413 views

Conditional window split

I have line to split window at start: au VimEnter * vsplit But sometimes it's annoying because I'm opening vim in small terminal, in this case I'd like to not split my window. I've tried this ...
1
vote
1answer
50 views

opening powershell from inside vim

I want to run powershell from vim and I have achieved it using the following mapping: map <leader>cd :cd %:p:h<cr>:silent !powershell<cr> The problem is that I can't do anything ...
0
votes
1answer
24 views

How come the splitted window failed to update its shapes along with the whole window

By the normal mode command :vs, I split the current buffer into two equally sized buffers. Then I resize the whole terminal window and only find the left portion of the screen remains the same as ...
0
votes
2answers
118 views

vim split horizontal resize shortcut

I can resize horizontal split windows by ctrl-w-shift-< and ctrl-w-shift->. I would like to have a shortcut for that. Close to the topic, recently I learned about the following maps: nnoremap &...
0
votes
1answer
36 views

How can I automatically preform operations when a vim *window* is resized?

I'm setting up NeoFormat/ALEfix-style code reformatting, and I'd really like to have it automatically and fluidly reformat the code as the window is resized. This is possible for whole-viewport vim-...
1
vote
0answers
29 views

How to auto save on *.coffee files when lose focus (in insert mode) then also back to normal mode

I'd like to lose focus when I'm in insert mode, to trigger auto-save on *.coffee buffers and also I need it to change mode from insert to normal mode to trigger Live compile feature of vim-coffee-...
0
votes
0answers
29 views

How do I open a tag with <C-]> but open it in an existing split?

I usually always have only two vertical splits open. One I use for actual coding and the other for reference. I would like to be able to search for tag in Window1 and have the result appear in ...
8
votes
1answer
146 views

Why does :bd # delete the current buffer when no alternate buffer exists?

Here is how I reproduce the behavior I am observing. First, I enter this command: echo aaaaa > a vim a In Vim, I enter these commands: :ls :e # :echo bufname('#') Here is the output of the ...
0
votes
1answer
59 views

Is it possible to not have the same buffer open in multiple windows?

When we have a buffer open, and we open a new one with :split or :vsplit, if in any opened window we execute :bprev or :bnext, we could have the same buffer open at the same time in both windows. Is ...
1
vote
1answer
36 views

How can I determine if *any* window in the current tabpage is in diff-mode?

So, I found this useful answer about iterating buffers; but due to the tabpage-specific duality of windows in Vim, I failed at adapting it to my needs. Thus: how can I construct a boolean expression, ...
1
vote
2answers
86 views

How to start gvim from command line with predefine pasting from clipboard

I know gvim -c [command] samaple.txt might run command predefined in command body. How to paste text from windows clipboard at the end of sample.txt file?
5
votes
2answers
477 views

Detect if window has neighbour in given direction

Is there a robust way to detect whether a window has a neighbour in a given direction? So far, the only solution I found uses wincmd, let winnum = winnr() noautocmd wincmd h if winnum != winnr(...
1
vote
0answers
42 views

How to pass C-r to Vim terminal window? [closed]

In the Vim terminal I want to be able to search history in bash and ipython but C-r is already bound to basic Vim functionality. Is there any general way to pass this and other characters to the ...
0
votes
0answers
33 views

Highlight block of injected code [duplicate]

windows 10/ gvim 1-1802. I use Javascript and there are sometimes blocks of HTML code that need to be inside a particular region that can be indicated by """, for example . I have a similar ...
1
vote
0answers
594 views

Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings'

I am new to vim. As much as I love it, there seem to be a lot of bugs or errors every time I try doing something. I am unable to run the plugin "browserlink.vim" (https://github.com/jaxbot/...
0
votes
1answer
44 views

How to have a buffer takes 1/4 of a window and another takes all the rest?

I have two buffers, and would like one takes 1/4 of a window and other takes rest of the window. Normal behavior would be for example sp or vsp would split buffer to take 50/50 percent each, there ...
0
votes
2answers
136 views

How to switch between buffer and terminal (cmd windows)

I have a vim's buffer and a terminal in the same vim's window but each time switch to terminal I can only exit it to go back to vim's buffer, Is there a way to keep terminal session but be able to ...
1
vote
1answer
85 views

Unable to Open NERDTree

I'm new to Vim, and for the paste couple of weeks, I've been using NERDTree with no problems. However, I recently added a few key mappings and am now unable to open NERDTree with the <C-n> ...
1
vote
1answer
37 views

Quit a window by its win_getid() identifier?

I use something like zoomwintab to zoom in/out of a single window view, using tabs to simulate the effect. It exposes a toggle function to zoom in on a single window, and to zoom back out to the ...
0
votes
0answers
25 views

Window resizing with the mouse inside GNU Screen does not work

Resizing the Vim windows with the mouse inside a GNU Screen session doesn't work. I'm using guake, vim 7.4.576 and GNU Screen 4.02.01. Any other mouse operation works ok (the scroll as well as ...
0
votes
1answer
54 views

Contextual key bindings when a specific context menu is open

I recently installed fzf CLI fuzzy search utility, and the accompanying fzf.vim file with it. They both work great, and I have been enjoying my experience with them thus far. However, I'd like to ...
1
vote
0answers
38 views

Disable regex searching in specific windows

I usually have about 4 or 5 windows open in Vim. Currently - one of my files is very large(in size) - a CPU cache trace. Every time I search with "/", vim searches all windows before returning the ...
1
vote
0answers
17 views

Resize windows “visually” [duplicate]

When I use tmux, I can hold Ctrl-c and continue pressing any of the 4 arrow directions I want to resize a pane: I then see the pane of interest resizing while pressing and I stop when I get visually ...
4
votes
1answer
76 views

How to lock a window height / width?

I jot notes in a tiny split window (buffer) regularly: <C-W>s :enew :res 5 ... jot jot... When I create a new horizontal split in the same tab, that little window resizes, as if doing <C-W&...
0
votes
1answer
42 views

Where are my recent commands stored in Vim?

So I have made about 10/12 substitutions in my current file using %s/longpatternN//g. Unfortunately I have to apply these same substitutions in 10 or more of my files. I can access my last commands ...
0
votes
1answer
29 views

Toggle showing a file (e.g. individual Cheatsheet)

To learn my mappings, I want to toggle an individual help (like e.g. a cheatsheet or so). I don't know how to toggle showing of a window, is there any way or neat key map to toggle something like ":...
1
vote
0answers
49 views

Avoid Scrolling When Switching Back to a Buffer

When switching back to a buffer (.e.g with Ctrl^ and :bn, etc.), Vim tries to scroll whatever line the cursor was on last to the center of the window. I find this behavior extremely disorienting, so I ...
1
vote
1answer
165 views

How to open a vertical split to the main view not just next to the current one in case of horizontal splitted viewport? [duplicate]

I have 2 buffers on eachother covering top and bottom of the screen. I want ot open a third buffer on right split but the problem is is I make a right split it will only split the top right or bottom ...
4
votes
1answer
313 views

How can I open a split at whose height is a percentage of the main window?

Is there a Vim function or variable that would return 1/3rd (or any dynamic value) of the current window height? I'm using Neoterm, and it's terminal splits open at half the current window height by ...
0
votes
0answers
51 views

Neovim spontaneously resizes and distorts windows after screen unlock

When I lock the screen then unlock it again, the windows are resized and distorted. Unmaximizing then maximizing the terminal window restores the buffers then using ctrl + w + = fixes the windows size....
3
votes
1answer
174 views

What is a working setup to use Vim plugins UndoTree and Goyo together?

I love UndoTree, saving me many times when I deleted/rewritten entire paragraphs but days later I realized that I needed to extract a phrase/sentence from them, without completely messing up my ...
2
votes
2answers
454 views

Any recommendations to enforce use of keybindings rather than equivalent command mode commands?

Context: I learned about the :[v]split command long before I learned the shortcuts Ctrl-w+[s|v] and as a result I find myself typing these commands often. Is there a way to break this habit ? (as a ...
1
vote
1answer
26 views

how can I make keymap to open a new file in a vertical split? [duplicate]

I tried nnoremap <c-m><c-m> <c-w>vs ene and nnoremap <c-m><c-m> <c-w>vs<space>ene but I don't get a new file, I get the same file in a new buffer.
1
vote
1answer
42 views

Getting tab and windows movement with one key combination

Recently I found this question: Is it possible to map one key to two commands, doing 2nd command only if first fails It's working well, but I'd like it to work this way: when Alt-l is pressed, do ...
1
vote
1answer
96 views

Is it possible to map one key to two commands, doing 2nd command only if first fails

I want to map the tab key to <c-w>w to switch windows when there is more than one window open. But if there is only one window but multiple tabs, I want it to detect that there is only one ...
1
vote
1answer
83 views

Is there a shortcut to open a blank vertical split window?

I know there is a shortcut to open a new blank split window horizontally. Namely, ctrl-w + n. But is there a shortcut to do the same thing vertically? More precisely, I want a shortcut for :vs ene. ...
4
votes
2answers
240 views

Close all windows except the current one and NERDTree

I know about :only and Ctrl+wo. But I want to keep NERDTree window untouched. Is there a way to achieve it?
1
vote
1answer
242 views

Closing error window

When I run yapf on my code, an error page appears, rightly showing the error I have in the code. How on earth do I close this window and go back to my code? :lclose doesn't work. :close closed the ...
5
votes
2answers
280 views

Is there a direct way to select the buffer displayed in a non-active window?

I usually have two windows open, one in which I'm working and one in which I'm viewing some information (compiler messages, relevant library headers, etc. etc.). Now, it's easy to switch the buffer on ...
1
vote
1answer
74 views

Why <C-W> does not enter operator pending mode?

I use Colemak layout. In order to use hjkl I remapped several keys nearby with noremap. It works fine. However, window movement commands somehow do not recognize these mappings. E.g. although I have '...
2
votes
1answer
111 views

How to open file in specific window (create or reuse)?

I'm trying to develop a plugin that would show results of SQL queries, by executing them inside tmux split and using mysql pager option to save them to the specific file. What I want now is to either ...
0
votes
1answer
71 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 ...
1
vote
1answer
92 views

How can I keep the Tab title text fixed, during movement through separate split panes/panels?

Generally, I only use split panes inside of a Tab when using plugins like NerdTree, TagBar, and Codi, or when opening up helptags with :help. When I enter one of these panes, the Tab title text ...
2
votes
1answer
352 views

A fixed position for preview windows

Is it possible to setup vim to open all preview windows on a specific location. I want them to open on the right side.
0
votes
2answers
81 views

Why does :only care if “Other window contains changes”?

I have two windows that I created with a :vsplit. Window 1 displays a file with changes that have not been saved yet, Window 2 displays another file. I want to get rid of Window 1, so I type :only in ...
1
vote
1answer
83 views

Turn Vim windows on the side

Let's say I have two windows open, stacked one above the other (via vim -o file1 file2 or :split). Is there a command (sequence) which would allow me to turn this into two windows that are side by ...
2
votes
2answers
1k views

How to disable moving the cursor with the mouse

I've been using Vim for decades (and Vi before it since around 1984.) I use it now on Linux. Somewhere along the line one behavior crept in that I'd like to disable: when I click in a window to move ...