Open plugin documentation in vim - vim

Vim plugins frequently provide text-based documentation in a /doc folder.
For example, vim-orgmode, and vim-go.
How can one easily open the documentation from within vim?

Each doc folder should have :helptags run. This will normally be done automatically by plugin managers. After that, any tag in the doc files should be a legal target for the :help command (for help files, "tag" being "the stuff between two asterisks"). Thus, since there's *org* in the vim-orgmode's doc file, you should be able to do :help org to jump there. You can also say :help orgguide.txt to open the file itself by name.

Super simple: :h <doc-name>

Check out the Vim documentation:
Vim's online documentation system, accessible via the :help command, is an extensive cross-referenced and hyperlinked reference. It's kept up-to-date with the software and can answer almost any question about Vim's functionality.

Related

Is there a Vim plugin that would TAB-complete symbols from CTags index?

I've stumbled upon a quite innovative functionality in editor – ability to TAB-complete symbols from CTags index, on this Asciinema video.
I wonder if there is anything like it available for Vim? I've been using many completion engines like eg. CoC, however none of them seems to offer what NeoMCEdit does. Is there such plugin for Vim?
Basic keyword completion, :help i_ctrl-p/:help i_ctrl-n, already does that out of the box because of the default value of :help 'complete'.
Alternatively, you can use your tags files as exclusive source with :help i_ctrl-x_ctrl-].

vim plugin for directory list/file open

I'm looking for a vim plugin similar to http://www.vim.org/scripts/script.php?script_id=1325 with a directory list in which you can select a file to open. Does this exist somewhere? Wasn't able to find it myself.
NERDTree is the second best ranked plugin on vim.org and it perfectly fits your description.
There are many other variations of the same principle:
FuzzyFinder
LustyExplorer (the one I used before)
Command-T (famous among TextMate switchers, I never liked it, though)
CtrlP (the one I use now)
…
And I second :Explore.
Have you tried the :Explore command that comes with the standard vim distribution since (roughly) version 6?
See http://vim.wikia.com/wiki/File_explorer for basic help on that command.
See http://vimdoc.sourceforge.net/htmldoc/pi_netrw.html#netrw-quickhelp for detailed help on what the Explorer can do.
If you want to open an explorer without replacing the current buffer, you can use the :Sexplore command. A puerile mnemonic for that is to execute :Sex.

VIM recently edited files history

Is there a history of files edited in VIM that persists between
vim sessions, e.g. last 20 opened files.
I tend to edit the same .conf files and I have to navigate to them each time
of course they are spread all over the filesystem.
Actually this behavior IS built in. With default settings you should be able to use the :oldfiles command to view a numbered list of recent files. Then use :e #>4 for example, to edit number 4 in the list. Or :browse oldfiles, according to this answer.
As standard, no, but there's a plugin here that adds this functionality. This one also mentions recent file history on the page, so it may provide an alternative.
As this answer indicates, one may use ctrl-o to jump backward in file history. It will automatically open previously edited files.
You should consider giving ctrlp a chance (if you are not using it now).
It provides the command:
:CtrlPMRUFiles
that let's you select previous opened files. That is besides all the other cool stuff.
I was using the MRU plugin mentioned by #DrAI but once I started using ctrlp I just use that one.
Another popular plugin that provides a mru capability is Unite.
You can use :marks to navigate between recently used files.

Fast 'Find in Files' for VIM?

