Sunday, February 8, 2009

Vim|Vamshi's notes on using Vi IMproved

Vamshi's notes on using Vi IMproved

 #####################################
# Modified ; 10-03/2005, 5:50p
#####################################
Here are some of the vim commands which I find useful and use on a regular
basis. These are ordered based on how I discovered them (some I have
organized).



This document lists only advanced vim commands. So it will be really useful if
you know the basics of vi or vim, although its not required. Learning vim as an
extension of vi in general is not so helpful. Vim is far too big to learn
quickly and even to learn slowly. So the best way would be to learn it a bit at
a time and getting comfortable with it. Since you have gotten this far :), it is
very much possible. My 2 cents......



You can use the "Contents" section LINKS below to get around in this file.

##########################
# vim settings
##########################
":set mouse=a" to enable vim mouse support


######################
#***** Contents *****#
######################
* VIM7 - New Features
* Some_Useful_Shortcuts
* Pattern_Search_Commands
* Pattern_Search_and_replace_Commands
* Editing_Cleverly
* Getting Around Fast
* Formatting_Text
* Auto-indenting_commands
* A_useful_printing_option
* Inserting in the Standard Output
* Copying and Moving Text
* Substituting Text ....same as Patt....needs to be merged
* Selecting Text (Visual Mode)
* Comment Strings
* Folding_Lines
* Windowing
* Vimdiff_and_diff
* Ctags and Vim
* Make Compilations and Error Viewing
* Encryption
* Editing Remote Files
* Auto-Completion mode
* Using Macros
* Operating commands over several files, windows or buffers
* File characters info and status line settings
* Tabs and Spaces
* Use sessions to save state of work
* Register Contents : Useful insertions of work
* Helpfiles: local plugins
* Tracking and tracing your vim settings
* Numbering lines in a file


###########################
# VIM7 - New Features! #
###########################
Highlight Matched Pairs!
* On by default
':NoMatchParen' to turn off
':DoMatchParen' to turn on
Cursor line and more...
* You can turn on cursor line and cursor columns
':set cursorline'
':set cursorcolumn'



###########################
# Some_Useful_Shortcuts #
###########################

Accessing Command/Search history
* Pressing 'q:' or ':' gives the command history window (list of
previously executed commands in the current session)

* Pressing 'q/' or '/' gives the command history window (list of
previously executed commands in the current session)

* In both the above windows, you can scroll, search (use '/') and edit already typed commands/searches to make new ones.
* Close those windows by pressing
* ':q' closes window and places you back in the main window
* '' executes the command under the cursor and places you back in the main window.
It works both in insert and normal mode of the command/search window.
* '' closes the command/search window and allows you to go back to the command line.
* Insert Mode to Command Line (single operation) bypassing Normal Mode and back - While in Insert Mode press ''
and then use ':' or '/' to perform the respective operations.

* Insert Mode to Normal Mode (single operation) without using '' - While in Insert Mode press ''
and then use the Normal Mode key sequence (can do it only once, after which you are switched back to Insert Mode).

* Pressing Ctrl-p and Ctrl-n allows scrolling previous commands at the ':' prompt.

* 'ga' or ':as[cii]' on a single character will print its decimal/octal/hex values

* 'CTRL-D' lists all the complete option at the ':' prompt

* 'CTRL-L' completes if there is only one option available
* 'CTRL-L CTRL-D' does both the above
* We can remap the key to give bash-like behavior by typing
':cnoremap '

* Pressing '~' while on a character switches the character case.

Script Setting
---------------
':%s/^/\=line('.')."\t"/g' to insert line numbers in a file

Note: to highlight special keywords we can use the match option as
':hi ctermbg=red'
':mat //'
To clear these highlights do
':mat[ch]'


#############################
# Pattern_Search_Commands #
#############################
* We can use the '*' key to search for text under the cursor in the forward
direction. This searches only whole words. If you would like to search for
any pattern (not only whole words) then use 'g*'.

* We can use the '#' key to search for text under the cursor in the reverse
direction. If you would like to search for any pattern use 'g#'.

* 'q/' gives the search history window

* '/\|' search for multiple patterns using OR '\|'

* Show lines matching word under cursor '[I'

Some Regular expression used by Vi/Vim:
---------------------------------------
'^' matches the beginning of line
'$' matches the end of line
'.' matches a single character
'*' matches 0 or more ocurrences of the preceding character
'.*' represents multiple characters till the end of line
'\<' matches the beginning of a word
'\>' matches the end of a word
'[chars]' matches the chars in the enclosed set
'[^chars]' matches the chars not in the enclosed set

* Searching for whole words can be done by using '\<' and '\>' in your search

* '/begin.*middle.*end' searches a sentence which has begin, middle, end as
keywords

Useful Settings for Pattern Search
----------------------------------
":set ignorecase" turns ignore case on
"/\c" can be used to turn on ignore case temporarily for that
particular search (the "\c" can appear anywhere in the pattern)




#########################################
# Pattern_Search_and_replace_Commands #
#########################################

