Vim for Word (or something like it) - vim

Are there any rich-text editors that have Vi(m) keybindings? Specifically, something like Word where I can compose a document with colors, headings, et al. but use Vi(m) bindings to move around and compose?

So if you have to use MS Word and want vim key bindings, there is an add on, but if you are not bound to that I would def. go for LaTeX + the vim latex suite.

Are you familiar with Latex?
Simply put it allows you to format your documents in plain text using tags or commands.
You then "compile" your document into the final format .pdf,.ps, etc.
Ex:
\documentclass{article}
\title{Cartesian closed categories and the price of eggs}
\author{Jane Doe}
\date{September 1994}
\begin{document}
\maketitle
Hello world!
\end{document}
This will allow you to write in vim, but still get professional non plain text output for your documents.

If you like Markdown or Latex, you could use the free open source Rstudio editor, with VIM-mode enabled. Export as either Word, PDF, or HTML etc.
Download Rstudio:
https://www.rstudio.com/products/RStudio/#Desktop
Read about markdown:
http://rmarkdown.rstudio.com/

If you wish to use vim for text editing, but want to, for example have text in different colors, bold it and such ... you can use Txtfmt plugin. It enables you, by using special characters, to "prettify" plain text files a little. They can look quite nice, and it comes handy if you're used to vim, and are, for example, writing documentation for your programs which you'll later just get in word, and make an adjustment or two, and ship off.

If you want to (or have to) stay with Word and don't want to shell out $100 for a ViEmu license, you can try using this AutoHotKey script for providing some basic vi-like functionality. The repo linked also provides a standalone exe to get the same without using AutoHotKey.
There are many good reasons to ditch word entirely, but sometimes that's just not an option :(

The Txtfmt plugin definitely provides the functionality you are looking for. It's a bit like having "rich text" capability for plain text in Vim.
Txtfmt (The Vim Highlighter)
Screenshots
The latest version supports 8 configurable foreground and background colors, as well as all combinations of bold, underline, italic, etc... The highlighting is token-based, but the tokens are rendered invisible by the syntax, and can be inserted with very convenient and intuitive mappings, which don't require you to remember anything: e.g., "bold-underline" could be specified with a string such as bu or ub. The version under development even supports visual maps, which will permit you to select some text and say (for example) "Make this text red, bold-italic", and have the plugin handle insertion/removal of the appropriate tokens automatically. (It's really quite simple and intuitive, however, even with the non-visual mappings.)
Although the plugin is highly configurable, the default settings are appropriate for most users, and the author is more than happy to answer any setup or usage questions...

There's a way of configuring Abiword to use vi key bindings

You can use the text editor of your choice with vim keys (vim, emacs, sublime, atom, vscode ,etc.) and write your document in markdown. Then use an open source tool called pandoc to translate it into almost any other markup language that you want. It is possible to compile your document to rich text formats including MS Word or even MS Powerpoint.
You can costumize your output by using a template.
Pandoc has extensive documentation and uses a richer markup syntax that allows you to do pretty much anything you want with the text. It is being actively developed by the community. Almost any major text editor has a few plugins for pandoc too.

You can use GlobalVim.
It can simulate vim modes and commands in most editing area.

Related

How to highlight variables in sublime?

