5 ms·
Using Vim as a writing environment
- smathieu 13y agoAlthough I write all of my code in Vim, I have always found it to not be great environment for text. The main annoyance comes from dealing with long lines or automatic line wrapping that never seems to do what I want it to. Does anyone have other plugins that they find useful when writing in vim?
- chrishenn 13y agoReed Esau creates a bunch of vim plugins for writing, I've found them to work very nice: http://wynnnetherland.com/journal/reed-esau-s-growing-list-of-vim-plugins-for-writers http://wynnnetherland.com/journal/reed-esau-s-growing-list-o...
- ikusalic 13y agoThank you for this link. vim-wheel is just pure gold, I needed that for a long time...
- AndreasFrom 13y agoI've written a lot of LaTeX and ConTeXt in Vim with one sentence per line without any problems.
- _nato_ 13y agoI also follow this convention. One sentence, then new line. It looks a little janky, but when you run it through pandoc or whatever, it yields the way you would want.
- edwintorok 13y agoHere are 2 more places that describe settings related to writing: http://gabekoss.com/blog/2013/11/writing_with_vim/ http://gabekoss.com/blog/2013/11/writing_with_vim/ https://alols.github.io/2012/11/07/writing-prose-with-vim/ https://alols.github.io/2012/11/07/writing-prose-with-vim/ When just brainstorming vimoutliner might help to organize ideas: http://peterstuifzand.nl/gtd-vimoutliner.html http://peterstuifzand.nl/gtd-vimoutliner.html http://jeromyanglim.blogspot.ro/2011/04/using-vim-and-vimoutliner-as.html http://jeromyanglim.blogspot.ro/2011/04/using-vim-and-vimout...
- smathieu 13y agoI did not know job `gj` and `gk` for line navigation. That will definitely be useful!
- zalmoxes 13y agohttp://www.drbunsen.org/writing-in-vim/ http://www.drbunsen.org/writing-in-vim/
- Crito 13y agoWhat I do is 1) use LaTeX so that I don't have to worry about lines and how they effect the final product, 2) :set wrap 3) map j and k to gj and gk, so that I can go up and down softwrapped lines like normal. I really don't get why the behavior of gj/gk isn't the default.
- goldfeld 13y agoWell since you mentioned long lines let me plug my own, because I find it a genuinely elegant solution to one related problem: http://github.com/goldfeld/vim-seek http://github.com/goldfeld/vim-seek, it's a motion I created mostly to move around long lines, which were a major pain point for me especially when writing prose (and even more acutely painful back when I used soft-wrapped lines, though I still get a lot of mileage from it while using hard-wrap at 80 columns, RMS/Linus-style.)
- a8da6b0c91d 13y ago> annoyance comes from dealing with long lines or automatic line wrapping You have to set 'formatoptions' depending on what you're doing. I have a keymapping to set/unset fo+=a/fo-=a.
- netdog 13y agoI find par to be very useful. http://www.nicemice.net/par/ http://www.nicemice.net/par/ Works great for re-wrapping code comments too. It's been packaged in Debian for ages.
- dfc 13y agopar is one of the handiest text tools around. I often use it to reformat longer quotes for HN. I just wish the documentation was a little better. I can only tell you about the two or three options that i use. I do not understand all of the other possible formatting commands and I definitely have no idea why I always set PARINIT="rTbgqR B=.,?_A_a Q=_s>" The first version of par was released in 1993 and the first Debian package was in 1996. The latest release will be 13 years old on Tuesday.
- makmanalp 13y agoAlso try simply "gq" + down arrow or "gq" + up arrow to realign line lengths to the paragraph length in the up or down direction. Or you can do "gqap" to do the whole paragraph regardless or where you are located. This helps me keep pretty 80char paragraphs when writing latex or .rst or .md files, and the separate lines get merged to a single line by the text processor. edit: To explain better, it basically re-wraps text in the optimal way into a paragraph. So you can not worry about spacing while typing and editing, and then when you are finally done you can just select the text and fix the wrapping really easily.
- dredmorbius 13y agogq for reflowing. The main problem I have is when I'm authoring in vim and pasting to another editor which interprets hard returns as, well, hard returns. Mostly I play games with piping through a formatting tool or join up lines manually before pasting them. Hrm. Now you've got me wondering if there's a good way to do that generically.
- dredmorbius 13y agoAnd here's what I've come up with, as ~/bin/unwrap: #!/usr/bin/perl -p use strict; BEGIN{$/=undef;} { s/(?<!\n)\n(?!\n)//sg; } END {print"\n"}
- vitaluha 13y agoHow about navigating filesystem in Vim? NerdTree ?
- techwizrd 13y agoI generally use NerdTree or Ctrl+P[1]. It's nice to be able to hit Ctrl+P and then type 3-5 chars + enter and be exactly where I want. [1]: http://kien.github.io/ctrlp.vim/ http://kien.github.io/ctrlp.vim/
- olssy 13y agoI use :Ex(plore) It's not great but it gets the job done.
- nilved 13y agotpope's vinegar is great
- leephillips 13y agoAuthor mentions having vim display greek letters and math symbols to replace the TeX input: other plugins supply the highlighting commands to do this as well, but I prefer setting LaTeX up to deal with Unicode symbols directly. I just like having actual integral signs, etc. in my source. Mainly because it freaks people out when you send them the source to your paper.
- edwintorok 13y agohow do you input those symbols efficiently? (without using a character map)
- pacaro 13y agovim has good support through digraphs, :digraphs will list them, and then to enter, either C-K <char1> <char2>, or <char1> <BS> <char2> for example ö is C-K o : or o <BS> : see http://vimdoc.sourceforge.net/htmldoc/digraph.html http://vimdoc.sourceforge.net/htmldoc/digraph.html for more details
- krick 13y agoDespite knowing vim digraphs I personally use XCompose for that these days. It's easier to configure and I can use the same shortcut for every program, wich makes memorizing vim digraphs useless.
- jeorgun 13y agoI'd mostly agree, but vim's digraphs are kind of essential when using gvim, since GTK+ seems to have an inexplicable vendetta against custom .XCompose files.
- krick 13y agoI don't know what to say. I am using gvim and my .XCompose settings seem to be fine. And I don't remember me having any troubles with that so I would have to fix something ever…
- panozzaj 13y agoI'm working on a book talking about how to write effectively using Vim ("Writing With Vim"), sign up for updates at: https://leanpub.com/vim-for-writers https://leanpub.com/vim-for-writers. I need a few more weekends and it should be good to go. It's at about fifty pages right now and covers philosophy, basic customizations, things that are built into Vim as well as plugins, and will cover some publishing workflows.
- spatten 13y ago50 pages? Ship it already! Seriously, though, if you think it'll save someone some time or effort, it may be worthwhile to hit the publish button instead of waiting. (I'm a cofounder of Leanpub, so I'm kind of biased, and being flippant here. Feel free to ignore me if it's not ready)
- panozzaj 13y agoActually, I appreciate your comment. I (tell myself I) was not able to commit to publishing previously because I could not make much time to provide updates. However, I think 1) this was probably a cop-out 2) the next couple of months will be more open. I am going to remove some interim text and/or comment it out and then publish for half price or something like that. Thanks for the push!
- tadhg 13y agoFor any other Vim & reStructuredText users out there, I wrote a plugin to improve the reST writing experience: https://github.com/erisian/rest_tools https://github.com/erisian/rest_tools http://tadhg.com/wp/2012/10/07/tools-for-writing-restructuredtext-in-vim/ http://tadhg.com/wp/2012/10/07/tools-for-writing-restructure...
- sramsay 13y agoI think I've written far more ordinary prose in Vim than I have code: two books, a dissertation, a dozen articles, probably sixty talks, letters, notes, thousands of email messages . . . you name it. I mainly use it, though, as an editor for LaTeX which, I think, is really using Vim precisely as it was intended (that is, as a code editor).
- dbbolton 13y ago>and things like replacing LaTeX greek letters by the actual greek letter, You can actually do that with conceal: http://ithaca.arpinum.org/2010/11/06/vim-conceal-for-ruby.html http://ithaca.arpinum.org/2010/11/06/vim-conceal-for-ruby.ht... http://vimdoc.sourceforge.net/htmldoc/syntax.html#conceal http://vimdoc.sourceforge.net/htmldoc/syntax.html#conceal http://vimdoc.sourceforge.net/htmldoc/options.html#'conceallevel' http://vimdoc.sourceforge.net/htmldoc/options.html#'conceall...
- fmoralesc 13y agoThat's precisely what vim-pandoc-syntax (the newest version of vim-pandoc's syntax file) + vim-latex use.
- ikusalic 13y agovimroom (mentioned in the article) is really great.
- colemorrison 13y agoSublime Text 2 + Vim mode + Markdown Plugin is amazing. It's like iA Writer except with VIM and all the fun Sublime Texyness.