Questions tagged [terminal-buffer]
A terminal emulator within vim, eg created by :terminal or term_start()
135
questions
0
votes
0
answers
16
views
Help migrating from conque to vim 8.1 terminal mode
I have been using the conque plugin for many years now to run a terminal within a vim window, but it is probably past time to migrate to the terminal features of vim 8.1 and above. I only really use ...
2
votes
2
answers
141
views
Execute reverse search in terminal mode at startup
I have tried to use the following
:nnoremap <leader>t :terminal<cr> <c-w>:call term_sendkeys('', "\<lt>c-r>")<cr>
To open a terminal with reverse search ...
0
votes
2
answers
81
views
How to close Terminal and NERDTree windows if they are the last windows?
If I close all buffers, I'm left with the terminal window, which automatically opens whenever I open Vim.
I would like it close automatically when I exit Vim.
I see that on the NERDTree repo, they ...
0
votes
1
answer
38
views
Get the last line of Vim terminal output
I use Vim for editing DocBook files. I created several functions that manipulate the text in the buffer. For example to build a PDF from the source using an external command. I run these functions ...
1
vote
1
answer
70
views
How can I create a keybinding that pastes in the terminal in bracketed paste mode, but only if the shell supports it?
Xterm has a feature where if you put in .Xresources
XTerm.vt100.translations: #override \
Shift Ctrl<Key>V: insert-selection(CLIPBOARD)
then ctrl+shift+V will paste from clipboard.
I notice ...
0
votes
1
answer
41
views
Go to file with gf from :terminal
I often keep a :terminal open on the right of a vertical split, and on the left keep a window open for files:
------------------------------
| | |
| file buffers | :terminal ...
1
vote
0
answers
24
views
term_sendkeys({buf},{keys}) move cursor to the next line if {keys} is empty
I am running gvim 9.0 on Windows 10.
I am developing Python code.
I am using Miniconda and I run gvim from a Miniconda CMD shell.
For this reason I prepared a .bat file for starting gvim with the ...
0
votes
0
answers
39
views
Bash powerline right segments don't work in Neovim terminal
I use powerline for bash. I also have right segments for displaying error codes and git branches:
{
"segments": {
"left": [
{
"function&...
0
votes
0
answers
22
views
From terminal to normal mode and run a command
I have the following mapping
tnoremap <F8> <c-w>N :Vista!!<CR>
but the command after <c-w>N (in my case :Vista!!) is not executed.
How should I fix it?
0
votes
1
answer
83
views
Nvim function to compile file in terminal
function! RunCppFile(filename, filedir)
let compile = "g++ " . a:filename . " -o " . a:filedir . "/a.exe"
:terminal
<i>
endfunction
nnoremap <C-L&...
0
votes
1
answer
38
views
How to automatically change a buffer terminal name?
I have a small .bat file to open Vim along with a terminal running an IPython console:
@echo off
call C:\Users\myname\Miniconda3\condabin\activate.bat C:\Users\myname\Miniconda3\envs\myenv
gvim -c &...
0
votes
1
answer
24
views
MacVim: <Delete> key does not work in a terminal window
I happened to find that we may open 'Terminal windows' in Vim and am happy to stop using terminal app. (It's available in v8 and v9)
However, when I have a typing mistake, pressing Delete key does not ...
0
votes
0
answers
8
views
Is it possible to suppress the output of term_sendkeys()
Sometimes there are lots of lines to be sent from the editor to the terminal and therefore thethe latter scroll a lot as soon as it execute the received commands. That may not be too nice to see ...
0
votes
1
answer
65
views
How do I disable easymotion in terminal mode?
I'm using easymotion with all buffers and it works well but changing to terminal mode raises the issue.
Thus I want to disable it in terminal mode for convenient.
How can I do it? Thanks for your ...
1
vote
2
answers
564
views
Leave terminal normal mode
Once I'm in 'terminal normal mode' (where VIM has control on the terminal display), i can't come back to simple 'terminal mode' (where i can write BASH or launch process).
How to leave the "...
2
votes
1
answer
509
views
Open file in new buffer within original vim instance from a terminal buffer [duplicate]
The terminal emulator is handy!
However, using it to open a file you wish to edit (while remaining in vim) is troublesome because simply doing vim myfile.txt will spawn a 'vim within vim inception' ...
2
votes
2
answers
50
views
Save all lines of a terminal buffer into a list after its job finishes
I need to save all lines of a terminal buffer into a list after its job finishes asynchronously. I,m opening the terminal buffer like this:
let term_buf_no = term_start(cmd, {'term_name': name, '...
0
votes
1
answer
40
views
Re-use or close vim terminal buffer on next command run
I'm opening a terminal buffer for my XML validation with the following command:
let term_buff_no = term_start(validate_cmd, {'term_rows': 10})
However, when running the same command again, a new ...
1
vote
1
answer
57
views
How to keep focus in the "normal" editing buffer while a terminal buffer is opened and running a command?
I am editing a DocBook XML file and want to validate it by running a custom command validate_cmd. In my plugin, I'm running the following:
let term_buff_no = term_start(validate_cmd, {'term_rows': 10})...
0
votes
1
answer
949
views
How do you set the cursor style in Vim terminal windows?
Vim has the :terminal command, which opens a window with a terminal session inside. According to the documentation (:help terminal-cursor-style),
By default the cursor in the terminal window uses a ...
2
votes
1
answer
357
views
How do you send vim to the background from a terminal window?
I just learned that Vim has the :terminal command, which opens a window with a terminal session inside. Previously, my normal workflow was to launch vim from my terminal and use job control to get in ...
0
votes
2
answers
45
views
How to get nnoremap <buffer> to work in different buffers?
I have a hotkey that runs python of the first buffer when I press F8 and outputs the outputs to the bottom.
However, this hotkey does not work when I switch buffers... it only works when I am on the ...
1
vote
0
answers
48
views
How to visually select entire broken line in NeoVim terminal
(I'm using NeoVim, vsplit term://zsh)
If I have a long terminal line that gets broken, and go into visual mode in order to copy something, selecting the entire line does not work as I expect:
|$ ...
1
vote
1
answer
126
views
How can I execute a non named file on terminal with NeoVIm?
Some time ago, I've made this question where I asked how to execute a file on the terminal with NeoVim... The solution I found was the following :terminal bash % . Knowing that, I made the following ...
1
vote
1
answer
713
views
How to configure options in :terminal (NeoVim)
I've read the help section for term, terminal, termopen, buftype, and I've read several stack questions, but I haven't been able to find a solution for settings options in terminal mode. I know about ...
0
votes
1
answer
81
views
Prevent vim from being launched in vim
When I'm using the terminal feature on nvim sometimes I run the last command again out of habit (thinking that I'll re-run the unittests for what I'm coding at the moment or something), but the latest ...
1
vote
1
answer
117
views
How to change the directory highlight in the terminal buffer?
I have a theme which is great apart from some minor things. I could already change the LineNr highlight and some others, but can't seem to change the directory highlight in the terminal buffer, which ...
0
votes
1
answer
78
views
Unable to resume backgrounded Neovim-terminal-emulator-process using `kill -CONT`
So, I'm trying to find an actual solution to another question on here that doesn't really have one. However, I'm running into a problem with backgrounding/foregrounding behaviour.
I need to background ...
1
vote
1
answer
55
views
Run :terminal so it starts in terminal-normal mode?
I want to run an async command and when it completes open a terminal window. Since the opening is delayed, I don't want it to steal input from me, so the new window should be in Terminal-Normal mode.
...
1
vote
1
answer
106
views
`termwinsize` cannot be accessed from Python 3
The option termwinsize cannot be accessed from Python 3.
Input
python3 << EOD
import vim
for window in vim.windows:
if (window.buffer.options['buftype'] == b'terminal'):
window....
2
votes
1
answer
875
views
Remap enter Terminal-normal mode Neovim to something else than Esc
I have remaped enter terminal normal-mode to <Esc> with:
tnoremap <Esc> <C-\><C-n> and it does work.
But I am using zsh vi-mode, which also requires the use of <Esc> to ...
0
votes
1
answer
198
views
How can I append to a terminal buffer in vimscript?
I am trying to implement a vimscript function which appends to a terminal buffer. It works when I write this as a single mapping which uses the normal mode 'a' command to append:
nnoremap <Leader&...
0
votes
1
answer
89
views
The remap doesn't resize terminal window
nnoremap <leader>rt :term<cr> <C-\><C-n> :resize 10<cr> i
I've tested the remap manually, it works as expected. A terminal window spawns I go into terminal normal mode, ...
2
votes
1
answer
96
views
How do you exit a terminal buffer unless in a pager
In a terminal buffer, I want to auto-exit when I press "kk". Except for when I'm in some interactive session, like a pager (like the pager which is created when you git diff).
To do that, I ...
-1
votes
1
answer
252
views
Split Navigation in vim terminal [duplicate]
I use vim splits quite a bit. To switch faster, I use this shortcut instead of doing ctrl + w + h/j/k/l/
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w&...
0
votes
1
answer
56
views
Prepend text to all commands in terminal mode
I would like to prepend clear; to all commands in terminal mode. This reduces the amount of 'clutter' in my terminal screen and makes things slightly clearer for me.
0
votes
2
answers
99
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()
...
3
votes
0
answers
50
views
How to retain terminal colors inside the Vim terminal (-NOT- in GVim)? [duplicate]
My default terminal look:
will turn into this in the Vim terminal:
It's not a huge deal, but the former is easier on my eyes - and this doesn't happen on my other box... Tried to compare ...
2
votes
0
answers
111
views
Eye torturing colors in Vim/GVim terminal
I am using GVim but this happens in terminal Vim too. I use the Gruvbox theme. Whenever I start the terminal using :term, I see too blue colors when I change the directory within the shell. The ...
-1
votes
2
answers
112
views
<BS> and <C-w> delete entire line in (terminal mode from a command) instead of a single character
I'm creating a mapping which is supposed to navigate to a specific window (call TEST_WIN), focus in on the terminal and then delete a single character.
The goal of this command is to navigate to the ...
1
vote
0
answers
38
views
Terminal window interprets quick initial q as macro record
I have a function that opens a terminal window running some program. The program is quit by pressing q. But when I press q in the terminal window shortly after (within 1-2 seconds) of it being opened, ...
-1
votes
1
answer
74
views
How I can convert into the right characters?
I'm getting something weird characters in :messages.
How can I get the right results?
reproduce steps
define functions.
let s:rails_console_id = 0
function common#utilities#open_rails_console() ...
0
votes
2
answers
5k
views
How to hide terminal when not needed?
In VScode ,we are using ctrl+j to hide the terminal. Then if we press ctrl+j again, it will open the same terminal.
Is it possible in VIM/NEOVIM? I tried :Terminal ,but there is no straightforward way ...
1
vote
1
answer
276
views
Reopen a terminal window running an active job
How do I reopen a terminal window with an active job if I hide the terminal window? This is similar to the following question: Close vim 8.1+ terminal buffer without unloading. In this case, however, ...
0
votes
1
answer
631
views
How do I set floatterm plugin in Neovim such that F5 compile javascript and how do I do it for other languages?
I plugged float-term plugin , that open terminal window in neovim.
when I compile javascript with node in float term I did like :FloatermNew node % then it compiles fine and show me the output in ...
-1
votes
1
answer
870
views
How to compile a program and open the output in a vertical terminal window?
How can I write a command that does the following?
With one mapping, compile and/or run a program based on the filetype (*.c,
*.cpp, *.js, *.py, etc.), and open a vertical terminal window with
the ...
3
votes
1
answer
40
views
Word completion ^P / ^N is very slow because of scanning a :term buffer
I open a terminal window inside of a vim session and leave it there for weeks, use it for compilation, running and debugging my code. After couple of days the length of the terminal buffer grows over ...
1
vote
0
answers
50
views
How can I keep my cursor normal after exiting a terminal buffer?
Right now, whenever I open a terminal with :term, my cursor changes from a half-height/orange cursor to a full-height/gray cursor (depending on the emulator).
When I navigate back to another window, ...
1
vote
0
answers
218
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 ...
2
votes
1
answer
82
views
Yank visual selection with modifications in a terminal-buffer
Upon writing a code, sometimes I open a terminal split with :term to test it by issuing some commands and checking some output. As an example, this is a fragment of what I have executed in a split ...