1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-01-19 04:20:47 +00:00
vlfi/README.org

107 lines
3.4 KiB
Org Mode
Raw Normal View History

2013-04-13 23:10:47 +03:00
* View Large Files Improved
2013-04-14 19:55:39 +03:00
An Emacs mode that allows viewing, editing and searching in large
files in chunks. Batch size can be adjusted on the fly and bounds the
memory that is to be used for operations on the file.
2013-02-02 16:12:30 +02:00
2013-04-16 15:56:10 +03:00
This mode builds on the bare bones GNU ELPA vlf.el. It adds the
following improvements:
2013-04-14 19:55:39 +03:00
- proper dealing with Unicode
2013-04-13 23:10:47 +03:00
- regular expression search on whole file (in constant memory
determined by current batch size)
- chunk editing (if size has changed, saving is done in constant
memory determined by current batch size)
2013-04-16 15:56:10 +03:00
- occur like indexing
2013-04-13 23:10:47 +03:00
- options to jump to beginning, end or arbitrary file chunk
2013-02-02 16:12:30 +02:00
- ability to jump/insert given number of batches at once
2013-04-13 23:10:47 +03:00
- newly added content is acknowledged if file has changed size
meanwhile
2013-04-14 19:55:39 +03:00
- automatic scrolling of batches
2013-04-17 12:33:04 +03:00
- VLFI is added as an option when opening large files and given dired
key-binding
GNU Emacs 23 and 24 are supported.
* Overview and tips
M-x vlfi PATH-TO-FILE
** Unicode
2013-04-17 12:33:04 +03:00
Emacs' Unicode support is leveraged so you'll not see bare bytes but
characters decoded as if file is normally opened. This holds for
2013-04-17 12:33:04 +03:00
editing, search and indexing.
2013-05-02 14:25:39 +03:00
** 32-bit GNU Emacs
2013-05-01 02:02:28 +03:00
Regular Emacs integers are used, so if you use 32-bit Emacs without
bignum support and have really huge file (with size beyond the maximum
integer value), VLFI will probably not quite work.
** Memory control
2013-04-17 12:33:04 +03:00
*vlfi-batch-size* bounds the memory used for all operations.
** Special mode
2013-04-17 13:19:37 +03:00
VLFI is derived from special-mode and keeps all its properties. For
2013-04-17 12:33:04 +03:00
example you can directly press digits to enter prefix arguments.
** Changing major mode
2013-05-01 02:02:28 +03:00
You can (temporarily) change major mode to whatever you like (for
example hexl-mode). Saving will insert contents as intended. You can
return to *vlfi-mode* too.
2013-04-17 12:33:04 +03:00
* Detail usage
** Controlling batch size
*+* and *-* control current batch size by factors of 2.
You can also set by hand local variable *vlfi-batch-size* and then
refresh with *g*.
2013-04-17 13:19:37 +03:00
** Move around
2013-04-17 12:33:04 +03:00
*M-PgUp* and *M-PgDn* move chunk by chunk. With positive prefix
argument they move prefix number of batches. With negative - append
prefix number of batches.
*[* and *]* take you to the beginning and end of file respectively.
2013-04-17 13:19:37 +03:00
*j* jumps to given chunk. To see where you are in file and how many chunks
there are (using the current batch size), look at the bracketed part
of the buffer name, batch size is also there - at the end.
2013-04-17 12:33:04 +03:00
2013-04-17 13:19:37 +03:00
** Search whole file
2013-04-17 12:33:04 +03:00
*s* and *r* search forward and backward respectively over the whole
2013-04-17 13:19:37 +03:00
file. This is done chunk by chunk so if you have really huge file -
you'd better set somewhat bigger batch size beforehand.
2013-04-17 12:33:04 +03:00
2013-05-01 02:02:28 +03:00
** Occur over whole file
*o* builds index for given regular expression just like occur-mode.
It does this chunk by chunk over the whole file. Note that even if
you prematurely stop it with *C-g*, it will still show index of what's
found so far.
2013-05-02 14:25:39 +03:00
** Jump to line
*l* jumps to given line in file. This is done by searching from the
beginning, so again the bigger current batch size, the quicker. With
negative argument, lines are counted from the end of file.
2013-04-17 13:19:37 +03:00
** Edit
2013-04-17 12:33:04 +03:00
2013-04-17 13:19:37 +03:00
*e* enters VLFI in edit mode. If editing doesn't change size of
2013-04-17 12:33:04 +03:00
the chunk, only this chunk is saved. Otherwise the remaining part of
the file is adjusted chunk by chunk, so again you'd better have bigger
current batch size. If chunk has been expanded the memory used is
2013-05-01 02:02:28 +03:00
#+BEGIN_EXAMPLE
(batch size + difference to the original chunk size) x 2
#+END_EXAMPLE