Questions tagged [escape]
The escape tag has no usage guidance.
59
questions
1
vote
1
answer
77
views
What are the escaping rules of command arguments?
The following does nothing:
:file /tmp/[some file]
or:
:file "/tmp/[some file]"
The following set's the file to /tmp/[some file]:
:file /tmp/\[some file]
What are the rules that :file ...
1
vote
1
answer
35
views
How to replace <Esc> with Ctrl-c completely?
NVIM v0.9.1
Windows10
I usually prefer <C-c> rather than <Esc> or <C-[> which made me think that I want to replace <Esc> with <C-c> perfectly for almost all situations(...
1
vote
1
answer
81
views
Why very magic flag can't take effect on character = in substitute command?
We can see the explaination on very magic :With very magic, all ASCII characters except 0…9, a…z, A…Z and _ become a a special meaning. In this mode, searching for text becomes very magic.
When you ...
1
vote
1
answer
24
views
Why rhs of cnoremap (used as a rhs of another cnoremap) can be <c-s> but not <space>?
If you execute this
cnoremap <expr> <silent> <C-S> execute(':cnoremap <c-s> ctrl-s')
and then hit /Ctrl-sCtrl-sCtrl-sCtrl-s, you'll see the search command be populated by /...
1
vote
2
answers
39
views
lnoremap doesn't seem to apply to insert mode when mapping an unwanted key combo to nop
This is a follow up to this question of mine.
I found out that having :noremap ^[[29^ <Nop> in my vimrc is not enough to disable the unwanted effect of Ctrl+Menu in insert mode, so I looked at :...
2
votes
1
answer
146
views
How can I inhibit the effect of hitting Ctrl+Menu
I'm referring to holding Ctrl and hitting Menu (which is this key), which happens by mistake sometimes.
For me it results in going back to normal mode and moving to the first non-blank character of ...
1
vote
1
answer
284
views
Special characters, escaped special characters, escape sequences, and terminal codes
I refer to those 4 terms using terminology picked up by various sources:
Steve Losh, in his Learn Vimscript the Hard Way's chapter 16 refers to things like <cr> (these 4 characters typed in a ...
0
votes
1
answer
49
views
How to change [esc] behavior only in normal mode?
I'm hoping I phrased the question correctly as I'm not too sure how to ask my question.
When I work in vim I use multiple "splits" (eg. :vsp, :sp). To navigate through the splits I have it ...
1
vote
1
answer
495
views
Command to go to Normal-mode and Visual-mode (or exiting insert-mode) - pressing ESC without the escape-key
I'm working on a server, that I can only SSH into via a browser. In there, I have to edit some files.
The problem is, that let's say I go to INSERT MODE and write some text.
If I then want to go back ...
0
votes
1
answer
123
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
1
answer
441
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
1
answer
231
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
3
answers
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
1
answer
168
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
0
answers
35
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 ...
1
vote
2
answers
604
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
2
answers
134
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
1
answer
1k
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
1
answer
564
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\""+...
10
votes
1
answer
384
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 ...
6
votes
0
answers
634
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
1
answer
1k
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
2
answers
498
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
1
answer
260
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, ...
2
votes
1
answer
3k
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
1
answer
2k
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
1
answer
242
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
1
answer
104
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
0
answers
206
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
1
answer
114
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
1
answer
2k
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
1
answer
269
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
3
answers
335
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
0
answers
177
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
1
answer
324
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
1
answer
480
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
1
answer
726
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
1
answer
123
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
1
answer
45
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 ...
22
votes
5
answers
16k
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 ...
9
votes
1
answer
6k
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
1
answer
106
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
2
answers
172
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
1
answer
513
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
\ |...
5
votes
1
answer
6k
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
1
answer
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
...
2
votes
1
answer
1k
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
1
answer
970
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
1
answer
402
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
1
answer
379
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.
" ...