Thursday, November 28, 2013

Re: vim slow, Lisp, etc.

Excerpts from Ed Kostas's message of Thu Nov 28 11:39:02 +0100 2013:
> I am helping a lawyer office in (a difficult) trying Vi(m), and have a
> few questions. The fact is that Vim seems to be very slow compared to
> Emacs. Let me elaborate on that.
How to find out why Vim is slow?

1) :syn off
=> is it fast again?

Make sure you're using most recent Vim, because regex engine got
replaced by one which is faster.

There are look aheads and synmaxcol settings or such which can be used

If this all does not help you can try writing a simpler syntax file
for latex, or ask somebody to do so. (I'd be interested in providing
an offer ..)

2) vim without plugin/ no syntax, no vimrc:
vim -u NONE -U NONE -N "$@"
is it fast again?

If this all does not work (unlikely) there is a serious issue.

> It seems that Vim outline did not work as well as Emacs Org-mode.
Which features do you expect form outline? I've written some
"alternative" regex based outline code which is similar to ttoc (which I
also recommend looking at) which is using grep for displaying lines
matching patterns, such as \subsection{}

> lawyers complain that it takes forever to close or open the
> paragraphs.
> Latex sources seems to be much slower in Vim, and often freezes Vim.
> In fact, I noticed that Vim becomes so slow that people types faster
> than Vim deals with the syntax coloring. First question: How to make
> Vim faster?
If you want things to be fixed you have to supply a sample file.
If you have to anonymisize your text you can pretty simple replace all
characters by x using such (fill in all keywords for latex or such):

%s/\(section\|subsection\)\@<!\([a-zA-Z]\+\)/\=repeat('x', len(submatch(2)))/g

> It does not have schedules, calendars, deadlines, etc.
Its known. Vim is not a kitchen sink. [1]
Try this instead: http://taskwarrior.org
It allows using Vim as editor. That should come close, also has web
frontend etc. Vim is the wrong tool, don't try to make it behave like a
calendar. Its nice for keeping memos, though. (IMHO)


> 2- Lawyers often make search by meaning.
There are programs, in elisp, that analize the text, and perform a fuzzy
search.
There is agrep or such. If that's not enough, wait for better replies or
stick to Emacs (sorry having to say this). Learn about evil extension
for Emacs.

Second question: How to switch from vimscript to Lisp? Any
dialect if Lisp will do.
:h if_mzsch.txt
You need to compile Vim with racket. Again, see [1]

> Vim accepts scripting in almost any language: Python, Ruby, and Racket.
Well, yes. But the interfaces to scripting languages have different
quality. Something may be available in to one
- threads
- accessing buffer lines
- ?
which is not in ruby/python or the like.

> 3- It seems that there is a Vi clone that does everything these
> lawyers want. It is fast in dealing with large Latex sources, it has
> an org-mode that works like emacs, etc. etc. It is called Evil. Third
> question: What am I loosing if I work with Evil?
No way replying to this question withou analysing your workflow.
Bram once said: Watch yourself, have a look at what you spend most time,
try to optimize that only. If you create such a list talking about what
lawyers (you know) spend most times on a program can optimize I'd be
more than happy to provide an offer to implement those features ..

> Please, I am not a programmer expert. In fact, I know very little
> about programming, and almost nothing about Vim and other Vi-clones.
> People says that Vim is better than Emacs,
Pepole say much. One thing is true:
Vim/Emacs have been around for 20-30+, they are will known in the linux
community for ages, so both have many batteries included. Both have
their particular strength. This email is not enough to start talking
about differences. You've already experienced some yourself.

The key difference has been "modal editing", but nowadays Emacs has
evil, so the difference is gets smaller.

VimL is "easier" to use than lisp, but also slower and less powerful.
Emacs provides great async support, for Vim only hacks exist.
Using Emacs you can get RSI faster (eventually) unless you use God-mode
like extensions - because in Emacs you use c- or m- combinations
more often (?). But you can create your own mappings and so on.

> Vim, etc. Therefore my friends decided to give Vim a chance. Audiatur
> et altera pars, lawyers say. In the context, it means: If there is a
> claim that Vim is better than Emacs, you should try Vim, before
> dismissing the claim.
Great idea. In the "Editor case" trying it takes years.
I guess Wikipedia has a list of editors which you might try.
Use the right tool for a job, thus determine the job, then try to find
the perfect tool.

> Therefore give examples, and explain how to
> install everything that need to be installed in order to make Vim
> faster.

In the end you do business, thus try both: Emacs/Vim, determine which
features each is missing, then ask both communities again about how to
solve .. and then you can make a decision about which tool is better for
your particular use case.

Lawyers also have to type much text, thus learning about tools such as
"plover steno knight" could be useful, too. Thus learning such system
can make you faster than spending month on any editor, depending on
yourc use case.

[1]: I'm trying to understand whether its worth at least allowing the
community to implement kitchen sinks by determining what to fix to
create a kickstarter project. Thus add feature requests here:
http://vim-wiki.mawercer.de/wiki/topic/in-which-way-does-vim-suck.html

Marc Weber

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: