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
34
votes
5answers
22k views

How to map Alt key?

I'm trying to map Alt key in the following way: :map <A-j> j :map <A-k> k but it doesn't work (bell is rang on Alt + j/Alt + k). What I'm missing? I'm using Terminal on OSX, the same ...
32
votes
3answers
10k 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 ...
30
votes
4answers
2k views

Terminal borked after invoking Vim with xargs

I've sometimes tried invoking Vim using xargs, like this: find . -name '*.java' | xargs vim … which kind of works: As Vim launches, I see the following warning flash briefly: Vim: Warning: Input ...
29
votes
2answers
6k 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 ...
20
votes
3answers
9k views

Can the split separator in vim be less than a full column wide?

I use a tiling window manager (awesome) + a terminal multiplexer (tmux) + splits inside of vim. I have no window decorations at all, so you there is no visual split between them at all if the content ...
18
votes
2answers
6k views

Scroll the screen, not the cursor, when using scrollwheel

I'm using Vim in a terminal, so scrolling with the scroll wheel uses the \e[A and \e[B syntax (where \e symbolizes \x1b, or escape). However, Vim interprets this by moving the cursor up or down a ...
15
votes
2answers
2k views

Tmux is changing part of the background in vim

This only seems to happens when using vim inside of tmux. I'm also using iTerm 2. If I create a new tmux pane or resize a tmux pane, it immediately looks like the this: And then the only way to fix ...
14
votes
3answers
1k views

How to label tmux tabs with the name of the file edited in vim?

Whenever I open a tmux session in terminal, all of the tabs containing vim sessions are labelled vim. My question is: How to configure it to label tmux tabs with the name of the edited file or ...
13
votes
9answers
22k views

Colorscheme's background not correct in terminal

I imported the solarized colorscheme and palette. My terminal has the correct colors and background, gvim has the correct colors and background, but vim has an incorrectly colored background. The text ...
13
votes
2answers
949 views

Detect neovim terminal from bash in bashrc

Does neovim set any environment variables that would let me detect from bash that the terminal is neovim? I want to change the behavior of my .bashrc if neovim is the terminal.
12
votes
0answers
183 views

Using <C-,> causes “<80>ü^D,” to flash in the showcmd area?

I've mapped <C-,> as well as some other special keys (<C-Enter>, <C-S-Space>, ...) in my vimrc like, :set <F13>=^[[44;5u :map <F13> <C-,> :map! <F13> <C-...
11
votes
2answers
3k views

Prevent Vim from clearing the terminal after exit

If I do: $ less file And press q to exit less, I stil see the same text as I had on the screen when less was still running. However, if I do $ vim file And :q, my terminal is blanked... ...
11
votes
1answer
325 views

What is causing my cursor to look so strange? [closed]

Whenever I hit the end or beginning of a line, I get this very odd character where my cursor was. Any idea what may be causing this? I believe I have my fonts and theme correctly installed. I'm using ...
10
votes
4answers
4k views

Use case for neovim terminal emulator?

One big difference of neovim and Vim is that neovim includes a terminal emulator that works asynchronously. However, I fail to see how can I profit from this feature. For what can I use it? Can you ...
10
votes
1answer
3k views

Number pad not working with vi and Putty?

When I am editing a file in vim via SSH, I will try to use the number pad on my keyboard to enter long numbers (like IP addresses). Vim does not seem to like that very much. I am using PuTTY for ...
10
votes
2answers
292 views

Scrolling issues when the `wrap` option is set

