Vim prints meaningless error - vim

When I load vim I get the following message that I cannot figure out how to debug.
4FNVHQ1|tmp
λ vim
default
Press ENTER or type command to continue
4FNVHQ1|tmp
λ
I've run vim -V9myVimLog and got this in the output but there's still nothing useful to me.
....
chdir(/c/Users/bjones/.vim/bundle/vundle/autoload/vundle)
fchdir() to previous dir
line 5: sourcing "/c/Users/bjones/.vim/bundle/vundle/autoload/vundle/config.vim"
finished sourcing /c/Users/bjones/.vim/bundle/vundle/autoload/vundle/config.vim
continuing in function vundle#rc
default
Searching for "filetype.vim" in "/c/Users/bjones/.vim/bundle/vim-javascript,/c/Users/bjones/.vim/bundle/vim-coffee-script,/c/Users/bjones/.vim/bundle/vim-jade,/c/Users/bjones/.vim/bundle/nerdtree,/c/Users/bjones/.vim/bundle/vim-rails,/c/Users/bjones/.vim/bundle/vim-commentary,/c/Users/bjones/.vim/bundle/vim-rake,/c/Users/bjones/.vim/bundle/snipMate,/c/Users/bjones/.vim/bundle/bsh.vim,/c/Users/bjones/.vim/bundle/vim-csharp,/c/Users/bjones/.vim/bundle/vim-distinguished,/c/Users/bjones/.vim/bundle/surround.vim,/c/Users/bjones/.vim/bundle/ctrlp.vim,/c/Users/bjones/.vim/bundle/jshint2.vim,/c/Users/bjones/.vim/bundle/vim-ps1,/c/Users/bjones/.vim/bundle/MatchTag,/c/Users/bjones/.vim/bundle/VCard-syntax,/c/Users/bjones/.vim/bundle/vim-liquid,/c/Users/bjones/.vim/bundle/vim-jst,/c/Users/bjones/.vim/bundle/vim-stylus,/c/Users/bjones/.vim/bundle/vim-swigjs,/c/Users/bjones/.vim/bundle/xmledit,/c/Users/bjones/.vim/bundle/vim-less,/c/Users/bjones/.vim/bundle/vim-markdown,/c/Users/bjones/.vim/bundle/vim-nerdtree-tabs,/c/Use
Searching for "/c/Users/bjones/.vim/bundle/vim-javascript/filetype.vim"
Searching for "/c/Users/bjones/.vim/bundle/vim-coffee-script/filetype.vim"
....
As you can see the word "default" is printed awkwardly in the debug log but there's nothing helpful.
Any help would be greatly appreciated.
EDIT: My vimrc is here: https://gist.github.com/brettof86/9906968
EDIT2 [FIX?]: IDK how it made a difference but I commented out every "Bundle" command in my vimrc then saved and quit. Then I went back and uncommented them 5 at a time and it started working? I have no idea why it was broken but I hope this helps anyone who may also run into this issue.

You mistakenly added an extra line colors in your vimrc, that as an VIM Ex command outputs the current selected colorscheme and since you haven't defined one yet, it outputs default since that is, as the name suggests, the default VIM colorscheme. You should comment it out since it clearly appears to be a documenting comment rather than executing an Ex command.

Related

Ctrl-p Vim bug - unclear what error message is telling me

prt path <mru>={ files }=<buf> <-> /home/....
Error detected while processing function <SNR>48_NormalPasta:
line 13:
E21: Cannot make changes, 'modifiable' is off
Press ENTER or type command to continue
kind of a strange vim error I get when I try to type the 'p' character using vim & ctrlp, using linux ubuntu here
Let's take that message one line at a time:
Error detected while processing function <SNR>48_NormalPasta:
There is an error in function NormalPasta() in the 48th script that was sourced by Vim.
line 13:
The error is on line 13 of that function.
E21: Cannot make changes, 'modifiable' is off
The function is trying to edit a non-modifiable buffer.
From there, you can do:
:filter 48 scriptnames
or:
$ grep -R NormalPasta ~/.vim/**/*.vim
to find in what script the problematic function is located.
This leads to this plugin, which appears to be OK. The whole situation seems rather strange, though, because the problematic function is supposed to be called from normal mode and I don't think a) that you should be in normal mode at CtrlP's prompt and b) that the CtrlP prompt is supposed to be non-modifiable.
My opinion is that the vim-pasta plugin is OK and thus that there is something fishy going on with CtrlP itself or the way you use it.

Configure Vim to use Xiki

I have installed xiki as per the instructions in https://github.com/trogdoro/xiki. I have read that Xiki provides partial support for Vi. I want to know how to setup Vim with Xiki. Can you point me in the right direction?
In searching for the answer to this, I encountered this question. I have now found it on my own:
The vim folder got moved. Here is the folder for vim in the Xiki github:
https://github.com/trogdoro/xiki/tree/master/misc/vim
here is the status report:
https://github.com/trogdoro/xiki/blob/master/misc/vim/vim_status.notes
and here is how it says to enable Xiki in Vim:
- 1) Add this line, and then restart vim
~/.vimrc
| let $XIKI_DIR = "[xiki dir]"
| source [xiki dir]/etc/vim/xiki.vim
- 2) Type "ip" on a blank line and double-click on it
Having no experience with xiki, I just googled this: https://github.com/trogdoro/xiki/tree/master/etc/vim. And here is some status report: https://github.com/trogdoro/xiki/blob/master/etc/vim/vim_status.notes. Hope that helps!

