Vim
Revision as of 19:35, 23 March 2020 by ScoopGracie (talk | contribs)
Vim is a text editor.
It edits text.
It is a "modal" editor, meaning that you can switch "modes." Vim starts in Command mode. More on this below. By pressing 'i', you can switch to Insert mode. In Insert mode, you just move around with the arrow keys or mouse like in a normal editor. To type, well, just type. To get back to Command mode, press Esc.
Command mode
Vim has literally hundreds of different commands. However, you don't need to be overwhelmed. Just know the following, and you'll be fine for starting out.
ZZ
- save and exit:open <file>
- open <file>:qa!
- discard all changes and exit:w
- save changes but do not exit:w <file>
- save as <file> (note that this must be followed by:open <file>
if future:w
s should use <file>):%s/<find>/<replace>/g
- find <find> and replace it with <replace>i
- switch to Insert mode
Editing XML (dix, transfer rules) in vim
http://www.pinkjuice.com/howto/vimxml/ is a nice guide to editing XML in vim.
Editing Xerox formats in vim
Various people have created lexc/twol syntax files for vim:
- https://github.com/arnsholt/proiel-morphology/tree/master/vim
- https://github.com/flammie/vim-finitestatemorphology (works with vundle as flammie/vim-finitestatemorphology)
- https://github.com/jonorthwash/dotfiles/tree/master/vim
See also Apertium-specific conventions for lexc#Syntax highlighting and folding in vim