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
33
votes
5answers
21k 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 ...
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" <...
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 ...
4
votes
1answer
929 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&...
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 ...
29
votes
2answers
5k 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 ...
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 ...
1
vote
2answers
2k views

How to use WSL's bash shell as default terminal of gvim/windows 10?

gvim 8 1-26 / windows 10 I'd like to use Windows Subsystem Linux (WSL)'s bash shell as a gvim's terminal instead of cmd. So if I type in command potion of gvim: :!.\test.sh, it will echo result ...
3
votes
1answer
507 views

How to read the exact command executed by the shell when sent from vim?

Sometimes, when I send a shell command from vim, I receive an error. For example, when I type the following command :!chmod +x shellescape("%"), zsh complains with : zsh:1: unknown sort specifier ...
29
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 ...
9
votes
1answer
581 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. ...
13
votes
2answers
935 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.
4
votes
1answer
321 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 ...
2
votes
1answer
74 views

How to know which highlighting group is used for the background of a word?

Vim highlights the background of certain words (e.g. when doing spellchecking) in a way that I would like to change (because the background and the word itself are almost of the same color, which ...
2
votes
2answers
646 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? ...
1
vote
1answer
1k views

solarized in xterm256(terminal.app) has wrong background

I using solarized in both terminal.app and vim, but in vim the background, airline and other things are not the color scheme's appearance which is different with MacVim. So how to deal with it? I ...
1
vote
1answer
974 views

How can Vim be configured to restore normal terminal color on exit?

I have set Vim's default colorscheme to Monokai, and when I exit Vim the Monokai colors are still on the screen until I clear it. How can Vim be set to run clear automatically on exit, or change the ...