Note: We can comment (# )code from lines 12 to 31 in a perl program by using
the following command
:12,31 s/^/# /
If you want to comment the next 3 lines from the current cursor position
:.,+2 s/^/# /
To uncomment we can do the following
:.,+2 s/# //
We can use the visual commands 'v' or 'V' to get the lines which we want
to comment. To do this go into visual mode by using either 'v' or 'V' and
then press ':' and type away!!!

Some 'ex' commands that can be executed in Vi:
----------------------------------------------
'g' means Global or sometime search global
'p' means print
'%' => operate on the whole file; synonym or abbrev. of 1,$
'^' means the beginning of a line
'/$/' means end of line (ie the symbol '$')
'$' in a seach expression means the last line of file
's' mean Substitute
'c' means Confirm

* typing ':g//p' searches and prints all lines containing
at the bottom of the screen

* Typing ':g!//p' searches and prints all lines not containing the
at the bottom of the screen

* ':, g//p' searches and prints lines containing
from line number to line number

* ':g//s///g' does two operations at once. It
searches for '' in the whole file (ie globally search as indicated
by the first g) and then it changes to globally on that
line.

* ':%s///g' replaces with in the entire
file ('%') without any confirmation.

Other similar patterns:
& ':s///g' replace every occurrence of
with on the current line

& ':s//' replace only the first occurrence of
with on the current line

& ':s//~' repeats the previous replace on another line

& ':&' or ':s' repeats previous substitute or replace command on the
current line (works same as the above command)

& ':40,99 s///g' replace every occurrence of
to from line 40 to line 99

& ':%s///gc' replaces every occurrence of with
while asking for confirmation at each replacement. Answer 'y' to
make the replacement and /n for no replacement.

* ':s' unconditionally repeat previous string replace or ':sc' means repeat
previous string replace with confirm

* ':1,$ s/[ ]*$//' is useful to trim blank spaces at the end of every
line

* ':%s:/dir1/dir2/dir3/file:/dir1/dir4/dir5/file1:gc' Using a another
separator ":" is useful when doing file path search and replace. This way
you don't have to escape every "/" with "\/".

Visualizing invisible characters (white space and tab):
-------------------------------------------------------
Other extra info:
'$' indicates EOL
'^I' indicates tabspace
To visualize non-printing control characters hidden in a file, do
':set list'
':set nolist' #toggles back to normal mode
To visualize on a particular line, do
':l[ist]'
':l%' visualize control characters on all lines


######################
# Editing_Cleverly
######################
Deleting
'dd' deletes an entire lines of text
'D' deletes an entire line of text without erasing the line
'dw' delete from current cursor position to the end of word including
white space
'd%' deletes by parenthesis matching. very useful in code
'd)' delete from cursor to end of sentence
'"_d' delete (using register) without destroying default buffer contents
"'_d' delete word without destroying default buffer contents

Change
'cc' change current line
'C' change a line from current cursor position to the end of line

Swap
'xp' swap char under the cursor with the next char
'dwwP' swap words (only works if there is atleast another word after the
next word
'ddp' swap current line with the next line

Shift
'9>>' shift current line and next 8 lines to right shiftwidth spaces
'9<<' shift current line and next 8 lines to left shiftwidth spaces

Join
'J' join current and next line
'9J' join current and next 8 lines
':j!' retain leading white space when joining lines
':j! 9' retain leading white spaces when joining current and next 8 lines



#########################
# Getting Around Fast #
#########################
Moving by Screens
Other than the basic commands h, j, k, l to move left, up, down, right
respectively there are other commands which help you move really fast in vim.
'ctrl-f' scroll forward one screen
'ctrl-b' scroll backward one screen
'ctrl-d' scroll forward half screen
'ctrl-u' scroll backward half screen

Moving within a Screen
'H' Move to top of screen
'M' Move to middle of screen
'L' Move to end of screen

Repositioning the Screen
'z' Move current line to top of screen
'z.' Move current line to center of screen
'z-' Move current line to bottom of screen


#####################
# Formatting_Text #
#####################
Word Wrapping for viewing
Generally Vim wraps long lines breaking them at the last character to fit
on screen. But if you would like to view a file with long lines wrapped at
words then use the following commands. This only affects teh way the file is
displayed, not its contents.
':set lbr' or ':set linebreak' wraps long lines (view only)
':set nolbr' or ':set nolinebreak' turns off word wrapping

Spacing setting, permanently Word Wrapping (add EOL in the file) & Aligning
':gq' or 'gq'
'gqgq' or 'gqq' formats the current line

':gqap' - formats the current paragraph

":ce" centers a line
":le" left justifies a line
":ri" right justifies a line

CaSe FOrmaTting
"~" swaps the cAse of a single character
"g~~" toggles the case of an entire sentence
'guu' or 'Vu' makes an entire sentence lowercase
'gUU' or 'VU' makes an entire sentence UPPERCASE
'vE~' flip case word
'vEU' upper case word
'vEu' lower case word
'ggguG' lower case entire file


#############################
# Auto-indenting_commands #
#############################
'Code auto-indenting can be turned on by doing ':set ai''
Note: If the autoindent option is on, vim uses the indent of the first line
for the following lines

'=}a' or '=a}' re-indents the current {.....} block relative to how
the {, } have been indented

General key syntax '='

'==' indents the current line according to the above

'==' indents n lines

'1G=G' re-indents the whole file

'Vjjj=' visually marks 4 lines and re-indents them

Other keywords to be explored cindent, cinkeys, cinoptions,
cinoptions-values

'>>' indents the current line

'[Visual] =' indents the current visual block


Note: If you like to see vertical indenting just like in editors like ....., do
':set list'
':set listchars=tab:\|\ ' notice the last space
or
':set lcs=tab:\|\ ' notice the last space


##############################
# A_useful_printing_option #
##############################

To create a page break which is only recognized during printing - in
Insert mode press CTRL and L. '^L; will appear in your text. This will cause
the printer to start priting on a new page from that point.

6. Inserting in the Standard Output
-----------------------------------
Normally to read in a file we use ':r '.
To execute a command and insert its standard output below the cursor, do as
':r! {cmd}'
The command can be anything like sort, ls etc


7. Copying and Moving Text
--------------------------
"{a-zA-Z0-9.%#:-"} Use register {a-zA-Z0-9.%#:-"} for next delete, yank or put
(use uppercase character to append with delete and yank) ({.%#:} only work
with put).
:reg[isters] Display the contents of all numbered and named registers.
:reg[isters] {arg} Display the contents of the numbered and named registers
that are mentioned in {arg}.
:di[splay] [arg] Same as :registers.
["x]y{motion} Yank {motion} text [into register x].
["x]yy Yank [count] lines [into register x]
["x]Y yank [count] lines [into register x] (synonym for yy).
{Visual}["x]y Yank the highlighted text [into register x] (for {Visual} see
Selecting Text).
{Visual}["x]Y Yank the highlighted lines [into register x]
:[range]y[ank] [x] Yank [range] lines [into register x].
:[range]y[ank] [x] {count} Yank {count} lines, starting with last line number
in [range] (default: current line), [into register x].
["x]p Put the text [from register x] after the cursor [count] times.
["x]P Put the text [from register x] before the cursor [count] times.
["x]gp Just like "p", but leave the cursor just after the new text.
["x]gP Just like "P", but leave the cursor just after the new text.
:[line]pu[t] [x] Put the text [from register x] after [line] (default current
line).
:[line]pu[t]! [x] Put the text [from register x] before [line] (default
current line).

7. Substituting Text
---------------------
:[range]s[ubstitute]/{pattern}/{string}/[c][e][g][p][r][i][I] [count] For each
line in [range] replace a match of {pattern} with {string}.
:[range]s[ubstitute] [c][e][g][r][i][I] [count] :[range]&[c][e][g][r][i][I]
[count] Repeat last :substitute with same search pattern and substitute
string, but without the same flags. You may add extra flags


The arguments that you can use for the substitute commands:
[c] Confirm each substitution. Vim positions the cursor on the matching
string. You can type:
'y' to substitute this match
'n' to skip this match
to skip this match
'a' to substitute this and all remaining matches {not in Vi}
'q' to quit substituting {not in Vi}
CTRL-E to scroll the screen up {not in Vi}
CTRL-Y to scroll the screen down {not in Vi}.
[e] When the search pattern fails, do not issue an error message and, in
particular, continue in maps as if no error occurred.
[g] Replace all occurrences in the line. Without this argument,
replacement occurs only for the first occurrence in each line.
[i] Ignore case for the pattern.
[I] Don't ignore case for the pattern.
[p] Print the line containing the last substitute.


################################
# Selecting Text (Visual Mode) #
################################
To select text, enter visual mode with one of the commands below, and use
motion commands to highlight the text you are interested in. Then, use some
command on the text.

'v' start Visual mode per character.
'V' start Visual mode linewise.
'' exit Visual mode without making any changes
'gv' re-select the previous visual area

The operators that can be used are:
~ switch case
d delete
c change
y yank
> shift right
< shift left ! filter through external command = filter through 'equalprg' option command
gq format lines to 'textwidth' length


################################
# Comment Strings #
################################
Comment strings can be viewed by typing ':set comments'


###################
# Folding_Lines #
###################
Folding is a very nice feature when you are viewing large coding. By pressing
"zc" we can create a fold.

foldmethod


###############
# Windowing #
###############
Vim supports multiple windows.
Windowing
':sp[lit] ' or ':sf[ind] ' or 'ctrl-w ctrl-s' or
'ctrl-w s'
Used to split the window horizontally. Note that the command line way
of splitting has an extra option which makes it more
powerful. You can search for the file according the 'wildmode' option set.

':vs[plit] ' or 'ctrl-w ctrl-v' or 'ctrl-w v'
Used to split the window veritically. Command line options are more
powerful since they allow you to specify a file name.

':clo[se][!]' or 'ctrl-w ctrl-c' or 'ctrl-w c'
Closes the current window. The ! is used to forcebly close/hide a
buffer. In the case its get closed, the changes are lost

':q[uit][!]' or 'ctrl-w ctrl-q' or 'ctrl-w q'
Quits current window. If its the last window and ! is used, the
changes to the buffer are lost.

':on[ly]' or 'ctrl-w ctrl-o' or 'ctrl-w o'
Displays only the current window. Hides the rest if the hidden option
is set.

Navigating


######################
# Vimdiff_and_diff #
######################
To diff between two files
'vimdiff ' / 'vim -d '
This sets the following options in each of the files
'diff' on
'scrollbind' on
'scrollopt' includes "hor"
'wrap' off
'foldmethod' "diff"
'foldcolumn' 2

Navigating -
"[c" will go to the line of the next difference
"]c" will go to the line of the previous difference

Other Commands:
To start up diff mode against a file with another opened file in vim
':[vert{ical}] diffsplit '

If two files are already open and if you want to start the diff mode then
':diffthis'
in both the files. This sets all the above options for each of the files.

':diffpatch ' can be used to apply a patch to the current file and
open a buffer on the result. ':vert' can be prepended to this to get the buffer
in a vertical window.

':diffu{pdate}' can be used to force the differences to be updated


#################
# Ctags and Vim #
#################

Vim works with the 'ctags' function which makes it very easy to jump to
functions and variables.

'ctrl-]' can be used to jump to a function/variable definition
'ctrl-t' can be used to jump back

Before being able to use the above you need to generate a tags file using
'ctags '.


##################################
# Make Compilations and Error Viewing #
##################################

Vim can compile with ":make" using a makefile. In addition to this you can
browse the errors with the ":cn" and ":cp" options.

In this mode it becomes difficult to view more than single line error
messages. You can open up an error window by doing
":cope 8" where 8 is the number of lines show in the error window.
Now you scroll the errors using the ":c" commands which the errors are
being highlighted in the error window.

To close the error window, do ":ccl"


######################
# Encryption
######################

Missing data here.........


######################
# Editing Remote Files (A very useful feature for me!!!!)
######################

You can use scp, ftp, rcp, http to edit remote files. So when you write back
to a file it gets saved to the remote location

"vim scp://user@hostname/path/file"

This leads to a lot of other good stuff :).

"vimdiff file1 scp://user@hostname/path/file2"
(Compare files on remote systems)


######################
# Auto-Completion mode
######################
Auto-completion (CTRL-X) can be used in the 'insert' mode. Using
auto-completion, we can do (in combination with CTRL-X)

- Keyword Local Completion (CTRL-N/CTRL-P),
- Whole line completion (CTRL-L),
- File name completion (CTRL-F),
- Pattern path completion (CTRL-I),
- Definition completion (CTRL-D),
- Command line completion (CTRL-V)



###############
# Using Macros
###############
'qa' starts recording the macro 'a'
'q' stops recording the macro
'@a' repeat the macro number of times

One way to use this is to create a number list
insert 1
'qa'
'yy'
'p'
'CTRL-A' on the new line to convert the 1 to a 2
'q'
'20@a' and voila! You have number 1 to 22 pasted in your file

So typically the keysequence would be 'i, 1., [esc], qa, yy, p, [CTRL-A], q, 20@a'



############################################################
# Operating commands over several files, windows or buffers
############################################################
Three commands can be used to apply commands over multiple files
':argdo'
':windo'
':bufdo'

'argdo' applies a commands on all the files indicated by the 'args' command
':args *.[ch]'
':argdo %s///ge | update'

The 'e' option suppresses errors if is not found in a
particular file. And 'update' updates the file before moving on (otherwise
you get the file modified error).



############################################################
# File characters info and status line settings
############################################################

'Ctrl-g' or ':f[ile]' can be used to extract file information like file name, cursor
position (in terms of %, filename with path, file status and number of lines
in file ).

'g Ctrl-g' gives the number of lines, words and character in a file just like
the 'wc' command in UNIX

'{visual} g Ctrl-g' works for the selected region.

To more the status line more informative, do the following setting
'set statusline=[%n]\ %<%f\ %((%1*%M%*%R%Y)%)\ %=%-19(\LINE\ [%3l/%3L]\ COL\ [%02c%03V]%)\ ascii['%02b']\ %P '


##################
# Tabs and Spaces
##################
An endless argument in editors is whether to insert tabs or spaces while
writing code. In order to satisy people on both sides, vim can be set to do
exactly what people want. The 'expandtab' option when unset inserts tabs when
you press the key and when set inserts spaces.

':set expandtab' - for spaces
':set noexpandtab' - for tabs

For people trying to meet the people on the other side, we can do the
following steps to..

1) Convert tabs to spaces
-------------------------
':set expandtab'
':%retab!'

2) Convert spaces to tabs
-------------------------
'set noexpandtab'
':%retab!'

In order to visualize the above actions, it is useful to do ':set list'
which turns on invisible characters (spaces, tabs, end of line etc).




#####################################
# Use sessions to save state of work
#####################################
In vim, it is easy to create a session file which stores the views for all
windows and also the global settings, so that you can restore the state of
your work later on in the future. You can easily start editing at a previously
saved state/views by using the '-S' arguement as
'vim -S session.vim'
To create a session at some point, you can use the command
':mks[ession][!] '
This creates a vim script which can be used to restore state/views later.
If the file name is not given, it uses a default name "Session.vim". The '!'
can be used to overwrite an existing file.


#####################################
# Register Contents : Useful insertions of work
#####################################
You can insert some contents of the registers used by vim which are very useful.
'i_ctrl-r_%' inserts current file name
'i_ctrl-r_=' and insert an equation which will be evaluated and its result placed at the current cursor position


#####################################
# Helpfiles: local plugins
#####################################
Local plugin help files can be created and accessed as...
':helptags ~/.vim/doc' generates local tags file for local plugin help
':help local-additions' shows you the entries for the local help file
':help ' takes you to the local help


#####################################
# Tracking and tracing your vim settings
#####################################
Sometimes it becomes such that settings get overidden, settings you don't want
get set (mostly in default files and you don't even know it) or settings get
sourced twice. For such things, I figured out a couple of things that can help
you know what's going on. It drives me crazy when I don't know what's going
on!!!
The 'set' options can be traced as follows
':verbose set ' - this helps trace from which file this option has been set
We can figure out for a particular group what 'autocmd' has been set
':autocmd ' - this shows all that has been set for a particular group & filetype


#####################################
# Numbering lines in a file
#####################################
A neat filtering trick using the 'nl' linux/unix program.
':%! nl -ba' - this helps trace from which file this option has been set

Vim|Convert tabs to spaces in Vim

Alan Haggai Alavi's Web Log: Convert tabs to spaces in Vim: "Convert tabs to spaces in Vim

Add the following to ~/.vimrc, /etc/vimrc or /etc/vim/vimrc:

set tabstop=4 ' The width of a TAB is set to 4.
' Still it is a \t. It is just that
' vim will interpret it to be having
' a width of 4.

set shiftwidth=4 ' Intents will have a width of 4

set softtabstop=4 ' Sets the number of columns for a TAB

set expandtab ' Expand TABs to spaces

To convert tabs to spaces in an already existing file, open it in vim and enter these:

:set expandtab :retab"


##################
# Tabs and Spaces
##################
An endless argument in editors is whether to insert tabs or spaces while
writing code. In order to satisy people on both sides, vim can be set to do
exactly what people want. The 'expandtab' option when unset inserts tabs when
you press the key and when set inserts spaces.

':set expandtab' - for spaces
':set noexpandtab' - for tabs

For people trying to meet the people on the other side, we can do the
following steps to..

1) Convert tabs to spaces
-------------------------
':set expandtab'
':%retab!'

2) Convert spaces to tabs
-------------------------
'set noexpandtab'
':%retab!'

In order to visualize the above actions, it is useful to do ':set list'
which turns on invisible characters (spaces, tabs, end of line etc).

Vim|Toggle auto-indenting for code paste - Vim

Toggle auto-indenting for code paste - Vim Tips Wiki - a Wikia wiki: "Toggle auto-indenting for code paste
From Vim Tips Wiki
(Redirected from Paste Indent Problems)
Jump to: navigation, search

Tip 906 Previous Next created 2005 · complexity basic · version 6.0

Pasting text into a terminal running Vim with 'autoindent' or 'smartindent' set can destroy the indenting of the pasted text. This tip shows how to avoid the problem.

See How to stop auto indenting for automatic indentation issues while you are typing.
Contents
[hide]

* 1 Background
* 2 Paste toggle
* 3 References
* 4 Comments

edit Background

If you use Vim commands to paste text, nothing unexpected occurs. The problem only arises when pasting from another application, and only when you are not using a GUI version of Vim.

In a console or terminal version of Vim (not gvim), there is no standard procedure to paste text from another application. Instead, the shell may emulate pasting by inserting text into the keyboard buffer, so Vim thinks the text has been typed by the user. After each line ending, Vim may move the cursor so the next line starts with the same indent as the last. However, that will change the indents already in the pasted text.
edit Paste toggle

Put the following in your vimrc (change the <F2> to whatever key you want):

set pastetoggle=<F2>

To paste from another application:

* Press <F2> (toggles the 'paste' option on).
* Use your shell to paste text from the clipboard.
* Press <F2> (toggles the 'paste' option off).

Then the existing indentation of the pasted text will be retained.

If you have a mapping for <F2>, that mapping will apply (and the pastetoggle function will not operate).

Some people like the visual feedback shown in the status line by the following alternative for your vimrc:

nnoremap <F2> :set invpaste paste?<CR>
imap <F2> <C-O><F2>
set pastetoggle=<F2>

The first line sets a mapping so that pressing <F2> in normal mode will invert the 'paste' option, and will then show the value of that option. The second line does the same in insert mode (but insert mode mappings only apply when 'paste' is off). The third line allows you to press <F2> when in insert mode, to turn 'paste' off."

Vim|paste indent problems

scientia potentia est » Vim: paste indent problems: "Vim: paste indent problems
Tag: CR, indent, LF, paste, putty, tabs, Vim — mr-euro @ 14:17

On one of my boxes I came across this weird behaviour when pasting code into Vim at the terminal. All indentation was broken in a stepped way. Every line indented more and more creating a real mess to work with. This only happened when actually pasting content into the terminal. Typing worked as normal.

I initially thought that it had something to do with Putty’s way of interacting with this specific box e.g. some configuration that was missing. Issues exist with carriage return (CR) and line feed (LF) handling across platforms. Nevertheless this was a dead end.

Digging around Vim’s extensive wiki provided some clues as to what was going on. Having ‘autoindent‘ or ‘smartindent‘ on creates havoc when pasting into Vim and therefore should be disabled. The problem is that these are nice features to have on when simply typing.

Vim has an alternative mode called ‘paste‘ that does not modify the pasted input in any way and therefore code looks just as in the original source. To enable ‘paste‘ mode during insert simply type ‘:set paste‘ and you are ready to paste. When finished pasting you probably want to leave ‘paste‘ mode by typing ‘:set nopaste‘.

As I am too lazy to type this every time I need to paste something I have now added the ‘pastetoggle‘ key into my profile’s .vimrc file as follows: ‘set pastetoggle=<F12>‘

From now on simply hit F12 on the keyboard and you will be in ‘paste‘ mode. Press F12 again to leave it."

SVN|svn 命令操作

svn 命令操作非常简单

和cvs的操作基本一致 。



对于日常操作来说,最常用的就是那几个命令, svn co/update/add/ci




修改了某个文件,想传上去: svn ci bob.c -m "bob modify"

如果 想想cvs 那样, cvsi ci bob.c 的时候自动弹出 vi窗口,要设置SVN_EDITOR变量: export SVN_EDITOR=/usr/bin/vim , 可以写死在 /root/.bash_profile 里面去。

新添加了某个文件, 想传上去, echo 1 > bob.c ; svn add bob.c ; svn ci bob.c

自己修改了, 发现错了, 想恢复到svn上面的版本, 可以用 svn update bob.c -r25 // 25 是版本号 。

想要删除某个文件bob.c : svn del bob.c ; svn ci bob.c

想彻底更新某个目录(可能改了某个目录的一些文件,都不想要了) , svn revert -R xxx (xxx是那个目录)

------
比如 ,我checkout下来后,新建了一个目录,然后要上传整个目录, 这点比cvs强,
svn add xxx (xxx就是那个目录) ,他会递规的增加整个目录的。
然后 svn ci 即可
SVN 使用之注意事项:

再次强调一点使用svn/cvs 的流程:

比如bob ,假如我修改了比较大的地方的代码,
我的流程是:

1>checkout 下来kernel的最新版本 (如果以前已经有了就update 一下 , 具体的命令不能用update ,应该用svn revert
2> 修改,本地调试, 测试ok
3> check in 自己修改过的文件和增加的文件(svn add xxx) 。 注意人无完人, 可能会忘记传了某个文件, 你可以在根目录下 ,执行svn ci ,它会列出来你改了哪些文件
4> 上传完毕后, 把全部代码 checkout 下来 ,编译, 测试, 如果ok , 发mail 给相关的人, 内容,比如“I have updated "drivers/fs/ext3.c , pls update it " ,总之越详细越好,
最好精确到文件, 如果不能精确到文件 ,也要精确到目录, 不要说 ,"我更新了kernel的代码, 你update一下”这样的话 , 会给别人增加工作量,kernel 那么多的代码, 别人总不能每次都update , 那样时间会很长。

5> 等待着别人的问题报告。。。。。。


注意事项: 当你都没有稳定某个c文件的时候 ,不要check in , 不要三天两头checkin svn上的同一个文件(如果是这样,只能说明,你的改的还不稳定, 先自己测试稳定了再传)

另外, svn 不是个人的备份的仓库,是大家的财产,要一字千金的改。







可以参考, 我的帖子:

http://infomax/bbs/viewthread.php?tid=8&page=1&extra=page%3D1


下面是其中的一部分, 对于日常用已经足够了。

svn 命令操作非常简单 ,和cvs的操作基本一致 。

下面列出一些最简单常用的 。 对于EasySVN的用法, 都是图形界面,可以自己仔细琢磨一下 ,可以问Kyo ,Kyo比较熟悉。

! 利用平时的空闲时间 ,利用 http://192.168.167.103/svn/try/uucp-1.07 来练熟它 , 不要等到自己用的时候 ,手忙脚乱。 uucp-1.07 专门练手用 ,乱掉也没有关系。



对于日常操作来说,最常用的就是那几个命令, svn co/update/add/ci

SVN|Tortoise SVN 客户端 基本用法

Tortoise SVN 客户端 基本用法
1. export 和check out
  export 下载源代码
  用法:
  1、新建一个空的文件夹,右键点击它,可以看到TortoiseSVN菜单以及上面的SVN Checkout。
  2、不用管这个Checkout,我们选择TortoiseSVN菜单下的Export...,接着它会让你输入url。
  3、比如输入【迷宫探宝】的SVN地址是:http://game-rts-framework.googlecode.com/svn/trunk/
  4、其他选项不需要更改,Omit externals不要勾选,HEAD Revision选中表示最新的代码版本,接着点击OK即可将代码导出到这个目录中:)
  check out 意思签出,虽然和Export的效果一样是把代码从服务器下载到本地,但是Checkout有验证的功能,Checkout到某处的代码,将会被TortoiseSVN监视,里面的文件可以享受各种SVN的服务。
  
  2 .每次提交代码需要注意哪些问题
  如果你更新了目录中的文件,提交代码需要用到commit功能,commit的功能不仅仅是上传,他会和服务器上面的文件进行对比,假如你更新了某个文件而服务器上面也有人更新了这个文件,并且是在你checkout之后做的更新,那么它会尝试将你的更新和他人的更新进行融合(merge),假如自动merge不成功,那么报告conflict,你必须自己来手动merge,也就是把你的更新和别人的更新无冲突的写在一起。
  commit的时候,最好填写Log信息,这样保证别人可以看到你的更新究竟做了写什么。这就相当于上传文件并且说明自己做了那些修改,多人合作的时候log非常重要。
  TortoiseSVN的commit只会上传原先checkout然后又被修改了的文件,假如你新加入了某些文件,需要右键点击文件选择 Add,然后文件上面会出现一个加号,在下次commit的时候它就会被upload并且被标记为绿色对勾。没有绿色对勾的文件不会被commit。
  假如你需要给带有绿色对勾文件改名或者移动它的位置,请不要使用windows的功能,右键点击它们,TortoiseSVN都有相应的操作。想象这些文件已经不在是你本地的东西,你的一举一动都必须让Tortoise知道。
  假如修改了某个文件但是你后悔了,可以右键点击它选择Revert,它将变回上次checkout时候的情况。或者Revert整个工程到任意一个从前的版本.
  下面描述在使用Commit时的几个注意点:
  -------------如有多个文件需要同时提交,同时文件在不同的目录下,必须找到这些文件的最短目录上点击Commit,TortoiseSVN会搜索被点击目录以及该目录下所有的文件,并将修改变动的文件罗列在列表中。
  -------------仔细查看列表中的文件,确定哪些文件时需要更新的,如果不需要更新某个已经变化了的文件,只需要在该文件上点击右键,选择还原操作;选择需要新增的文件,不要将临时文件添加到版本库中。
  -------------如遇到文件冲突(冲突:要提交的文件已被其他人改动并提交到版本库中)要启用解决冲突功能。
  3. 如何保持本地版本和服务器版本同步
  使用update来同步本地和服务器上的代码。同样是右键选择SVN update,所有的更改就会从服务器端传到你的硬盘。注意,假如别人删除了某个文件,那么更新之后你在本地的也会被删除。
  如果本地的代码已经被修改,和commit一样会先进行merge,不成功的话就会报告conflict
  4 如何在同一个在一个工程的各个分支或者主干之间切换
  使用tortoise SVN-->switch
  在URL中输入branch或trunk的url地址
  5.如何比较两个版本之间的差别
  
  本地更改
  如果你想看到你的本地副本有哪些更加,只用在资源管理器中右键菜单下选TortoiseSVN→ 比较差异。
  与另外一个分支/标签之间的差异
  如果你想查看主干程序(假如你在分支上开发)有哪些修改或者是某一分支(假如你在主干上开发)有哪些修改,你可以使用右键菜单。在你点击文件的同时按住Shift键,然后选择TortoiseSVN→ URL比较。在弹出的对话框中,将特别显示将与你本地版本做比较的版本的URL地址。
  你还可以使用版本库浏览器,选择两个目录树比较,也许是两个标记,或者是分支/标记和最新版本。邮件菜单允许你使用比较版本来比较它们。阅读第 5.9.2 节 “比较文件夹”以便获得更多信息。
  与历史版本的比较差异
  如果你想查看某一特定版本与本地拷贝之间的差异,使用显示日志对话框,选择要比较的版本,然后选择在右键菜单中选与本地拷贝比较差异
  两个历史版本的比较
  如果你要查看任意已提交的两个历史版本之间的差异,在版本日志对话框中选择你要比较的两个版本(一般使用 Ctrl-更改),然后在右键菜单中选比较版本差异
  如果你在文件夹的版本日志中这样做,就会出现一个比较版本对话框,显示此文件夹的文件修改列表。阅读第 5.9.2 节 “比较文件夹”以便获得更多信息。
  提交所有修改
  如果你要在一个视窗中查看某一版本的所有更改,你可以使用统一显示所有比较 (GNU 片段整理)。它将显示所有修改中的部分内容。它很难显示一个全面清晰的比较,但是会将所有更改都集中显示出来。在版本日志对话框中选择某一版本,然后在右键菜单中选择统一显示所有比较。
  文件差异
  如果你要查看两个不同文件之间的差异,你可以直接在资源管理器中选择这两个文件(一般使用 Ctrl-modifier),然后右键菜单中选TortoiseSVN→ 比较差异。
  WC文件/文件夹与URL之间的比较差异
  如果你要查看你本地拷贝中的任一文件与版本库中任一文件之间差异,
  谴责信息之间的比较差异
  如果你要查看的不仅是比较差异而且包括修改该版本的作者,版本号和日期,你可以在版本日志对话框中综合比较差异和谴责信息。这里有更多详细介绍第 5.20.2 节 “追溯不同点”。
  比较文件夹差异
  TortoiseSVN 自带的内置工具不支持查看多级目录之间的差异,但你可以使用支持该功能的外置工具来替代。在这里 第 5.9.4 节 “其他的比较/合并工具”我们可以介绍一些我们使用过的工具。
  6.提交代码时怎样知道自己改了哪些文件,别人改了哪些文件
  7. 如何知道某个文件的某一行是谁在哪个版本修改的
  
  8. 如何为一个SVN主工程建立分支或tag
  创建分支使用步骤:
  1、选择你要产生分支的文件,点击鼠标右键,选择[分支/标记...]
  2、在[至URL(T)]输入框中将文件重命名为你的分支文件名,输入便于区分的日志信息,点击确认。
  3、在SVN仓库中会复制一个你所指定的文件,文件名称就是你所命名的,但是在你的本地目录上看不到新建的分支文件名,要使你的文件更新作用到你的分支上,你必须选择文件,点击鼠标右键,选择[切换...],选择你重命名的文件,点击确定即可。这样你的本地文件就和分支文件关联上了,不要奇怪,这时本地目录上看到的文件名仍然为旧的文件名。
  经验小结:
  1、如果操作的文件之前还未提交,而你又想把文件提交到新的分支上,记得一定要选择切换
  2、SVN分支的管理实际上就是把不同的分支用不同的文件保存,因此你在取得新版本的时候会发现,不同分支的最新文件也会被获取下来。
  创建tag操作,相当于把当前的代码版本复制一份到其他地方,然后以这个地方为出发点进行新的开发,与原来位置的版本互不干扰。
  对于branches、tags、trunk这三个目录,并不是subversion必需的,而是被总结的一种良好的团队开发习惯,其使用方法为:
  1、开发者提交所有的新特性到主干。 每日的修改提交到/trunk:新特性,bug修正和其他。
  2、这个主干被拷贝到“发布”分支。 当小组认为软件已经做好发布的准备(如,版本1.0)然后/trunk会被拷贝到/branches/1.0。
  3、项目组继续并行工作,一个小组开始对分支进行严酷的测试,同时另一个小组在/trunk继续新的工作(如,准备2.0),如果一个bug在任何一个位置被发现,错误修正需要来回运送。然而这个过程有时候也会结束,例如分支已经为发布前的最终测试“停滞”了。
  4、分支已经作了标签并且发布,当测试结束,/branches/1.0作为引用快照已经拷贝到/tags/1.0.0,这个标签被打包发布给客户。
  5、分支多次维护。当继续在/trunk上为版本2.0工作,bug修正继续从/trunk运送到/branches/1.0,如果积累了足够的bug修正,管理部门决定发布1.0.1版本:拷贝/branches/1.0到/tags/1.0.1,标签被打包发布。
  一般建立最初的repository时,就建好这三个目录,把所有代码放入/trunk中,如:要将project1目录下的代码导入 repository,project1的结构就是:project1/branches,project1/tags,project1/trunk, project1/trunk/food.c,project1/trunk/egg.pc……,然后将project1目录导入repository,建立最初的资料库。然后export回project1,作为本地工作目录。

Tuesday, February 3, 2009

Format|format conversion - restructured text

Tools to convert restructured text to different format

use easy_install to install these 2

XHTML2PDF:it's called pisa
pisa is a html2pdf converter using the ReportLab Toolkit, the HTML5lib and pyPdf. It supports HTML 5 and CSS 2.1 (and some of CSS 3). It is completely written in pure Python so it is platform independent. The main benefit of this tool that a user with Web skills like HTML and CSS is able to generate PDF templates very quickly without learning new tech nologies. Easy integration into Python frameworks like CherryPy, KID Templating, TurboGears, Django, Zope, Plone, Google AppEngine (GAE) etc. (see 'demo' folder for examples)

rst2pdf:this includes some other tools eg rst2htm, etc

Highlights
14 of the Best Free Linux Wiki Engines
A Wiki engine is a type of collaborative software that runs a wiki system. This facilitates web pages being created and edited using a web browser. This type of software is usually implemented as an application server that runs on one or more web servers.

(Read more)

IBM Informix
(commercial) IBM Informix provides Linux developers with the full power of an SQL-based database engine, combined with the quality, configurability, and interoperability of the Linux operating system.

Links:

  • a2pdf
    a2pdf converts plain (ASCII) text files to documents in the PDF format. Its features include optional line/page numbering, multiple font support, syntax highlighting for Perl source code, and customizable headers and footers. Binaries are available for Linux x86, Mac OS X (Intel), and Microsoft Windows platforms.
  • Ascii2Binary
    Ascii2Binary reads input consisting of textual representations of numbers separated by whitespace and produces as output the binary equivalents.
  • ASCIIweb
    ASCIIweb is a text-to-HTML formatting system that uses the 'pre' tag to create ASCII art Web pages, either on-the-fly or for static retrieval. It has a simple and flexible module system that also allows you to integrate shell scripts and practically any text output into your Web pages. It will also parse and include live Apache-style directory listings into your pages, giving you a creative and good looking way to make files available to your users. It looks just as good in Lynx as it does in Mozilla.
  • bbdir
    converts directory tree into a blackbox root menu format
  • bib2html
    a converter from a BibTeX database to HTML files
  • bib2html
    a utility for converting a bibTeX file into HTML format. It will recognize the 'url' field in the bibTeX entries and make appropriate links in the HTML output to the URL location
  • Bib2x
    Bib2x allows the conversion of BibTeX bibliographies to any ASCII/UTF8-based file format using templates. Bib2x allows filtering on a subset of bibliographic entries read from BibTeX databases.
  • bib2xhtml
    converts BibTeX files into HTML (specifically XHTML 1.0). The conversion is mostly done by specialized BibTeX style files, derived from a converted bibliography style template. This ensures that the original BibTeX styles are faithfully reproduced
  • bk2site
    a GPL program that converts your Netscape bookmakrs file into a yahoo-like web site
  • camp2ascii
    camp2ascii is a tool for converting Campbell Scientific binary files into ASCII (formatted as CSV, SQL, etc.). It extracts the data stored in the binary files created by data loggers while trying to be fast, reliable, and to extract as much information as possible. It should also work on a wide range of platforms.
  • CdUtil
    a utility to convert an existing database with a CD-collection into html
  • chopro2anything
    chopro2anything is a suite of programs that convert chopro files into a range of other formats.
  • ConvertAll
    ConvertAll is a unit conversion program where you can combine the units any way you want. If you want to convert from inches per decade, that's fine. Or from meter-pounds. Or from cubic nautical miles.
  • convmv
    convmv converts filenames (not file content), directories, and even whole filesystems to a different encoding. This comes in very handy if, for example, one switches from an 8-bit locale to an UTF-8 locale or changes charsets on Samba servers. It has some smart features: it automagically recognises if a file is already UTF-8 encoded (thus partly converted filesystems can be fully moved to UTF-8) and it also takes care of symlinks. Additionally, it is able to convert from normalization form C (UTF-8 NFC) to NFD and vice-versa. This is important for interoperability with Mac OS X, for example, which uses NFD, while Linux and most other Unixes use NFC. Though it's primary written to convert from/to UTF-8 it can also be used with almost any other charset encoding. Convmv can also be used for case conversion from upper to lower case and vice versa with virtually any charset. Note that this is a command line tool which requires at least Perl version 5.8.0.
  • csv2latex
    converts a well formed csv file (as done by OpenOffice.org) to a LaTeX document. it is written in C and flush the document to the standard output. The number of columns is automatically detected
  • CSV2LDIF
    a small converter tool for transforming csv files to ldif
  • csv2pdf
    (shareware) a very flexible Perl5 program based on txt2pdf 6.x core. It allows you to convert all your CSV files to PDF format, and is flexible enough to run on any platform that supports Perl
  • csv2txt
    a Perl converter from the CSV format to text format. Some features of csv2txt include the ability to select the CSV delimiter, the ability to set global alignment (left, right, center), and the ability to set the global decimal format
  • csv2vcard
    a command line tool for converting *.csv (comma seperated values) files to the vcard format
  • csv2xml
    a simple csv to xml converter. It reads csv files from standard input, and output a valid xml file on standard output
  • dbtroff
    dbtroff uses XSLT, Heirloom troff, and Ghostscript to convert DocBook documents to PDF or PostScript. It allows you to flexibly customize the layout of the generated output by using troff instructions, and provides automatic page element positioning to avoid typographical artifacts like “widows”. Full-width and inline pictures can be included, and are also automatically positioned.
  • denature
    a perl program that attempts to convert an HTML page into XSL-FO which it then passes off to the FOP (Formatted Objects Formatter) to produce a PDF document
  • deplate
    a tool for converting wiki-like markup to latex, html, or "html-slides". It supports embedded LaTeX code, footnotes, citations, biblographies, automatic generation of an index etc
  • DocToText
    DocToText is a utility that can convert MS Word documents to plain text. This allows documents to be used for many things such as searching, indexing, archiving, or just reading in text mode on a console.
  • dot2gdl
    dot2gdl is a converter from GraphViz Dot files into aiSee (formerly xvcg) GDL files. Although the conversion is non-trivial in general due to different concepts of controlling the layout algorithms, the application converts many graphs nicely already. This package contains a library and a command line tool.
  • ebook-tools
    ebook-tools provides tools for accessing and converting various ebook file formats.
  • edifact2awk
    edifact2awk is a small program that parses an EDIFACT file and converts it to a flat text file, which may be easily parsed by the AWK text processing language (including by other scripting languages like Perl, Python, Visual Basic, etc.).
  • eoconv
    a tool which converts text files to and from Esperanto text encodings
  • Epoch2Time
    Epoch2Time is a little program to convert Unix epoch values to local time.
  • fig2pstricks
    fig2pstricks converts a fig (xfig) file to pstricks. Currently it works with FIG 3.2.
  • FileGarden
    FileGarden is text to postscript and PDF, image conversion, custom scripting, batch processing, support custom component plugins. Features through a configuration file: * Create your own menu, menu sub-items and speed-buttons, * Run your own program or scripts from the created menu and speed-buttons, * Build your own VCL component and plug it into the programs, * Suitable for files batch conversion, batch. Licence : Freeware.
  • gEuCo
    gnome Euro conversor. It converts currencies from all the countries of the Euro community to Euro and vice-versa
  • Gneuro
    Gneuro is a lightweight Euro / old european currencies converter.
  • Gnome-u2ps
    Gnome-u2ps converts Unicode texts to GNU a2ps style postscript.
  • gonvert
    gonvert is a conversion utility that allows conversion between many units like CGS, Ancient, Imperial with many categories like length, mass, numbers, etc. All units converted values shown at once as you type. Easy to add/change your own units. Written in Python, pygtk, libgade.
  • Html To Xhtml Convertor
    Html to Xhtml Convertor is a straight-forward Perl script to convert HTML pages into XHTML pages. It can process batches of files, convert Windows/Unix/Mac line breaks, and deal with attribute minimization, quoting of attribute values, and more.
  • icxf
    converter from the Italian Cadastrial Exchange Format to DXF and SVG
  • IDX-DocBook2LaTeX
    a stylesheet to convert DocBook XML documents to LaTeX. It is powerful (handles both french and english, tables, footnotes, graphics, indices, bibliography, etc.) and easy to extend
  • kdelnk2wmaker
    a .desktop (or .kdelnk in old version) to WindowMaker menu converter which supports locale. It uses your environment variable LANG to determine the application name
  • KEuroConverter
    KEuroConverter is a currency converter includes all the old european currencys that have a fix rate to the Euro. One can also add other currencies in a configuration dialog.
  • KExchange
    a currency converter for over 70 currencies using up-to-date exchange rates from the PACIFIC Exchange Rate Service
  • KUnit
    a simple program to convert various units
  • LDIF to VCARD conversion
    LDIF to VCARD conversion is a simple command line Perl script to migrate a Netscape address book to GnomeCard.
  • Linbox Converter
    converts MS-Office documents (Word, Excel, Powerpoint) to PDF, PostScript, text, HTML, RTF, and TIFF
  • Majix
    transforms RTF files such as Microsoft Word documents into XML. It can convert headings, lists (numbered or not), simple tables, bold, italics, and underline
  • menushki
    converts the menus between different Window Managers
  • Mozilla Exporter
    a utility that converts the configuration files of the Mozilla Web browser from the format used by the Linux version to the format used by the Windows version
  • naartex
    converts docbook files directly into LaTeX
  • NS2Html
    NS2Html is a tool which converts configuration files extracted from Netscreen devices into friendly HTML rulebases. It was developed to gather data from policies used at old firewalls under administration.
  • NTXShape
    a GIS data conversion tool that translates CARIS NTX interchange files into the ESRI shapefile format. It converts points, lines, polygons, text, spot heights, and soundings, preserving virtually all of the information found in the source data
  • o3read
    a standalone converter for the OpenOffice.org writer format. It doesn't depend on Open Office or any other external tools or libraries
  • odf-converter-integrator
    odf-converter-integrator is an easy way to open Microsoft Office 2007 files (also called Office Open XML, .docx, .xlsx, and .pptx) with a high-quality conversion on any Linux or Windows system in any version of OpenOffice.org.
  • ol2ical
    a tool to convert MS Outlook calendar e-mail messages to ical events. ol2ical handles many types of events from Outlook and has some provision for time zone differences
  • OperaHotlist2HTML
    a Perl script that converts Opera bookmarks (called "Hotlist") to HTML 4.01. It will also convert to Netscape/Mozilla bookmark files as well
  • pandoc
    pandoc is an implementation of markdown (and much more) in Haskell. It can convert markdown-formatted text to HTML, LaTeX, rich text format, reStructuredText, or an S5 HTML slide show. It can also convert HTML, LaTeX, and reStructuredText to markdown.
  • PDFRead
    PDFRead is a tool for converting PDF and DJVU documents for reading on eBook devices. It does this by creating an image out of each page, enhancing the image, and then collating the images in a device-specific format. It supports creating images for any ebook reader device and has out of the box profiles for the 1100/1150/1200 and PRS-500.
  • pfbtopfa
    converts PostScript Type 1 fonts in the PFB binary format into the ASCII PFA format used by X and other Unix PostScript Type 1 font uses
  • Prince
    Prince is a batch formatter for converting XML into PDF and PostScript by applying Cascading Style Sheets (CSS). Unlike other formatters, Prince prints any XML vocabulary without relying on proprietary markup.
  • PyC2LaTeX
    takes a given c, java or idl file and writes a (beautiful) latex file to prettyprint the code
  • Quick Base Converter
    an ANSI C command line base convertor. It also does posfix basic operations, interpreting the numbers as natural numbers. It supports any base from 2 to Z
  • rem2ics
    rem2ics will convert the output of "remind -s" into correct RFC2445 iCalendar format.
  • Republic
    enables old-style computer reports (formally known as 'ascii' reports to be parsed and turned into OASIS OpenOffice.org Spreadsheet documents. This data can then more easily analysed by management. Parsing Rules are held in a simple XML format
  • roffit
    converts input nroff man pages to output HTML pages
  • Rosetta
    an interactive tool to help translate documents in the DocBook format. More specifically it'll read any text with DocBook XML markup and present it to the translater split-up between mark up and real text
  • rst2pdf
    rst2pdf is a tool to convert Restructured Text to PDF without using any intermediate formats.
  • RTFX
    converts RTF files into a generic XML format. It majors on keeping meta data like style names, etc... rather than every bit of formatting. This makes it handy for converting RTF documents into a custom XML format
  • RusXMMS
    RusXMMS provides character set conversion for languages which can be represented with more than one character set.
  • sdml2txt
    sdml2txt is a script to convert SDML to ASCII text UML Sequence Diagrams. SDML is an extremely simplistic UML sequence diagram markup language.
  • sh2html
    a shell wrapper and awk script, that formats a Bourne-compatible shell script into syntax highlighted HTML
  • Shape Tools
    a very simple tool to convert from ARCINFO EXPORT (.E00) to ESRI ShapeFile
  • soffice2html
    converts a staroffice/openoffice.org document to HTML, using xsltproc for the xml conversion and ImageMagick's convert to convert images. Also create a table of contents with links, handles tables, styles, spans, and many other xml elements from a writer file
  • spirito-pisa
    pisa converts HTML to PDF using the ReportLab Toolkit, the HTML5lib, and pyPdf. It supports HTML 5 and CSS 2.1 (and some of CSS 3).
  • StarOffice Converter
    creates a simple filter to convert StarOffice 5.x documents into plain text. Currently it works for Writer documents
  • sub2srt
    a simple tool to convert 2 common subtitle formats (microdvd and subrip - both are known as ".sub") to subviewer ".srt" format
  • Tamil Converters
    This package contains five programs that convert among several encodings of Tamil and the ITRANS romanization. Two programs convert between ISCII and ITRANS, two between ISCII and Unicode. The fifth program, tscii2uni, converts the TSCII encoding of Tamil to UTF-8 Unicode.
  • Temperature Converter
    a Perl/Tk app to convert between the Celsius, Fahrenheit, Kelvin, Rankine and Reaumur temperature scales
  • Text-to-PDB-Doc
    a Unix-based Text-to-Doc file conversion program. (It also converts Doc files to plain text.)
  • Tipograf
    a graphical user interface for the famous a2ps program
  • trace2html
    trace2html is a utility to convert execution coverage data obtained with the trace module of the standard Python library into a set of human readable HTML documents showing a sortable summary and annotated source files.
  • txt2docbook
    allows one to convert a ascii (README-like) file to a valid docbook xml document. It simplifies the publishing of rather small papers significantly
  • txt2xhtml
    a plain text to XHTML converter. It outputs valid XHTML and CSS code. It allows user to specify some styles as command line parameters and to import some external stylesheets or create link to them. txt2xhtml allows user to specify multiple input files
  • UConvert
    a simple units conversion program
  • uni2ascii
    This package provides conversion in both directions between UTF-8 Unicode and a variety of 7-bit ASCII equivalents. Such ASCII equivalents are useful when including Unicode text in program source, when debugging, and when entering text into web programs that can handle the Unicode character set but are not 8-bit safe.
  • units
    GNU `units' converts between different systems of units. It can handle multiplicative scale changes as well as nonlinear conversions, such as Fahrenheit to Celsius. Over 2000 units definitions are included in a well-annotated data file.
  • unoconv
    unoconv converts between any document format that OpenOffice understands. It uses OpenOffice's UNO bindings for non-interactive conversion of documents.
  • vim2html
    a small shell program that will export any Vim-editable file into well-formed HTML - simulating a Vim session
  • vsdviewer
    vsdviewer is a MS Visio Drawing and Stencil (VSD/VSS) import filter for the sK1 vector editor and UniConvertor. It can also be used as a standalone viewer.
  • xhtml2pdf
    xhtml2pdf converts HTML/XHTML/XHML to PDF using the ReportLab Toolkit, the HTML5lib, and pyPdf. It supports HTML 5 and CSS 2.1 (and some of CSS 3). It has best support for frameworks like Django, Turbogears, CherryPy, Pylons, WSGI.
  • xtopdf
    xtopdf is a PDF creation/conversion toolkit. It is both a set of end-user tools and a library for developers. It supports creating PDF (Portable Document Format) files from plain text, DBF (XBASE), CSV (Comma Separated Values), TDV (Tab Delimited Values) and XLS (Microsoft Excel).
  • YAFPC
    Yet Another Free PDF-composer: can compose PDF documents from picture files and other PDF files, encrypt the created document and send it to some e-mail address. YAFPC is aimed to act as command-line tool in combination with GhostScript
  • z2html
    translates Z input code to compliant XHTML 1.1, and the translator also comes with a full Z language manual