You can set 'termwinkey' to a sequence other than <C-W> to use a different keystroke to access the special sequences on the terminal.
See also :help terminal-typing.
There is a Lexplore command to toggle a netrw window on the left hand side. However there is a bug that executing it multiple times will generate a lot of empty buffers.
For now I think stimulate's anwser is quite good. I created my single-function version based on that answer (I am not a vim expertise so not sure if this is better):
nnoremap <Tab> :...
I looked at the docs. You need to set:
My previous installation was vim-gtk. I suppose this package has this value set as default.
Now both backspace and delete work as before.
You actually want syntax enable (for good reasons which I’ll leave to the :help to explain).
I created this custom command to toggle syntax; you could adjust the mapping similarly:
\ if exists("g:syntax_on") |
\ syntax off |
\ else |
\ syntax enable |
This leaves you with
nnoremap <expr> &...
TLDR: Make sure that g:submode_keyseqs_to_leave does not include the <esc> key.
Either reset it to an empty list:
let g:submode_keyseqs_to_leave = 
Or double the <esc> key:
let g:submode_keyseqs_to_leave = ['<esc><esc>']
In the latter case, you'll ...
You can use 2<c-w>0 to resize current window to fit buffer, with 2 extra lines.
It's fully commented, read comment as explanation.
" Resize window to fit buffer + <count>. It works the same as <c-w>_ if there
" are too many lines to fit.
command -count WinFitBuf call s:win_fit_buf(<count>)
nnoremap <expr> <...
According to coc readme you can trigger completion manually with:
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
NOTE that not every terminal supports <c-space>...
I don't know for sure how to map cmd in vim... Probably D or something:
" Use <CMD-x> to trigger completion.
The documentation explicitly recommends using the maximum number of digits. See :help i_CTRL-V_digit:
Normally you would type the maximum number of characters. Thus to enter a
space (value 32) you would type <C-V>032. You can omit the leading zero, in which case the character typed after the number must be a non-digit. This
happens for the ...
This is documented under :help map-error:
Note that when an error is encountered (that causes an error message or beep)
the rest of the mapping is not executed. This is Vi-compatible.
Regarding this part of your question:
2) In the case of the above answer, the error is invisible: if i press up in the first line in vim, theres no notification of an ...
To change the behavior of <Del> so that it only deletes the character under the cursor and doesn't behave like backspace when at the end of the line, you can use the following mapping:
cnoremap <expr> <Del> getcmdpos() <= strlen(getcmdline()) ? "\<Del>" : ""
See @D.BenKnoble's answer for a solution to deleting until the end of ...
You can use the following function:
let l:cmd = getcmdline()
let l:pos = getcmdpos()
let l:newcmd = strpart(l:cmd, 0, l:pos - 1)
To use it on the command line, you need to do (I choose <C-x> arbitrarily since it wasn't used for anything else, and reminds me of X in normal mode):
With a recent enough Vim binary, and for some terminals – including xterm – Vim can distinguish C-i from Tab.
You need at least the Vim patch 8.1.2134.
And you may need to add these lines in your vimrc:
let &t_TI = "\<Esc>[>4;2m"
let &t_TE = "\<Esc>[>4;m"
Unless your Vim binary also includes the patch 8.1.2194, in which case it ...
Short answer: you cannot.
Long answer: <C-i> being equivalent to <Tab> isn't a vim quirk or builtin. It's a quirk of how terminals represent characters (cf. https://bestasciitable.com).
You simply cannot avoid this fact. Now, it may be possible to force your mapping to take precedence over the tab-behavior of inserting tabs/spaces, but I haven'...
As mentioned in the comments, you need to make sure cpoptions does not contain the k and < flags before defining your mappings (this explains why netrw broke too).
The likely culprit is that vim was running in compatible mode (this should not be the case if you have a .vimrc file, but it's possible to do some funky things with the invocation to end up in ...
You can use <Left> to move the cursor to inside the single quotes after you do the expansion. For example:
inoremap jj print('')<Left><Left>
The main problem with using an insert-mode mapping here is that typing a single j in insert mode is weird and blocks waiting for another character... Also, typing jj in any context, including inside ...
Hmm. This is interesting. Here's what get saved as the command (:com Test0):
nnoremap <NL> :echom "c-j"<CR>
(<C-J> is equivalent to <NL> in Vim)
So what do we know about the <> format? That it can be used in mappings and abbreviations as a substitute for the represented keys/chars. That it can be used in exe command arguments ...
I wrote something similar recently, I changed it again to make <c-a> and <c-x> work on any step.
You may get the command here and the function here.
It support 123.24 or 123. or 123 or .123 style number, count is also supported now:
# change slide step to 0.000001,
# change slide step to 0.1, save after slide. I use this to
There are several issues. First of all what happens when you make a visual selection and then go to the command line with :? You see how it's pre-populated with '<,'>. You should drop that from the first substitution in your mapping as it's redundant. (Or you can leave it in and make the first part of your mapping <C-U> as in Ctrl-U. That will ...
If your terminal has support, you can simply press End.
Otherwise, use CtrlO to get into normal mode for a single command only. So Ctrl-O and then $ (or A) will do the trick.
In principle, you can remap Ctrl-E to do Ctrl-O $ (like inoremap <c-e> <c-o>$), but :h i_ctrl-e is sometimes useful in Vim on its own.
The best I could come up with for now. It does not respect the current tab page yet, but maybe this could be achieved with using some kind of map data structure
nnoremap <Tab> :call OpenNetRW()<CR>
nnoremap <Tab> :call CloseNetRW()<CR>
This is a normal behaviour of gui flavours of vim like gvim. <m-i>, <a-i> and é are the same thing.
Usually people aren't bothered by meta+key inserting an accentuated character, but the other way around. See the very old issue with French people needing to insert é in LaTeX document which in turn triggers \item insertion (IIRC) with vim-latex.
I suspect, but cannot confirm because information is missing, that the line is "bare" in the OP's vimrc.
This means it would execute, no matter what, for the first buffer vim opens. Because of <buffer>, that mapping is only available in that buffer!
Instead, you should put the mapping in ~/.vim/after/ftplugin/python.vim as follows:
I have this since 2002 it seems
It also handles <end> key
inoremap <silent> <Home> <c-o>@=<SID>HomeLikeVCpp()<cr>
nnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr>
vnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr>
inoremap <silent> <End> <c-\><c-n>...
This is what I came up with. It is not as short as other options, but seems to
do the job:
let n_ind = indent(line('.'))
let n_col = col('.') - 1
if n_col > n_ind
nmap <Home> :call F_home()<CR>
imap <Home> <C-R>=F_home()<CR>
Yes, it is possible to create a mapping for that.
For example, a mapping that will go to the indent if you're elsewhere in the line, but go to the first character if you're on the indent:
noremap <expr> <Home> col('.') == match(getline('.'), '\S') + 1 ? "\<Home>" : "^"
inoremap <expr> <Home> col('.') == match(getline('.'), '\...
Maybe there is some kind of remapping plugin for either chrome or firefox that addresses this?
Regarding Citrix, Citrix Lite and the browser, you'll have more luck asking about it on Superuser, so I suggest you post a question there for a solution from that front.
Is there any other strategy that vi users adopt?
You should be able to use Vim mappings to ...
I'm not familiar with mintty, but a quick google search returned the following:
1. mintty tips:
Unexpected behaviour with certain applications (e.g. vim)
If for example the PgUp and PgDn keys do not work in your editor, the
reason may be that in the mintty Options, the Terminal Type was set to
"vt100" and based on the resulting setting of the ...
I feel like this is all overly complicated, you can realize this with just a few lines of regex:
This expression will allow you to add a closing tag after the cursor:
- < matches the start of the opening tag
- \w\+ matches the tag content, we include it in braces so that we can use it in the replacement
- > ...
So the issue is that the mapping for <Esc> is interfering with other mappings. Since most special keys generate sequences that start with an ESC character (which typically shows up as ^[), the mapping is causing Vim to take that initial ESC from the first mapping, which is ignoring the <Esc>, then keeping the rest of the characters (OA) as a ...