vundle: ConqueTerm: not an edit command - vim

I tried to install Conque-Shell via Vundle, and when I input :ConqueTerm bash in vim, it showed 'ConqueTerm: Not an edit command'. I thought there was something wrong with my path. But I did write set rtp+=~/.vim/bundle/vundle in my .gvimrc. And the configure of Vundle is at the beginning of the .gvimrc.
I copied the .vim/bundle/Conque-Shell/plugin/conque_term.vim to .vim/plugin/conque_term.vim and then it worked.
So, is there anything wrong with my .gvimrc?? Thanks!
My .gvimrc: https://gist.github.com/guori12321/5506991

If you observe the output of :scriptnames (the list of scripts sourced during startup), you'll note that .gvimrc comes last, after .vimrc and the plugins. Therefore, any changes to the 'runtimepath' there are too late; plugins (like ConqueTerm) have already been loaded. You can read more about the startup process at :help initialization.
Even if you only use the GUI GVIM, put the common settings into ~/.vimrc; the ~/.gvimrc file is for GUI-only stuff that doesn't apply to the terminal Vim, e.g. setting 'guifont' and similar options.

Related

SPF VIM syntax on by default

I just installed spf13 vim on my machine with CentOS. One thing I noticed is that I was not able to set "syntax on" by default.
The difference are the parenthesis color and the GLOB color. The default color is very light on my monitor, so really want to set syntax on by default.
I am not sure what went wrong. Here is my ~/.vimrc.local
filetype plugin on
syntax on
Setting up vim defaults can be funky on new installs.
First, confirm that the rc is being sourced.
Place the line echom "file is sourced on startup" into your .vimrc.
Open a new instance of vim. Type :messages then <return>. If you don't see that line, the file isn't being sourced.
To find out where vim is looking for your .vimrc:
Enter the command :echo $HOME. The folder it outputs is a good place to try putting a .vimrc or .vimrc.local file. Try both of those.
Also try :e $MYVIMRC, which might find the file you need to edit anyway.
Finally, make sure to put set nocompatible in your rc.

How to add a vimrc path to vim

currently there are a few paths where .vimrc files are being searched. (as can be seen in :scriptnames command).
How do I add another path?
You're mistaken. :scriptnames tells you which scripts were loaded. It will be:
.vimrc,
possibly .gvimrc,
plus all plugins in 'runtimepath',
plus all ftplugins, syntax files and indent files in runtimepath that apply for all the buffers you have edited,
plus the autoload plugins loaded by the previous files,
plus the files you've sourced manually.
If you want to change the places where to search for your .vimrc, it will be more complex as vim has a very specific heuristic to search for a .vimrc. See :h startup.
Any way. If you really want to add a path where the .vimrc file will be searched, it's not possible unless you define an alias to vim that use the -u flags.
If you want to add other paths where to look for plugins, you'll have to set the 'runtimepath' option in your .vimrc. For instance, :set rtp+=~/.vim/addon/foobar will have all plugins named $HOME/.vim/addon/foo/plugin/*.vim and $HOME/.vim/addon/foo/after/plugin/*.vim loaded automatically, plus the ftplugin/syntax file/indent files loaded automatically as well if you enable them, and when you enter a buffer related to them.
The 'runtimepath' option specifies the locations of the Vim configuration subdirectories (i.e. directories containing autoload/, plugin/, syntax/, etc.) The Pathogen plugin made it popular to extend this so that each plugin is installed into a separate such subdirectory, and other plugin managers (like Vundle) do that as well.
Now, there's only one .vimrc (and you can change its location via the -u command-line argument), but nothing prevents you from using :source path/to/another/script.vim to load other Vim scripts during startup.
TL;DR
To execute a separate Vimscript file during startup, just :source it from your ~/.vimrc. If you have a plugin(s) that you want to install in a separate location, use :set runtimepath+=path/to/pluginroot in your ~/.vimrc, or just use Pathogen or another plugin manager.

What can I do if vim still chooses the wrong syntax highlighter?