the dollar sign `$` cannot be removed from iskeyword [duplicate]

In my vimrc, I have included a script (say, otherscript.vim, which I need to include for work reasons) that says:
autocmd FileType php setlocal iskeyword+=$
and I don't want this behaviour. So, sometime later in the vimrc, I say:
autocmd FileType php setlocal iskeyword-=$
(I also tried using set instead of setlocal.) But, when I open a php file, iskeyword still contains the $ symbol in it. I am using vim 7.2. The output of ':verbose set iskeyword' is
iskeyword=#,48-57,_,192-255,$
Last set from /path/to/otherscript.vim
The output of ':scriptnames' is:
...
7: /usr/share/vim/vim72/ftplugin.vim
8: /home/yogeshwer/.vimrc
...
74: /path/to/otherscript.vim
...
Can somebody help me how I can revert the changes to 'iskeyword' made by the other script? Thanks a bunch.
I like to avoid autocmds when I can and use the after directory structure.
$ mkdir -p ~/.vim/after/{ftplugin,syntax,indent}
$ echo 'setlocal iskeyword-=$' >> ~/.vim/after/ftplugin/php.vim
This sets up a basic after directory in your user-specific vim config folder. Whereas ~/.vim/ftplugin/$FILETYPE.vim would be used in lieu of vim's standard $FILETYPE.vim file, files in an after directory get executed after, allowing you to override or change the behavior of your ftplugins, syntax definitions, and indent commands.
As an additional example to show you how these work, I'll include part of my local after/syntax/python.vim file here. I like all the "structural punctuation" of my code to stand out when I read it, so I do this:
syn match pythonParen /[()]/
syn match pythonBrack /[][]/
syn match pythonCurly /[{}]/
hi def link pythonParen Paren
hi def link pythonBrack Brack
hi def link pythonCurly Curly
I've also got an after/indent/php.vim file that was supposed to fix some of the annoying indent issues I ran into with the indent behavior when switching in and out of <?php ?> regions in a template file, but the code is a mess and never really worked in the first place, so I won't reproduce it here. I mention it only to give you an example of what can be done with the after hooks.

No mapping found

Starting up vim and then No mapping found shows up at bottom.
running the command: vim -V20logfile
line 3: redir => res
line 4: silent! execute a:cmd
line 5: redir END
line 6: let &verbosefile = oldverbosefile
I had the same issue.
I commented out all maps, thinking they were all fine. Sure enough, vim loaded without err.
Then, I reintroduced the mappings until one broke it. Sure enough I had left out the space between the lhs and the rhs. As soon as I corrected this, it worked perfectly again.
I found the best way to debug your .vimrc is to enable the debug and pip it to a log file. Examine the file and search for the error.
If the error you are receiving is " no mapping found", open the log file and search for the these words.
:/no mapping found.
It will show you where the error is coming from. In my case I found that the error is from a plugin I installed. I disabled it and it works fine again.
Run the following command at the prompt:
vim -V20 2>&1 | tee logfile

Removing a character from 'iskeyword' in vim

In my vimrc, I have included a script (say, otherscript.vim, which I need to include for work reasons) that says:
autocmd FileType php setlocal iskeyword+=$
and I don't want this behaviour. So, sometime later in the vimrc, I say:
autocmd FileType php setlocal iskeyword-=$
(I also tried using set instead of setlocal.) But, when I open a php file, iskeyword still contains the $ symbol in it. I am using vim 7.2. The output of ':verbose set iskeyword' is
iskeyword=#,48-57,_,192-255,$
Last set from /path/to/otherscript.vim
The output of ':scriptnames' is:
...
7: /usr/share/vim/vim72/ftplugin.vim
8: /home/yogeshwer/.vimrc
...
74: /path/to/otherscript.vim
...
Can somebody help me how I can revert the changes to 'iskeyword' made by the other script? Thanks a bunch.
I like to avoid autocmds when I can and use the after directory structure.
$ mkdir -p ~/.vim/after/{ftplugin,syntax,indent}
$ echo 'setlocal iskeyword-=$' >> ~/.vim/after/ftplugin/php.vim
This sets up a basic after directory in your user-specific vim config folder. Whereas ~/.vim/ftplugin/$FILETYPE.vim would be used in lieu of vim's standard $FILETYPE.vim file, files in an after directory get executed after, allowing you to override or change the behavior of your ftplugins, syntax definitions, and indent commands.
As an additional example to show you how these work, I'll include part of my local after/syntax/python.vim file here. I like all the "structural punctuation" of my code to stand out when I read it, so I do this:
syn match pythonParen /[()]/
syn match pythonBrack /[][]/
syn match pythonCurly /[{}]/
hi def link pythonParen Paren
hi def link pythonBrack Brack
hi def link pythonCurly Curly
I've also got an after/indent/php.vim file that was supposed to fix some of the annoying indent issues I ran into with the indent behavior when switching in and out of <?php ?> regions in a template file, but the code is a mess and never really worked in the first place, so I won't reproduce it here. I mention it only to give you an example of what can be done with the after hooks.

Resources