2013-08-06 02:02:02 +03:00
|
|
|
* View Large Files
|
2013-01-12 17:05:25 +02:00
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
Emacs minor mode that allows viewing, editing and searching large
|
|
|
|
files in batches. 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-08-06 02:02:02 +03:00
|
|
|
This is development version of the GNU ELPA [[http://elpa.gnu.org/packages/vlf][vlf.el]] package. Here's
|
|
|
|
what it does in a nutshell:
|
2013-04-14 19:55:39 +03:00
|
|
|
|
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-12-11 03:21:08 +02:00
|
|
|
- as VLF is minor mode, font locking and functionality of the
|
|
|
|
respective major mode is also present
|
2013-08-25 17:57:43 +03:00
|
|
|
- VLF is added as an option when opening large files
|
2013-04-17 12:33:04 +03:00
|
|
|
|
|
|
|
GNU Emacs 23 and 24 are supported.
|
|
|
|
|
|
|
|
* Overview and tips
|
|
|
|
|
2013-08-25 17:57:43 +03:00
|
|
|
M-x vlf PATH-TO-FILE
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-04-17 13:11:40 +03:00
|
|
|
** Unicode
|
|
|
|
|
2013-04-17 12:33:04 +03:00
|
|
|
Emacs' Unicode support is leveraged so you'll not see bare bytes but
|
2013-04-17 13:11:40 +03:00
|
|
|
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-04-17 13:11:40 +03:00
|
|
|
|
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
|
2013-08-25 17:57:43 +03:00
|
|
|
integer value), VLF will probably not quite work.
|
2013-04-17 13:11:40 +03:00
|
|
|
|
|
|
|
** Memory control
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-08-25 17:57:43 +03:00
|
|
|
*vlf-batch-size* bounds the memory used for all operations.
|
2013-04-17 12:33:04 +03:00
|
|
|
|
|
|
|
* Detail usage
|
|
|
|
|
2013-12-11 03:21:08 +02:00
|
|
|
** Applicability
|
|
|
|
|
|
|
|
You can control when vlf-mode is invoked or offered as choice with the
|
|
|
|
*vlf-application* customization option. By default it will offer VLF
|
|
|
|
when opening large files. There are also options to never use it (you
|
|
|
|
can still call *vlf* command explicitly); to use it without asking for
|
|
|
|
large files or to invoke it on all files. Here's example setup such
|
|
|
|
that vlf-mode automatically launches for large files:
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
(custom-set-variables
|
|
|
|
'(vlf-application 'dont-ask))
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
|
|
|
** Keymap
|
|
|
|
|
|
|
|
All VLF operations are grouped under the *C-c C-v* prefix by default.
|
|
|
|
Here's example how to add another prefix (*C-x v*):
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
(eval-after-load "vlf"
|
|
|
|
'(define-key vlf-prefix-map "\C-xv" vlf-mode-map))
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
2013-08-06 02:02:02 +03:00
|
|
|
** Control batch size
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
*C-c C-v +* and *C-c C-v -* control current batch size by factors
|
|
|
|
of 2.
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-08-25 17:57:43 +03:00
|
|
|
You can also set by hand local variable *vlf-batch-size* and then
|
2013-12-03 02:54:33 +02:00
|
|
|
refresh with *C-c C-v g*.
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-04-17 13:19:37 +03:00
|
|
|
** Move around
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-12-11 03:21:08 +02:00
|
|
|
*C-c C-v n* and *C-c C-v p* move batch by batch. With positive
|
2013-12-03 02:54:33 +02:00
|
|
|
prefix argument they move prefix number of batches. With negative -
|
|
|
|
append prefix number of batches.
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-12-11 03:21:08 +02:00
|
|
|
*C-c C-v SPC* displays batch starting from current point.
|
2013-12-07 20:18:07 +02:00
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
*C-c C-v [* and *C-c C-v ]* take you to the beginning and end of file
|
|
|
|
respectively.
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
*C-c C-v 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
|
2013-12-04 14:00:24 +02:00
|
|
|
parenthesized part of the buffer name, batch size is also indicated 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
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
*C-c C-v s* and *C-c C-v r* search forward and backward respectively
|
|
|
|
over the whole file. This is done batch by batch 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
|
|
|
|
|
2013-12-04 14:00:24 +02:00
|
|
|
*C-c C-v o* builds index for given regular expression just like
|
|
|
|
*M-x occur*. It does this batch by batch 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-01 02:02:28 +03:00
|
|
|
|
2013-05-02 14:25:39 +03:00
|
|
|
** Jump to line
|
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
*C-c C-v 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-05-02 14:25:39 +03:00
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
** Edit and save
|
2013-04-17 12:33:04 +03:00
|
|
|
|
2013-12-03 02:54:33 +02:00
|
|
|
If editing doesn't change size of the chunk, only this chunk is saved.
|
|
|
|
Otherwise the remaining part of the file is adjusted batch by batch,
|
|
|
|
so again you'd better have bigger current batch size.
|