5/24/2023 0 Comments Vim supertab jk instead of arrowsWith supertab's longest match enhancement disabled, typing B while still in the completion mode will end up completing 'FooBarBaz' or 'FooBarFoo' depending your settings, instead of the next longest common match of 'FooBar'. Vim's builtin longest support will complete the longest common text 'Foo' and offer 'FooBarFoo', 'FooBar', 'Foo', and 'FooBarBaz' as possible completions. The documentation continues with this example where your buffer has the following contents: FooBarFoo Supertab will provide an enhanced longest match support where typing one or more letters and hitting tab again while in a completion mode will complete the longest common match using the new text in the buffer. then according to :h g:SuperTabLongestEnhanced. If you enable it with :let g:SuperTabLongestEnhanced = 1 In the Supertab docs there's a global configuration variable that seems related: g:SuperTabLongestEnhanced. I don't use Supertab but that sounds similar to Vim's 'wildmode' setting "longest". Here, I expect it to again complete to the longest word FooBar and show valid suggestions. Now I type FooB and it starts scrolling and autocompletes to one of the suggestions. inserting a Tab character) useful, probably because this is a common function in many IDEs and other editors. It's just that many users find the overloaded behavior of the Tab key (complete vs. This is done so you dont have to move from the major key area of the keyboard. With set completeopt=longest,menu,noselect, it autocompletes to Foo and show the menu with the remaining suggestions. Supertab indeed uses the same built-in insert-mode completion as / (or variations thereof like omnicompletion, depending on the configuration). By default, vi/vim is programmed to replace arrow keys with the keys h, j, k, l.The behaviour I expect is to show a menu only for showing suggestions, no scrolling. Another tab starts scrolling through the menu. The one below allows it for just the first tab. The behaviour would be similar to: set completeopt=longestīut with a menu only for previewing the suggestions. You keep typing and pressing tab until you get the required word. In the end, the behaviour would be same as how bash works. ![]() ![]() Is it possible to prevent replacing the text under the cursor, maybe my preventing scrolling even if I press tab multiple times. The plugins I'm using don't override each other: ls ~/.When I press tab for autocompletion (with the supertab plugin, but its applicable with vim's autocomplete feature as well), the selection scrolls from the bottom-most selection towards top with the selection text being replaced under the cursor. Personally, after gaining some general familiarity with vim, I disabled the arrow keys for a while to get the hang of hjkl and reenabled them later to simplify my. I found this report of some people experiencing the same behavior, while others saying it works for them. People new to vim are used to using the arrow keys to move around and so don't learn hjkl, thus not getting the chance to see if this is preferable. In theory, if both plugins are installed SuperTab should handle Jedi seamlessly, but that's not my case. That is, if I use TAB, I get SuperTab's completion (autocomplete what I have previously written) whereas if I use CTRL + SPACE I get Jedi's completion (everything from libs: classes, modules, etc). I installed both plugins using Pathogen, but they don't work together as it should be.
0 Comments
Leave a Reply. |