Questions tagged [terminal]

A terminal emulator (or terminal, for short) displays characters, colours, and the cursor on the screen. Vi & Vim are run inside of a terminal, gVim is not.

Filter by
Sorted by
Tagged with
1 vote
0 answers
26 views

Is there an equivalent to tmux clear-history in vimterminal?

In tmux there is a command which clears any additional history that may have shown up in the buffer. Does vim have a similar function for clearing out a vim terminal?
1 vote
0 answers
36 views

`term_start` fails to have `-m` option for shell like bash when using the shell path to invoke

I uses vim 9.1 shipped with bash 5.2.26(1)-release (x86_64-pc-msys) both installed by git-bash. :h terminal-use says :term will start one "terminal emulator" and ran the job. Then when I ...
0 votes
1 answer
159 views

How to synchronize background with terminal using solarized colorscheme with neovim

When I toggle my terminal from a dark to light colorscheme, neovim doesn't match: If my terminal is dark and I open nvim, nvim is dark (:set bg says dark) If my terminal is light and I open nvim, ...
2 votes
2 answers
2k views

Pasting text on Vim inside tmux breaks indentation

When pasting text into Vim without tmux, it shows a normal paste: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ...
1 vote
1 answer
59 views

Text shifts one character to the left when moving upwards

When I move the cursor upwards, the whole line (including the number) shifts one character to the left. The GIF explains it the best. I'm using Neovim installed in Windows but opened through WSL ...
3 votes
4 answers
18k views

How can I emulate :shell command in Neovim?

There is no :shell command in neovim. :terminal opens a shell without previous output, while :shell contains all the output of the parent shell and all previous shells. Is there any way to emulate :...
2 votes
1 answer
793 views

Why does terminal vim enter replace mode with my vimrc file? [duplicate]

I mostly use MacVim, but sometimes I'm in the terminal and use the CLI vim. I recently decided to clean up my vimrc file, retaining only what I knew I wanted. It works fine with MacVim, but when I ...
1 vote
1 answer
468 views

Vim display won't refresh in XQuartz

