Questions tagged [escape]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
50 views

How to escape a pipe (|) in my vimrc

I've seen How to escape pipe character in `:make`, `:grep` and friends How to escape pipe (|) in mapped substitution? https://stackoverflow.com/questions/29596150/use-to-diplay-tabs-in-vim But none ...
1
vote
1answer
68 views

Replace two forward slashes with one using escape? [duplicate]

I am new to VI. How do you replace two forward slashes with one globally? I did: :%s/\// and :%/\//\/g Those don't work as desired. Example or Goal //This is good//because it//works; //on every//...
1
vote
1answer
47 views

Escaping ' (apostrophe) in \\' (leader leader apostrophe) in a @let statement inside .vimrc

I have mapping \\' (leader leader apostrophe) within my .vimrc. The mapping works just fine. I have recorded a macro to key e using this mapping. qe ... steps ... q The macro works just fine. then I ...
8
votes
3answers
1k views

See what Vim `:!` executes

Between :%! exe "!..." exe "!bash -c" shellescape(...) I'm getting quite confused as to what exactly Vim invokes. And I suspect at some point it invokes bash -c bash .... Is ...
0
votes
1answer
72 views

Mapping jj to Escape doesn‘t work over SSH connection

When I connect to a remote server via iterm2 and SSH and use vim on this server remapping to the Escape key doesn't work. Other key mappings in the .vimrc work as expected but inoremap jj <Esc> ...
0
votes
0answers
24 views

Attaching audio spoken word "escape" to Esc key stops escape key escaping to normal mode in nvim. How to fix?

I am running the latest versions of: Arch, nvim, and the Openbox window manager. I often don't know whether I have actually hit the escape key or not, when exiting another mode to normal mode. If I ...
0
votes
1answer
50 views

escape sequences showing up within vi

When I am working in vi there pop up things that look like uninterpreted escape sequences. They come for example when I type i to enter insert mode, or ESC to leave it Example, triggered by typing i ...
0
votes
2answers
114 views

Adding <Esc> to a remap literally inserts <Esc> into the file

I'm remapping o and O in my Git Bash vimrc to insert a new line without staying in insert mode: nnoremap o o<Esc> nnoremap O O<Esc> The problem is that a new line is inserted and the ...
2
votes
1answer
196 views

Replace embeded escape code in text

I am using the most recent nvim in arch. I have this text showing in my text doc customerâ<80><99>s the <80><99> appears in blue. The text should read customer's I wish to ...
0
votes
1answer
87 views

Escape for double quotes not working

I'm trying to search for quotation mark, but it seems it doesn't work: \v^\s"\zs\"+ is what i tried. Though I'm well aware it need to be escaped...I tried: \v^\s""\zs\""+...
9
votes
1answer
167 views

Why does `<Bar>` behave like `|` in the `:command` command in Vim?

Here is the list of experiments I performed that shows that <Bar> is treated as literal <Bar> in some commands but it is treated as | in the :command command. I am trying to understand why ...
4
votes
0answers
134 views

How to exit insert mode if pressing escape merely types "^["?

I have neovim 0.4.2 running in a session of kiTTY 0.17.4 on OSX. I have pasted a long url while in insert mode. After doing this, every time I type BKSPC vim adds ^? to my document. Every time I type ...
4
votes
1answer
325 views

