├── INSTALL ├── README.md ├── bin └── vim ├── doc ├── tab-indent.txt └── vimacs.txt └── plugin ├── tab-indent.vim ├── vimacs.vim └── vimacs └── vim /INSTALL: -------------------------------------------------------------------------------- 1 | *vimacs-unix-quickstart* 2 | 3 | Firstly, you'll need Vim 6 installed. Vimacs won't work on older 4 | versions. So, make sure you're running Vim 6: 5 | > 6 | vim --version | head -1 7 | < 8 | The reply you get should say "VIM - Vi IMproved 6.0" (or higher). 9 | 10 | To install Vimacs, execute the following commands in your shell: 11 | > 12 | mkdir -p $HOME/.vim/doc 13 | mkdir -p $HOME/.vim/plugin 14 | cp -R doc plugin $HOME/.vim 15 | echo 'let g:VM_Enabled = 1' >> $HOME/.vimrc 16 | < 17 | Run the following command in a shell to make Vim rescan your documentation 18 | directory: 19 | > 20 | vim --cmd "helptags $HOME/.vim/doc" --cmd "q" 21 | < 22 | That's it. If you're a Vim user, Emacs key mappings will now be enabled 23 | whenever you're in Vim's Insert mode. If you're an Emacs user and have 24 | never used Vim before, you probably want to always keep Vim in Insert 25 | Mode, and use Select mode rather than Visual mode: 26 | > 27 | echo 'set insertmode' >> $HOME/.vimrc 28 | echo 'set selectmode += cmd' >> $HOME/.vimrc 29 | < 30 | Vimacs is now completely installed. However ... 31 | 32 | If you want to have a more sophisticated setup, where you can type a 33 | different command (such as 'vimacs') to always start in Insert mode, but 34 | typing 'vim' starts Vim in Normal mode, read on. 35 | 36 | Put the shell script located at bin/vim somewhere in your $PATH, and 37 | symlink it to the appropriate files. Change the $myscriptdir variable 38 | below to whatever directory you use for scripts; if you don't currently 39 | have one, you'll need to mkdir the directory and add it to your $PATH. 40 | (Consult your local Unix expert on adding directories to your $PATH if you 41 | don't know how to do this.) 42 | > 43 | myscriptdir=$HOME/bin 44 | mkdir -p $myscriptdir 45 | cp plugin/vimacs/vim $myscriptdir 46 | chmod 755 $myscriptdir/vim 47 | ln -s $myscriptdir/vim $myscriptdir/gvim 48 | ln -s $myscriptdir/vim $myscriptdir/vm 49 | ln -s $myscriptdir/vim $myscriptdir/gvm 50 | ln -s $myscriptdir/vim $myscriptdir/vimacs 51 | ln -s $myscriptdir/vim $myscriptdir/gvimacs 52 | myscriptdir= 53 | < 54 | For more detailed installation instructions, see |vimacs-installation| in 55 | the Vimacs help file. 56 | 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | What is Vimacs? 2 | =============== 3 | 4 | * Conrad Parker: "Dude, I gotta get you doing some serious hacking projects." 5 | * Erik de Castro Lopo: "Oh, so you're the insane guy that K was talking about." 6 | * Wichert Akkerman: "Gross. Horror. Vim abuse. Mind if I include this as an example in the Debian vim packages? :)" 7 | * Henry Gebhardt: "Vimacs, as ridiculously as it sounds, is a great idea." 8 | 9 | The Nutshell Version 10 | -------------------- 11 | 12 | Vimacs (Vim-Improved eMACS) brings Emacs's extensive key bindings and modeless 13 | editing features to the Vim world, while completely retaining Vim's powerful 14 | moded editing style. 15 | 16 | Vimacs is based on the keymaps of GNU Emacs 21 and XEmacs, so if you are 17 | familiar with them, you'll feel right at home in Vimacs. For Emacs users, you 18 | won't take long to get used to Emacs's keys: just like Vim, Emacs's key layout 19 | has been designed so that commonly used keys are quick to access. 20 | 21 | Vimacs is a standard Vim plugin, so just put the `vimacs.vim` file in your plugin 22 | directory, and put `vimacs.txt` in your documentation directory. That's it! If 23 | you're using Unix, you should also read the INSTALL text file that comes with 24 | Vimacs for notes on how to run Vim with or without Vimacs. 25 | 26 | 27 | Why use Vimacs? 28 | --------------- 29 | 30 | If you're a long-time Vim user, you retain Vi's powerful moded editing paradigm while gaining all the benefits of Emacs's modeless editing. You have nothing to lose! Since Vimacs only emulates Emacs when you're in Insert mode, you may not even notice that it's there. 31 | 32 | Of course, after a while, you may find that the `` and `` keys become second nature to you, just as you're used to the _h_, _j_, _k_, and _l_ keys for movement. Some of the keys familiar to you in Insert mode have been changed, but you won't take long to get used to Emacs's keys: just like Vim, Emacs's initially obscure key layout will reward you later on for its efficiency. Emacs experts are just as fast as Vim experts in manipulating text, and as a bonus, you start becoming familiar with Emacs keybindings, which are gradually becoming more pervasive in Unix applications. (Even Mac OS X supports some Emacs keys in its dialog boxes!) 33 | 34 | If you're an Emacs user, you'll find that Vimacs offers most of the comforts that you're used to in Emacs, with one significant advantage: blazing speed. Vim is optimised for efficient text editing, whereas Emacs is optimised for extensibility, and sacrifices speed because of it. In addition, I feel that Vim is much more straightforward to customise than Emacs, it has better documentation, and has better cross-platform support. 35 | 36 | Of course, a major disadvantage of Vim compared to Emacs is that you don't have the enormous number of Emacs add-ons that have been integrated into the editor over the last few decades. However, you may be surprised at how many of those add-ons are incorporated into Vim itself, for speed. For example, dynamic abbreviation, parenthesis highlighting, and C indenting are all built into Vim. Even complex add-ons, such as Emacs' Grand Unified Debugger, have been implemented in Vim via add-on scripts. Vim does offer its own scripting language if you want to extend it, and if that isn't enough, Vim 6.1 supports Perl, Python, Tcl, OLE, and Ruby as scripting languages: far more choices than just LISP! 37 | 38 | Ultimately, the differences between the two editors come down to different design goals: Emacs is aimed at being everything for everyone, and Vim is aimed at being a pure text editor. Vimacs opens up Vim to Emacs users (and everyone else) by allowing you to work with it without having to press `` all the time, so you aren't forced to work with Vi's moded editing style. If you've shied away from Vim because of its Vi-style editing, give Vimacs a shot! 39 | 40 | The History of Vimacs 41 | --------------------- 42 | 43 | In classic open-source spirit, Vimacs was created to "scratch an itch". I used to use Emacs all the time; it's a fantastic tool for doing all kinds of things (even text editing...). However, it suffers from some problems which I feel are unsolvable without a drastic redesign: 44 | 45 | * Speed. Emacs doesn't even begin to approach Vim for raw speed; Vim can load and fully syntax-colour a file before Emacs even displays its window. (Using gnuclient doesn't count!) One of the reasons for Emacs's slow speed compared to many other text editors is that it uses LISP for everything. Now, using LISP for everything has many advantages, including making Emacs completely extensible. I'm all for extensibility, but in this case, Emacs is too slow (for me) because of it. In my eyes, you use an editor so much in the UNIX environment that you really want it to be as fast as possible. Even though Emacs is extensible++, it's slow enough that I never load it for quick editing jobs. 46 | 47 | * Customisation is too hard. Emacs exposed so much of its complexity and internals to you that it would befuddle your average user who just wanted to change a few settings. I didn't feel like learning LISP just to customise the editor a bit; `M-x customize` made this much better, but it's still still unnecessarily hard to change something which isn't in that list of options. Try writing your own syntax file or colour scheme, for instance; other editors usually make this much easier. Of course, you can argue that learning the language of Emacs (i.e. LISP) leads to learning a powerful generic language which can be used in many places outside of Emacs, but hey, some of us want to get other work done, too. 48 | 49 | Please don't get me wrong--I'm not flaming Emacs, and I'm definitely not saying that it's a bad editor. It's a fantastic editor; it's arguably one of the most powerful pieces of software on the planet. It's just not the kind of editor that I like to use on a daily basis. I don't need most of its ninja-fu abilities, but some of them are incredibly helpful. I can't live without things like dynamic abbreviation (the magical `M-/` key), and having the editor understand the syntax of the file you're editing. Once you're used to those features, life is simply miserable without them. 50 | Vimacs was created because I was looking for an alternative to Emacs, and I found none. I wanted a cross-platform editor, since I work a lot on both Win32 and UNIX systems, and I wanted it to be fast and easy to customise, yet still have most of the power that Emacs gave me when I was editing text files, or coding. I tried every single editor I found on Freshmeat and Ibiblio, but I still couldn't find one that I liked. Vim would have been perfect, but I could never get used to the moded style of editing. Pressing <Esc> all the time drove me nuts. (I'm not saying that moded editing sucks, mind you, I'm just saying that I personally hated being forced into that kind of editing style.) 51 | After toying around with Vim's scripting language, I decided to do something to end my misery, and I figured that Vim's scripting capabilities were powerful enough that it could be used to emulate Emacs quite well. I wouldn't be able to emulate everything, of course, but I'd be able to emulate Emacs well enough that it'd have all the key bindings that I was used to. So, Vimacs was born. Vim by itself is a powerful editor; I loved everything about it except for the moded editing paradigm. Vimacs is simply something which makes Vim more accessible to the non-Vi crowd, and it does so in a way which impacts existing Vim users in a very small way. 52 | -------------------------------------------------------------------------------- /bin/vim: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # real path to vim 4 | VIM_CMD=${VIM_CMD:-/usr/bin/vim} 5 | GVIM_CMD=${GVIM_CMD:-/usr/bin/gvim} 6 | 7 | # what program name was i run as? 8 | argv0=`basename $0` 9 | 10 | # turn off software flow control so and will work. you can add 11 | # extra stty settings by setting $VIM_STTY (i use 'erase ^?' here) 12 | [ -t 0 ] && stty -ixon -ixoff $VIM_STTY 13 | 14 | case "$argv0" in 15 | g*) 16 | VIM_CMD="$GVIM_CMD" 17 | ;; 18 | esac 19 | 20 | case "$argv0" in 21 | *diff) 22 | VIM_CMD="${VIM_CMD}diff" 23 | ;; 24 | esac 25 | 26 | case "$argv0" in 27 | # This case has to come before vim 28 | *vm*|*vimacs*) 29 | exec $VIM_CMD --cmd "let g:VM_Enabled = 1" \ 30 | --cmd "set insertmode" \ 31 | "$@" 32 | ;; 33 | *vim*) 34 | exec $VIM_CMD --cmd "let g:VM_Enabled = 1" \ 35 | "$@" 36 | ;; 37 | esac 38 | 39 | -------------------------------------------------------------------------------- /doc/tab-indent.txt: -------------------------------------------------------------------------------- 1 | *tab-indent.txt* Tab Indentation for Vim 2 | 3 | |TabIndent.01| Introduction 4 | |TabIndent.02| Usage 5 | |TabIndent.03| Options 6 | |TabIndent.04| Revision History (ChangeLog) 7 | |TabIndent.05| Contact, Help, Credits 8 | 9 | 10 | ============================================================================== 11 | *TabIndent.01* Introduction 12 | 13 | The TabIndent plugin allows you use the key in Insert mode to indent the 14 | current line, as well as retain its usual task of inserting a real 15 | character. TabIndent exhibits a bit of intelligence by making sure that the 16 | current line is only indented if you're editing source code, by checking the 17 | 'cindent' and 'indentexpr' options. Editing text files will never cause the 18 | key to perform indentation. 19 | 20 | You can also change the behaviour of when indentation is performed; some 21 | people prefer to always perform indentation, and others may want to 22 | indent only if the cursor is at the start of the line. TabIndent is designed 23 | to make every user work the way they want to. 24 | 25 | 26 | ============================================================================== 27 | *TabIndent.02* Usage 28 | 29 | To install the TabIndent plugin, put the tab-indent.vim file into the plugin 30 | subdirectory, contained in one of the directories in your 'runtimepath'. 31 | (Such as /usr/share/vim/vimfiles/ on UNIX, or "C:\Vim\vimfiles" on Win32). 32 | You'll need Vim 6.0 or above. 33 | 34 | Once the TabIndent plugin is installed, simply press the key in Insert 35 | mode to indent the line. will perform an indent if the current buffer 36 | has the 'cindent' or 'indentexpr' options set, otherwise it will act as if you 37 | had pressed normally. (Whether it inserts a real, physical is 38 | dependent upon other options such as 'softtabstop'; the TabIndent plugin 39 | doesn't touch these options). 40 | 41 | To install the TabIndent documentation, copy this textfile (tab-indent.txt) to 42 | the "doc" directory in your 'runtimepath'. (e.g. "$HOME/.vim/doc" on UNIX), 43 | then run the |helptags| command on that directory from inside Vim. (e.g. 44 | ":helptags ~/.vim/doc"). See |add-local-help| for details. 45 | 46 | 47 | ============================================================================== 48 | *TabIndent.03* Options 49 | 50 | TabIndent can change its behaviour to your liking by setting variables in your 51 | Vim startup file ("$HOME/.vimrc" in Unix; "C:\Vim\_vimrc" in Windows; see 52 | |.vimrc| for more information). You can set variables using |:let| command, 53 | e.g. 54 | > 55 | let g:TabIndentStyle = "emacs" 56 | < 57 | 58 | *TabIndent-option-list* 59 | 60 | *'g:TabIndentStyle'* 61 | 62 | 'g:TabIndentStyle' number or string (default "emacs") 63 | 64 | Changes the behaviour of the key if the TabIndent plugin is 65 | loaded. No matter what you set this variable to, indentation will 66 | only occur if either the 'cindent' or 'indentexpr' option is set for 67 | the current buffer. If both those options are not set, pressing 68 | will always act as if you pressed the key without the plugin 69 | loaded. 70 | 71 | setting behaviour ~ 72 | 73 | "0" or "never" always inserts a real tab 74 | 75 | "1" or "emacs" always indents 76 | or "always" 77 | 78 | "2" or "whitespace" will indent if the cursor is in 79 | whitespace (space or tab character) at 80 | the start of the line 81 | 82 | "3" or "startofline" will indent if the cursor is in 83 | whitespace (space or tab character) at 84 | the start of the line, or at the very 85 | start of the line 86 | 87 | 88 | ============================================================================== 89 | *TabIndent.04* Revision History (ChangeLog) 90 | 91 | *TabIndent-history* 92 | 93 | I originally had the tab-or-indent functionality in Vimacs, a completely 94 | separate plugin for Vim; the actual idea is borrowed from c-mode in (X)Emacs. 95 | It was pointed out to me that I should make the behaviour of the key 96 | customisable; it was at that point that I decided to make it a completely 97 | separate plugin. Since I couldn't find any comparable script on the Vim 98 | Online website which did this, I decided to make it a real Vim plugin and 99 | release it to the world. 100 | 101 | *TabIndent-changelog* 102 | 103 | *TabIndent-1.0* 104 | 105 | Initial release. 106 | 107 | 108 | ============================================================================== 109 | *TabIndent.05* Contact, Help, Credits 110 | 111 | *TabIndent-help* *TabIndent-author* 112 | 113 | The author of the TabIndent plugin is Andre Pang . 114 | 115 | Just email me directly if you have any queries about the plugin. I don't bite 116 | :). 117 | 118 | *TabIndent-webpage* 119 | 120 | There isn't a webpage for the plugin at the moment. You can always find the 121 | latest version at the Vim Online website, at http://vim.sourceforge.net/. 122 | TabIndent also comes bundled with Vimacs, which is locate at 123 | http://www.vimacs.cx/. 124 | 125 | *TabIndent-thanks* 126 | 127 | TabIndent wouldn't be as useful as it is without the help of the following 128 | people (whether they realise it or not ;): 129 | 130 | Charles E. Campbell ~ 131 | For writing an excellent document on how to write "proper" Vim plugins. 132 | 133 | Michelle Wibisono ~ 134 | For making me realise that the tab-or-indent functionality in Vimacs 135 | should be made customisable, and put into its own Vim plugin. Yay 136 | modularity! 137 | 138 | Thanks! 139 | 140 | 141 | ============================================================================== 142 | vim:tw=78:sts=0:ts=8:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: 143 | 144 | -------------------------------------------------------------------------------- /doc/vimacs.txt: -------------------------------------------------------------------------------- 1 | *vimacs.txt* Vimacs: Emacs mappings (emulation) for Vim 2 | 3 | |Vimacs.01| Introduction 4 | |Vimacs.02| Installing Vimacs 5 | |Vimacs.03| Vimacs Options 6 | |Vimacs.04| Changes for Emacs users 7 | |Vimacs.05| Changes for Vim users 8 | |Vimacs.06| Key Map 9 | |Vimacs.07| Design Comments 10 | |Vimacs.08| Known Problems 11 | |Vimacs.09| Revision History (ChangeLog) 12 | |Vimacs.10| In the Future ... (TODO list) 13 | |Vimacs.11| Contact, Help, Credits 14 | 15 | 16 | ============================================================================== 17 | *Vimacs.01* Introduction 18 | 19 | *vimacs* 20 | 21 | *vimacs-introduction* 22 | 23 | Vimacs (Vim-Improved eMACS) brings Emacs' extensive key bindings and modeless 24 | editing features to the Vim world, while completely retaining Vim's 25 | powerful moded editing style. 26 | 27 | Vimacs is based on the keymaps of GNU Emacs 21 and XEmacs, so if you are 28 | familiar with them, you'll feel right at home in Vimacs. For Emacs users, 29 | most (if not all) of the common key maps in Emacs are present in Vimacs, such 30 | as , and to mark, kill and yank regions, to 31 | find a file, and 2 to vertically split a window. However, you can now 32 | take advantage of the incredible power of Vim's Normal and Command modes with 33 | a touch of the key. 34 | 35 | Why use Vimacs instead of Emacs? Vim's configuration and option tweaking is 36 | arguably much easier than doing the same task in the Emacs world; its 37 | scripting language is simpler and more conventional than LISP, and still very 38 | powerful. Python, Perl, and |libcall()| (C library interface) support allow 39 | for incredibly powerful scripting if you need something which is the equal of 40 | ELISP. Vim is heavily optimised for speed and text editing; you may find Vim 41 | to be much quicker in many tasks. While Emacs and Vim may run on equally as 42 | many platforms, Vim often has superior support for non-Unix operating systems 43 | in comparison to Emacs; e.g. Vim for Win32 can natively function as a DDE 44 | server and can integrate into Microsoft Visual Studio. 45 | 46 | If you're a long-time Vim user, you retain vi's powerful moded editing 47 | paradigm while gaining all the benefits of Emacs' modeless editing. After a 48 | while, the and keys will become second nature to you, just as 49 | you're used to the |h|, |j|, |k|, and |l| keys for movement. Some of the keys 50 | familiar to you in Insert mode have been changed, but you won't take long to 51 | get used to Emacs' keys: just like Vim, Emacs' key layout has been designed so 52 | that commonly used keys are quick to access. Emacs' initially strange key 53 | layout will reward you later on for its efficiency, just like Vim does. Emacs 54 | experts are just as fast as Vim experts in manipulating text, and as a bonus, 55 | you start becoming familiar with Emacs keybindings, which are gradually 56 | becoming more pervasive in Unix applications. (Even MacOS X supports some 57 | Emacs keys in its dialog boxes!) 58 | 59 | *vimacs-terminology* 60 | 61 | Vim and Emacs use different (and sometimes conflicting) terminology. Since 62 | Vimacs runs within the Vim environment, we will use the Vim terminology rather 63 | than Emacs terminology. 64 | 65 | Emacs Terminology Vim Terminology 66 | 67 | (key)binding map 68 | point cursor 69 | kill yank 70 | yank paste 71 | register mark 72 | rectangle block 73 | kill-ring registers 74 | 75 | It is Vim standard that key bindings are written in |<>| notation; thankfully 76 | this is essentially the same as Emacs' key binding notation. In Emacs, the 77 | key combination Control-x followed by Control-f is written as "C-x C-f"; in 78 | Vim, this is written as "". Meta-f in Emacs is written as "M-f"; in 79 | Vim, this is written as "" or "". (The 'A' stands for Alt; in Vim, 80 | there is no distinction between the Meta and Alt keys.) Vim helpfiles also 81 | use a |CTRL-X_CTRL-F|-style notation; Vimacs-specific keys will use a 82 | |vimacs:CTRL-X_CTRL-F| notation. 83 | 84 | For the gory details of Vim notation, see |notation|. 85 | 86 | *vimacs-help-navigation* 87 | 88 | Emacs users: If you are not in insert mode (if you do not see a line at the 89 | bottom of the screen saying "-- INSERT MODE --"), use to follow a link, 90 | and to go back a link. If you are using Vimacs keybindings and are in 91 | Insert mode, you can follow a help link such as |vimacs-introduction| by 92 | moving your cursor over it and pressing . This is the same as Emacs' 93 | typical keybinding, which is the |vimacs:find-tags| command. Jump back 94 | to your previous position using the key. 95 | 96 | Vim users: Pressing in Insert mode performs the same function as 97 | |CTRL-]| in Normal mode. is equivalent to |CTRL-T|. 98 | 99 | 100 | ============================================================================== 101 | *Vimacs.02* Installing Vimacs 102 | 103 | *vimacs-quickstart* 104 | 105 | The following quick start guides are for Win32 and Unix systems. Detailed 106 | installation instructions follow afterward. 107 | 108 | *vimacs-win32-quickstart* 109 | 110 | Firstly, you'll need Vim 6 installed. Vimacs won't work on older 111 | versions. 112 | 113 | To install Vimacs, copy the .txt file in the archive to your Vim 114 | documentation directory (typically "C:\Program Files\vim\vimfiles\doc"), 115 | and copy the .vim file to your plugin directory (typically "C:\Program 116 | Files\vim\vimfiles\plugin"). 117 | 118 | See the |vimacs-installation| topic in the main Vimacs help file for full 119 | information. 120 | 121 | *vimacs-unix-quickstart* 122 | 123 | Firstly, you'll need Vim 6 installed. Vimacs won't work on older 124 | versions. So, make sure you're running Vim 6: 125 | > 126 | vim --version | head -1 127 | < 128 | The reply you get should say "VIM - Vi IMproved 6.0" (or higher). 129 | 130 | To install Vimacs, execute the following commands in your shell: 131 | > 132 | mkdir -p $HOME/.vim/doc 133 | mkdir -p $HOME/.vim/plugin 134 | cp -R doc plugin $HOME/.vim 135 | < 136 | Run the following command in a shell to make Vim rescan your documentation 137 | directory: 138 | > 139 | vim --cmd "helptags $HOME/.vim/doc" --cmd "q" 140 | < 141 | That's it. If you're a Vim user, Emacs key mappings will now be enabled 142 | whenever you're in Vim's Insert mode. If you're an Emacs user and have 143 | never used Vim before, you probably want to always keep Vim in Insert 144 | Mode, and use Select mode rather than Visual mode: 145 | > 146 | echo 'set insertmode' >> $HOME/.vimrc 147 | echo 'set selectmode += cmd' >> $HOME/.vimrc 148 | < 149 | Vimacs is now completely installed. However ... 150 | 151 | If you want to have a more sophisticated setup, where you can type a 152 | different command (such as 'vimacs') to always start in Insert mode, but 153 | typing 'vim' starts Vim in Normal mode, read on. 154 | 155 | Put the shell script located at plugin/vimacs/vim somewhere in your $PATH, 156 | and symlink it to the appropriate files. Change the $myscriptdir variable 157 | below to whatever directory you use for scripts; if you don't currently 158 | have one, you'll need to mkdir the directory and add it to your $PATH. 159 | (Consult your local Unix expert on adding directories to your $PATH if you 160 | don't know how to do this.) 161 | > 162 | myscriptdir=$HOME/bin 163 | mkdir -p $myscriptdir 164 | cp plugin/vimacs/vim $myscriptdir 165 | chmod 755 $myscriptdir/vim 166 | ln -s $myscriptdir/vim $myscriptdir/gvim 167 | ln -s $myscriptdir/vim $myscriptdir/vm 168 | ln -s $myscriptdir/vim $myscriptdir/gvm 169 | ln -s $myscriptdir/vim $myscriptdir/vimacs 170 | ln -s $myscriptdir/vim $myscriptdir/gvimacs 171 | myscriptdir= 172 | < 173 | For more detailed installation instructions, see |vimacs-installation| in 174 | the Vimacs help file. 175 | 176 | *vimacs-installation* 177 | 178 | Vimacs is designed for Vim 6 only; if you are running Vim 5.x, please upgrade 179 | to Vim 6. There is no intention to `port' Vimacs to run on older versions of 180 | Vim. 181 | 182 | Vimacs is a Vim 6 plugin; simply drop it into any Vim plugin directory, such 183 | as "$HOME/.vim/plugin" on a Unix system, or "C:\Program 184 | Files\vim\vimfiles\plugin" on Windows. You may also want to place this 185 | documentation (the "vimacs.txt" file) in a Vim documentation directory; e.g. 186 | "$HOME/.vim/doc", or "C:\Program Files\vim\vimfiles\doc". You should run the 187 | |:helptags| command on the documentation directory after installation; see 188 | |add-local-help| for more information. 189 | 190 | Vimacs does not initially start in Insert mode, to be consistent with what Vim 191 | users normally expect. If you an Emacs user, you may wish to put 192 | > 193 | set insertmode 194 | set selectmode += cmd 195 | < 196 | in your |.vimrc| startup file, so that you use a more Emacs-like selection 197 | mode, as well as being in Insert mode straight away. 198 | 199 | Please read the |vimacs-unix| section if you are running Vimacs on a Unix 200 | systems, and |vimacs-non-unix| if you are installing Vimacs on other operating 201 | systems (e.g. Windows, Macintosh). 202 | 203 | *vimacs-unix* 204 | *vimacs-unix-flow-control* 205 | 206 | Like Emacs, Vimacs uses the key to search, and to insert the next 207 | character literally ('quoted-insert' in Emacs-speak; normally in Vim). 208 | 209 | In many Unix terminals, and are flow control characters used to 210 | stop and start terminal output, which means that Vim will look like it has 211 | frozen when you press . (This problem only affects the Unix console 212 | version of Vim; gvim is not affected.) Emacs modifies your terminal's 213 | settings, so it doesn't normally have this problem. Vim, however, does not 214 | modify terminal settings, and thus you need to explicitly turn off flow 215 | control. 216 | 217 | To solve the / flow control problem, you need to turn off XON/XOFF 218 | flow control processing for your tty. The stty(1) command will do this: 219 | > 220 | $ stty -ixon -ixoff 221 | < 222 | You may wish to make a shell script somewhere in your path to do this 223 | automatically, e.g. 224 | > 225 | $ cat << END > $HOME/bin/vim 226 | #!/bin/sh 227 | 228 | # turn off flow control if we're a terminal 229 | [ -t 0 ] && stty -ixon -ixoff 230 | 231 | exec /usr/bin/vim "$@" 232 | END 233 | < 234 | For a more in-depth example of using a wrapper shell script to initialise Vim 235 | (and Vimacs) to your choosing, see |vimacs-unix-progname| 236 | 237 | *vimacs-unix-meta-sends-esc* 238 | 239 | This applies to the console version of Vim only (i.e. not gvim). On many Unix 240 | terminals, the Meta key typically generates an followed by the 241 | combination key; for example, pressing generates the key sequences 242 | x. However, you may have a terminal emulator that sends as an 'x' 243 | with the 8th bit set, rather than as x. Most Unix terminal emulators, 244 | (including xterm) have an option to do this, but do not enable it by default. 245 | If your terminal sends as x with the 8th bit set, set the 246 | |'g:VM_UnixConsoleRemapEsc'| option to 1. 247 | 248 | NOTE: This is not a Vimacs-specific problem; Vim also has to work around this 249 | issue, with options like 'esckeys', 'timeout' and 'ttimeout'. 250 | 251 | *vimacs-unix-progname* 252 | 253 | Via the magic of shell scripts (and symlinks), it's possible to change the 254 | default behaviour of Vimacs, depending on what you typed to run it. For 255 | example: 256 | 257 | Command name Load Vimacs? Start in/use Insert mode? 258 | 259 | (g)vim yes no/no 260 | (g)vimacs yes yes/yes 261 | (g)vm[1] yes yes/yes 262 | 263 | 1. `vm' is an abbreviation for `ViMacs' 264 | 265 | To do the above, firstly, make a directory to store programs and scripts in, 266 | and add that directory to your $PATH: 267 | > 268 | $ mkdir $HOME/bin 269 | $ export PATH="$HOME/bin:$PATH" 270 | < 271 | Save the following shell script in the above directory as "vim". For 272 | convenience, this script is also available in the plugin/vimacs directory; 273 | simply copy it to $HOME/bin/vim. 274 | > 275 | #!/bin/sh 276 | 277 | # real path to vim 278 | VIM_CMD=${VIM_CMD:-/usr/bin/vim} 279 | GVIM_CMD=${GVIM_CMD:-/usr/bin/gvim} 280 | 281 | # what program name was i run as? 282 | argv0=`basename $0` 283 | 284 | # turn off software flow control so and will work. you can add 285 | # extra stty settings by setting $VIM_STTY (i use 'erase ^?' here) 286 | [ -t 0 ] && stty -ixon -ixoff $VIM_STTY 287 | 288 | case "$argv0" in 289 | g*) 290 | VIM_CMD="$GVIM_CMD" 291 | ;; 292 | esac 293 | 294 | case "$argv0" in 295 | *diff) 296 | VIM_CMD="${VIM_CMD}diff" 297 | ;; 298 | esac 299 | 300 | case "$argv0" in 301 | # This case has to come before vim 302 | *vm*|*vimacs*) 303 | exec $VIM_CMD --cmd "let g:VM_Enabled = 1" \ 304 | --cmd "set insertmode" \ 305 | "$@" 306 | ;; 307 | *vim*) 308 | exec $VIM_CMD --cmd "let g:VM_Enabled = 1" \ 309 | "$@" 310 | ;; 311 | esac 312 | 313 | < 314 | Now, make your vim command executable: 315 | > 316 | chmod a+x $HOME/bin/vim 317 | < 318 | Finally, make symlinks from the `vim' shell script to the other commands 319 | you'll be running it as: 320 | > 321 | ln -s $HOME/bin/vim $HOME/bin/gvim 322 | ln -s $HOME/bin/vim $HOME/bin/vm 323 | ln -s $HOME/bin/vim $HOME/bin/gvm 324 | ln -s $HOME/bin/vim $HOME/bin/vimacs 325 | ln -s $HOME/bin/vim $HOME/bin/gvimacs 326 | ln -s $HOME/bin/vim $HOME/bin/vimdiff 327 | ln -s $HOME/bin/vim $HOME/bin/gvimdiff 328 | ln -s $HOME/bin/vim $HOME/bin/vmdiff 329 | ln -s $HOME/bin/vim $HOME/bin/gvmdiff 330 | ln -s $HOME/bin/vim $HOME/bin/vimacsdiff 331 | ln -s $HOME/bin/vim $HOME/bin/gvimacsdiff 332 | < 333 | Now, after all that hard work, you can give Vim different personalities 334 | just by running a different command name! 335 | 336 | *vimacs-non-unix* 337 | 338 | There are no special notes for running Vimacs on non-Unix operating systems. 339 | 340 | 341 | ============================================================================== 342 | *Vimacs.03* Vimacs Options 343 | 344 | *vimacs-options* 345 | 346 | Vimacs can change its behaviour to your liking by setting variables in your 347 | Vim startup file ("$HOME/.vimrc" in Unix; "C:\Program Files\vim\_vimrc" in 348 | Windows; see |.vimrc| for more information). You can set variables using 349 | |:let| command, e.g. 350 | 351 | > 352 | let g:VM_CmdHeightAdj = 0 353 | let g:VM_NormalMetaXRemap = 1 354 | < 355 | 356 | *vimacs-option-list* 357 | 358 | *'g:VM_CmdHeightAdj'* 359 | 360 | 'g:VM_CmdHeightAdj' number (default 1) 361 | 362 | Adjust the current 'cmdheight' setting. Vimacs will normally increase 363 | the 'cmdheight' option to 2 if it's less than 2 and the 'showmode' 364 | option is set, because the mode message will often obscure the most 365 | recent message. 366 | 367 | *'g:VM_Dev'* 368 | 369 | 'g:VM_Dev' number (default 0) 370 | 371 | Turn on "developer mode"; forces overwriting of commands, functions 372 | and maps which already exist when Vimacs is loaded. Vimacs will not 373 | typically load its own commands, functions or mappings if one 374 | currently exist. 375 | 376 | *'g:VM_Enabled'* 377 | 378 | 'g:VM_Enabled' number (default 1) 379 | 380 | Don't load Vimacs at all. May be useful in your startup script, e.g. 381 | for Unix people who use the "less" Vim script: 382 | > 383 | if v:progname == "less" 384 | source /usr/share/doc/vim/macros/less.vim 385 | let g:VM_Enabled = 0 386 | endif 387 | < 388 | *'g:VM_F10Menu'* 389 | 390 | 'g:VM_F10Menu' number (default 1) 391 | 392 | Enable the key to pull down the menus which are normally only 393 | available in the GUI version of Vim. (GNU Emacs uses F10 for this 394 | purpose.) 395 | 396 | *'g:VM_NormalMetaXRemap'* 397 | 398 | 'g:VM_NormalMetaXRemap' number (default 1) 399 | 400 | In Normal mode, map the key to go to Command mode (i.e. it has 401 | the same effect as typing |:|). 402 | 403 | NOTE: is always enabled in Insert mode; this option affects 404 | in Normal mode only. 405 | 406 | *'g:VM_SearchRepeatHighlight'* 407 | 408 | 'g:VM_SearchRepeatHighlight' number (default 0) 409 | 410 | Highlight all occurances of your current search on the screen when you 411 | repeat a search with or . This effectively turns on the 412 | 'hls' option while you're searching. 413 | 414 | *'g:VM_SingleEscToNormal'* 415 | 416 | 'g:VM_SingleEscToNormal' number (default 1) 417 | 418 | Only need to press the once in Insert mode to return to Normal 419 | mode. If this option is off, you need to press to return 420 | to Normal mode; see |vimacs-unix-esc-key| for rationale. 421 | 422 | *'g:VM_UnixConsoleMetaSendsEsc'* 423 | 424 | 'g:VM_UnixConsoleMetaSendsEsc' number (default 1) 425 | 426 | Remap x to become (where x is any keypress); this is needed 427 | for Unix terminals which send a Meta key as an Escape sequence, rather 428 | than sending the keypress with the 8th bit on. Most Unix terminals 429 | seem to do that these days. 430 | 431 | *'g:VM_Wrap'* 432 | 433 | 'g:VM_Wrap' number (default 2) 434 | 435 | Allow wrapping when the cursor moves. By default all keys are allowed 436 | in all modes. Set its value to 1 to allow wrapping only in 437 | insert/replace mode, or 0 to retain the vim |'whichwrap'| option. 438 | 439 | *'g:VM_WrapHL'* 440 | 441 | 'g:VM_WrapHL' number (default 1) 442 | 443 | Allow h/l keys to wrap in normal/visual mode. Since it's not 444 | recommended in vim, it can be turned off separately. When 445 | |'g:VM_Wrap'| is not 2, this option has no effect. 446 | 447 | *'g:VM_Hidden'* 448 | 449 | 'g:VM_Hidden' number (default 1) 450 | 451 | Hide the buffer when editing a new file. This option affects the 452 | |'hidden'| option and the bindings of keys etc. 453 | 454 | *vimacs-vim-options* 455 | 456 | Vimacs's operation is heavily influenced by a few of Vim's options. You can 457 | set them in the usual manner (with the |:set| command). 458 | 459 | *'vimacs-backspace'* 460 | 'backspace' 'bs' string (default "") 461 | global 462 | {not in Vi} 463 | 464 | Vimacs will automatically set this option, since pressing in 465 | Emacs typically backspaces over anything and everything :). 466 | 467 | *'vimacs-cedit'* 468 | 'cedit' string (Vi default: "", Vim default: CTRL-F) 469 | global 470 | {not in Vi} 471 | {not available when compiled without the |+vertsplit| 472 | feature} 473 | 474 | Currently, Vimacs relies on the 'cedit' option to be CTRL-F. This is 475 | regarded as a bug, and will hopefully be fixed in the future. 476 | 477 | *'vimacs-esckeys'* 478 | 'esckeys' 'ek' boolean (Vim default: on, Vi default: off) 479 | global 480 | {not in Vi} 481 | 482 | Vimacs automatically sets this option. (Note that strictly speaking, 483 | this may not be necessary ... please send me a patch if you can't live 484 | with this behaviour). 485 | 486 | *'vimacs-hidden'* 487 | 'hidden' 'hid' boolean (default off) 488 | global 489 | {not in Vi} 490 | 491 | Vimacs will automatically set this option; Emacs always "hidden 492 | buffers". 493 | 494 | *'vimacs-incsearch'* 495 | 'incsearch' 'is' boolean (default off) 496 | global 497 | {not in Vi} 498 | {not available when compiled without the 499 | |+extra_search| feature} 500 | 501 | CTRL-S (incremental search forward) and CTRL-R (incremental search 502 | backward) will override Vim's 'incsearch' option; they will always do 503 | an incremental search. 504 | 505 | *'vimacs-insertmode'* 506 | 507 | 'insertmode' 'im' boolean (default off) 508 | global 509 | {not in Vi} 510 | 511 | Setting the 'insertmode' option makes Insert mode the default mode, 512 | and effectively makes Vim modeless. This is important for Vimacs 513 | since it allows for a much more complete emulation of Emacs. (See 514 | Vim's 'insertmode' help entry for more detail.) 515 | 516 | When 'insertmode' is set and Vimacs is active, the CTRL-O and CTRL-L 517 | keys change to the Emacs behaviour, and still escapes back to 518 | normal mode. 519 | 520 | See also: the |'g:VM_SingleEscToNormal'| option and 521 | |vimacs-unix-esc-key|. 522 | 523 | *'vimacs-keymodel'* 524 | 'keymodel' 'km' string (default "") 525 | global 526 | {not in Vi} 527 | 528 | Vimacs will automatically manipulate this option to ensure that 529 | marking blocks using (and the key, if the "key" word 530 | is included in 'selectmode') works as intended. 531 | 532 | *'vimacs-selection'* 533 | 'selection' 'sel' string (default "inclusive") 534 | global 535 | {not in Vi} 536 | 537 | Vimacs will change the default value of this option to "exclusive", 538 | since it's very much more Emacs-like in its behaviour. 539 | 540 | *'vimacs-selectmode'* 541 | 'selectmode' 'slm' string (default "") 542 | global 543 | {not in Vi} 544 | 545 | If the "cmd" word is in the 'selectmode' option, Vimacs will use 546 | Select mode when marking a block using . 547 | 548 | *'vimacs-timeout'* 549 | 'timeout' 'to' boolean (default on) 550 | global 551 | *'vimacs-ttimeout'* 552 | 'ttimeout' boolean (default off) 553 | global 554 | {not in Vi} 555 | 556 | Vimacs will automatically set these options for optimal behaviour, 557 | depending on whether the 'insertmode' and |'g:VM_SingleEscToNormal'| 558 | options are set, and whether you're running in a UNIX console or not. 559 | 560 | This is done for safety reasons; it's quite easy to screw up Vim if 561 | use key mappings extensively and you're running in a UNIX 562 | console. 563 | 564 | *'vimacs-whichwrap'* 565 | 'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "") 566 | global 567 | {not in Vi} 568 | 569 | Vimacs will automatically manipulate this option to obtain Emacs-like 570 | behaviour. (If you're that pedantic about this option, why on earth 571 | are you using Vimacs in the first place? Send me a patch, send me 572 | a patch ...) 573 | 574 | *'vimacs-wildcharm'* 575 | 'wildcharm' 'wcm' number (default: none (0)) 576 | global 577 | {not in Vi} 578 | 579 | Vimacs automatically manipulates this option. If you don't like that, 580 | send me a patch! 581 | 582 | *'vimacs-winaltkeys'* 583 | 'winaltkeys' 'wak' string (default "menu") 584 | global 585 | {not in Vi} 586 | {only used in Win32, Motif, GTK and Photon GUI} 587 | 588 | Vimacs will automatically unset this option, since it interferes with 589 | remapping the / keys. 590 | 591 | 592 | ============================================================================== 593 | *Vimacs.04* Changes for Emacs users 594 | 595 | Nothing written yet. Send patches or hate mail to the |vimacs-author| :). 596 | 597 | 598 | ============================================================================== 599 | *Vimacs.05* Changes for Vim users 600 | 601 | Nothing written yet. Send patches or hate mail to the |vimacs-author| :). 602 | 603 | 604 | ============================================================================== 605 | *Vimacs.06* Key Map 606 | 607 | Emacs has many keys, and this section of the documentation is currently 608 | incomplete. If you want to help complete this section, please send me 609 | patches! 610 | 611 | Other than looking at the vimacs.vim script file itself, a suggested way of 612 | learning the Emacs key set is from Emacs itself (and Emacs clones such as jed 613 | and jmacs). Press b in GNU Emacs or XEmacs to get a list of key 614 | bindings. 615 | 616 | Files and Buffers 617 | *vimacs:CTRL-X_CTRL-F* 618 | 619 | CTRL-X CTRL-F Loads a new file into the current window; see |:edit|. 620 | 621 | *vimacs:CTRL-X_CTRL-S* 622 | 623 | CTRL-X CTRL-S Saves the current buffer to disk, but only if's been 624 | modified. See |:update|. 625 | 626 | *vimacs:CTRL-X_s* 627 | 628 | CTRL-X s Saves all changes buffers to disk; see |:wa|. 629 | 630 | *vimacs:CTRL-X_i* 631 | 632 | CTRL-X i Inserts a file into the current buffer. See |:read|. 633 | 634 | *vimacs:CTRL-X_CTRL-W* 635 | 636 | CTRL-X CTRL-W Saves the current buffer to disk as a different filename. 637 | See |:write_f|. 638 | 639 | 640 | Error Recovery 641 | *vimacs:CTRL-_* 642 | *vimacs:CTRL-X_CTRL_U* 643 | 644 | CTRL-_ 645 | CTRL-X CTRL-U Undo your last action. 646 | 647 | 648 | ============================================================================== 649 | *Vimacs.07* Design Comments 650 | 651 | This is a collection of anecdotes, design issues and ramblings that I came 652 | across with when writing Vimacs. Vi was certainly never designed to be used 653 | in a modeless way, and Vimacs pushes Vim's modeless functionality to its 654 | limits, so I expected to encounter some bugs^H^H^H^Hundocumented features in 655 | writing Vimacs. Somewhat surprisingly, there seems to be only a few small 656 | problems in Vim which limit Vimacs' Emacs emulation capabilities, and these 657 | tend to be philosophical or conceptual differences between the two editors 658 | rather than being actual bugs. (Quite amazing, considering that the two 659 | editors, at first glance, seem so completely different.) 660 | 661 | *vim-emacs-similarity* 662 | 663 | Many Emacs features actually have a direct 1:1 mapping to Vim commands; for 664 | example, Emacs' |vimacs:META-A| command is exactly the same as Vim's Command 665 | mode |(| command. Thus, many of the Vimacs commands were very simple to 666 | imlpement. 667 | 668 | *cursor-at-eol* 669 | 670 | One of the bigger complications that arose in Vimacs is that the cursor 671 | position is conceptually different between Vim's various modes. In Insert 672 | mode, Vim's cursor is treated as being _between_ two characters, not "on" a 673 | character. 674 | 675 | In Normal mode, the cursor is treated as being "on" a character, and not 676 | between the characters. (If you use gvim, you can see that the cursor is a 677 | normal block shape in Command mode, but the shape changes to a thin vertical 678 | line in Insert Mode.) This means that switching from Insert mode to Normal 679 | mode can cause problems if you're at the end of a line. The cursor seems to 680 | 'jump back' a character, because the cursor is _after_ the last character in 681 | Insert mode, and when you revert to Normal mode, the cursor cannot be past the 682 | end of the line, so it goes to the last character on the line. Going back to 683 | Insert Mode from there therefore puts your cursor one character back from the 684 | end of the line, rather than being at the end of the line. 685 | 686 | You can use the |a| command instead of the |i| to solve this problem, but then 687 | you lose precision at the beginning of the line, rather than at the end. It's 688 | not a particularly easy problem to solve; I hope that Bram Moolenar provides 689 | an option to change this behaviour in the future. 690 | 691 | *remapping-CTRL_O* 692 | 693 | In Emacs, the key is mapped to `open-line'; in Vim, executes one 694 | command in Normal mode, and then returns to Insert mode (see |i_CTRL-O|). 695 | This poses a problem: internally, Vim uses for many commands, and 696 | remapping it to `open-line' causes problems. Commands such as |:amenu| use 697 | to return to Normal mode from Insert mode, and thus remapping can 698 | lead to interesting problems. 699 | 700 | There will be an option in the future to prevent from being remapped at 701 | all; of course, this means that you can't remap the to a function at 702 | all, which isn't ideal. 703 | 704 | The `proper' way to fix this would be for Vim to limit the mapping to 705 | Insert mode only, and fix the other commands (such as |:amenu|) so that they 706 | always use the unmapped version of . 707 | 708 | *vimacs-quotes* 709 | 710 | Conrad Parker: "Dude, I gotta get you doing some serious hacking 711 | projects" 712 | 713 | Erik de Castro Lopo: "Oh, so you're the insane guy that K was talking 714 | about" 715 | 716 | Wichert Akkerman: "Gross. Horror. Vim abuse. Mind if I include this as 717 | an example in the Debian vim packages? :)" 718 | 719 | (add yours here if you like :) 720 | 721 | 722 | ============================================================================== 723 | *Vimacs.08* Known Problems 724 | 725 | *vimacs-and-lazyredraw* 726 | 727 | Vim seems to be a bit buggy and occasionally doesn't redraw the screen 728 | properly when it should, if you have the 'lazyredraw' option set. Please turn 729 | it off if you notice redraw glitches. 730 | 731 | This is a problem in Vim, not Vimacs, but Vimacs seems to exarcerbate the 732 | problem. 733 | 734 | *vimacs-meta-d-at-eol* 735 | 736 | Pressing at the end of the line (EOL) doesn't delete the word. 737 | 738 | *vimacs-unix-esc-key* 739 | 740 | On Unix console systems (i.e. not gvim), you may get a warning when you press 741 | twice telling you to use the or keys to return to Normal 742 | mode. i.e. You can't do a simple press to return to Normal mode, as you 743 | normally do in Vi(m). In a nutshell, this is because of Vim's 'insertmode' 744 | option. 745 | 746 | When 'insertmode' is turned on, Vim normally remaps the key so that 747 | novice users don't find themselves in Vim's Normal mode if they accidently hit 748 | . Remember that 'insertmode' is originally designed for |evim|, which is 749 | a point-and-click editor in the style of Windows Notepad. You don't want 750 | users winding up in Normal mode if they want something as simple as Notepad! 751 | 752 | Due to the way that Unix terminals were originally designed, if: 753 | 754 | 1. you are running Vimacs in a Unix console, 755 | 2. have |g:VM_UseInsertMode| (and the 'insertmode' option) set 756 | 3. have |g:VM_UnixConsoleRemapEsc| set 757 | 4. have |g:VM_SingleEscToNormal| set 758 | 759 | when Vim receives an key, it is completely impossible to determine 760 | whether it is part of a Meta key mapping (such as ) or the single 761 | key press that you did to get out of Insert mode. The simple solution to this 762 | is: either get used to the or keys to get back to Insert mode, or 763 | change one of the above g:VM_ settings. There's no way around it, sorry; this 764 | is a limitation in the way that Vim and Unix consoles were designed. 765 | 766 | Another way to solve the problem is to always make the user press twice 767 | to get back to Normal mode. Vim will interpret an in an 768 | unambigious way, and therefore you will never have this problem. To do this, 769 | turn off the |'g:VM_SingleEscToNormal'| option. The obvious problem with this 770 | solution is that you need to change your habits, so that you must press 771 | to return to Normal mode, rather than a simple . 772 | 773 | Deep Vim and Unix hackers may be interested to hear why this happens. Vim can 774 | normally tell whether the key is part of a Meta key sequence (such as 775 | f), by using its multitude of |:timeout|-related options. However, if 776 | |:insertmode| is set (which it is if |g:VM_UseInsertMode| is set), Vim changes 777 | the key so that it no longer brings you out of Insert mode. To get 778 | around this, we remap the ourselves so that it does bring you out of 779 | Insert mode. We can do this in an environment which has a completely 780 | unambigious key; i.e. an is always an . However, in the Unix 781 | console, since many (most?) terminals send a combo as x, we must 782 | change Vim's terminal settings to interpret a x as . However, now 783 | there's no way for Vim to tell whether the first is a single by 784 | itself, or part of a larger sequence like x, because we have both the 785 | key remapped to and the key being part of a larger key 786 | sequence. This unfortunate design flaw is therefore a limitation of both Vim 787 | (because it changes the normal behaviour of ) and the Unix console 788 | (because whoever designed the original terminals decided to put the real 789 | key on the keyboard, which should never have happened). Any suggestions to 790 | fix this annoying situation would save me a lot of pain :). 791 | 792 | *vimacs-'cedit'* 793 | 794 | See the |'vimacs-cedit'| topic in the option summary for details. 795 | 796 | 797 | 798 | ============================================================================== 799 | *Vimacs.09* Revision History (ChangeLog) 800 | 801 | *vimacs-changelog* 802 | 803 | *vimacs-0.96* 804 | 805 | Added "set nocp" note to INSTALL_unix file 806 | 807 | Fixed some mark commands (e.g. ) so that don't splurge out confusing 808 | messages to the screen 809 | 810 | *vimacs-0.95* 811 | 812 | Fixed up 'duplicate tag "vimacs" in file vimacs.txt' when running helptags; 813 | merci dopey! 814 | 815 | BTW, Vimacs is now available in Debian, thanks to dopey! apt-get install 816 | vimacs to annoy everybody else using vim on your computer 817 | 818 | *vimacs-0.94* 819 | 820 | Searching the last searched text with or now works a bit 821 | better (although I'm still not 100% satisfied with it) 822 | 823 | Fixed not working 824 | 825 | in Visual mode now copies to the clipboard (PRIMARY selection in X) 826 | 827 | in Visual mode now cuts to the clipboard (PRIMARY selection in X) 828 | 829 | Fixed "trailing characters" error message when doing (:QueryReplace) 830 | 831 | Fixed QueryReplaceRegexp 832 | 833 | *vimacs-0.93* 834 | 835 | Made the thankyou (credits) list look a bit nicer :). 836 | 837 | *vimacs-0.92* 838 | 839 | and now cycle through the QuickFix list rather than perform the 840 | next/previous search 841 | 842 | at EOL now deletes the word at the start of the next line, 843 | instead of the last character at the end of the current line 844 | 845 | on command line now deletes the word before the cursor 846 | 847 | on command line copies the selection (to register) 848 | 849 | on command line pastes the selection 850 | 851 | Indenting on key moved to a tab-indent.vim 852 | 853 | *vimacs-0.91* 854 | 855 | Moved vi check to be much earlier in the script 856 | 857 | Rewrote : it's (much) simpler now 858 | 859 | Updated Unix installation notes 860 | 861 | at EOL will now include the last character on the line 862 | 863 | Use Vim's 'keymodel' option instead of own g:VM_VisualMode variable 864 | 865 | Use Vim's 'selectmode' option instead of own g:VM_ShiftSel variable 866 | 867 | *vimacs-0.9* 868 | 869 | Added Piet Delport to THANKS section 870 | 871 | Wrote a function to initialise a variable to a default value, with Piet's help 872 | 873 | Added Barrie Stott to THANKS section 874 | 875 | Added navigation keys such as to Operator Pending mode (actually done in 876 | 0.2, but I forgot to add it to the ChangeLog. Oops.) 877 | 878 | Automatically pop up list of buffers for b 879 | 880 | Added , , , to select region (for 881 | g:VM_ShiftSel) 882 | 883 | Added commandline abbreviations for query_replace 884 | 885 | Added to normal mode (yeah, I kept hitting instead of just typing 886 | a colon (':'); sad, innit? 887 | 888 | is now remapped in Insert mode instead of Normal mode 889 | 890 | (query-replace) and (query-replace-regexp) now escape / 891 | characters, so the s/// doesn't get messed up 892 | 893 | Remapped to (for UNIX terminals) 894 | 895 | (fill-paragraph) now leaves cursor at fill point, thanks to the 896 | very useful Mark() function stolen from foo.vim by Benji Fisher. 897 | 898 | Added ... bindings for quick escape into Normal mode 899 | 900 | Added (that's Meta and a backtick) to return to Normal mode 901 | 902 | Added to pulldown the menus (in the GUI system), ala GNU Emacs 903 | 904 | Added VM_Enabled variable to allow users to not load Vimacs 905 | 906 | Properly fixed mapping of x keys to keys, using the :set 907 | command rather than :map 908 | 909 | Added r when in Visual mode to switch to Visual Block mode; this is 910 | meant to (poorly) emulate Emacs' rectangle support. It'll almost 911 | definitely be changed at a later date, because this isn't similar to how 912 | Emacs works at all 913 | 914 | Changed mappings to (see :help ; it doesn't 915 | mention that it's case-sensitive!) 916 | 917 | Made and search forward/backward from within a search prompt 918 | 919 | Added Hari Krishna Dara & Arun Easi to THANKS section 920 | 921 | Made be more Emacs-like by making Vim go into Select mode rather 922 | than Visual mode. (This is now the default; set g:VM_VisualMode to 1 to 923 | change it back to the old behaviour where triggers Visual mode.) 924 | 925 | Added g:VM_SearchRepeatHighlight option, which highlights the current item 926 | you're searching for if you press or to search again 927 | 928 | Default for g:VM_AlwaysRemapEsc changed from 0 to 1, to maintain interface 929 | consistency throughout all of vim's console/GUI versions 930 | 931 | Initial formal documentation (vimacs.txt: check it out!) 932 | 933 | Fixed to leave one line 934 | 935 | Added (toggle-readonly) 936 | 937 | Added (find-file-read-only) 938 | 939 | Added (upcase-region) 940 | 941 | in Insert mode now jumps back to Command mode; to suspend Vimacs 942 | from Insert mode, press twice. Note that you'll be in Normal mode 943 | when you resume 944 | 945 | Fixed highlighting one less character than the current word 946 | 947 | Changed all functions to have be internal to the script (i.e. use 948 | mappings) 949 | 950 | Implemented primitive yank-pop () support, but hey, it does work ... 951 | 952 | Added Charles E. Campbell to THANKS section 953 | 954 | now actually redraws as well as recentering cursor 955 | 956 | and move by paragraphs 957 | 958 | scrolls other window down. 959 | 960 | Integration with Jeff Lanzarotta's BufExplorer plugin for b. Vimacs will 961 | launch BufExplorer when you press b if you have it. BufExplorer will use 962 | a default sort order of MRU, since this how it works in Emacs. You will need 963 | BufExplorer 6.0.16 for this to work properly, otherwise ':insertmode' will 964 | screw things up ... 965 | 966 | Added , and : All map to Vim's |insert_expand| command 967 | 968 | Added to |Cmdline-mode| 969 | 970 | inserts the character above the cursor (|i_CTRL-Y|) 971 | 972 | 973 | ============================================================================== 974 | *Vimacs.10* In the Future ... (TODO list) 975 | 976 | *vimacs-todo* 977 | 978 | Replace "set =^[x" with a loop; ASCII range 7 to 127 979 | 980 | Implement haskell-mode and with vimsh for Manuel :) 981 | 982 | BufExplorer used for bdelete etc. commands? 983 | 984 | Don't overwrite maps. Err. Will be hard ... 985 | 986 | GotoLine should accept a range or argument 987 | 988 | Autoconfiscate ... is that overkill?! 989 | 990 | Make b silent (for :BufExplorer?) 991 | 992 | C-x n p 993 | 994 | Emacs-like status line? 995 | 996 | "Mark stack" ala in Emacs, and to jump to last 997 | marks 998 | 999 | Add Mac notes to documentation. 1000 | 1001 | Jed keys: = newline but no indent, = ?, = 1002 | leave one line, = find-alternate-file, 1003 | 1004 | Emacs folding keys 1005 | 1006 | Fix and to turn on regexps 1007 | 1008 | Bind , and ? 1009 | 1010 | Follow mode (http://www.csd.uu.se/~andersl/follow.shtml). Maybe as a 1011 | separate script; e.g. vimacs-follow.vim 1012 | 1013 | Argument (M-1/M-2/etc) and universal argument keys. Ahahaha, good 1014 | luck to me ... (hmm, v:count1 looks promising!) 1015 | 1016 | mapcheck() everything -- oooh boy 1017 | 1018 | Port the rest of XEmacs' 419830213 bindings 1019 | 1020 | Zippy, Doctor, kitchen sink 1021 | 1022 | 1023 | ============================================================================== 1024 | *Vimacs.11* Contact, Help, Credits 1025 | 1026 | *vimacs-author* 1027 | 1028 | The author of Vimacs is Andre Pang . 1029 | 1030 | *vimacs-webpage* 1031 | 1032 | The official Vimacs webpage is at http://www.vimacs.cx/. It is also regularly 1033 | uplaoded to the Vim Online website, at http://vim.sourceforge.net/. 1034 | 1035 | *vimacs-thanks* 1036 | 1037 | Many people have inspired me to work on Vimacs. (This is actually a good 1038 | thing. Really ...) The following are a brief list of people who have been 1039 | particularly helpful: 1040 | 1041 | Manuel Chakravarty ~ 1042 | For introducing me to Emacs, otherwise I'd never be writing an 1043 | alternative for it ;) 1044 | 1045 | Piet Delport ~ 1046 | Vim scripting help 1047 | 1048 | Benji Fisher ~ 1049 | Vim scripting help, and the wonderful foo.vim script 1050 | 1051 | Barrie Stott ~ 1052 | Testing and feedback on early releases 1053 | 1054 | Hari Krishna Dara, Arun Easi ~ 1055 | Inspiration on how to map and to repeat your current search 1056 | 1057 | Charles E. Campbell ~ 1058 | Writing a document on how to write Vim plugins, convincing me use s 1059 | and s for Vimacs's internal functions, Vim scripting help 1060 | 1061 | The Vim, GNU Emacs, and XEmacs teams ~ 1062 | For absolutely amazing text editors! 1063 | 1064 | *vimacs-suggestions* 1065 | 1066 | Please, please ask for key mappings which you consider to be fundamental 1067 | in Emacs! This is a serious project, it's not another Vigor :). I'm not 1068 | a veteran Emacs user by any means, so there are potentially scores of 1069 | keys which many consider to be fundamental which I am missing. Send me 1070 | a request (or even better, a patch!) if you feel like a favourite key 1071 | binding is missing, or if behaviour is incorrect. 1072 | 1073 | *vimacs-gpl2* 1074 | 1075 | GNU GENERAL PUBLIC LICENSE 1076 | Version 2, June 1991 1077 | 1078 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 1079 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1080 | Everyone is permitted to copy and distribute verbatim copies 1081 | of this license document, but changing it is not allowed. 1082 | 1083 | Preamble 1084 | 1085 | The licenses for most software are designed to take away your 1086 | freedom to share and change it. By contrast, the GNU General Public 1087 | License is intended to guarantee your freedom to share and change free 1088 | software--to make sure the software is free for all its users. This 1089 | General Public License applies to most of the Free Software 1090 | Foundation's software and to any other program whose authors commit to 1091 | using it. (Some other Free Software Foundation software is covered by 1092 | the GNU Library General Public License instead.) You can apply it to 1093 | your programs, too. 1094 | 1095 | When we speak of free software, we are referring to freedom, not 1096 | price. Our General Public Licenses are designed to make sure that you 1097 | have the freedom to distribute copies of free software (and charge for 1098 | this service if you wish), that you receive source code or can get it 1099 | if you want it, that you can change the software or use pieces of it 1100 | in new free programs; and that you know you can do these things. 1101 | 1102 | To protect your rights, we need to make restrictions that forbid 1103 | anyone to deny you these rights or to ask you to surrender the rights. 1104 | These restrictions translate to certain responsibilities for you if you 1105 | distribute copies of the software, or if you modify it. 1106 | 1107 | For example, if you distribute copies of such a program, whether 1108 | gratis or for a fee, you must give the recipients all the rights that 1109 | you have. You must make sure that they, too, receive or can get the 1110 | source code. And you must show them these terms so they know their 1111 | rights. 1112 | 1113 | We protect your rights with two steps: (1) copyright the software, and 1114 | (2) offer you this license which gives you legal permission to copy, 1115 | distribute and/or modify the software. 1116 | 1117 | Also, for each author's protection and ours, we want to make certain 1118 | that everyone understands that there is no warranty for this free 1119 | software. If the software is modified by someone else and passed on, we 1120 | want its recipients to know that what they have is not the original, so 1121 | that any problems introduced by others will not reflect on the original 1122 | authors' reputations. 1123 | 1124 | Finally, any free program is threatened constantly by software 1125 | patents. We wish to avoid the danger that redistributors of a free 1126 | program will individually obtain patent licenses, in effect making the 1127 | program proprietary. To prevent this, we have made it clear that any 1128 | patent must be licensed for everyone's free use or not licensed at all. 1129 | 1130 | The precise terms and conditions for copying, distribution and 1131 | modification follow. 1132 | 1133 | GNU GENERAL PUBLIC LICENSE 1134 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 1135 | 1136 | 0. This License applies to any program or other work which contains 1137 | a notice placed by the copyright holder saying it may be distributed 1138 | under the terms of this General Public License. The "Program", below, 1139 | refers to any such program or work, and a "work based on the Program" 1140 | means either the Program or any derivative work under copyright law: 1141 | that is to say, a work containing the Program or a portion of it, 1142 | either verbatim or with modifications and/or translated into another 1143 | language. (Hereinafter, translation is included without limitation in 1144 | the term "modification".) Each licensee is addressed as "you". 1145 | 1146 | Activities other than copying, distribution and modification are not 1147 | covered by this License; they are outside its scope. The act of 1148 | running the Program is not restricted, and the output from the Program 1149 | is covered only if its contents constitute a work based on the 1150 | Program (independent of having been made by running the Program). 1151 | Whether that is true depends on what the Program does. 1152 | 1153 | 1. You may copy and distribute verbatim copies of the Program's 1154 | source code as you receive it, in any medium, provided that you 1155 | conspicuously and appropriately publish on each copy an appropriate 1156 | copyright notice and disclaimer of warranty; keep intact all the 1157 | notices that refer to this License and to the absence of any warranty; 1158 | and give any other recipients of the Program a copy of this License 1159 | along with the Program. 1160 | 1161 | You may charge a fee for the physical act of transferring a copy, and 1162 | you may at your option offer warranty protection in exchange for a fee. 1163 | 1164 | 2. You may modify your copy or copies of the Program or any portion 1165 | of it, thus forming a work based on the Program, and copy and 1166 | distribute such modifications or work under the terms of Section 1 1167 | above, provided that you also meet all of these conditions: 1168 | 1169 | a) You must cause the modified files to carry prominent notices 1170 | stating that you changed the files and the date of any change. 1171 | 1172 | b) You must cause any work that you distribute or publish, that in 1173 | whole or in part contains or is derived from the Program or any 1174 | part thereof, to be licensed as a whole at no charge to all third 1175 | parties under the terms of this License. 1176 | 1177 | c) If the modified program normally reads commands interactively 1178 | when run, you must cause it, when started running for such 1179 | interactive use in the most ordinary way, to print or display an 1180 | announcement including an appropriate copyright notice and a 1181 | notice that there is no warranty (or else, saying that you provide 1182 | a warranty) and that users may redistribute the program under 1183 | these conditions, and telling the user how to view a copy of this 1184 | License. (Exception: if the Program itself is interactive but 1185 | does not normally print such an announcement, your work based on 1186 | the Program is not required to print an announcement.) 1187 | 1188 | These requirements apply to the modified work as a whole. If 1189 | identifiable sections of that work are not derived from the Program, 1190 | and can be reasonably considered independent and separate works in 1191 | themselves, then this License, and its terms, do not apply to those 1192 | sections when you distribute them as separate works. But when you 1193 | distribute the same sections as part of a whole which is a work based 1194 | on the Program, the distribution of the whole must be on the terms of 1195 | this License, whose permissions for other licensees extend to the 1196 | entire whole, and thus to each and every part regardless of who wrote it. 1197 | 1198 | Thus, it is not the intent of this section to claim rights or contest 1199 | your rights to work written entirely by you; rather, the intent is to 1200 | exercise the right to control the distribution of derivative or 1201 | collective works based on the Program. 1202 | 1203 | In addition, mere aggregation of another work not based on the Program 1204 | with the Program (or with a work based on the Program) on a volume of 1205 | a storage or distribution medium does not bring the other work under 1206 | the scope of this License. 1207 | 1208 | 3. You may copy and distribute the Program (or a work based on it, 1209 | under Section 2) in object code or executable form under the terms of 1210 | Sections 1 and 2 above provided that you also do one of the following: 1211 | 1212 | a) Accompany it with the complete corresponding machine-readable 1213 | source code, which must be distributed under the terms of Sections 1214 | 1 and 2 above on a medium customarily used for software interchange; or, 1215 | 1216 | b) Accompany it with a written offer, valid for at least three 1217 | years, to give any third party, for a charge no more than your 1218 | cost of physically performing source distribution, a complete 1219 | machine-readable copy of the corresponding source code, to be 1220 | distributed under the terms of Sections 1 and 2 above on a medium 1221 | customarily used for software interchange; or, 1222 | 1223 | c) Accompany it with the information you received as to the offer 1224 | to distribute corresponding source code. (This alternative is 1225 | allowed only for noncommercial distribution and only if you 1226 | received the program in object code or executable form with such 1227 | an offer, in accord with Subsection b above.) 1228 | 1229 | The source code for a work means the preferred form of the work for 1230 | making modifications to it. For an executable work, complete source 1231 | code means all the source code for all modules it contains, plus any 1232 | associated interface definition files, plus the scripts used to 1233 | control compilation and installation of the executable. However, as a 1234 | special exception, the source code distributed need not include 1235 | anything that is normally distributed (in either source or binary 1236 | form) with the major components (compiler, kernel, and so on) of the 1237 | operating system on which the executable runs, unless that component 1238 | itself accompanies the executable. 1239 | 1240 | If distribution of executable or object code is made by offering 1241 | access to copy from a designated place, then offering equivalent 1242 | access to copy the source code from the same place counts as 1243 | distribution of the source code, even though third parties are not 1244 | compelled to copy the source along with the object code. 1245 | 1246 | 4. You may not copy, modify, sublicense, or distribute the Program 1247 | except as expressly provided under this License. Any attempt 1248 | otherwise to copy, modify, sublicense or distribute the Program is 1249 | void, and will automatically terminate your rights under this License. 1250 | However, parties who have received copies, or rights, from you under 1251 | this License will not have their licenses terminated so long as such 1252 | parties remain in full compliance. 1253 | 1254 | 5. You are not required to accept this License, since you have not 1255 | signed it. However, nothing else grants you permission to modify or 1256 | distribute the Program or its derivative works. These actions are 1257 | prohibited by law if you do not accept this License. Therefore, by 1258 | modifying or distributing the Program (or any work based on the 1259 | Program), you indicate your acceptance of this License to do so, and 1260 | all its terms and conditions for copying, distributing or modifying 1261 | the Program or works based on it. 1262 | 1263 | 6. Each time you redistribute the Program (or any work based on the 1264 | Program), the recipient automatically receives a license from the 1265 | original licensor to copy, distribute or modify the Program subject to 1266 | these terms and conditions. You may not impose any further 1267 | restrictions on the recipients' exercise of the rights granted herein. 1268 | You are not responsible for enforcing compliance by third parties to 1269 | this License. 1270 | 1271 | 7. If, as a consequence of a court judgment or allegation of patent 1272 | infringement or for any other reason (not limited to patent issues), 1273 | conditions are imposed on you (whether by court order, agreement or 1274 | otherwise) that contradict the conditions of this License, they do not 1275 | excuse you from the conditions of this License. If you cannot 1276 | distribute so as to satisfy simultaneously your obligations under this 1277 | License and any other pertinent obligations, then as a consequence you 1278 | may not distribute the Program at all. For example, if a patent 1279 | license would not permit royalty-free redistribution of the Program by 1280 | all those who receive copies directly or indirectly through you, then 1281 | the only way you could satisfy both it and this License would be to 1282 | refrain entirely from distribution of the Program. 1283 | 1284 | If any portion of this section is held invalid or unenforceable under 1285 | any particular circumstance, the balance of the section is intended to 1286 | apply and the section as a whole is intended to apply in other 1287 | circumstances. 1288 | 1289 | It is not the purpose of this section to induce you to infringe any 1290 | patents or other property right claims or to contest validity of any 1291 | such claims; this section has the sole purpose of protecting the 1292 | integrity of the free software distribution system, which is 1293 | implemented by public license practices. Many people have made 1294 | generous contributions to the wide range of software distributed 1295 | through that system in reliance on consistent application of that 1296 | system; it is up to the author/donor to decide if he or she is willing 1297 | to distribute software through any other system and a licensee cannot 1298 | impose that choice. 1299 | 1300 | This section is intended to make thoroughly clear what is believed to 1301 | be a consequence of the rest of this License. 1302 | 1303 | 8. If the distribution and/or use of the Program is restricted in 1304 | certain countries either by patents or by copyrighted interfaces, the 1305 | original copyright holder who places the Program under this License 1306 | may add an explicit geographical distribution limitation excluding 1307 | those countries, so that distribution is permitted only in or among 1308 | countries not thus excluded. In such case, this License incorporates 1309 | the limitation as if written in the body of this License. 1310 | 1311 | 9. The Free Software Foundation may publish revised and/or new versions 1312 | of the General Public License from time to time. Such new versions will 1313 | be similar in spirit to the present version, but may differ in detail to 1314 | address new problems or concerns. 1315 | 1316 | Each version is given a distinguishing version number. If the Program 1317 | specifies a version number of this License which applies to it and "any 1318 | later version", you have the option of following the terms and conditions 1319 | either of that version or of any later version published by the Free 1320 | Software Foundation. If the Program does not specify a version number of 1321 | this License, you may choose any version ever published by the Free Software 1322 | Foundation. 1323 | 1324 | 10. If you wish to incorporate parts of the Program into other free 1325 | programs whose distribution conditions are different, write to the author 1326 | to ask for permission. For software which is copyrighted by the Free 1327 | Software Foundation, write to the Free Software Foundation; we sometimes 1328 | make exceptions for this. Our decision will be guided by the two goals 1329 | of preserving the free status of all derivatives of our free software and 1330 | of promoting the sharing and reuse of software generally. 1331 | 1332 | NO WARRANTY 1333 | 1334 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 1335 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 1336 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 1337 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 1338 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1339 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 1340 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 1341 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 1342 | REPAIR OR CORRECTION. 1343 | 1344 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 1345 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 1346 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 1347 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 1348 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 1349 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 1350 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 1351 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 1352 | POSSIBILITY OF SUCH DAMAGES. 1353 | 1354 | END OF TERMS AND CONDITIONS 1355 | 1356 | How to Apply These Terms to Your New Programs 1357 | 1358 | If you develop a new program, and you want it to be of the greatest 1359 | possible use to the public, the best way to achieve this is to make it 1360 | free software which everyone can redistribute and change under these terms. 1361 | 1362 | To do so, attach the following notices to the program. It is safest 1363 | to attach them to the start of each source file to most effectively 1364 | convey the exclusion of warranty; and each file should have at least 1365 | the "copyright" line and a pointer to where the full notice is found. 1366 | 1367 | 1368 | Copyright (C) 1369 | 1370 | This program is free software; you can redistribute it and/or modify 1371 | it under the terms of the GNU General Public License as published by 1372 | the Free Software Foundation; either version 2 of the License, or 1373 | (at your option) any later version. 1374 | 1375 | This program is distributed in the hope that it will be useful, 1376 | but WITHOUT ANY WARRANTY; without even the implied warranty of 1377 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1378 | GNU General Public License for more details. 1379 | 1380 | You should have received a copy of the GNU General Public License 1381 | along with this program; if not, write to the Free Software 1382 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1383 | 1384 | 1385 | Also add information on how to contact you by electronic and paper mail. 1386 | 1387 | If the program is interactive, make it output a short notice like this 1388 | when it starts in an interactive mode: 1389 | 1390 | Gnomovision version 69, Copyright (C) year name of author 1391 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 1392 | This is free software, and you are welcome to redistribute it 1393 | under certain conditions; type `show c' for details. 1394 | 1395 | The hypothetical commands `show w' and `show c' should show the appropriate 1396 | parts of the General Public License. Of course, the commands you use may 1397 | be called something other than `show w' and `show c'; they could even be 1398 | mouse-clicks or menu items--whatever suits your program. 1399 | 1400 | You should also get your employer (if you work as a programmer) or your 1401 | school, if any, to sign a "copyright disclaimer" for the program, if 1402 | necessary. Here is a sample; alter the names: 1403 | 1404 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 1405 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 1406 | 1407 | , 1 April 1989 1408 | Ty Coon, President of Vice 1409 | 1410 | This General Public License does not permit incorporating your program into 1411 | proprietary programs. If your program is a subroutine library, you may 1412 | consider it more useful to permit linking proprietary applications with the 1413 | library. If this is what you want to do, use the GNU Library General 1414 | Public License instead of this License. 1415 | 1416 | 1417 | ============================================================================== 1418 | vim:tw=78:sts=0:ts=8:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: 1419 | 1420 | -------------------------------------------------------------------------------- /plugin/tab-indent.vim: -------------------------------------------------------------------------------- 1 | """ 2 | "" TabIndent (1.0) 3 | " 4 | " Overloads to either insert a tab, or perform indentation 5 | " 6 | 7 | " 8 | " Copyright (C) 2002 Andre Pang 9 | " 10 | " Please see the documentation (tab-indent.txt) for installation and usage 11 | " notes. 12 | " 13 | 14 | if exists("loaded_TabIndent") 15 | finish 16 | endif 17 | 18 | " Load Vimacs tab-indent? 19 | if v:progname =~ '^vi$' 20 | " Never load Vimacs if user wants true Vi! (We're not _that_ evil 8) 21 | finish 22 | elseif v:progname =~ 'vimacs' || v:progname =~ 'vemacs' || v:progname =~ 'vm' 23 | let g:TabIndentStyle = "emacs" 24 | elseif !exists("g:TabIndentStyle") || g:TabIndentStyle == 0 25 | " A user should explicitly enable tab-indent style 26 | finish 27 | endif 28 | 29 | inoremap =TabOrIndent() 30 | 31 | function! TabOrIndent() 32 | 33 | let saved_cpoptions = &cpoptions 34 | set cpoptions-=<,C,k 35 | set cpoptions+=B 36 | 37 | let indent_blank_line = "\x\==\\\" 38 | let indent = "\==" 39 | let real_tab = "\" 40 | 41 | let &cpoptions = saved_cpoptions 42 | 43 | if &cindent || &indentexpr != "" 44 | 45 | if g:TabIndentStyle == 1 || g:TabIndentStyle == "emacs" || g:TabIndentStyle == "always" 46 | if getline('.') =~ '^\s*$' 47 | return indent_blank_line 48 | else 49 | return indent 50 | endif 51 | 52 | elseif g:TabIndentStyle == 2 || g:TabIndentStyle == "whitespace" 53 | if virtcol('.') <= indent(line('.')) 54 | return indent 55 | else 56 | return real_tab 57 | endif 58 | 59 | elseif g:TabIndentStyle == 3 || g:TabIndentStyle == "startofline" 60 | if virtcol('.') <= indent(line('.')) || virtcol('.') == 1 61 | return indent 62 | else 63 | return real_tab 64 | endif 65 | 66 | endif 67 | 68 | else 69 | return real_tab 70 | endif 71 | 72 | endfunction 73 | 74 | let loaded_TabIndent = 1 75 | 76 | -------------------------------------------------------------------------------- /plugin/vimacs.vim: -------------------------------------------------------------------------------- 1 | """ 2 | "" Vimacs (0.96) 3 | " 4 | " Vim-Improved eMACS 5 | " 6 | " (Oh dear, what have I got myself into?) 7 | " 8 | 9 | " 10 | " Copyright (C) 2002 Andre Pang 11 | " 12 | " Please see the documentation (vimacs.txt) for the README, installation 13 | " notes, and the ChangeLog. 14 | " 15 | 16 | " 17 | " This program is free software; you can redistribute it and/or modify 18 | " it under the terms of the GNU General Public License as published by 19 | " the Free Software Foundation; either version 2 of the License, or 20 | " (at your option) any later version. 21 | " 22 | " This program is distributed in the hope that it will be useful, 23 | " but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | " GNU General Public License for more details. 26 | " 27 | " You should have received a copy of the GNU General Public License 28 | " along with this program; if not, write to the Free Software 29 | " Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 30 | " 31 | " This General Public License does not permit incorporating your program into 32 | " proprietary programs. If your program is a subroutine library, you may 33 | " consider it more useful to permit linking proprietary applications with the 34 | " library. If this is what you want to do, use the GNU Library General 35 | " Public License instead of this License. 36 | " 37 | 38 | " TODO: :h map-script 39 | " :h cpoptions 40 | " :h mapleader 41 | " :h map- 42 | " :h 43 | " :h undo? 44 | " :h write-plugin 45 | 46 | " Have for all maps? 47 | 48 | " Load Vimacs? 49 | if v:progname =~ '^vi$' 50 | " Never load Vimacs if user wants true Vi! (We're not _that_ evil 8) 51 | if !exists("g:VM_Enabled") 52 | let g:VM_Enabled = 0 53 | endif 54 | finish 55 | elseif v:progname =~ 'vimacs' 56 | let g:VM_Enabled = 1 57 | elseif v:progname =~ 'vemacs' || v:progname == 'vm' 58 | let g:VM_Enabled = 1 59 | set insertmode 60 | elseif !exists("g:VM_Enabled") || g:VM_Enabled == 0 61 | " A vim user should explicitly enable Vimacs 62 | finish 63 | endif 64 | 65 | 66 | if version < 600 67 | " We require Vim 6 to work :( 68 | echoerr 'Vimacs requires Vim 6 to run :(' 69 | finish 70 | endif 71 | 72 | " We want to be able to remap <> key codes and do line continuation 73 | let s:saved_cpoptions = &cpoptions 74 | set cpoptions-=<,C 75 | 76 | 77 | " Set a default value for a variable only if it doesn't exist 78 | " (like "$foo |= 'bar'" in Perl) 79 | " 80 | " Thanks to Piet Delport for this solution, and Benji Fisher for 81 | " additional comments :) 82 | " 83 | 84 | function! LetDefault(var_name, value) 85 | if !exists(a:var_name) 86 | execute 'let ' . a:var_name . '=' . a:value 87 | endif 88 | endfunction 89 | 90 | command! -nargs=+ LetDefault call s:LetDefault() 91 | 92 | 93 | " Developers may want to turn this on, to always load the file 94 | LetDefault g:VM_Dev 0 95 | 96 | if (exists("loaded_vimacs") && g:VM_Dev == 0) || &cp 97 | finish 98 | endif 99 | 100 | 101 | " 102 | " Function to mark a cursor position and restore it afterward -- used in a few 103 | " functions, like FillParagraph(). Blatantly stolen from foo.vim by Benji 104 | " Fisher :) 105 | " 106 | 107 | function! Mark(...) 108 | if a:0 == 0 109 | let mark = line(".") . "G" . virtcol(".") . "|" 110 | normal! H 111 | let mark = "normal!" . line(".") . "Gzt" . mark 112 | execute mark 113 | return mark 114 | elseif a:0 == 1 115 | return "normal!" . a:1 . "G1|" 116 | else 117 | return "normal!" . a:1 . "G" . a:2 . "|" 118 | endif 119 | endfun 120 | 121 | 122 | " 123 | " set virtualedit=all (or onemore in Vim 7) is necessary 124 | " for consistent word movement 125 | " 126 | 127 | function! SetVirtualedit() 128 | let s:saved_virtualedit = &virtualedit 129 | set virtualedit=all 130 | endfunction 131 | 132 | function! RestoreVirtualedit() 133 | let &virtualedit = s:saved_virtualedit 134 | endfunction 135 | 136 | 137 | " 138 | " It's a good idea to have a command height of at least 2 if showmode is on, 139 | " because many important messages will be overwritten by the mode display. 140 | " e.g. , which saves the file, will display that the file has been 141 | " saved, but the notice will be immediately overwritten by the modeline when 142 | " this happens. 143 | " 144 | 145 | " Don't fork around with cmdheight? 146 | LetDefault g:VM_CmdHeightAdj 1 147 | 148 | if &cmdheight == 1 && &showmode == 1 && g:VM_CmdHeightAdj 149 | set cmdheight=2 150 | endif 151 | 152 | 153 | " 154 | " Vim options essential for emulating Emacs-ish behaviour 155 | " 156 | 157 | " Turn off / pulling down GUI menu 158 | set winaltkeys=no 159 | " Emacs normally wraps everything 160 | LetDefault g:VM_Wrap 2 161 | LetDefault g:VM_WrapHL 1 162 | if g:VM_Wrap==2 163 | set whichwrap=b,s,<,>,[,],~ 164 | if g:VM_WrapHL 165 | set whichwrap+=h,l 166 | endif 167 | elseif g:VM_Wrap==1 168 | set whichwrap+=[,] 169 | endif 170 | " Emacs always has 'hidden buffers' 171 | " The 'g:VM_Hidden option' also affects bindings of etc 172 | LetDefault g:VM_Hidden 1 173 | if g:VM_Hidden 174 | set hidden 175 | endif 176 | " Backspace in Emacs normally backspaces anything :) 177 | set backspace=indent,eol,start 178 | " Want to be able to use within our mappings 179 | " (This has got to be the coolest option name ever, btw) 180 | set wildcharm= 181 | " Recognise key sequences that start with in Insert Mode 182 | set esckeys 183 | 184 | 185 | " 186 | " For the UNIX console -- make x == 187 | " 188 | 189 | " Pressing sends x? (As Unix terminals often do) 190 | LetDefault g:VM_UnixConsoleMetaSendsEsc 1 191 | 192 | " One or two s required to go back to Normal mode? 193 | LetDefault g:VM_SingleEscToNormal 1 194 | 195 | if has("unix") && !has("gui_running") && g:VM_UnixConsoleMetaSendsEsc 196 | " x maps to 197 | "let charCode = 65 198 | "while charCode <= 122 199 | " exec "set =\" . nr2char(charCode) 200 | " let charCode = charCode + 1 201 | "endwhile 202 | "unlet charCode 203 | set =1 204 | set =2 205 | set =3 206 | set =4 207 | set =5 208 | set =6 209 | set =7 210 | set =8 211 | set =9 212 | set =0 213 | set =a 214 | set =b 215 | set =c 216 | set =d 217 | set =e 218 | set =f 219 | set =g 220 | set =h 221 | set =i 222 | set =j 223 | set =k 224 | set =l 225 | set =m 226 | set =n 227 | set =o 228 | set =p 229 | set =q 230 | set =r 231 | set =s 232 | set =t 233 | set =u 234 | set =v 235 | set =w 236 | set =x 237 | set =y 238 | set =z 239 | set = 240 | set =/ 241 | " Doing "set >=^[>" throws up an error, so we be dodgey and use Char-190 242 | " instead, which is ASCII 62 ('>' + 128). 243 | set => 244 | " Probably don't need both of these ;) 245 | set =< 246 | set =< 247 | set =0 248 | 249 | set =% 250 | set =* 251 | set =. 252 | set =^ 253 | " Can't set right now :( 254 | "set = 255 | " 256 | endif 257 | 258 | 259 | " 260 | " One or two s to get back to Normal mode? 261 | " 262 | 263 | function! NormalModeKey() 264 | if &insertmode 265 | return "\" 266 | else 267 | return "\" 268 | endif 269 | endfunction 270 | 271 | " on CmdwinLeave? 272 | if g:VM_SingleEscToNormal == 1 273 | if &insertmode 274 | if has('unix') && !has('gui_running') && g:VM_UnixConsoleMetaSendsEsc 275 | inoremap :UseF1ForNormal 276 | else 277 | inoremap 278 | endif 279 | endif 280 | 281 | set notimeout 282 | set ttimeout 283 | set timeoutlen=50 284 | else 285 | inoremap =NormalModeKey() 286 | vnoremap 287 | " for some reason, double in Select mode wasn't working 288 | " until I added a second explicit select-mode map...? 289 | if version >= 700 290 | snoremap 291 | endif 292 | nnoremap 293 | set notimeout 294 | set nottimeout 295 | endif 296 | 297 | command! UseF1ForNormal echoerr "Use F1 or to return to Normal mode. :help vimacs-unix-esc-key" 298 | 299 | 300 | " 301 | " Insert mode <-> Normal mode <-> Command mode 302 | " 303 | 304 | inoremap : 305 | inoremap : 306 | inoremap =NormalModeKey() 307 | inoremap 308 | inoremap 309 | inoremap =NormalModeKey():echo "Returning to Normal mode; press again to suspend Vimacs" 310 | nnoremap :call Suspend() 311 | " M-` isn't defined in Emacs 312 | 313 | inoremap 1 314 | inoremap 2 315 | inoremap 3 316 | inoremap 4 317 | inoremap 5 318 | inoremap 6 319 | inoremap 7 320 | inoremap 8 321 | inoremap 9 322 | 323 | LetDefault g:VM_NormalMetaXRemap 1 324 | 325 | if g:VM_NormalMetaXRemap == 1 326 | nnoremap : 327 | endif 328 | 329 | function! Suspend() 330 | suspend! 331 | if &insertmode 332 | startinsert 333 | endif 334 | endfunction 335 | 336 | 337 | " 338 | " Leaving Vim 339 | " 340 | 341 | inoremap :confirm qall 342 | 343 | 344 | " 345 | " Files & Buffers 346 | " 347 | 348 | if g:VM_Hidden 349 | inoremap :hide edit 350 | else 351 | inoremap :edit 352 | endif 353 | inoremap :update 354 | inoremap s :wall 355 | inoremap i :read 356 | "what does C-x C-v do? 357 | inoremap :write 358 | inoremap :set invreadonly 359 | if g:VM_Hidden 360 | inoremap :hide view 361 | else 362 | inoremap :view 363 | endif 364 | 365 | 366 | " 367 | " Help Sistemmii (hi Finns) 368 | " 369 | "inoremap :help 370 | 371 | 372 | " 373 | " Error Recovery 374 | " 375 | 376 | inoremap u 377 | inoremap u 378 | "lots of other stuff :( 379 | 380 | 381 | " 382 | " Incremental Searching and Query Replace 383 | " 384 | 385 | inoremap :call StartSearch('/')/ 386 | inoremap :call StartSearch('?')? 387 | inoremap :cnext 388 | " not in Emacs: next in QuickFix 389 | inoremap :cprevious 390 | " not in Emacs: previous in QuickFix 391 | inoremap :call StartSearch('/')/ 392 | inoremap :call StartSearch('?')? 393 | inoremap :set invhls 394 | inoremap :call QueryReplace() 395 | inoremap :call QueryReplaceRegexp() 396 | cnoremap ? 397 | 398 | command! QueryReplace :call QueryReplace() 399 | command! QueryReplaceRegexp :call QueryReplaceRegexp() 400 | 401 | " Searching is a bit tricky because we have to emulate Emacs's behaviour of 402 | " searching again when or is pressed _inside_ the search 403 | " commandline. Vim has no equivalent to this, so we must use a bit of 404 | " on-the-fly remap trickery (popular in Quake-style games) to provide 405 | " different functionality for , depending on whether you're in 'search 406 | " mode' or not. 407 | " 408 | " We must map and because we have to undo the map trickery that we 409 | " set up when we abort/finish the search. All in all, it's not too complex 410 | " when you actually look at what the code does. 411 | " 412 | " Note that in Emacs is functionally the same as . 413 | 414 | LetDefault g:VM_SearchRepeatHighlight 0 415 | 416 | function! StartSearch(search_dir) 417 | let s:incsearch_status = &incsearch 418 | let s:lazyredraw_status = &lazyredraw 419 | let s:hit_boundary = 0 420 | set nowrapscan 421 | set incsearch 422 | set lazyredraw 423 | cmap 424 | cnoremap :call SearchAgain()/ 425 | cnoremap :call SearchAgain()? 426 | cnoremap :call StopSearch() 427 | cnoremap :call AbortSearch() 428 | cnoremap :call AbortSearch() 429 | if a:search_dir == '/' 430 | cnoremap :set invhls/ 431 | else 432 | cnoremap :set invhls? 433 | endif 434 | let s:before_search_mark = Mark() 435 | endfunction 436 | 437 | function! StopSearch() 438 | cunmap 439 | cunmap 440 | cunmap 441 | cunmap 442 | cunmap 443 | cnoremap 444 | if exists("s:incsearch_status") 445 | let &incsearch = s:incsearch_status 446 | unlet s:incsearch_status 447 | endif 448 | if g:VM_SearchRepeatHighlight == 1 449 | if exists("s:hls_status") 450 | let &hls = s:hls_status 451 | unlet s:hls_status 452 | endif 453 | endif 454 | endfunction 455 | 456 | function! AbortSearch() 457 | call StopSearch() 458 | if exists("s:before_search_mark") 459 | execute s:before_search_mark 460 | unlet s:before_search_mark 461 | endif 462 | endfunction 463 | 464 | function! SearchAgain() 465 | 466 | "if (winline() <= 2) 467 | " normal zb 468 | "elseif (( winheight(0) - winline() ) <= 2) 469 | " normal zt 470 | "endif 471 | 472 | let current_pos = Mark() 473 | if search(@/, 'W') == 0 474 | " FIXME 475 | set wrapscan 476 | if s:hit_boundary == 1 477 | let s:hit_boundary = 2 478 | endif 479 | let s:hit_boundary = 1 480 | else 481 | if s:hit_boundary == 2 482 | let s:hit_boundary = 0 483 | endif 484 | execute current_pos 485 | endif 486 | 487 | cnoremap :call SearchAgain()/ 488 | cnoremap :call SearchAgain()? 489 | 490 | if g:VM_SearchRepeatHighlight == 1 491 | if !exists("s:hls_status") 492 | let s:hls_status = &hls 493 | endif 494 | set hls 495 | endif 496 | 497 | endfunction 498 | 499 | " Emacs' `query-replace' functions 500 | 501 | function! QueryReplace() 502 | let magic_status = &magic 503 | set nomagic 504 | let searchtext = input("Query replace: ") 505 | if searchtext == "" 506 | echo "(no text entered): exiting to Insert mode" 507 | return 508 | endif 509 | let replacetext = input("Query replace " . searchtext . " with: ") 510 | let searchtext_esc = escape(searchtext,'/\^$') 511 | let replacetext_esc = escape(replacetext,'/\') 512 | execute ".,$s/" . searchtext_esc . "/" . replacetext_esc . "/cg" 513 | let &magic = magic_status 514 | endfunction 515 | 516 | function! QueryReplaceRegexp() 517 | let searchtext = input("Query replace regexp: ") 518 | if searchtext == "" 519 | echo "(no text entered): exiting to Insert mode" 520 | return 521 | endif 522 | let replacetext = input("Query replace regexp " . searchtext . " with: ") 523 | let searchtext_esc = escape(searchtext,'/') 524 | let replacetext_esc = escape(replacetext,'/') 525 | execute ".,$s/" . searchtext_esc . "/" . replacetext_esc . "/cg" 526 | endfunction 527 | 528 | 529 | " 530 | " Command line editing 531 | " 532 | 533 | " Navigation 534 | cmap 535 | cmap 536 | cnoremap 537 | cnoremap 538 | cmap 539 | cmap 540 | 541 | " Editing 542 | cmap 543 | cmap 544 | cmap 545 | cnoremap " 546 | cnoremap 547 | cnoremap 548 | cnoremap d$ 549 | "Should really use &cedit, not just -- but how? 550 | 551 | 552 | " 553 | " Navigation 554 | " 555 | 556 | function! ForwardWord() 557 | if col('.')>1 || line('.')>1 558 | return "normal! hel" 559 | else 560 | return "normal! el" 561 | endif 562 | endfunction 563 | 564 | inoremap ForwardWord :call SetVirtualedit() 565 | \:execute ForwardWord() 566 | \:call RestoreVirtualedit() 567 | 568 | onoremap OForwardWord :call SetVirtualedit() 569 | \execute ForwardWord() 570 | \call RestoreVirtualedit() 571 | 572 | " Weird. In Vim 7, if insertmode is on, if you exit visual mode in a mapping, 573 | " things get weird unless you do some normal command, even a no-op 574 | nmap Nop 575 | function! ExitVisual() 576 | if ! &insertmode 577 | startinsert 578 | else 579 | normal! Nop 580 | endif 581 | endfunction 582 | 583 | function VForwardWord1() 584 | if col('.')>=col('$') 585 | let s:vforward_fix = 1 586 | else 587 | let s:vforward_fix = 0 588 | endif 589 | endfunction 590 | 591 | function VForwardWord2() 592 | if s:vforward_fix 593 | return "\gv``\" 594 | else 595 | return "\gv``" 596 | endif 597 | endfunction 598 | 599 | function AdjustVisualModeExitPosition(backwards) 600 | if line('.')==line("'>") && col('.')+1 == col("'>") 601 | if !a:backwards || line('.')!=line("'<") || col('.') != col("'<") 602 | return "\" 603 | endif 604 | elseif line('.')==line("'<") && col('.')+1 == col("'<") 605 | return "\" 606 | endif 607 | return "" 608 | endfunction 609 | 610 | if version >= 700 611 | vnoremap VForwardWord 612 | \:call ExitVisual() 613 | \=AdjustVisualModeExitPosition(0) 614 | \:call SetVirtualedit() 615 | \:execute ForwardWord() 616 | \:call VForwardWord1() 617 | \m` 618 | \:call RestoreVirtualedit() 619 | \=VForwardWord2() 620 | else 621 | vnoremap VForwardWord 622 | \i 623 | \=AdjustVisualModeExitPosition(0) 624 | \:call SetVirtualedit() 625 | \:execute ForwardWord() 626 | \:call VForwardWord1() 627 | \m` 628 | \:call RestoreVirtualedit() 629 | \=VForwardWord2() 630 | endif 631 | 632 | function! BackwardWord() 633 | let l:line = line('.') 634 | let l:getline = getline(l:line) 635 | if col('.')==1 || strpart(l:getline,0,col('.')-1) =~ '^\s*$' 636 | let l:count = l:line-1 - prevnonblank(l:line-1) 637 | if l:count > 0 638 | return "normal! " . l:count . "kb" 639 | endif 640 | endif 641 | if col('.')>=col('$') && line('.') BackwardWord :call SetVirtualedit() 649 | \:execute BackwardWord() 650 | \:call RestoreVirtualedit() 651 | 652 | onoremap OBackwardWord :call SetVirtualedit() 653 | \execute BackwardWord() 654 | \call RestoreVirtualedit() 655 | 656 | if version >= 700 657 | vnoremap VBackwardWord 658 | \:call ExitVisual() 659 | \=AdjustVisualModeExitPosition(1) 660 | \:call SetVirtualedit() 661 | \:execute BackwardWord() 662 | \m` 663 | \:call RestoreVirtualedit() 664 | \gv 665 | \`` 666 | else 667 | vnoremap VBackwardWord 668 | \i 669 | \=AdjustVisualModeExitPosition(1) 670 | \:call SetVirtualedit() 671 | \:execute BackwardWord() 672 | \m` 673 | \:call RestoreVirtualedit() 674 | \gv 675 | \`` 676 | endif 677 | 678 | " Insert/Visual/Operator mode maps 679 | imap 680 | vmap 681 | omap 682 | imap 683 | vmap 684 | omap 685 | imap 686 | vmap 687 | omap 688 | imap 689 | vmap 690 | omap 691 | inoremap