What are some options for getting really fast 'Find in Files' searching in VIM?
Our codebase is large enough that searching needs to work off an index. grep/vimgrep/etc are too slow.
Indexing doesn't need to be particularly fast; I can index overnight.
Thanks,
[EDIT] I'm also working in a Windows environment.
If it's source code (rather than full text search), then ctags with the TagList plugin should work well for your needs. See, for example:
http://www.thegeekstuff.com/2009/04/ctags-taglist-vi-vim-editor-as-sourece-code-browser/
EDIT: TagList and ctags will work on Windows as well (that's what I use). See the TagList install page and FAQ. The following links might prove useful:
http://www.vim.org/scripts/script.php?script_id=273
http://vim-taglist.sourceforge.net/installation.html
http://vim-taglist.sourceforge.net/faq.html
There's also a TagList forum where you can get further help:
http://tech.groups.yahoo.com/group/taglist/
I set it up on my windows machine a while back, but I don't remember encountering any problems.
Something that I use, but not through vim, is ack: http://betterthangrep.com/
It is a perl based tool, and it should be usable in Windows.
If you're working with a large codebase, then it might be time to look for a more powerful solution than conventional tools. OpenGrok is a very fast source code search and cross-reference engine. On top of its great performance, it integrates with Subversion, Mercurial, and ClearCase, among other source revision control software. It sounds a lot like something you could use.
If you want support to use OpenGrok from within Vim, you could easily write a vim function that would call system() to start the search for you. To read more about writing new vim commands, look up :help 40.2 within vim.
I hope that's what you were looking for.
I don't know how I found this, but looks like someone has written a plugin for google desktop
Try to install https://github.com/mileszs/ack.vim, http://beyondgrep.com/ ,
then make a link
ln -s /usr/bin/ack-grep /usr/bin/ack
and add
noremap <C-f> :copen<CR>:Ack -aQi --ignore-dir someignoringdir
to your .vimrc, after you can find in files through Ctrl+F, enjoy
_ /|
\'o.O'
=(___)=
U
You can try this
:vimgrep /something/ */
and dont forget to open search result window after
:cw

Favorite (G)Vim plugins/scripts? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
What are your favorite (G)Vim plugins/scripts?
Nerdtree
The NERD tree allows you to explore your filesystem and to open files and
directories. It presents the filesystem to you in the form of a tree which you
manipulate with the keyboard and/or mouse. It also allows you to perform
simple filesystem operations.
The tree can be toggled easily with :NERDTreeToggle which can be mapped to a more suitable key. The keyboard shortcuts in the NERD tree are also easy and intuitive.
Edit: Added synopsis
Tim Pope has some kickass plugins. I love his surround plugin.
Pathogen plugin and more things commented by Steve Losh
Taglist, a source code browser plugin for Vim, is currently the top rated plugin at the Vim website and is my favorite plugin.
I love snipMate. It's simular to snippetsEmu, but has a much better syntax to read (like Textmate).
A very nice grep replacement for GVim is Ack. A search plugin written in Perl that beats Vim's internal grep implementation and externally invoked greps, too. It also by default skips any CVS directories in the project directory, e.g. '.svn'. This blog shows a way to integrate Ack with vim.
A.vim is a great little plugin. It allows you to quickly switch between header and source files with a single command. The default is :A, but I remapped it to F2 reduce keystrokes.
I really like the SuperTab plugin, it allows you to use the tab key to do all your insert completions.
I have recently started using a plugin that highlights differences in your buffer from a previous version in your RCS system (Subversion, git, whatever). You just need to press a key to toggle the diff display on/off. You can find it here: http://github.com/ghewgill/vim-scmdiff. Patches welcome!
Elegant (mini) buffer explorer - This is the multiple file/buffer manager I use. Takes very little screen space. It looks just like most IDEs where you have a top tab-bar with the files you've opened. I've tested some other similar plugins before, and this is my pick.
TagList - Small file explorer, without the "extra" stuff the other file explorers have. Just lets you browse directories and open files with the "enter" key. Note that this has already been noted by previous commenters to your questions.
SuperTab - Already noted by WMR in this post, looks very promising. It's an auto-completion replacement key for Ctrl-P.
Desert256 color Scheme - Readable, dark one.
Moria color scheme - Another good, dark one. Note that it's gVim only.
Enahcned Python syntax - If you're using Python, this is an enhanced syntax version. Works better than the original. I'm not sure, but this might be already included in the newest version. Nonetheless, it's worth adding to your syntax folder if you need it.
Enhanced JavaScript syntax - Same like the above.
EDIT: Comments - Great little plugin to [un]comment chunks of text. Language recognition included ("#", "/", "/* .. */", etc.) .
Not a plugin, but I advise any Mac user to switch to the MacVim distribution which is vastly superior to the official port.
As for plugins, I used VIM-LaTeX for my thesis and was very satisfied with the usability boost. I also like the Taglist plugin which makes use of the ctags library.
clang complete - the best c++ code completion I have seen so far. By using an actual compiler (that would be clang) the plugin is able to complete complex expressions including STL and smart pointers.
No one said matchit yet ? Makes HTML / XML soup much nicer
http://www.vim.org/scripts/script.php?script_id=39
Tomas Restrepo posted on some great Vim scripts/plugins. He has also pointed out some nice color themes on his blog, too. Check out his Vim category.
With version 7.3, undo branches was added to vim. A very powerful feature, but hard to use, until Steve Losh made Gundo which makes this feature possible to use with a ascii
representation of the tree and a diff of the change. A must for using undo branches.
Matrix Mode.
My latest favourite is Command-T. Granted, to install it you need to have Ruby support and you'll need to compile a C extension for Vim. But oy-yoy-yoy does this plugin make a difference in opening files in Vim!
Conque Shell : Run interactive commands inside a Vim buffer
Conque is a Vim plugin which allows you to run interactive programs, such as bash on linux or powershell.exe on Windows, inside a Vim buffer. In other words it is a terminal emulator which uses a Vim buffer to display the program output.
http://code.google.com/p/conque/
http://www.vim.org/scripts/script.php?script_id=2771
The vcscommand plugin provides global ex commands for manipulating version-controlled source files and it supports CVS,SVN and some other repositories.
You can do almost all repository related tasks from with in vim:
* Taking the diff of current buffer with repository copy
* Adding new files
* Reverting the current buffer to the repository copy by nullifying the local changes....
Just gonna name a few I didn't see here, but which I still find extremely helpful:
Gist plugin - Github Gists (Kind
of Githubs answer to Pastebin,
integrated with Git for awesomeness!)
Mustang color scheme (Can't link directly due to low reputation, Google it!) - Dark, and beautiful color scheme. Looks really good in the terminal, and even better in gVim! (Due to 256 color support)
One Plugin that is missing in the answers is NERDCommenter, which let's you do almost anything with comments. For example {add, toggle, remove} comments. And more. See this blog entry for some examples.
I like taglist and fuzzyfinder, those are very cool plugin
TaskList
This script is based on the eclipse Task List. It will search the file for FIXME, TODO, and XXX (or a custom list) and put them in a handy list for you to browse which at the same time will update the location in the document so you can see exactly where the tag is located. Something like an interactive 'cw'
I really love the snippetsEmu Plugin. It emulates some of the behaviour of Snippets from the OS X editor TextMate, in particular the variable bouncing and replacement behaviour.
Zenburn color scheme and good fonts - [Droid Sans Mono](http://en.wikipedia.org/wiki/Droid_(font)) on Linux, Consolas on Windows.
If you're on a Mac, you got to use peepopen, fuzzyfinder on steroids.
I use the following two plugins all the time:
project
vimoutliner
For vim I like a little help with completions. Vim has tons of completion modes, but really, I just want vim to complete anything it can, whenver it can.
I hate typing ending quotes, but fortunately this plugin obviates the need for such misery.
Those two are my heavy hitters.
This one may step up to roam my code like an unquiet shade, but I've yet to try it.
Txtfmt (The Vim Highlighter)
Screenshots
The Txtfmt plugin gives you a sort of "rich text" highlighting capability, similar to what is provided by RTF editors and word processors. You can use it to add colors (foreground and background) and formatting attributes (all combinations of bold, underline, italic, etc...) to your plain text documents in Vim.
The advantage of this plugin over something like Latex is that with Txtfmt, your highlighting changes are visible "in real time", and as with a word processor, the highlighting is WYSIWYG. Txtfmt embeds special tokens directly in the file to accomplish the highlighting, so the highlighting is unaffected when you move the file around, even from one computer to another. The special tokens are hidden by the syntax; each appears as a single space. For those who have applied Vince Negri's conceal/ownsyntax patch, the tokens can even be made "zero-width".
tcomment
"I map the "Command + /" keys so i can just comment stuff out while in insert mode
imap :i

Resources