Questions tagged [terminal-buffer]

A terminal emulator within vim, eg created by :terminal or term_start()

Filter by
Sorted by
Tagged with
1
vote
1answer
68 views

Making terminal buffer unlisted

I'm configuring my scripts to work with terminal in VIM and have a question regarding :h special-buffers. Among mentioned kinds there were the following: unlisted The buffer is not in the buffer ...
1
vote
1answer
42 views

How to start a terminal, so that on exit will call a function?

I recorded info of terminal buffers in a dict, and want remove bufnr of closed ones. Can you tell me how to start a terminal such that call a function on exit, eg, func! myterm#remove(bufnr): ...
1
vote
2answers
35 views

CTRL-V_CTRL-[key], instead of ^[key] gives ^[[27;5;[ASCII code of key]~ in xterm on Arch

For example, Ctrl-v_Ctrl-w gives ^[[27;5;119~ instead of usual ^W. It does behave in such way only on (u)xterm. I've tested it on st, lxterminal, xfce4-terminal and rxvt. I'm also 98% positive that ...
0
votes
0answers
22 views

Vim terminal job prevents from exiting

I'm writing a function which is supposed to create a terminal buffer once for the entire Vim session and which would not prevent it from exiting. Here is how it looks like: let s:term_buf_nr = -1 ...
1
vote
2answers
52 views

Make a buffer active by its number

I'm configuring a terminal buffer and now I have the following problem. I have only one terminal buffer and I need to make it active by its number to avoid lots of CTRL-w j/k/l clicks. Here is what ...
1
vote
1answer
37 views

Toggle terminal buffer vimscript function

I'm new to vimscript and writing a function to toggle a terminal buffer. Here is what I tried: let g:toggle_term = "<C-j>" let g:term_buf_nr = -1 function! ToggleTerminal() if g:...
1
vote
1answer
28 views

Execute Vim command in terminal window and return to Terminal-Job mode

For a while, I'd been using :nnoremap <C-H> <C-W>h and :tnoremap <C-H> <C-W>h, et. al. to switch windows. This was working great, so when I started using tabs, I decided to ...
3
votes
1answer
179 views

Is there a way to start vim in terminal mode?

I often find myself Opening a terminal Running vim Starting a :terminal Is there a way to say vim --start-terminal and have Vim automatically run :terminal ++curwin as soon as it starts?
1
vote
1answer
69 views

How does g:terminal_ansi_colors affect the :terminal colors?

:term usually looks ugly in most colorschemes I've tried. At least on Windows, with light themes, these colors do not work and end up in an unreadable shade of yellow against my light background. I ...
0
votes
1answer
21 views

Allow text to reflow in terminal mode after resizing

I opened up a terminal with :terminal. Then I ran a server process that prints logs whenever someone hits the API. Next, I resized gnome-terminal, but I noticed vim didn't update the view of the ...
3
votes
1answer
23 views

Is it possible to use <C-H> (and J/K/L) for navigation inside a Vim 8 terminal?

I rebound control + H/J/K/L to navigate between splits without needing <C-W>: nnoremap <C-J> <C-W><C-J> nnoremap <C-K> <C-W><C-K> nnoremap <C-L> <C-...
1
vote
0answers
25 views

Autocmd commands for sharing terminal when open new tab

I was trying to create a trigger that does the following: When opening a new tab with a file, if there already exists a terminal buffer, it is opened below in this new tab. I have seen in logfiles ...
2
votes
2answers
43 views

closing :terminal / term_start() should quit vim if it's the last buffer

Situation: I've typed this: vim foo.js :terminal Now I have one split, a file editing buffer and a terminal. The good: I can quit by closing the terminal first, then the file buffer. The bad: But ...
1
vote
1answer
78 views

Vim terminal: How to split below by default?

Opening the vim terminal using :term, creates a horizontal split with the terminal placed at the top half of the window. Is there a way to open the terminal at the bottom half instead? I know I can ...
1
vote
0answers
29 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 ...
2
votes
1answer
68 views

How to copy long line from terminal buffer as it is without adding new lines?

I wanted to copy a public key from one machine to the other. I opened up vim and had two terminal buffers - one for each machine. In the terminal in which I had the first machine I went into normal ...
1
vote
2answers
242 views

How to follow the output of a command in a terminal window

I recently decided to give a try at neovim and one thing is bothering me: I use a terminal window to run my code watcher i.e. a never ending command which outputs new lines each time I write a buffer....
1
vote
0answers
47 views

send <cr> to ipython in :term

When I am developing some python script, I regularly find myself running part of the code to see if it does what I want it to do. Currently I do this by copying the code that I want to run to the ...
1
vote
3answers
147 views

Command to copy from current window and paste the text into terminal buffer

I am having trouble crafting a command that would copy the text from the current window and paste this text into a terminal buffer opened in the split below. Here are a few things I tried: normal ...
0
votes
1answer
69 views

vim 8.1 send_termkeys problem

I noticed that, if I use call term_sendkeys(buf, "make\n") and then I try to execute something else in the terminal windows (i.e. ls), vim append the last string sent from command mode to the actual ...
1
vote
0answers
42 views

use pipe symbol in vim :term command [duplicate]

recently i stumpled over vim :terminal mode. i am really exited about that. now i wanted to ask, how i can create a mapping, which sends a command, including a pipe symbol to :terminal? it should look ...
1
vote
1answer
56 views

Using a login shell only for the :term command

I'm on MacOS, so basically all terminals are login terminals for me which source my bash_profile and load everything I need. However, the :term command does not source my bash_profile, I believe ...
0
votes
0answers
36 views

Automatically inserting predefined strings to terminal buffer

When I compile any code file in vim, I use a specific mapping to open the terminal buffer and get into insert mode, but this requires me to be aware of the (potentially long and complicated) file name....
0
votes
1answer
45 views

Ex command to put value of variable into terminal emulator?

Using a terminal emulator (with :term), I would like to insert the value of a variable at the terminal cursor. In a normal text buffer, I could use put =g:my_variable or exec ("normal! i" . g:...
1
vote
2answers
387 views

neovim key remap specific to terminal buffer

I have been using nvim terminal mode to learn python and I want to have Ctrl-C break the python script from the terminal window even when I am not in insert mode. However, I also want Ctrl-C in my ...
0
votes
0answers
443 views

How to hide terminal buffer without closing it?

I want to make toggleable window with terminal buffer similar to every IDE terminal feature. Currently i have mapped: noremap <F4> :botright 8split term://bash<CR> tnoremap <F4> &...
0
votes
1answer
313 views

How to keep the neovim terminal buffer in the buffer list even after it being hidden

My problem is similar to, if not same as, this issues. But I can't follow what they're talking about. The following steps are necessary to reproduce my problems: :sp :term :wincmd w :wincmd o :ls ...
0
votes
0answers
16 views

How can I reproduce a Linting Plugin Behavior

I'm trying to get in to plugin writing, and currently I'm doing some builds (like Latex and LanguageTools checker), and I have in place hotkeys that call for the compilation, and It throws the output ...
0
votes
2answers
188 views

How to go up to previous command when in terminal mode in Vim 8?

I am new to Vim. I managed to use :terminal and :vertical terminal to have a terminal side by side with my code. This works great, I can move between my code and the terminals. However, how do I go ...
0
votes
1answer
68 views

Identifying the PID of Vim 8.1 internal terminal launched with :terminal ++close

When launching an internal Vim 8.1 terminal for an exclusive program like in terminal ++close ipython, is there a way to identify from vimscript which is the PID of the launched process (i.e. of the ...
0
votes
1answer
104 views

In Vim 8.1, “:term ipython” gives a different version of IPython than typing “ipython” on an already open terminal

When I open a Gnome terminal in my Ubuntu 18 and execute the command ipython, I start an Anaconda IPython terminal version 5.8.0. Within Vim 8.1, that is what I also get if I first open a Vim terminal ...
3
votes
1answer
77 views

Unmapping the global mappings on a per-buffer basis

I have the following mapping in tnoremap <Esc> <C-\><C-n> init.conf to exit insert mode while in the terminal. In certain terminal buffers I would like to not have that global ...
1
vote
1answer
66 views

Execute command in terminal mode at terminal startup

I'm trying to execute simple commands in the vim terminal mode, but cannot get it to work. For example, I tried nmap <F12> :let $VIM_DIR=expand('%:p:h')<CR>:terminal<CR>cd $VIM_DIR&...
1
vote
3answers
363 views

Start a new terminal instance if window splitting was initiated from a terminal buffer

When I'm in the terminal and I press <C-w>s the screen is split vertically and the terminal buffer is shown twice. Then I have to do :terminal if I want a separate terminal instance. Typing ...
1
vote
1answer
405 views

Commands history for vim commandline and :terminal [closed]

I want a way in which we can access a history of commands in terminal mode (and Vim/NeoVim's internal command line), just like in a normal bash terminal; i.e. if I press the up key it will scroll ...
1
vote
1answer
162 views

Execute visual selection/current line in Vim terminal via keymap

How can I create a keymap to send the visual selection/current line to a vim terminal window? I opened a normal vim window (containing only the line echo test) and a vim terminal window and tried ...
0
votes
1answer
203 views

How to make Neovim to not show the “[Process exited {num}]” when quitting a term?

When quitting the terminal it always shows the [Process exited 2], how can I disable it so that when I quit the terminal buffer should just close silently?
1
vote
2answers
1k views

How could I adjust terminal height

I like to use the vim embedded terminal, but I do not know how I could adjust its height. Sometimes, I need it to be lower so that I could concentrate on my editor how could I adjust it ?
3
votes
2answers
2k views

Opening :terminal window in new buffer

When I type :terminal to vim8.1, it splits the window and I use it split window. I want to open a new buffer and open the terminal inside it. Basically, like neovim's terminal emulator. Is there a way ...
0
votes
1answer
90 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 ...
1
vote
1answer
353 views

Change the terminal emulater neovim uses

Is there a way to change which terminal emulator neovim uses for its :terminal command? I am running neovim on Windows 10, and it used cmd by default; however, I would rather use cmder or another ...
0
votes
1answer
31 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 ...
1
vote
1answer
3k views

How could I create a terminal at the bottom

I could create a terminal with vim by running :term in the vim normal mode. However, this terminal is opened at the top of the window and I would like to open it in the bottom. How could I open it at ...
1
vote
2answers
301 views

Switching buffers in VI while skipping any terminal in VI 8.1

I am using multiple files within the same tab and when I switch buffers using :bn I reach the terminal, at which point I have to issue the command again to move. Here is the catch, I am using keymaps ...
1
vote
0answers
393 views

Use :terminal to display file with ansi escape codes

I want to display a file in Neovim with ansi terminal escape codes interpreted. I created a file which contains ansi escape codes (only colors for now, we can think about others as a bonus): echo '\...
1
vote
2answers
163 views

Running vim's ':make' using ':term'

Is there a way that I can have the :make command output itself to a terminal window in vim? In the 8.1 release, they added the :term command, which allows you to run an external program in a vim ...
7
votes
2answers
255 views

How to capture errors from make in terminal window

Vim 8.1's release note seems to indicate that you can feed output from make running in a terminal window to a quickfix list, but I couldn't find any detailed explanation. Is there a way to do this ...
1
vote
3answers
526 views

How to redirect terminal output to vim or get `vim like` behaviour in terminal output [closed]

How to get vim keybindings at terminal output so I can navigate/operate at terminal output like in vim or get smooth shell command processing in vim. For example I type: ifconfig an i want to make ...
2
votes
1answer
306 views

Vim Session keeping terminal state

I am currently using tmux to have two terminals on the left and vim on the right. One terminal is running Django server, and the other one is for general usage. I am trying to find out if I can ditch ...
0
votes
2answers
3k 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 ...