I'm on a system (linux) that always recognizes cpp files (*.cc) as tcl files. I don't know what file type that is, but I wanted to override it. The correct syntax highlighting is chosen if I manually do :set ft=cpp. However, I'm having troubles setting that automatically and I don't want to use the modeline option. My own .vimrc doesn't interfere (same result if I rename it).
From the vim help (:help ftplugin-override)
*ftplugin-overrule*
If a global filetype plugin does not do exactly what you want, there are three
ways to change this:
1. Add a few settings.
You must create a new filetype plugin in a directory early in
'runtimepath'. For Unix, for example you could use this file:
vim ~/.vim/ftplugin/fortran.vim
You can set those settings and mappings that you would like to add. Note
that the global plugin will be loaded after this, it may overrule the
settings that you do here. If this is the case, you need to use one of the
following two methods.
I have used this option before on another machine and that worked. I've tried
<file> .vim/ftplugin/tcl.vim
set filetype=cpp
"au BufRead,BufNewFile * set filetype=cpp
The first line correctly sets the filetype (:set ft? returns cpp), but syntax highlighting is not the same as if I said :set ft=cpp. It's still the tcl syntax highlighting. The second line does nothing.
2. Make a copy of the plugin and change it.
You must put the copy in a directory early in 'runtimepath'. For Unix, for
example, you could do this:
cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim
Then you can edit the copied file to your liking. Since the b:did_ftplugin
variable will be set, the global plugin will not be loaded.
A disadvantage of this method is that when the distributed plugin gets
improved, you will have to copy and modify it again.
There seems to be no file in my $VIMRUNTIME directory /usr/share/vim/vim72/ftplugin/ called tcl.vim.
3. Overrule the settings after loading the global plugin.
You must create a new filetype plugin in a directory from the end of
'runtimepath'. For Unix, for example, you could use this file:
vim ~/.vim/after/ftplugin/fortran.vim
In this file you can change just those settings that you want to change.
Has the same effect as 1. Is there anything else I can try? Thanks a lot in advance.
cpp is the default filetype for *.cc and *.cpp files.
The tcl filetype is only set for *.tcl, *.tk, *.itcl, *.itk and *.jacl.
I see no reason why Vim would default to tcl when loading a *.cc file but you could check if theses files are installed:
/usr/share/vim/vim7x/ftplugin/cpp.vim
/usr/share/vim/vim7x/indent/cpp.vim
/usr/share/vim/vim7x/syntax/cpp.vim
and if the correct checks are done in:
/usr/shhare/vim/vim7x/filetype.vim
Are you the only person working on this machine? Do you use modelines?

Vim commands :Explore :Sexplore :Hexplore doesn't work in cygwin

3.3 in cywing 2.721, the installation was made using cywing, every thing works but when I try to use the following command.
:Explore
vim said E492: Not an editor command
also neither :Sexplore or :Hexplore works.
is there any way to activate this functionality?
This is in machine with windows xp.
Well I solved reading the
:help usr_01.txt
It said that is necessary to run this command !cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc inside vim, it just copy a .vimrc to home user.
I close and opened vim and :Explore, Hexplore, Vexplore worked.
I had the same problem as well. Since it's a fresh install of Vim you don't have a .vimrc (or _vimrc on Windows). A vimrc is Vim's configuration file, and once you have one Vim will no longer try to be compatible with Vi (usually what you want).
So all you have to do is create a vimrc file and you should be ready to :Explore all you want. Below are locations you can put your vimrc file, and the filename to use for it. (depending on your system)
Unix/Linux/OSX: $HOME/.vimrc or $HOME/.vim/vimrc
MS-Windows: $HOME/_vimrc, $HOME/vimfiles/vimrc
or $VIM/_vimrc
sources:
* :help 'compatible'
* :help 'vimrc'
I also recommend following atomsfat's answer as well to give you a simple vimrc to start out with.
Those commands are provided by the netrw plugin. Check :scriptnames to see if that plugin is loaded.

How to turn-off a plugin in Vim temporarily?

I have multiple plugins in Vim and some of them modify the default behavior of Vim. For example I use Vimacs plugin, which makes Vim behave like emacs in the insert mode alone. Sometime I want to turn off the Vimacs plugin without moving the vimacs.vim out of the plugins directory. Is there a way to do it?
You can do this if you use a plugin manager like Vundle or Pathogen, which will keep the plugin in its own directory underneath the ~/.vim/bundle/ directory.
In that case, just find out the runtimepath of the vimacs plugin with the following command:
set runtimepath?
Let's say it's ~/.vim/bundle/vimacs.
Then, put this command in your .vimrc:
set runtimepath-=~/.vim/bundle/vimacs
To load vimacs, just comment that line out and relaunch Vim (or source your .vimrc).
See which variable vimacs check on start. On the begin of the script file find something Like if exists('g:vimacs_is_loaded").... Then set this variable in your .vimrc or while start vim with vim --cmd "let g:vimacs_is_loaded = 1".
In case you are using pathogen, this post gives a better answer, in my opinion. Since I have frequent need to disable snippets when using latex, also added this in my ~/.config/ranger/rc.conf:
map bs shell vim --cmd "let g:pathogen_blacklist = [ 'ultisnips', 'vim-snipmate' ]" %f
This way, whenever I want to open a file with snippets disabled, it is easy.

Resources