Loading a 4 GB file with qemacs takes less than 1 second. However jumping to the end of the file takes 1 minute. I thought at the begging that there would be some lazy loading behind the scenes, but not. The data is in memory, however going through the buffer is very very slow. I made some local optimizations, but there would be much much to much work to make such operations faster than with vim.
Viq was intentended to be a project to add vim like interface to qemacs…
My obsession for speed will probably make me abandon my favorite tool vim. Instead I will go back to emacs. Hm.. I mean not really to emacs, but qemacs. I mean not really qemacs, but qvi. That is qemacs with vim like bindings. But qvi does not sound very friendly, so what about viq, spelled WIK, like wiki.
Vim 7.2 for windows mobile is available at:
mobiphil.com/vim.exe
This version still needs a lot of cleanup, just uploaded for “demo” reason.
Among other problems the environment variables are hardcoded:
HOME = /SDMMC/MySystem/home
VIM = /SDMMC/MySystem/Programms/Vim
VIMRUNTIME = /SDMMC/MySystem/Programms/Vim
PATH= /SDMMC/MySystem/Programms/Vim
However it is stated on the homepage of wikipediafs that the project is not maintained, it works! The only one change one has to make is:
user.py:56: self.login_page = “%s?title=Special:Userlogin” % self.basename
into
user.py:56: self.login_page = “%s?title=Special:UserLogin” % self.basename
(note the change from Userlogin to UserLogin)…
and now it is straightforward and easy to edit the wiki with vim… I will write probably a plugin to jump to links automatically. I wish one day there will be fuse fore wince
and I will be able to edit wikis with vim on mobile
Please note that wikipediafs is a userspace filesystem and is mounted with help of http://fuse.sourceforge.net.
Vim 7.2 is running full screen on windows mobile. Screeshots and exe comming soon, stay tuned. Plannning soon to put some structured info on http://mobiphil.com/vimowiki
I just discovered that there is an ongoing porting activity of vim to qt. That should run on qtmoko… diid not try yet… It is on my agenda…
I created a wiki where I will try to collect information about issues/success stories/problems building vim for windows mobile:
http://mobiphil.com/vimowiki
your help is welcome!
I am sure there are people who thought about writing a new vim in c++ (vim++ sounds good?, isn’t it?), where features could be added much easier through some plugin mechanism. I love the philosophy of vim, but its evolution is limited as it is now…
Imagine the buffers for example would be some polymorphic stuff, or some template magic where one would provide some interfaces, and beside some default imlementations one could implement that interface to read a file from disk, iterate through a huge resultset of a database… etc. Imagine you could plugin a search engine, that would be complementary to the existing one. Indeed lot of stuff can be done through scripting, but the scripts have their limitations…
So imagine a nicelly designed editor, that would be far from an overdesigned eclipse, would still keep simplicity as it’s feature no 1.
I am a <search everywhere> obsessed with vim. However I miss a lot the feature to be able to (incremental) search in lists exactly as one searches in windows. Such lists are useful concepts in vim, mainly as they are similar to modal dialogs as you do not want to see them all the time, just when you need them.
:messages
:map
:ll
Usecase1… in my daily work it is always interesting to go back to old messages… I have a keyboard shortcut for the messages list (ctrl _lm)… but here the story ends. What I would love to do is to be able to search in this list.
Usecase2… MRU. I know there are lot of MRU implementations, but all of them they open a window and they destroy the layout of the windows… however what I think would be clever is to have a list with MRU shown, incremental search in it, enter, list is closed, and open file in the latest window as a new buffer… Similar way it would be powerfull to search in a loaded tags list, or why not, imagine a concatenated source file with all your source code. In such a buffer of concatenated files, you could incrementally search (I am using it often, but opened in a window), and once you identified the correct line, enter, and the file that represents that part of the concatenation would be opened on your last window.
Custom lists would be very interesting, and some commands to read a list from a file (elements of the list would be obviously the lines).
Another maybe exaggerated idea would be a feature to search inside completion lists… I press ctrlx f/i, thousands of files listed, or items listed, would be nice to have a shortcut that would bring me into incremental search mode, and select faster the item I am interested in…
I am using vim to edit/view large files (> 600MB). Unfortunately, it looks like opening such large files even on a Pentium 3.4Ghz with PATA disk takes quite some time (17sec)(ubuntu, kernel 2.6.22-14). I know that vim
creates some internal tree representation of the file, but I wonder if something could be tuned, so that such loading times decrease, even if memory usage would increase.
I tried to open a 767.187.800 bytes file (I created this file by cat-ing all vim src files 100 times ) :
time vim -u ./.vimrc –noplugin -c”:q” ../all3.c
the result is:
real 0m17.670s
user 0m15.457s
sys 0m1.428s
the .vimrc contains only
set noswapfile
I profiled vim, and opening the same file I got the results below….
So the question would be, is it possible to tune sthg. to open faster
these files??
here is the gprof head
XXXXX$ head -40 no_swap
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
46.12 1.96 1.96 1 1.96 4.22 readfile
23.53 2.96 1.00 31025600 0.00 0.00 ml_append_int
12.94 3.51 0.55 31025601 0.00 0.00 ml_updatechunk
8.24 3.86 0.35 31361959 0.00 0.00 ml_find_line
4.94 4.07 0.21 31025600 0.00 0.00 ml_append
0.47 4.09 0.02 1876672 0.00 0.00 mf_put
0.47 4.11 0.02 1655954 0.00 0.00 mf_find_hash
0.47 4.13 0.02 1655954 0.00 0.00 mf_get
opening the same file with grep or with the script below takes on the same machine around 0.25 seconds
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char ** argv)
{
if(argc < 1) {
printf(”file name not provided..\n”);
return -1;
}
int fd = open(argv[1], O_RDONLY);
if(fd < 0) {
printf(”cannot open file %s”, argv[1]);
return -1;
}
int chunk_size = 1000;
if(argc > 2) {
chunk_size = atoi(argv[2]);
}
char *buffer = (char * )malloc(chunk_size);
int res, count = 0;
while( (res = read(fd, buffer, chunk_size) ) > 0) {
count ++;
}
printf(”total read %d*%d=%d”, count, chunk_size, count*chunk_size);
}