How to remove the mapping from Ctrl-[ to Escape? [duplicate]

If you have an American English keyboard, pressing Ctrl-[ (control plus left square bracket) is equivalent to pressing Esc. This provides an easy way to exit from insert mode. source: https://vim....
1
vote
2answers
344 views

Problem remapping § to esc in vim on a macbook with touch-bar

I am using a macbook with touchbar. As many others I would like to map a different key to the esc key, since the touchbar esc is a bit inconvenient. My problem is that I have some weird behaviour of ...
2
votes
1answer
125 views

escape, ctrl-w through citrix lite in browser

I need to be able to run vi on a machine that I access through Citrix lite in the browser. However I've come across a number of problems because of conflicts around esc and ctrl+w. Specifically, ...
1
vote
1answer
1k views

Search for Pattern "^M*"

My file contains multiple blocks looking like this some Test "^M ^M ^M "some more text I'd like to remove these passages (including the "), but can't seem to fine the right regex. EDIT: I already ...
0
votes
1answer
699 views

How can one use jk to escape universally without causing hang?

Recently I was reading http://learnvimscriptthehardway.stevelosh.com, and he said a very fast way to improve your speed in vim is to do inoremap jk <esc>. Sure, that made sense. Then when I ...
1
vote
1answer
66 views

How to remap escape in *vi* (not vim)?

I've used the information in this answer previously, but recently encountered a minimal installation with only vi. I edited the .vimrc in the user's home folder (~/.vimrc), but when typing jj, the ...
3
votes
1answer
92 views

Is ESC involved in any key combinations?

Just starting to get into Vim and facing the classic escape problem. I'm thinking binding CapsLock to be control when used with another key, and escape when released without pressing anything else ...
1
vote
0answers
134 views

Pressing <Alt-3> (left alt key) suddenly maps to Esc (and not the character "#") using iTerm2 [closed]

Characteristics: MacOS 10.14.6 I'm using VIM as text editor for a few weeks, with both Terminal and iTerm2 I could write character dependent on hitting key alt (left alt key in iTerm) without ...
3
votes
1answer
67 views

Match <Esc> only for the ESC key, not escape sequences

In a normal mode key mapping I'd like to match the ESC and only this key, not key sequences like caused by the arrow keys. Background: I thought I'd torture myself in the process of avoiding excess ...
2
votes
1answer
916 views

How to escape forward slashes?

I was editing a file and found accidentally that I somehow escaped all the forward slashes in a path I was replacing in text. And that is something very useful! For instance, to do this replacement ...
2
votes
1answer
171 views

How to assign a Python list to a vim variable and escape its strings correctly

Here is a Python list that I'm trying to assign to some Vim variable. lines = ['"""Something foo\'s thing."""', '', 'foo = "asdfasdf" \\', 'bar'] command = 'let l:corrected_lines = {lines}'.format(...
1
vote
3answers
244 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
0answers
132 views

How to stop a function when <esc> is pressed? OR how to catch a <esc> signal in vimscript?

I have a function which calls another function that reads user input from input(). function! fun1() call fun2() endfunction function! fun2() let temp = input("Please input:") endfunction What I ...
1
vote
1answer
204 views

Can you match unicode blocks by name in vim?

\p{Cyrillic} Works in my normal regular expressions. When trying to match in Vim or gvim however, I can not seem to get it to work. I tried something like this: \p\{Cyrillic} Is it not supported, ...
1
vote
1answer
227 views

fnameescape() : add other characters to be escaped (parenthesis, commas etc)

I looked around for a long time but did not find any solution for that. On my Unix system (Ubuntu), using LaTeX-suite, I need to escape some characters in file names for compilation, say parenthesis (,...
3
votes
1answer
570 views

Some function keys switch cases of letters under and after the cursor

Foreword I use UltiSnips and have the following definitions in my .vimrc file let g:UltiSnipsExpandTrigger="<F8>" let g:UltiSnipsJumpForwardTrigger="<F8>" let g:...
2
votes
1answer
119 views

Why does ^C behave differently from ESC when exiting visual block substitution?

I've started using CTRL+C instead of ESC in vim because of its position on the keyboard and better responsiveness. It mostly behaves the same except when exiting visual block replacements. I am ...
1
vote
1answer
40 views

Going to the start of insert command on exit

Hi Vi StackExchange, A Picture of what I want Say I have the following in my buffer: foo("a", "bar") And I am in normal mode with my point on b in bar. Now I want to insert some ...
11
votes
5answers
9k views

Slow vim escape from insert mode

When I press <Esc> from insert mode, it delayed about 1 sec, but if I just do <ctrl+c> instead it is fast. I checked if there were mapping with escape with :verbose imap <Esc>, but ...
7
votes
1answer
4k 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 ...
-1
votes
1answer
105 views

Is \r operating system specific?

In the Vim documentation, it says that \r "matches < CR >", however for the result of replacement I could not find in the documentation a description of what it does. For example, imagine this: :%...
1
vote
2answers
108 views

Avoid so much escaping in substitution expression

I have a substitute expression to find words beginning with a dollar signs and capture them like this: :%s/\$\(.*\)\>//g However there are a lot of escape sequences in the regular expression (4). ...
3
votes
1answer
443 views

endif treated as part of command in autocmd

Here is my code: autocmd BufWritePost *.c,*.cpp,*.h \ let dir=expand('<amatch>:p:h') \ | if filereadable(dir.'/Makefile') || filereadable(dir.'/makefile') \ | Make > /dev/null \ |...
4
votes
1answer
5k views

How to escape pipe character in `:make`, `:grep` and friends

I'm trying to use :grep to search for one of several words. Since grep accepts regular expressions, I figured I could just use the pipe character | to build a single expression for both words: :grep -...
0
votes
1answer
2k views

Exiting back to normal mode in terminal buffer from Vimscript

<C-\><C-n> is working as (I'd) exepected, but not from a Vimscript. I am trying to make a script that will: open Neovim's :terminal run a python script exit from the terminal input mode ...
1
vote
1answer
758 views

delay between hitting `ESC` (in insert mode) and switching to normal mode within `screen`

If I open (vanilla) vim by running $ vim [-u NONE], switch to insert mode by pressing a, add an 'a' by pressing a again, switch back to normal mode by pressing ESC, and repeat steps 2 and 4 several ...
4
votes
1answer
899 views

recover default behavior of arrow keys rather than having them produce ABCD, when I map <esc>

My question is related to this post which for some reason was closed. Here's my .vimrc file set cpoptions=BceFs$ ":compatibility flags with /usr/ucb/vi set hlsearch hi Search ctermfg=white ...
0
votes
1answer
317 views

Ask a list of all percent-prefixed variables

In reading other's .vimrc, I find many percent signs. For instance in the portion concerning the status line, I know %F%m%r%h must stands for something like the current filename being edited. But ...
3
votes
1answer
265 views

How to escape filename containing single and double quotes mix?

Let's say i create a filename with this: xb@dnxb:/tmp/test$ touch '"i'"'"'m noob.mp4"' xb@dnxb:/tmp/test$ ls -1 "i'm noob.mp4" xb@dnxb:/tmp/test$ Then vim . to go inside Netrw directory listing. " ...
5
votes
1answer
456 views

How do I prevent the delay when mapping jj to <ESC> in insert mode?

I've recently mapped jj to <ESC> in insert mode for quick escaping. While everything is functional, I find the brief delay after typing j while it waits for a second input very distracting. Is ...
6
votes
3answers
405 views

Is it possible to open a new file that starts with '+'?

I cannot figure out how to open a file that starts with +, e.g. +models/File.m. This is a naming convention for packages in Matlab. I've tried escaping \+models/File.m. This doesn't work because the ...
4
votes
1answer
71 views

Two character remap sometimes failing in INSERT mode

For 4-5 years I've had the following in my .vimrc file: inoremap jj <Esc> which I understand is pretty conventional, and I've never had problems until recently. Every so often, typically when ...
7
votes
1answer
1k views

How to escape angle brackets in mappings (the ones that appear in <esc> and <cr>)

I am making a complex mapping that requires me to insert angle brackets (<and >) but I do not know how to escape them so vim does not interpret them as special key-codes. It seems like escaping ...
4
votes
0answers
420 views

How to remap <C-[> on linux [duplicate]

I have the same vimrc file for both Windows and Ubuntu environments. It works fine on both platforms, except for one difference. The line: nmap <C-[> <C-t> is working fine on Windows, ...
9
votes
4answers
5k views

How can I bind Ctrl-Space to be Esc when not in insert mode, and to switch to insert mode otherwise?

I dislike to have to reach up to the Escape key all the time. For a while I used the program xcape under Linux to map Caps lock to be both Control and Escape. However, I am currently working more and ...
16
votes
5answers
1k views

Why does this <Esc> normal mode mapping affect startup?

I'm experiencing a weird problem with a normal mode mapping of Esc. If you create the file escmapvimrc with the contents: set nocompatible set showcmd " Doesn't affect the problem: just makes it ...
3
votes
4answers
661 views

Can Escape be disabled in insert mode?

I'm trying to retrain my fingers to refrain from using Escape so often. Can I disable Escape when I'm in insert mode, leaving just Control+[ and Control+C as the only ways to return to normal mode? ...
117
votes
16answers
125k views

Other ways to exit Insert mode besides Escape

The primary reason I like vim over emacs is that my hand movement distance away from the home row is very low (even as a programmer). However, the one main time that I do this is leaving insert mode, ...