How to highlight variables in sublime text 3? like in netbeans
Your question is not very clear, but here are some options. First, if you're just trying to get variables highlighted differently, you'll need a color scheme with more options than the default Monokai. There are many available on Package Control, but one in particular that I know will work (since I'm its author) is Neon:
You can use the excellent tmTheme Editor to see how this or hundreds of other themes will look (sort of) in different languages. (I say "sort of" because the highlighting engine used on the website is different than the one in Sublime, so there will be some differences. Overall it's pretty good, though.)
On the other hand, if you're trying to highlight all the instances of the $page variable, you'll have to do two things. First, double-click on $page to select it. Then, select Find -> Quick Find All (or use its keyboard shortcut) to select all the instances of $page in the document:
The gutter icons and colored underlines are from the BracketHighlighter plugin
Unfortunately, this is the only way to get this to work when using PHP and other languages like JavaScript that denote variables with a $ or other symbol. If we were to use Python, for example, you could just double-click on page and it would look like so:
As you can see, all the other instances of page have boxes around them. This behavior is hard-coded into Sublime, so while it can be turned on and off, it can't be modified or told to recognize other characters in any way.
Good luck!

Define personal autocomplete library

I regularly have to program small applications for several very specific situations.
My mother language is Dutch so I define my variables in Dutch.
When I write this programs I try to use VIM.
In most of my programs I use the same syntax, so I wanted to make my own auto complete library. But because I have to switch regularly between language (from lisp to latex for example). Specifically I want to be able to load a library after I started vim.
I don't have a clue about how this library should look, but the easiest thing I could come up with is a word on every line.
set complete+=k
set dict+=~/path/to/dict
The cool thing about VIM is autocomplete happens from any open buffer. In my opinion, you can load an "autocomplete file" in a buffer, then open your source file that you're going to work on, which will open in in another buffer, and you will get all your autocomplete goodness. This will allow you to open and close whatever buffers you want autocomplete to recognize. Effectively customizing your autocomplete for that particular session.

Wrap over the showed text when using vimwiki

I'm using vimwiki, that allows you to write links like [[wiki link ...|name link]].
If you're in edit mode and in a line with a link, then you see the real file content, otherwise you just see "name link". (In a similar fashion to the vim help |links|).
But vim, to calculate the wrap, uses the real content and not the displayed content.
I would like for vim to use the displayed characters to calculate the wrap.
vimwiki uses the relatively new conceal feature to hide parts of the link, like the Vim help does with its markup. The illusion of hidden text isn't very deep, though, and Vim commands as well as the line wrapping still operate on the full text. The core Vim implementation would need to be extended to get what you want; someone needs to write a patch (and corresponding tests).
However, it's unclear how far this should be taken. After all, Vim is a text editor, not WYSIWYG. The conceal feature is a nice convenience and optical trick, not a core feature.
Instead of using conceal feature you can manage state of the actual content which is eventually written on the disk. As you can see this is a complicated approach and ridden with edge cases which risk data loss. A web equivalent of this would be rich text editors which are notoriously hard to get right.

How to write a VIM color scheme?

I have been looking around for VIM color schemes and found some great ones out there (esp. by using http://code.google.com/p/vimcolorschemetest/), but I always want to change a few aspects of each one I find. So I've decided now that what I really want to do is make my own, or be able to customize the ones I find on the fly. Basically, what I want to know is:
1) How do I write a vim color scheme -- are there any good (quick) tutorials?
2) How do I add language-specific customizations? Like say for Python, I might be interested in having different colors for classes and methods (is this even possible? What level of customization is possible?). Anything you can tell me about how to customize for specific languages would be fantastic! (esp. python, but also others like C, Java, Ruby would be great)
3) Are there are good, complete (ideally well-commented) templates that I could start from which contain all aspects of a color scheme, like background, text, language specific stuff, and the like?
Vivify lets you interactively create vim colorschemes with color pickers and previews your scheme using several code samples.
I didn't watch the "Creating colorschemes for Vim" episode of VIMcasts, but the others are really good.
colorschemes are actually vim scripts. You use the hi command for coloring, which works like
hi TextType guifg=#hexforegroundcolor guibg=#hexbgcolor gui=bold/italic/underlined/undercurled (assumed you use gvim). If you type :hionly, you get a complete list of text types with their current highlighting
see also http://vimdoc.sourceforge.net/htmldoc/syntax.html#:colorscheme
May be you can find this colorscheme template useful: http://www.vim.org/scripts/script.php?script_id=106
The original description is
"The philosophy here is to provide a ready-to-uncomment list of highlight commands for all the important groups. Then you can deviate from the default until you come up with one you like."
Launch vim, say ":help syntax", it has quick start etc.
For the complete templates look at your installation:
colorschemes are in /usr/share/vim/vimcurrent/colors/
languages syntax in /usr/share/vim/vimcurrent/syntax/

Interface texshop with vim

Any advice on how you would interface texshop on mac osx with vim? I'm using vim quite a lot lately for coding. I find myself now trying to use vim-commands (replace, search, pattern matching, move, etc) when writing documents for latex with texshop and they obviously don't work. However, I don't want to leave texshop altogether, because it has some pretty nice tools I use very often (maybe the most important one is the ability to click the compliled .pdf file while pressing the CMD key on my macbook to jump immediately to the corresponding place in the .tex file).
Thanks in advance!
Can't really help with the question but if you want to use vim I would highly recommend vim-latex suite. It has a lot of mappings and other latex goodness including completion of references/citations (it loads them from the bib file and gives prompts based on what you've already typed). Also it supports pdfsync forward/backward searching - I use that with Skim. There is some information here on how to get that working (and see other posts on that blog).
Are there any other texshop features you would like to reproduce in Vim?

Resources