Can't write <word>.<word> while using eclim - vim

When i try to write import org.junit.Test, just when I have completed writing import.jun it converts(auto-completes) it to import org.jun=acp#onPopupPost().
Is it some eclim autocomplete feature which is misbehaving or something else? I only face this issue when I am inside a project opened via eclim. Other wise there is no issue.

Looks like you have a problem with the AutoComplPop plugin; part of its mapping is inserted literally. I'm using the plugin myself, but haven't seen that issue. It may be interference with another plugin; have you done any updates to other plugins recently?! If you can reproduce the problem with a clean .vimrc and no other plugins loaded, submit an issue to the author.
To temporarily disable the plugin (without uninstalling), put the following into your ~/.vimrc:
let g:loaded_acp = 1

Related

VSCode Vim multiple cursors

I have looked everywhere and I am still unable to switch off this 'feature'!
I've been using vi and, later, vim, since the 80's and I have never had need of multiple cursors, nor can I see a use for them.
:<range>s/search/replace/ does everything I need so this new feature is infuriating beyond words, especially as I've no idea how to switch it off when it seemingly-randomly appears.
Would someone be wonderful enough as to tell me how to banish, remove, consign-to-history the multiple cursors feature in VSCode Vim 1.12.4, please?
I believe this issue is specific to the plugin. I experienced it with the HTML plugin recently, and I'm assuming you have the same problem with HTML files, but the same principle should apply to other plugins as well. You just have to find the setting.
In the VS Code settings, there is an option that reads:
HTML: Mirror Cursor On Matching Tag
You can uncheck the box there to disable the feature. Or you can go to the settings.json in your local repo (inside the .vscode directory), or the equivalent global file, and add/modify the following field like so:
"html.mirrorCursorOnMatchingTag": false
That should take care of it for you.

snippet in vim - any option to go back to the previous parameter?

I am using neocomplcache along with neosnippet and honza's vim-snippets. They are great, except that when I press Ctrl-k, I can go to the next parameter, but I have no way to go back to the previous parameter.
So for example, if I inserted 'for' snippet and made a typo on the index variable, but I already pressed Ctrl-k, am I screwed? Must I go through modifications of all the parameters and then come back to do replace operation? Or is there mapping for select mode that I can help me in this situation? Currently Tab and S-Tab do not do anything.
Lastly, are all snippet plugins like this? Or is neocomplcache just missing this feature (out of the box, at least)?
I encourage you to try UltiSnips. It is much more powerful and mature than vim-snippets or neosnippet. For instance, since UltiSnips is based on Python, it is very extensible. Concerning your problem: yes, you can jump back and forth with UltiSnips. Finally, be sure to check out screencasts (listed in the link) to see all the fancy stuff you can do with it.
For example, I use the following configuration:
let g:UltiSnipsSnippetsDir = '~/.vim/snippets/'
let g:UltiSnipsSnippetDirectories = ['UltiSnips', 'snippets']
let g:UltiSnipsExpandTrigger = '<C-CR>'
let g:UltiSnipsJumpForwardTrigger = '<A-d>'
let g:UltiSnipsJumpBackwardTrigger = '<A-a>'
NOTE: ~/.vim/snippets/ is my directory for custom snippets.
As I've already mentioned UltiSnips uses Python extensively, and therefore requires Vim to be built with Python support. If you are on Windows (especially x64), that might be a trouble, the one I've run into quite some time ago. To save yourself precious time and avoid frustration you may consider downloading my Vim for Windows. Both x86 and x64 architectures are provided, and it supports both Python 2 and Python 3 simultaneously. I can assure you that it is stable. To install properly just follow the instructions. These builds are updated frequently.
The original SnipMate and its fork (the plugins for which vim-snippets is actually meant to be) both allow you to go back to the previous placeholder with <S-Tab>. I believe UltiSnips does too.
Neocomplcache doesn't support snippet expansion out of the box anymore. AFAIK, you need another plugin by the same author called neosnippet which is the one responsible for the <C-k> mapping. A quick look at the doc shows no "reverse jump" mapping, function or command. You can probably create a new issue on neosnippet's Github page.

Adding vim snippets

I have found this resource for Ruby/Rails snippets, seems like it has lots of cool snippets that I could use with vim.
But since I'm new to vim, I don't know how to enable those snippets to my vim editor. There is no instruction manual as such.
How can I get these kind of snippets enabled in the vim editor?
Those snippets are for the snipMate - TextMate-style snippets for Vim plugin. You need to install it first.
Note that though this plugin isn't maintained any more, it's still working fine (and probably will continue to do so, due to Vim's great record of backwards compatibility), and is still used by many people (me included). There's a renewed fork available, though: garbas/vim-snipmate. A newer, more powerful plugin is UltiSnips - The ultimate snippet solution for python enabled Vim, which can convert the old snipMate snippets into its format. So, there's a lot of choice.
About Snippet Plugin in Vim
I recommend the plugin Neosnippets: https://github.com/Shougo/neosnippet This is the best in my opinion.
Step 1: Install plugin. Recommend using Pathogen to install
step 2: Download/clone a snippet repo you like to local machine, or create your own(recommeneded)
Step 3: Set the path of above repo as Neosnippets's snippets folder in vimrc
let g:neosnippet#snippets_directory='~/path/to/above/snippets/'
Step 4: Customize more if you like, according to the help file.
For the repo you mentioned
I checked it.
One problem is it's out of date, many Rails code are several years ago. They are of little use now.
The other problem is the format is not compatible with NeoSnippet. You can check :help neosnippet-snippet-syntax for how to write snippets for NeoSnippets. It's simple while easy to use.

Strange issue in vim, code not updating

I have been using my Vim setup for quite some time now, but all of a sudden the saving of code does not update the code. I use FuzzyFinder for browsing files.
Opening a file normally, i.e. as Vim from console doesnt seem to give problems.
But when I open a file through FuzzyFinder it shows the old code without changes.
However, opening it through a other editor (or without the plugin) or doing git diff shows the changes.
Is it some problem caused by Git, a bug in the plugin, or maybe a cache issue?
Do you try use :edit!? I think problem is buffer. Vim have buffered file and don't reload it, when you open it via Fuzzy Finder.
Have you tried setting the autoread option in your .vimrc? It should force a reload after changes have been made.
From its help page:
When a file has been detected to have been changed outside of Vim and
it has not been changed inside of Vim, automatically read it again.
When the file has been deleted this is not done.

SuperTab Plugin doesn't work together with the omnicomplete feature (<C-X><C-O>)

I am using VIM to code PHP. I also have indexed my project folder with ctags. It works pretty well with omnicompletion, so when I type for example $someObject-><C-X><C-O> it shows all methods of the object.
I am working with the SuperTab plugin too though, and when this plugin is active, I cannot hit anymore. Nothing happens, only below in the status bar INSERT becomes (insert).
Does anyone have an idea why doesn't work with SuperTab?
Ok, an update to the newest version of SuperTab (0.51) helped solve the problem

Resources