30
votes
Accepted
Why am I getting a "E488: Trailing characters" error on this custom command?
Remove the trailing <cr>
That is only needed for mappings, but not for commands.
25
votes
Accepted
BufWinLeave * mkview with unnamed file: Error 32
Switching to ?* as the regex will no longer match empty file names. I actually recommend you switch to the following, which is a corresponding block of .vimrc that has been tweaked to suppress many of ...
8
votes
Accepted
How to cut/trim line in statusline?
Values used in :set are strings. See :h set-args:
:set-args E487 E521
:se[t] {option}={value} or
:se[t] {option}:{value}
...
8
votes
Accepted
When should a function *not* be defined with "abort"
Discl.: It's just guessing on my part.
abort didn't exist when function was introduced. I guess that in order to not break existing code it was decided to not change the current behaviour and to ...
8
votes
Accepted
In Linux, on an extremely long running vim session, calls to system() fail with E484 "can't open file /tmp/<tempfile>"
This happens when some system cron job cleans out "unused" files from /tmp. The solutions are:
Find that cron job and stop it from rm'ing your Vim /tmp files.
Recreate Vim's temporary directory.
...
7
votes
How do I open file under cursor, when the filename has a trailing dot?
From :help gf:
Trailing punctuation characters ".,:;!" are ignored.
So I suppose the dot at the end is not considered as part of the filename but as punctuation.
I don't know if it can be done with ...
7
votes
Accepted
Why do I get an E488 error when printf .vimrc?
# is not a comment character, " is. So it should read:
" Funcionar como vim y no como vi
set nocompatible
" Colorear sintaxis
syntax on
colorscheme sienna
" Otros seteos
" Más info, desde vim poner:...
7
votes
Accepted
Print an error message without "Error detected while processing function"
The solution is described in the manual:
If you just want a highlighted message use :echohl.
And to get a beep: :exe "normal \<Esc>"
Thus:
function! PrintError(msg) abort
execute '...
6
votes
How can I suppress startup error E575?
Check your init.vim. If there is any line concerning viminfo, temporarily remove/comment it, you can later discover the reason it messed up.
Then backup and remove ~/.local/share/nvim/shada folder. ...
5
votes
Accepted
Why I'm getting Invalid arguments for the function when using double-quotes?
From :help :put:
The register can also be = followed by an optional expression. The expression continues until the end of the command. You need to escape the | and " characters to prevent them ...
5
votes
Accepted
E334: Menu not found: Window.Minimize
Important note As I mentioned it in the comments when you begin to use Vim the best you can do is to start with an emtpy .vimrc. From this you'll be able to build your own configuration which really ...
5
votes
What does `<Bar>` mean?
I'd like to add that in normal mode, the | command (which has to be substituted with <bar>, \| or ^V| while remapping it, as mentioned in other answers) allows you to go to a specific screen ...
4
votes
Accepted
Delay with remapped q
This happens because Vim waits to see if you want to do q<letter> to start recording a macro (there are a couple other things too like q:).
You can use the tm option to change the amount it ...
4
votes
Don't fail if pattern is not found
Here's a mapping that won't change the last search register or print errors:
nnoremap <expr> ]m filter([search('pattern', 'nW'), line('.')], 'v:val')[0].'G'
filter() takes a list of items and ...
4
votes
Accepted
How do I open file under cursor, when the filename has a trailing dot?
Another option is to set includeexpr. From :help includeexpr:
*'includeexpr'* *'inex'*
'includeexpr' 'inex' string (default "")
...
4
votes
Accepted
Why do I get "incompatible error" while opening .sh files using vi in cygwin?
The option name is nocompatible. Replace incompatible with nocompatible to solve your problem.
4
votes
Accepted
Difference between make and make!
This is happening because while :make! doesn't jump to the first error message, it actually sets the quickfix cursor at it. So when you use :cnext it will actually try to go to the second error, which ...
4
votes
Accepted
Copy vim messages into clipboard
You can typically see the error messages produced by plug-ins using the :messages command.
If you'd like to put those messages into a Vim buffer, so that you can copy them to the clipboard from there, ...
3
votes
Accepted
vim-autoformat plugin - undefined shiftwidth function
shiftwidth() is a function that has been added I think late in the 7.3 circle. Can you update your Vim version?
3
votes
Accepted
Why Error E172 on Execution?
You need to escape the line so that
tabedit /Users/masi/Raspberry Pi/me-hello-yes.tex
becomes
tabedit /Users/masi/Raspberry\ Pi/me-hello-yes.tex
Otherwise, tabedit sees two filenames /Users/masi/...
3
votes
`E575: viminfo: Illegal starting char in line: ...` on startup
For me, this problem keeps showing up even if I delete the ~/.viminfo file - not right away, but a couple of days later.
I just noticed there's a way to skip using the viminfo file entirely, as ...
3
votes
Accepted
List files if there are too many of them
Completion
Use <tab> to complete a filename. If you know there are going to be many candidates then you can use <c-d> to list out the candidates. May want to look into 'wildmenu' & '...
3
votes
Accepted
Why do mappings abort on errors?
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 ...
3
votes
Gvim throws the error 'E285: Failed to create input context'
I had the same problem when starting gvim from a shell script. Looking at the code vim ignores the fact that creating this context failed. It is just annoying the users with this message except when ...
3
votes
Accepted
Error in editing vimrc
Probably you don't have local user .vimrc.
$MYVIMRC is pointed to the one that was used to initialize your vim. If there is no user .vimrc it would be system-wide one and usually you would have to ...
3
votes
Accepted
Gvim E370: cannot load library python36.dll with installed Python 3.8
Is it possible to force Gvim to use python38.dll or it should be recompiled with python 3.8? Probably if I install the Python3.6 it will work. Is it necessary to recomile every time there is new ...
3
votes
gvim: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
I found the answer starting here and ending here:
export NO_AT_BRIDGE=1
The latter linked page refers to this as a hack. Since it seems to be a Gnome thing, and I don't use Gnome on the system where ...
3
votes
Accepted
Neovim Lua: Error while calling lua chunk [...] '' expected near 'local'
In my case this was because I had this in my file,
return require('packer').startup(function()
-- stuff
end)
And then after that I had
let on_attach = function(client, bufnr)
...
end
And that ...
3
votes
Accepted
Error when using vim-plug from git-bash
As pointed out by romainl in the comments, you have two versions of Vim installed:
Vim 9.0 with GUI for Windows you probably installed yourself
Vim 8.2 without GUI that came on top of git-bash (on a ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
error × 99vimrc × 15
neovim × 11
vimscript × 10
microsoft-windows × 7
gvim × 6
functions × 6
key-bindings × 5
autocmd × 5
buffers × 4
plugin-system × 3
quickfix × 3
search × 2
highlight × 2
macro × 2
statusline × 2
linux × 2
save × 2
vimscript-python × 2
line-numbers × 2
shell × 2
makeprg × 2
python × 2
map-operator × 2
errorformat × 2