When you use the += operator, you actually ask vim to append some new values to the statusline variable. When you first open Vim statusline is set to an emtpy value so adding %.35f to it give you the expected behavior.
However when you source your config again, nothing empties the variable so you keep adding duplicate values to it. Thus you probably want to ...
There is no built-in way to do this in vimscript that I'm aware of. You could put it in a function:
if &formatoptions =~# a:option
exec "set formatoptions-=".a:option
exec "set formatoptions+=".a:option
nnoremap <leader>A :<C-u>call ToggleOption('a')<cr>
But if you ...
Due to the way that the keyboard input is handled internally, this unfortunately isn't generally possible today, even in GVIM. Some key combinations, like Ctrl + non-alphabetic cannot be mapped, and Ctrl + letter vs. Ctrl + Shift + letter cannot be distinguished. (Unless your terminal sends a distinct termcap code for it, which most don't.) In insert or ...
According to one of our former mods, the answer is no:
Sending Control with a character from the 2nd column is useless. Control clears the 7th bit, but this is already 0, so Control+# will just send "#".
Notice that & in the second column has binary representation 01 00110, so clearing the 0 doesn't help.
The basics of simple mappings are explained in Vim's excellent user manual at :help 05.4.
You want some key combination (Shift + Tab) to do what's already provided by Vim's Ctrl + D command, so you map <S-Tab> (using :help key-notation now) to <C-d>. As Vim is a mode-based editor, you need to consider the mode; :help i_CTRL-D is for insert mode.
Use the \< and \> anchors around your pattern, to match word boundaries before and after your words.
:call matchadd("MyGroup1", '\<foo\>')
:call matchadd("MyGroup2", '\<bar\>')
You need single quotes, to prevent Vim from using \ as an escape character.
:help matchadd() for details on how pattern is used and ...
You can come up with something relatively simple, following and tinkering what vim has described in :h :map-operator:
As an example I came up with in about 15 minutes of experimenting:
nmap <silent> gi :set opfunc=InsertToTextObject<CR>g@
vmap <silent> gi :<C-U>call InsertToTextObject(visualmode(), 1)<CR>
nmap <silent> ...
Make a buffer active by its number
You can combine win_gotoid() & win_findbuf() to accomplish this:
:call win_gotoid(get(win_findbuf(g:tn), 0))
But we can do better for terminal like things by improving a few things:
Automatically set our variable on TerminalOpen autocmd
Provide methods to send text to the terminal
Provide a command to jump to the ...
So the top buffer became "a mirror" of the terminal buffer with the number 2.
Your problem is that you confuse "buffer" and "window". Those "rectangles" you see are called "windows", while their contents are called "buffers".
So the command :b 2 says "I want a buffer number two to be shown in the current window". And that's not what you really wanted.
Any command opening a split in Vim is influenced by splitbelow (horizontal) and splitright (vertical) options. So terminal opens on top, because you have set nosplitbelow (this is the default setting).
So you can either change a global setting, or use an additional "modifier" command as needed. These modifiers are aboveleft, belowright, topleft and botright....
This code works:
autocmd BufWritePost *.vim,vimrc,$MYVIMRC ++once source $MYVIMRC | e
does the augroup group/autocmd! dance to set up a group and clear any commands already in it
establishes a one-time (++once) autocmd that
sources the vimrc
uses :edit to re-edit the current file (effectively sourcing ...
As @statox suggested in comments I should have used tnoremap to implement it. The following works fine:
execute "tnoremap ".g:toggle_term ." <C-w>:call ToggleTerminal()<CR>"
The mistake I initially made was the space right after the N
execute "tnoremap ".g:toggle_term ." <C-w>N :call ToggleTerminal()<CR>"
and since I rebound ...
In general, you can't/shouldn't "create a custom colorscheme in which define custom highlight group each of containing set of words".
What you can/should do:
define your colorscheme file where for the color groups specific colors are defined (example snip):
let g:colors_name = '...
The solution was to define $HOME as a Windows environment variable.
Once I did that and restarted gVim, it read my ~\_vimrc and also sourced my native Vim 8.1 packages correctly.
Source: this answer at Stack Overflow.
You have a few options to accomplish that.
Actually changing the highlight rules after setting the colorscheme in your Vimrc is not a completely unreasonable approach, since the colorscheme is usually only reloaded if you set the background, so if you tend not to switch from "light" to "dark" or vice-versa, you might be fine...
There are better approaches ...