I 'm not sure this is actually a vim question and if you dont feel like
answering or if you think it is inappropriate to ask such questions
here, just ignore me...
The thing is I hate document processors. I really do.
I love vim. I really really do.
But "they" want a .doc file. With italics, bold, red for the code and
green for page count.
I tried editing with vim and then opening with open office writer
coloring, italizing, bolding and saving to .doc. But it is painful! To
much mouse work... select the text go press the stupid B or I button or
go press font color and then red or green. Painful.
I want to use my keybord and only my keyboard.
So here is what I thought. I will edit an html document, open it with
oowriter and save to .doc.
And here is the question:
Is there an even easier way to do this using my vim?
Ditto :)
> But "they" want a .doc file. With italics, bold, red for the
> code and green for page count.
To get this from plain-text, you need _some_ sort of text markup
(he types, using underscores to mark up the sentence). There are
literally hundreds if not thousands of markup languages, and you
can even produce your own fairly easy (one of the main
contributing factors to the large numbers). Choices include RTF,
HTML, Markdown, DocBook, LaTeX...the list goes on and on.
> I tried editing with vim and then opening with open office
> writer coloring, italizing, bolding and saving to .doc. But it
> is painful! To much mouse work... select the text go press the
> stupid B or I button or go press font color and then red or
> green. Painful. I want to use my keybord and only my keyboard.
>
As an aside, in most word-processors, you should be able to
select by holding down <shift> while using motion keys (arrows,
control+arrows, home, end, pgup/pgdn, etc). You can then use
control+B to get bold, control+I to get italics. Colors, not
usually as readily available. But that's 2/3 of a solution. :)
> So here is what I thought. I will edit an html document, open
> it with oowriter and save to .doc.
>
> And here is the question:
>
> Is there an even easier way to do this using my vim?
Choose some markup that's easy for you, and then post-process it
to tweak it to be valid HTML. I happen to think fairly natively
in basic HTML (wrote most of my college papers in HTML using a
text-editor and then printed from the library for free instead of
the $0.07/pg in the labs; darn javascript end-note library I
wrote from scratch :), so I just started there. HTML has good
control for styling and doing things like code-blocks, or
defining <div>/<span> elements for page-counts.
However, your markup can be as simple as
<code>
here's some code
</code>
@42@
which you can then post-process to HTML (bound in a
script/keystroke to save your sanity)
:%s/@\(\d\+\)@/<span class='page'>\1<\/span>/g
Vim has fairly strong support for HTML so I know that's pretty
easy. You don't mention what's getting italicized, bolded, or
made red, so I'm not sure if there's a better/worse way to mark
those up.
If you're willing to put up with RTF markup, you can do this
natively in Vim and just open the resulting file directly in Word
or WordPad (most users see the idiot-icon for Word and don't care
that it's an RTF file instead of .DOC as long as it opens in
Word). I think OO.o does .rtf as well (when forced to use a
document processor, I tend to use AbiWord because it's a bit more
light-weight on my old machine here).
Hope this gives you some ideas,
-tim
I'm sorry! I will keep it in mind.
On Fri, 2009-04-03 at 20:01 -0700, Ben Fritz wrote:
> Download the TxtFmt plugin.
I will give it a try...
Thank you.
I downloaded the plugin and extracted the files to ~\.vim\plugin
~\.vim\ftplugin ~\.vim\doc etc...
Should I add something to my vimrc to load the plugin? I am confused...
Also I did not quite understand this. Do I have to use a special
filetype? How are my changes saved on a simple txt file?
It can be the whole solution if the OP uses Open Office styles. He
sets all code as style "Code" then sets style "Code" as colour red.
> However, your markup can be as simple as
>
> <code>
> here's some code
> </code>
> @42@
>
> which you can then post-process to HTML (bound in a
> script/keystroke to save your sanity)
>
> :%s/@\(\d\+\)@/<span class='page'>\1<\/span>/g
>
Wouldn't this be easier:
<dive style="code">
here's some code
</div>
And then a CSS rule for code.
--
Dotan Cohen
Actually the easiest proved to be this:
<style type="text/css">
h1 {display:inline; color:#ff0000; font-size:1em; }
h2 {display:inline; color:#ff00ff; font-size:1em; }
</style>
Plus the <i> and <b>.
Thats all I need. Then I convert html to doc with OO.org (is there a
script available?)
On Sat, 2009-04-04 at 07:21 -0500, Stahlman Family wrote:
> There are many ways to use Txtfmt.....
Brett, thank you for your response...
Txtfmt probably wont work for me... I need to be able to have colored
text right next to uncolored with no space between.
I think html will be just fine...
thanx anyway.
<code> is a legit HTML element, so I'd just use it as-is.
-tim
If the plugin (which I don't know) includes a *.txt help file for the
/doc/ subfolder, then after downloading it there you should do (with the
paths shown above)
helptags ~/.vim/doc
in order to make it part of your Vim installation's integrated help.
Otherwise (and assuming, of course, that your vim is compiled with
+autocmd +eval and that your vimrc or something it sources has a line
reading
filetype plugin on
or
filetype plugin indent on
), then nothing is required beyond dropping the files into the right
subfolders and restarting Vim. The same mechanism which loads the
standard global plugins and filetype-plugins distributed together with
Vim will find your local additions too.
HOWEVER:
- If you are on Unix/Linux (or on Windows using the Cygwin version of
Vim) you should use only _forward_ slashes as path separators;
- If you are on Windows with the native-Windows version of [g]vim, you
may use either forward or backward slashes, but you should download the
files into subfolders of ~/vimfiles/, not of ~/.vim/.
- On any platform you may also use $VIM/vimfiles/ (not .vim even on
Unix) instead of ~/.vim or ~/vimfiles, if you want to make the plugins
available to all users (all login names) and not private to yourself.
Where exactly that will be will vary among OSes: on Windows $VIM will
typically be C:\Program Files\vim (aka C:\PROGRA~1\vim) or somesuch
while on Unix it will be /usr/local/share/vim or somesuch.
Best regards,
Tony.
--
How many seconds are there in a year? If I tell you there are
3.155 x 10^7, you won't even try to remember it. On the other hand,
who could forget that, to within half a percent, pi seconds is a
nanocentury.
-- Tom Duff, Bell Labs
If you feel at ease writing HTML as text, and even more if you know how
to link it with the three possible kinds of CSS (in "style=" attributes
in tags, in a <style type="text/css"> tag as part of the <head>, or
external with <link rel="stylesheet" type="text/css"
href="whatever.css">), then awesome results can be achieved. But (like
every new "language") it does take some getting used to, at first.
Best regards,
Tony.
--
"Plaese porrf raed."
-- Prof. Michael O'Longhlin, S.U.N.Y. Purchase
I did not know that, thanks!
I don't know if it's the way my terminals are set up, or maybe I need to
compile vim with some extra optioni (latest stable with ruby support),
but I get this when I do
:MakeTestPage
http://michaelmaurer.net/images/gnometerminal.png
http://michaelmaurer.net/images/xterm.png
I put this in my .vimrc
set t_Co=256
set term=gnome-256color
but get no change (I dl'd the ncurses-term package you specified) .
I'd really like to use your plugin, it looks great!
- Mike
--
Entering the Ballardosphere
http://michaelmaurer.net/archives/2009/04/03/entering_the_ballardosphere/index.html
I tried :hi Ignore but got no results, :hi Ignore ctermfg=black did the
trick
http://michaelmaurer.net/images/gnometerm2.png
http://michaelmaurer.net/images/xterm2.png
But when you look at the gnome-terminal screenshot, you can still see the
fine lines of the chinese (?) characters inside the colored space.
Another problem is the fact that italic text doesn't get displayed. I've
tried switching fonts, but Monospace should be able to display this
anyway. rxvt-unicode displays everything alright, but gnome-terminal
should support unicode.. argh.
- Mike
--
"How I helped build the bomb that blew up Wall Street."
http://michaelmaurer.net/archives/2009/04/04/how_i_helped_build_the_bomb_that_blew_up_wall_street/index.html
What you want is Ctrl-B and Ctrl-I inside Open Office
Writer, not a text editor.
If you find the whole business of writing in a WYSIWYG
word processor painful check out Pandoc.
<http://johnmacfarlane.net/pandoc/>
It can output rtf and odt format, which can be opened by
Open Office Writer. Then of course you can use vim to
produce markdown files, used as input to Pandoc.
I do it all the time!
/BP
* Paris <pari...@otenet.gr> [04.04.2009 00:03]:
>
> I tried editing with vim and then opening with open office writer
> coloring, italizing, bolding and saving to .doc. But it is painful! To
> much mouse work... select the text go press the stupid B or I button or
> go press font color and then red or green. Painful.
> I want to use my keybord and only my keyboard.
You could try using ViEmu
It works for Word, Outlook and Visual Studio, allowing you to use
commands, motions, regex etc. just like in vim. Or so they say (never
used it) . I can feel your pain, I found myself in a similar situation
once. I made the switch to vim and LaTex, but still have to occasionally
use OOo when people send me stuff.
- - Mike
- --
How to sell, how to go bankrupt, how to shoot stuff
http://michaelmaurer.net/archives/2009/04/05/how_to_sell_how_to_go_bankrupt_how_to_shoot_stuff/index.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFJ2OQmTXXWYTQ0StkRAm5UAJ9GQuawApGp+90cCqtBani0+QancQCfbVU+
025elev1zlkG0ZHkEsVQflo=
=UqCs
-----END PGP SIGNATURE-----
On Sun, 2009-04-05 at 08:30 -0700, Brett Stahlman wrote:
> I created Txtfmt precisely because I occasionally like the convenience
> of WYSIWYG highlighting, but like to use Vim for all text editing. The
> *current* version of Txtfmt supports customizable foreground colors,
> in addition to bold, underline, italic, standout, reverse and
> undercurl.........
The thing is that I wanted to use it not for programming but for a
translation. So I cant have two spaces between a bold and italics word
and a non formated one.
Maybe I did something wrong because when I used \i fbi,cr and then
<ctrl-\><ctrl-\> f-,c- there were two or 3 spaces before and after the
formated word.
Anyway I must be able to have a red word followed by a non red
questionmark or a half red half nonformated word and with txtfmt I cant
do that. I 'm not saying txtfmt is not great, I'm just saying that I
cannot use it due to specific requirements.
Yes you are right, I'm sorry. But there can be only one space between
words on a book or article etc
* Stahlman Family <bretts...@comcast.net> [05.04.2009 22:38]:
snip...
> Sounds good. When you say "the default color scheme for Ubuntu Studio
> 8.04", I assume you're talking about the color scheme of the terminal
> and not Vim's "colorscheme".
Ahh yes. I've put
colorscheme elflord
set background=dark
inside my vimrc and (nearly) everything works as advertised now. I say
"nearly" because every time I switch between screen-windows and back to
VIM, the underline-formatting gets lost. Italicize, bold and color seem
to work no matter what. But if I want to see the underlined text again,
I have to ctrl-f or ctrl-b. Something having to do with the terminal
getting redrawn? I have no clue. Could be related to gnome-terminal,
screen or both.
> Incidentally, I'm glad to have found a terminal (urxvt) that properly
> supports the italic attribute. I appreciate your feedback...
I appreciate you having written this, and for helping me set it up!
Together with the Universal-Text-Linking-plugin, this makes VIM into a
blazing fast Knowledge-Management-/Hyperlink-System.
Thanks,
Mike
>
> Brett S.
- --
How to sell, how to go bankrupt, how to shoot stuff
http://michaelmaurer.net/archives/2009/04/05/how_to_sell_how_to_go_bankrupt_how_to_shoot_stuff/index.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFJ2iNcTXXWYTQ0StkRAkU6AJwNpCogvnyCU6kuPQnM8SvMslE1bgCfXeEJ
ocqkYVVK3UjLeSaQXmMLY8I=
=Lr3q
-----END PGP SIGNATURE-----