Re: Aha: vim trainer mode
I must warn you when you reach level 2, you need to buy a license =( So I checked for a while and would recommend those: Vim casts: http://vimcasts.org/ Learning and memorizing shortcuts: https://www.shortcutfoo.com/app/tutorial/vim More resources here: http://stackoverflow.com/questions/7579213/is-there-an-interactive-way-to-learn-vim On Fri, Aug 8, 2014 at 10:02 PM, Kent Tenney kten...@gmail.com wrote: On Fri, Aug 8, 2014 at 12:19 PM, Edward K. Ream edream...@gmail.com wrote: On Fri, Aug 8, 2014 at 9:36 AM, Edward K. Ream edream...@gmail.com wrote: vim-training mode will disable the operation of all arrow keys, [except] Alt-arrow keys Recent revs implement vim-trainer. OMG, vim-trainer is *intense*. Here are some notes: 1. vim-trainer *instantly* changed how I use vim mode. jj becomes necessary, and pretty much second nature. 2. I have not found a way to disable mouse clicks in the body pane. One would think it would be possible in LeoQTBaseTextWidget.mouseReleaseEvent, which does receive all mouse clicks in the body. But maybe disabling clicks is a bad idea. Lol. The workaround is just to move the mouse far away, which seems good enough. Why disable mouse? I often mix in some mouse when using vim. 3. I had no idea I was using the arrow keys so much. Ditto for Home, End, Ctrl-P, Ctrl-V, Ctrl-X and a few others. At present, vim-trainer mode does not disable these keys. It would be easy to do, but I'm stressed enough as it is :-) 4. Without these cursor motion keys, the corresponding vim commands become absolutely essential. This has revealed problems: - $ sucks. This is one of the most difficult keys to type. Yeah, I don't use it - 0 and ^ seem backwards: typing 0 is much easier than typing ^, so I would prefer that 0 be the smart-home key. Maybe I've gotten these commands backwards... I - You could say that backspace and esc are on the keyboard, but I find them both difficult to type. That's why jj is useful. - Del is worse: on my keyboard it is farther than any arrow key... almost forgot 'x' for delete I'll investigate whether there are easy alternatives to backspace and del. Hmm. One way is visual mode: v{motion keys}d. = Summary vim-trainer is a big success: it *instantly* changed how I use vim mode. vim-trainer still allows Home, End, Ctrl-P, Ctrl-V, and Ctrl-X. For now, disabling them would cause my head to explode. These keys will be disabled when vim-mode has good alternatives. I'll play the vim adventures game to discover which vim commands should be added sooner rather than later. Having said that, I would rate the odds of me converting to vim at less than 50%. Otoh, I am pretty sure that committed vim users are going to fee comfortable with Leo's vim-mode. Edward -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Aha: vim trainer mode
Sorry again, but the shortcutfoo website also asks for money when you reach certain level :( Seems like best solution right now is vim-trainer mode :D -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Weird autocompleter bug
On Fri, Aug 8, 2014 at 10:00 AM, Fidel N fidelpe...@gmail.com wrote: well ill wait till c. completes well then try to find out the difference, but I really trust when the other thing is fixed this also will. I'll attempt a fix today. Edward -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Weird autocompleter bug
On Sat, Aug 9, 2014 at 8:24 AM, Edward K. Ream edream...@gmail.com wrote: I'll attempt a fix today. I inserted a trace in AutoCompleterClass.get_leo_namespace:: def get_leo_namespace (self,prefix): ''' Return an environment in which to evaluate prefix. Add some common standard library modules as needed. ''' trace = True and not g.unitTesting k = self.k d = {'c':k.c, 'p':k.c.p, 'g':g} aList = prefix.split('.') if len(aList) 1: name = aList[0] m = sys.modules.get(name) if m: d[name]= m if trace: g.trace('prefix',prefix,'aList',aList) for key in sorted(d.keys()): g.trace(key,d.get(key)) return Here is what it reported (minus the leading method name):: prefix c. aList [u'c', u''] c module 'c' from '...\leo\plugins\importers\c.pyc' g module 'leo.core.leoGlobals' from '...\leo\core\leoGlobals.pyc' p pos 168544912 childIndex: 5 lvl: 0 key: 118966416:5 autocompleter test So now it's clear what is happening: the module defined in leo/plugins/importers/c.py is polluting the global namespace. That is, it is entered into sys.modules as c rather than leo.plugins.importers.c. You would think it would be easy to change that, but as I recall there is a problem with rst.py. It, at least, must be entered bare, or docutils will barf. Big sigh. I think Leo must special case rst.py. Btw, there is already a special case for docutils, the importer is leo.plugins.importers.leo_rst. I'll have to think about this... Edward -- Edward K. Ream: edream...@gmail.com Leo: http://leoeditor.com/ Speak the truth, but not to punish--Thich Nhat Hanh -- -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Weird autocompleter bug
On Sat, Aug 9, 2014 at 11:10 AM, Edward K. Ream edream...@gmail.com wrote: Ach. I see why the git bisect was so dashed confusing. The commit that caused the problems changed *two* files, leoAtFile.py and leoImport.py. Somehow, I didn't see the change to leoImport.py, but now, from first principles, it's clear that it was the change to ic.createImporterData that caused the problem, *not* the change to at.createWritersData. So the mystery of my rollback of leoAtFile.py didn't solve the problem is completely explained. Still, some care will be required. I'll fix this later today... Edward -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Weird autocompleter bug
On Sat, Aug 9, 2014 at 11:19 AM, Edward K. Ream edream...@gmail.com wrote: So the mystery of my rollback of leoAtFile.py didn't solve the problem is completely explained. Still, some care will be required. I'll fix this later today... Fixed. Maybe. Here is the checkin log for rev 90a0531... QQQ Revert to old code that imports plugins/writers and plugins/importers using importlib.import_module. This causes autocompleters for c.whatever to work. All tests pass, pylint is happy, and the writers and importers appear to work, but I have the feeling I am missing something... QQQ I should have said also that docutils appears to work. So I have tried every test that comes to mind, but I have the feeling there could be problems. After all, there may have been a reason for the change to the code. Heh, heh. Otoh, as part of the new commit, I improved the tests for duplicate classes: no warning is given if the old and new entries in ic.atAutoDict are the same. This is expected because Leo reads some .leo files twice. Maybe what happened is that I was overly worried about the messages and went to too-extreme lengths to avoid them. In short, the new code is an experiment. Please report your experience, for good or ill... Edward -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.