Vim

From 43FoldersWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 03:45, 12 October 2005 (edit)
DavidCary (Talk | contribs)
(WikiAsPim, VimAsPim)
← Previous diff
Revision as of 15:00, 12 October 2005 (edit) (undo)
Bkasterm (Talk | contribs)
(note on syntax coloring added)
Next diff →
Line 52: Line 52:
See our dedicated page to this topic at [[Vim/char-EOL]]. See our dedicated page to this topic at [[Vim/char-EOL]].
 +
 +=== Using Syntax Coloring ===
 +
 +A nice way to have your task list (and whatever else) easier to read is to use syntax coloring.
 +
 +Put
 + vim:set filetype=plan:
 +as a modeline (last line of the file, see :help modeline). And then put a file named plan.vim in your ~/.vim/syntax/ (or on windows ~/vimfiles/syntax/ with for instance contends
 +
 + syntax keyword Directory Goal Milestone Target Task
 + syntax match Directory "Category of Goal"
 + syntax match Special "^ [1-4]-[:a-zA-Z]*"
 + syntax match Special "[A-Z][a-z]\+ [-9]\+ [A-Z][a-z]\+$"
 + syntax match Special "\*\+"
 + syntax match NonText "^#"
 + syntax match NonText "^##"
 + syntax match NonText "^## [A-Za-z ]\+"
 + syntax match NonText "^###"
 +
 +For an explanation of these commands (and how you customize) see :help syntax. Don't forget to turn on syntax coloring by :synt on (or syntax enable in your .vimrc (on windows _vimrc)).
==See Also== ==See Also==

Revision as of 15:00, 12 October 2005

Vim
Platform: many
License: Charityware
Cost: $0
Download Size:  ??
Site: http://www.vim.org/

Contents

Description

Vim, or "vi improved" is a text editor by Bram Moolenaar. It is an enhanced version of "the unix text editor," vi, which is in turn based on ed and ex.

Testimonials

The Linux Journal magazine in its annual Readers' Choice Award selected vim as favorite text editor four years in a row!

Hacks

making outlines with vim

VimOutliner

Using text files as a proto-Wiki

Have you ever tried the gf command? It parses whatever word is under the cursor and tries to open that file in a new buffer. You don't need to use WikiCase for jump words, but it might be helpful. (On *nixes this operation will be case sensitive, I'm guessing on Windows it would be case insensitive.)

By way of example, this allows one to have a "todo" file containing text like projects/foo - Foo, the generic project. If you have your cursor over projects/foo and hit gf in command mode, the foo file in the projects directory will open in a new buffer. To navigate the jump history, use Tab or Ctrl-I to go forward and Ctrl-O to move backwards. Your todo file can now link to related files without any actual link markup! Maximum laziness. Of course, you don't need to organize them in subdirectories, either.

Since vim 6.x can also open directory listings, if you have a bunch of files in the projects directory and wish to link to a list of them, just use projects/!

For further wiki-like behavior, add this mapping to your .vimrc: (See the vim help on gf)

:map gf :e <cfile><CR>

Now if you gf on a word that doesn't have a file yet, vim will create a buffer that will save to that file name - just like a wiki, essentially.


See also WikiAsPim http://c2.com/cgi/wiki?VimKi http://c2.com/cgi/wiki?VimAsPim

* quickly Get Files in your Environment

Abstract: what are some quick ways to access files? Environment variables and the gf command. See this vim tip written by 43folders User:Gochess.


Editing files that use non-Unix end-of-line characters

See our dedicated page to this topic at Vim/char-EOL.

Using Syntax Coloring

A nice way to have your task list (and whatever else) easier to read is to use syntax coloring.

Put

 vim:set filetype=plan:

as a modeline (last line of the file, see :help modeline). And then put a file named plan.vim in your ~/.vim/syntax/ (or on windows ~/vimfiles/syntax/ with for instance contends

 syntax keyword Directory Goal Milestone Target Task
 syntax match Directory "Category of Goal"
 syntax match Special "^  [1-4]-[:a-zA-Z]*"
 syntax match Special "[A-Z][a-z]\+ [-9]\+ [A-Z][a-z]\+$"
 syntax match Special "\*\+"
 syntax match NonText "^#"
 syntax match NonText "^##"
 syntax match NonText "^## [A-Za-z ]\+"
 syntax match NonText "^###"

For an explanation of these commands (and how you customize) see :help syntax. Don't forget to turn on syntax coloring by :synt on (or syntax enable in your .vimrc (on windows _vimrc)).

See Also

Join the Mailing List

  1. subscribe to the list by sending a message to vim-subscribe@vim.org
  2. read the archives

Subscribe to the RSS feed

Personal tools