I got a new laptop (macOS Big Sur 11.5.1) and vim does not work correctly in an XQuartz terminal window. Many commands that should erase characters on the screen (such as backspacing while in insert ...
0 votes
1 answer
111 views

Can't use `:wqa` with open terminal buffers

I have next problem: When I use :term buffers the :wqa command produces error: Which is quite expected because terminal buffers isn't writable. BUT the :wa and :q separatly work. This is strange. To ...
0 votes
1 answer
67 views

Conditional Key Mapping in Neovim Based on File Type

How can I do in nvim if the file type is js do this: vim.api.nvim_set_keymap('n', '<A-1>', [[:w | split term://node % <CR>]], { noremap = true, silent = true}) else if file type is lua do ...
0 votes
1 answer
32 views

Backspaces in script are not interpreted in playback

I recently learned of the -w option to record inputs. Trying to "play them back" with -s, it seems the playback doesn't perfectly reproduce the edits in at least one way backspaces, <80&...
1 vote
4 answers
2k views

Toggle Vim Terminal with Mapping like VS Code

I am trying to implement toggling of the Vim terminal like VS Code by doing <C-~>. But am not sure how to go about it. I find executing :term to open and to close tedious. I figured having a ...
1 vote
2 answers
62 views

delete using command in terminal mode of nvim

In terminal mode, commands like d or dd are not applicable for deleting texts. I think this would be useful since it is common to edit a command line. For example, if I open a terminal vim :term and ...
2 votes
1 answer
510 views

Cannot open terminal ini nvim

I installed Plugin terminal using the vim-terminal plugin and try to execute :TerminalSplit bash but before the terminal open I got a warning message. Python 2 interface is not installed, using Python ...
2 votes
1 answer
324 views

How to pass custom arguments to the shell invoked by :terminal?

I would like to specify the startup command to run on the :terminal shell. E.g. bash -c ls. The shell can be specified with set shell=bash, but how to specify the arguments? In another use case, I ...
1 vote
2 answers
223 views

How can I make Neovim kill ongoing processes when I quit?

I'm setting up a nice development environment in Neovim. If I have a Docker container running inside a terminal in Neovim, I want that command to exit when I quit Neovim with :qall. Currently, I can ...
2 votes
1 answer
56 views

What is set_opfunc?

I'm configuring toggleterm.nvim, and in particular I'm putting this keybinding in my config file, as suggested by the plugin author here: -- Send motion to terminal vim.keymap.set("n", "...
0 votes
0 answers
32 views

Where is my terminal?

I installed iron.nvim. I open two Python files with nvim m1.py m2.py. When I send over some lines to the REPL and then close the first buffer with :bd, I'm left with the terminal window. I go to the ...
1 vote
2 answers
471 views

How to elegantly return to text file after executing a `:terminal` command similar to `:!`?

I want to return to the open file after I executed command with :terminal <command> First off, I am using neovim. So to get to the situation, I want to improve: follow these steps : create a ...
0 votes
0 answers
58 views

Why is the buffer being overwritten with the commands I use in normal mode?

I am using Alacritty terminal on MacOS and when I am type commands in Normal mode sometimes it writes them over the text. For example, when moving with l, it prints the l in an empty space it finds in ...
2 votes
1 answer
1k views

Remapping Ctrl+backspace in insert mode to delete one word back

I want to bind Control+Backspace in insert mode to delete a word. I'm able to bind Control+Del in both insert and normal modes, but I can only seem to bind Control+Del in normal mode. I've checked ...
1 vote
1 answer
218 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 ...
0 votes
0 answers
65 views

How do I allow higher function keys (F13-F24) in Vim?

My vim sessions use term=win32 and my F13-24 keys do not work, but they are permitted I believe from checking :help t_ku. I've gained shallow insight on how to connect vim keycodes to term keys via &...
1 vote
1 answer
194 views

Get terminal bell from inside Vim terminal

My terminal can and does sound a bell for different actions such as hitting tab or running >printf '\7'. My Vim is configured to sound a bell for error scenarios such as the command ggk. However, ...
0 votes
0 answers
25 views

Termdebug won't show messages back from openocd

I am working with a microcontroller (stm32f4) and I am attempting to debug it by connecting Termdebug to openocd. Everything works nicely with the exception that the messages sent back from openocd (...
2 votes
1 answer
77 views

What are the differences between built-in terminals in Neovim and Vim?

AFAIK the main difference is that Vim has this :terminal feature as optional. Could you mention another other important differences?
6 votes
1 answer
474 views

How do I make vim's terminal use my emulator's cursor shape?

I am using ibeam a.k.a vertical bar cursor right now. When I switch to terminal mode in vim, it changes the cursor shape to block - but doesn't restore it after I quit the terminal. I tried changing ...
1 vote
1 answer
52 views

Can I map Alt+j without mapping Escape followed by j to the same thing?

If in insert mode I do Ctrl+v and then press Alt+j, I see ^[j inserted, with ^[ being actually a single character. That's the same I get if I press Escape followed by j instead of Alt+j. I've known ...
1 vote
1 answer
64 views

Run "+normal <leader>?" when starting vim on the command line

Context vimrc: maps <leader> to , maps ',?' to an action From a terminal, vim '+normal ,?' runs the action just fine. Problem Run the same terminal command without hardcoding the character ...
1 vote
1 answer
56 views

How to start Neovim terminal in full window?

I know the equivalent command in Vim is: :terminal ++curwin How do I do the same thing in Neovim?
0 votes
3 answers
79 views

How can I run this command (clang++ *.cpp -o main && ./main) in :term on Vim?

In Neovim, my code compiles and runs fine with this command: :term clang++ main.cpp -o main && ./main , but not in Vim. When I run it in Vim the code neither compiles nor executes. I get the ...
9 votes
1 answer
3k 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 '\e[...
6 votes
3 answers
698 views

Properly restore terminal title after suspending Vim

I'm using Vim 7.3 on OS X Terminal version 2.6.1 (OS X version 10.11.2). If it's relevant, my version is compiled without X11. When I open a file in Vim, the terminal title bar changes to show the ...
0 votes
1 answer
775 views

In nvim, can I map Tab without removing <C-i> as `jump forward`?

I've been mapping all my telescope commands to tab-<key>, which is quite convenient. However I've noticed that its broken the default shortcut for navigating forwards through the jump list, ...
0 votes
1 answer
114 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 ...
0 votes
1 answer
899 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 vote
0 answers
50 views

How can I handle whitespace of the path with nvim_buf_get_name?

I am using Neovim and I use this code to get the full path of the current file. local currnetPath=vim.api.nvim_buf_get_name(0) I want to use this variable for opening the current HTML file, so I need ...
0 votes
0 answers
132 views

How to automatically close a terminal popup window if a python script run in it didn't return any error?

I am wondering if there is a way to automatically close a popup window running a terminal if the execution of the last program didn't report any error and to keep it open if the execution of the last ...
1 vote
2 answers
123 views

How can I disable the terminal statusline in gVim?

I want to disable the terminal statusline in gVim as it seems quite useless and I usually have the windows at a relatively small size when using gVim, so it takes up too much space. I've tried quite a ...
0 votes
0 answers
58 views

How to set TMUX window using set title option?

In neovim source code title option is set as follows at https://github.com/neovim/neovim/blob/73c7a0d58e6358d35fe2d5a11b3e807a625a0001/src/nvim/tui/tui.c#L1460 : void tui_set_title(TUIData *tui, ...
1 vote
1 answer
180 views

Making a shortcut for compiling in C

I've changed my code a million times and can't get it right. I want to compile the file I have open with whatever its name is minus the .c that comes after and I want to do it on a second terminal to ...
55 votes
4 answers
24k views

Can Vim interpret terminal color escape codes?

Many CLI programs output nicely-highlighted text. While most of them check if the output is going to a file, some include the terminal escape codes. I like the output with the escape codes, but ...
2 votes
2 answers
228 views

See Last Commands Output from the Terminal Buffer

Lets say I run the external very_long_taking_command like this: :!very_long_taking_command and I get the output in this Vim Terminal where it says "Press ENTER or type command to continue". ...
44 votes
3 answers
15k views

Can I use a non-monospaced font in either Vim or gVim?

Is there any way to use a non-monospace font in either vim or gvim? I tried changing the font for gVim with: :set guifont=Dejavu\ Serif\ 12 But this gives me some rather ugly results: I get the ...
0 votes
1 answer
26 views

rightbelow not exhibiting the correct behavior

I am not seeing the correct behavior when I use the rightbelow command. If I run :vertical term then a terminal opens in a vertical split (terminal on the left, existing pane on the right), but the ...
12 votes
4 answers
12k views

How to run internal Vim terminal at current file's dir?

When I edit file: /home/me/projects/myproj/src/util.c I would like to start terminal at: /home/me/projects/myproj/src. With Vim version > 8 I can run :terminal but it always starts at folder in ...
0 votes
0 answers
70 views

How to change the terminal that launches Neovim?

When I double click a text file, the file is opened with Neovim in an xfce4-terminal. How to change xfce4-terminal to kitty? I tried to uninstall xfce4-terminal and then ln -s /usr/bin/kitty /usr/...
0 votes
0 answers
35 views

Query terminal colors via OSC11

Is it possible to query the terminal colors via OSC-11 used in highlight groups? Similar to what is done here https://github.com/neovim/neovim/blob/5d8ab32f3871b0232972cac1116ac7cba98389e5/src/nvim/...
0 votes
1 answer
611 views

Unable to map C-/ in visual mode with Neovim and kitty

I am unable to map <C-/> in Neovim. In particular, it does not work for visual mode. I have created the mappings below: vim.keymap.set('i', '<C-/>', '<Esc>:Commentary<CR>') ...
6 votes
1 answer
2k views

Why does `set t_ve=' hide cursor in terminal

Vim's documentation lists t_vi as "cursor invisible" and t_ve as "cursor visible", but provides no hints on usage. Naively, I would have guessed that Vim would send the t_vi sequence when you somehow ...

1
2 3 4 5
10