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