I find myself dealing with this issue every time the wrap option is active (in my particular case whenever I'm working with markdown files). What happens is that, while scrolling up and down the ...
9
votes
1answer
601 views

Change the cursor shape in operator pending mode

My cursor in Gvim: My cursor in Gvim after pressing d: Is there any way I can change the cursor in terminal Vim when in operator pending mode? It doesn't have to look exactly like the screenshots. ...
8
votes
2answers
3k views

Mapping Ctrl+s does not work

I am trying to map Ctrl+s to save my file however it does not work. My mappings: map <C-s> :w <CR> :echo "Saved" <CR> imap <C-s> <Esc> :w <CR> :echo "Saved" <...
7
votes
3answers
426 views

How to specify the content of a new buffer from command line?

Is there a way to call Vim in such a way that it opens a buffer with some content specified on the terminal, i.e. not saved in a file? For example, I would like to run vim and have it open a buffer ...
7
votes
1answer
441 views

Is it possible for Vim to output ANSI colors from the terminal, without a colorscheme?

Many terminal emulators allow you to define colors: Rather than trying to approximate (and duplicate!) the same theme in a Vim colorscheme, is there a way to tell terminal Vim to output ANSI escape ...
7
votes
1answer
998 views

I can't move around the document while editing

I am working on a ChromeOS computer with both Vi and Vim. When I open up the editor to an existing document, I type A to begin editing. When I try to move around with my arrow keys, the following ...
7
votes
2answers
216 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 ...
6
votes
1answer
264 views

How to prevent accidentally piping text to Vim?

I use Vim to edit the output of shell commands all the time. Appending the dash in this line is second nature: $ ./some-command | vim - But every once in a while I get distracted and forget: $ ./...
6
votes
1answer
676 views

Clipboard sharing broke under MacOS X

I'm using (roughly) the same config for my mac and my ubuntu machine. I use set clipboard=unnamed,unnamedplus To conveniently share vim's clipboard with the system clipboard. However, lately the ...
6
votes
0answers
488 views

Patched font for devicons doesn't show up in terminal [closed]

I would like to install the Vim plugin "vim-devicons". But I am unable to install the patched font "Hack". I copied the following file into ~/.local/shared/fonts. The installation of the font seems ...
5
votes
1answer
3k views

Change cursor shape in different terminals

At home I use iTerm2 on MacOS X, and at work, I have a laptop with CygWin. I have another PC where I use gnome-terminal or terminator, and sometimes I use tmux. I'm looking to configure the cursor ...
5
votes
1answer
762 views

:silent makes my vim go blank

When I used :silent to run a terminal command in the background, my vim screen goes blank, until I navigate through my code, at which point each line I move to reappears. What gives?
5
votes
1answer
592 views

Scrollback in Vim 8 Terminal

Been really loving the asynchronous terminal in Vim 8. Sometimes I have a large amount of output in the terminal, and when I enter normal mode in the terminal and use gg to go to the top, I see that ...
5
votes
1answer
2k views

What's the difference between the “clipboard” and “xterm_clipboard” features?

What is the difference between the clipboard and xterm_clipboard features? When do I need to enable one or the other at compilation time? As an aside, how do these features relate to the mouse ...
5
votes
1answer
293 views

Why can't I set <Home> or t_kh in my vimrc file?

I'm having some problems remapping my home key; it works when I run Vim from tmux but not when I run it from a regular xterm without tmux. It looks like they're sending different escape codes and Vim ...
5
votes
2answers
927 views

Edit Neovim terminal commandline within the same Neovim instance

In bash one can edit the current commandline in $EDITOR by pressing <c-x><c-e>. I am running bash inside a terminal buffer within Neovim. I would like to be able to press <c-x><c-...
5
votes
0answers
246 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 ...
4
votes
2answers
553 views

How do PuTTY/KiTTY ANSI colors affect Vim colorschemes?

I'm having a hard time understanding how the ANSI colors affect the named colors in Vim. My KiTTY terminal has "regular" and "bold" versions for the main 8 colors, plus foreground/background colors. ...
4
votes
2answers
3k views

I can't get 256 colours to work with Vim in iTerm2 on MacOS X

I am having a rough time getting the colors right with my vim setup and the color scheme I want to use. Using: OSX 10.10.2 Vim 7.4 iTerm2 (Set to report terminal type as "xterm-256color") gruvbox ...
4
votes
1answer
961 views

Mapping control-H in insert mode doesn't work; it always works like backspace

I tried mapping control-H, J, K, and L respectively in insert mode to move around splits. inoremap <C-h> <ESC><C-W><C-h>i inoremap <C-l> <ESC><C-W><C-l&...
4
votes
1answer
57 views

Pressing Shift-Backspace in insert mode types '^?' instead of backspacing

When I mess up typing an uppercase letter, I usually hold Shift while pressing the Backspace. Instead of backspacing, it types ^? (to my frustration). Google tells me that ^? is the "delete" ...
4
votes
1answer
328 views

Understanding :help set-termcap

I would like to define some mappings involving key combinations like <S-F1> or <A-d>. For example something like this: nnoremap <A-d> :echo "hello world!"<cr> However, on my ...
4
votes
1answer
545 views

Clear New Vim Terminal window

Vim's new :term feature is pretty neat, but when I run something like a rails server, I want to be able to clear logging output every now and then. The usual methods in a non-vim term window don't ...
3
votes
5answers
3k views

How to restore bash terminal title if using 'set title' in vim?

I recently got to know that useful info can be shown in title of bash terminal when editing files using vim. Adding below displays file name, path of the file being edited. set title But on exiting ...
3
votes
2answers
2k views

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

I edit file /home/me/projects/myproj/src/util.c And want to start terminal at /home/me/projects/myproj/src. Vim version > 8 so I can run :terminal but it always starts at folder in which I've opened ...
3
votes
1answer
1k views

Up arrow key code, why '^[[A' becomes '^[OA'?

If I run cat under terminal (xterm-256color), and then press the up arrow button, I see ^[[A as output. But if I press <ctrl-v> <up> in vim insert mode, I see ^[OA as output. So i wonder ...
3
votes
1answer
331 views

Remapping Alt key in terminal: problem with macros

I'm using xfce4-terminal. I remapped most Alt+key combinations in a file that is loaded in the .virmc. The file (called alt_bindings.vim, only loaded in vim 8 terminal mode) is like this: set <M-...
3
votes
2answers
1k views

Neovim Gray Background

Problem Anytime I switch to a colorscheme the background turns this ugly gray that gives everything a washed out look. Why does this happen, and how can I prevent it? Example screenshot— More ...
3
votes
1answer
1k views

Is it possible to change the statusline color in Vim 8 terminal windows?

I would like to change the default green terminal statusline below to my usual colorscheme statusline color: Is this possible? There is no mention of it in :h terminal.
3
votes
2answers
715 views

VIM: how to send entire line to a buffer of type “Terminal”?

In Vim 8, you can open a terminal inside Vim with the term command. This opens a new buffer of type terminal inside vim. Is there any way of sending lines from other buffers to this type of buffer? ...
3
votes
2answers
836 views

When using bash or another shell from a buffer, how do I modify text?

Inside vim, I often use conque plugin, so I can run a bash shell inside a vim buffer. I also may try out VimShell soon. In conque, lets say I start typing some bash command, and before I enter it, I ...
3
votes
1answer
302 views

Get back regular vim colors

I just installed Linux Mint 18.3 and to my surprise colors in vim changed! Vim in the terminal on the left has the color scheme I've always seen and got used to. Vim in the terminal on the right has ...
3
votes
1answer
2k views

Why doesn't my numpad work right in my terminal?

In several terminal programs, such as PuTTY, SecureCRT, iTerm, and Mac OS Terminal, if I have NumLock on and I press the number pad (numpad) keys 0123456789 in insert mode, my vim looks like this: y ...
3
votes
1answer
240 views

Mapping vim key to change to next tab in Konsole

Description: In my Konsole the key mappings for changing tabs to left and right are Shift-left and Shift-right (where left/right are the arrow keys). What I'm trying to do is to map F2 in vim to ...
3
votes
1answer
532 views

How does vim map keystrokes to hex values?

This question might be a little bit out of the ordinary for this site, but I want to better understand how vim works under the hood. I know that if I enter the hex value 0x01 vim will display it as ^A....