Fix hover "ri" in Janus, Vim setup? - vim

I have installed Janus to improve my vim. All works fine, except for the Ri documentation, that opens on hovering a keyword. On my installation it shows the output of "ri --help" instead of the documentation of the keyword.
I have found a way to disable it, but I'd rather just fix it. I am using gvim on Ubuntu 11.10.
What is the name of the plugin or script that offers these tooltips?
Could it have anything to do with RVM being active?

The problem is a bug in the ruby.vim plugin. That triggers ri with a wrong argument.
There is a bug report for this.
Solving is easy: edit file .../ftplugin/ruby.vim and change line 194: the -f argument should not be simple, but either bs or ansi. I had success with bs.

Does any of these shortcuts (from ri's homepage) work, especially the last two?
,r opens the search/autocomplete window, and will use a horizontal split to display matching documentation
,R opens the search/autocomplete window, and will use a vertical split to display matching documentatoin
,K opens the search/autocomplete window and prefills it with the keyword under the cursor
K is automatically remapped to use ri.vim if the current buffer is a *.rb file

Related

Neovim: How do I set guicursor to make the cursor blink?

The cursor blinking is off by default in Neovim and I want it back. I have tried to apply different arguments to guicursor, but didn't succeed. Since I want it to blink the same way in every mode, I think, I need something with the letter 'a' in it.
Here's what I have tried so far:
:set guicursor=a:blinkwait700-blinkon400-blinkoff250 (I also tried with 'i')
:set guicursor=a:blinkon100 (as the opposite of a:blinkon0 which switches it off)
I've already looked into the help but it didn't help me unfortunately.
Update:
What is peculiar is that :set guicursor=a:blinkon100 enables the blinking in gVim, but not in Neovim.
From neovim 0.2 onwards, setting guicursor does achieve the desired effect:
" Enable blinking together with different cursor shapes for insert/command mode, and cursor highlighting:
set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50
\,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor
\,sm:block-blinkwait175-blinkoff150-blinkon175
Find more by typing :help 'guicursor' from inside nvim.
For more info, see the official wiki
Finally, if you use st, you can patch it to get this working:
https://st.suckless.org/patches/blinking_cursor/
EDIT: I noticed from the comments of the first answer that OP was talking about nvim-qt, for those interested in that, a fix for it has been merged at the beginning of this year.
If you are using the st terminal by Suckless then that does not support cursor blinking I belive, otherwise if your terminal does support it try setting the option let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 in your init.vim file. You could also pass that on the command line such as NVIM_TUI_ENABLE_CURSOR_SHAPE=1 nvim.

plugin to vim that shows definition of function/macro/struct in a popup box?

Im using vim with ctag+tagbar plugin to navigate through kernel code and its amazing ! Thanks to a guide I saw here.
I read here about some nice shortcuts for ctags that helps a lot, but I couldnt find a way that a definition(of structs/function etc) would show in popup box - something like eclipse ide.
Is there a way to do so with ctag? is there a plug-in I can add to vim that would that ? so when the mouse cursor(or also keyboard cursor) on function a popup box next to it will show?
Thanks!
Generally, you should avoid trying to use Vim as an IDE. It's meant to be a modular text editor.
Having said that, if you are looking for eclipse functionality inside of Vim, you may want to consider eclim. Another good set of plugins are the Clang based tools, like clang-format and YouCompleteMe.
ctags is very useful plugin, but if you also use ctags you can then copy file http://cscope.sourceforge.net/cscope_maps.vim to your ~/.vim/plugin directory and this will add keymappings that will allow you to jump to definition or show it in horizontal or vertical split.
I also added to my cscope_maps file an extra set of mappings like so:
nmap <C-h>g :tab cs find g <C-R>=expand("<cword>")<CR><CR>
to open my search in a new tab.
Example above allows you to use Ctrl+h and then g to "find global definition(s) of the token under cursor" and open it in a new tab.
Consider using cscope- it can also work with ctags (I always use both).
I know that this is not a pop-up window, but vim is not an IDE.

How to remove the start message of Gvim? And why my mark function does not work?

When I open my Gvim under Windows, it gives above message. How to remove it?
The 2nd question is about the 'mark' function of Gvim.
By default, it should be installed together with Gvim and can be used after the installation. I did so in my own computer. But today when I do the same thing on my office computer, the 'mark' function does not work.
In my _vimrc file, I set below:
let mapleader=";"
So every time I just press ';' and then 'm' to activate mark function but failed.
The message box shows :echomsg output from both cscope and the TagList plugin. During GVIM startup, these appear in a message box popup, because the GUI hasn't yet been initialized.
The messages (at least the second; I don't understand Chinese) alert you about things that are missing on your system; you need to either install them (e.g. ctags from Exuberant Ctags), or uninstall / disable the corresponding plugin.
It looks that something similar applies to your second question: There is no built-in mark function accessible through mapleader; I think you mean a plugin that has to be installed separately (or copied from another system's ~/.vim/ folder).

How can I disable scratch preview window?

While coding Python, I like Vim's omnicompletion function, but I don't want Scratch Window to pop up at top.
How can I disable it?
(I'm using gVim 7.3)
This behavior is defined by the presence of preview in the value of the 'completeopt' option.
The default value is:
menu,preview
To remove preview, simply add this line to your ~/.vimrc or modify an existing completeopt line:
set completeopt-=preview
If you don't mind the preview window too much, but want to easily close it, you can use the :pclose command or CTRL-W z keyboard combination see :help :pclose.

Using :Vexplore effectively

So, the :Vexplore command in vim opens a nice little directory browser to the left.
But how do I then open a file from that side-pane into the main window on the right?
One would assume there's a simple mapping for it, but I can't seem to find it.
I think you want o or P
Also, have a look at the documentation, e.g.
:he netrw-p11
It turns out it's just a single line in .vimrc:
let g:netrw_browse_split=4 " Open file in previous buffer
Source: http://vimcasts.org/episodes/the-file-explorer/#comment-45366660
I'm sure what you're looking for is this:
:Vexplore!
This is the same command you would use to navigate to different windows in Vim (like quickfix window, or different split), everything is explained in
:help windows.txt
But to answer to your question directly:
CTRLwCTRLh to move to the left window
CTRLwCTRLl to move to the right window
then Enter to select the file you want to open.
You might want to read :help netrw as well
The latest netrw plugin (up to v153f) now provides the :Lexplore command, which opens an explorer on the right hand side of the vim display. It sets g:netrw_chgwin so edits occur in the window to the right of the netrw window. You can get it from http://www.drchip.org/astronaut/vim/index.html#NETRW .

Resources