blob: d3f349e0d875fe8878cb8542e38fe14fb2b3c4ac [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 Moolenaar3f32a5f2022-05-12 20:34:15 +01003" Last Change: 2022 May 10
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
Bram Moolenaar3f32a5f2022-05-12 20:34:15 +010011" Allow for using CTRL-Q in Insert mode to quit Vim.
12inoremap <C-Q> <C-O>:confirm qall<CR>
13
Bram Moolenaar071d4272004-06-13 20:20:40 +000014" Vim is in Insert mode by default
15set insertmode
16
17" Make a buffer hidden when editing another one
18set hidden
19
20" Make cursor keys ignore wrapping
Bram Moolenaarb230bd52010-05-25 21:02:00 +020021inoremap <silent> <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR>
22inoremap <silent> <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR>
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
24" CTRL-F does Find dialog instead of page forward
Bram Moolenaarb230bd52010-05-25 21:02:00 +020025noremap <silent> <C-F> :promptfind<CR>
26vnoremap <silent> <C-F> y:promptfind <C-R>"<CR>
27onoremap <silent> <C-F> <C-C>:promptfind<CR>
28inoremap <silent> <C-F> <C-O>:promptfind<CR>
29cnoremap <silent> <C-F> <C-C>:promptfind<CR>
Bram Moolenaar071d4272004-06-13 20:20:40 +000030
31
32set backspace=2 " allow backspacing over everything in insert mode
33set autoindent " always set autoindenting on
34if has("vms")
35 set nobackup " do not keep a backup file, use versions instead
36else
37 set backup " keep a backup file
38endif
39set history=50 " keep 50 lines of command line history
40set ruler " show the cursor position all the time
41set incsearch " do incremental searching
42set mouse=a " always use the mouse
43
44" Don't use Ex mode, use Q for formatting
45map Q gq
46
47" Switch syntax highlighting on, when the terminal has colors
48" Highlight the last used search pattern on the next search command.
49if &t_Co > 2 || has("gui_running")
50 syntax on
51 set hlsearch
52 nohlsearch
53endif
54
Bram Moolenaar314dd792019-02-03 15:27:20 +010055" Enable file type detection.
56" Use the default filetype settings, so that mail gets 'tw' set to 72,
57" 'cindent' is on in C files, etc.
58" Also load indent files, to automatically do language-dependent indenting.
59filetype plugin indent on
Bram Moolenaar071d4272004-06-13 20:20:40 +000060
Bram Moolenaar314dd792019-02-03 15:27:20 +010061" For all text files set 'textwidth' to 78 characters.
62au FileType text setlocal tw=78
Bram Moolenaar071d4272004-06-13 20:20:40 +000063
Bram Moolenaar8c08b5b2016-07-28 22:24:15 +020064" Add optional packages.
65"
66" The matchit plugin makes the % command work better, but it is not backwards
67" compatible.
Bram Moolenaar24a98a02017-09-27 22:23:55 +020068" The ! means the package won't be loaded right away but when plugins are
69" loaded during initialization.
Bram Moolenaar8c08b5b2016-07-28 22:24:15 +020070if has('syntax') && has('eval')
Bram Moolenaar24a98a02017-09-27 22:23:55 +020071 packadd! matchit
Bram Moolenaar8c08b5b2016-07-28 22:24:15 +020072endif
73
Bram Moolenaar071d4272004-06-13 20:20:40 +000074" vim: set sw=2 :