Checking if an optional Vim feature is available, using Vim script [duplicate] - vim

This question already has answers here:
How can you check which options vim was compiled with?
(3 answers)
Closed 7 years ago.
I am using the same Vim configuration on several computers. They are running different Vim builds, and i do not have root access. I therefore want to check for feature support inside vimrc, so that i can avoid running unsupported plugins.
Is there a way to check if an optional Vim feature is supported from inside a Vim script? In the case i ran into, i want to detect the relatively new float support.

:h has
:h feature-list
if has('float')

Related

GVIM : Possible to begin editing the file without having to press "i"? [duplicate]

This question already has answers here:
Is there a way to change vim's default mode
(5 answers)
Closed 9 years ago.
I am trying to move from GEDIT to GVIM but I noticed that when I open a file I am not free to edit it.
unless I press i to go in (INSERT) mode.
Is there a way to bypass this? So the file is instantly editable?
You can do this by editing your .vimrc file. It looks like set im! is the command you're looking for to set input mode as the default, but you'll also need to explicitly map escape to change to command mode.
A better question is why you would want to do this, though. Unless you're opening a brand new file, once you know vim, you'll probably spend very little time in insert mode, as you should be using more advanced command-mode commands (append, correct, etc) to edit and update your code at the appropriate places. If you're just going to use vim the same way you use gedit, don't bother - gedit is better than vim at being gedit.
EDIT: After reading the comments on your question, it sounds like you really, really shouldn't be using vim. It's not something you want to stumble into by default, certainly not if what you want is a basic editor with customizable display.

Is there any efficient ways to locate, open files in Vim? [duplicate]

This question already has answers here:
Shortcut to open file in Vim
(19 answers)
Closed 9 years ago.
I use Nerdtree, it is convenient. But when there is too many files in directories, it is little inconvenient to locate files and open it.
Is there some efficient way to locate, open files in Vim?
This other answer of mine covers a few of the methods available to you without installing anything. Vim's built-in ** and tab-completion are your best friends:
:e **/foo*/bar<tab>
The above mentioned CtrlP is a great tool that does a lot more than file navigation. You should try it, as well as the other plugins in my answer.
Also, NERDTree is close to useless because you already have a file explorer in Vim: :help netrw.

Does "M-x term" of emacs exist on vim? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I open a Shell inside a Vim Window?
In emacs there is an amazing functionality that allows user to split the window into two ones and run shell commands on one window. Does it exist on vim?
Thanks
There are several, but Conque appears to be the most full-featured one.

Displaying Vim variables [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Get current value of a setting in Vim
I know that you can use :set to change Vim settings and that you can set up a configuration file ~/.vimrc but I'm running into some issues getting this to work with MacVim and I want to be able to display what a Vim environment variable is.
Is there a command like :show tw or something like this that will do this?
Thanks.
:set tw?
or if you want to know where it is set as well
:verbose set tw?
For even more setting fun
:options
In addition to the accepted answer you may also use :echo &tw.
This has the advantage that you can't accidentally set a boolean option by forgetting to add the ?. The disadvantage is that you cannot use this method with verbose.

Cannot use arrows in VI on some consoles [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Linux vi arrow keys broken in insert mode
When I use vi in some consoles, I can use the arrows normally. But in others if I press the up arrow, it prints an "A". I then have to press escape to use the arrows normally.
I'm guessing it's something in the terminal configuration. How do I fix this?
Try using Vim instead of vi. I was forced to use vi at uni. It's crap.

Resources