blob: 4a875ee911a1bb2a0667abeaf8249d761b11727d [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim script for Evim key bindings
2" Maintainer: Bram Moolenaar <Bram@vim.org>
Bram Moolenaar314dd792019-02-03 15:27:20 +01003" Last Change: 2019 Jan 27
Bram Moolenaar071d4272004-06-13 20:20:40 +00004
5" Don't use Vi-compatible mode.
6set nocompatible
7
8" Use the mswin.vim script for most mappings
9source <sfile>:p:h/mswin.vim
10
11" Vim is in Insert mode by default
12set insertmode
13
14" Make a buffer hidden when editing another one
15set hidden
16
17" Make cursor keys ignore wrapping
Bram Moolenaarb230bd52010-05-25 21:02:00 +020018inoremap <silent> <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR>
19inoremap <silent> <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR>
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
21" CTRL-F does Find dialog instead of page forward
Bram Moolenaarb230bd52010-05-25 21:02:00 +020022noremap <silent> <C-F> :promptfind<CR>
23vnoremap <silent> <C-F> y:promptfind <C-R>"<CR>
24onoremap <silent> <C-F> <C-C>:promptfind<CR>
25inoremap <silent> <C-F> <C-O>:promptfind<CR>
26cnoremap <silent> <C-F> <C-C>:promptfind<CR>
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
28
29set backspace=2 " allow backspacing over everything in insert mode
30set autoindent " always set autoindenting on
31if has("vms")
32 set nobackup " do not keep a backup file, use versions instead
33else
34 set backup " keep a backup file
35endif
36set history=50 " keep 50 lines of command line history
37set ruler " show the cursor position all the time
38set incsearch " do incremental searching
39set mouse=a " always use the mouse
40
41" Don't use Ex mode, use Q for formatting
42map Q gq
43
44" Switch syntax highlighting on, when the terminal has colors
45" Highlight the last used search pattern on the next search command.
46if &t_Co > 2 || has("gui_running")
47 syntax on
48 set hlsearch
49 nohlsearch
50endif
51
Bram Moolenaar314dd792019-02-03 15:27:20 +010052" Enable file type detection.
53" Use the default filetype settings, so that mail gets 'tw' set to 72,
54" 'cindent' is on in C files, etc.
55" Also load indent files, to automatically do language-dependent indenting.
56filetype plugin indent on
Bram Moolenaar071d4272004-06-13 20:20:40 +000057
Bram Moolenaar314dd792019-02-03 15:27:20 +010058" For all text files set 'textwidth' to 78 characters.
59au FileType text setlocal tw=78
Bram Moolenaar071d4272004-06-13 20:20:40 +000060
Bram Moolenaar8c08b5b2016-07-28 22:24:15 +020061" Add optional packages.
62"
63" The matchit plugin makes the % command work better, but it is not backwards
64" compatible.
Bram Moolenaar24a98a02017-09-27 22:23:55 +020065" The ! means the package won't be loaded right away but when plugins are
66" loaded during initialization.
Bram Moolenaar8c08b5b2016-07-28 22:24:15 +020067if has('syntax') && has('eval')
Bram Moolenaar24a98a02017-09-27 22:23:55 +020068 packadd! matchit
Bram Moolenaar8c08b5b2016-07-28 22:24:15 +020069endif
70
Bram Moolenaar071d4272004-06-13 20:20:40 +000071" vim: set sw=2 :