Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [escape]

The tag has no usage guidance.

0
votes
1answer
20 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
89 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
102 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
33 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 characters, say ...
0
votes
3answers
227 views

Slow vim escape from edit mode

When I press <Esc> from edit mode is it quite slow 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>, ...
3
votes
1answer
468 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
78 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: :%...
0
votes
2answers
42 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). ...
1
vote
1answer
93 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 \ |...
0
votes
1answer
124 views

How to escape @ in search replacement

I usually have to worry about escaping search parameters to get special characters to match literally, but this time I'm seeing a problem with my replacement string. I want to take text like this: @@...
3
votes
1answer
1k 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
382 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 ...
0
votes
1answer
217 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 ...
3
votes
1answer
196 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
152 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 ...
4
votes
1answer
146 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. " ...
3
votes
0answers
95 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 ...
5
votes
3answers
328 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
60 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 ...
5
votes
1answer
786 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 ...
3
votes
0answers
96 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, ...
5
votes
2answers
2k 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 ...
13
votes
4answers
720 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 ...
2
votes
4answers
447 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? ...
60
votes
10answers
39k 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, ...