evim.vim (2284B)
1 " Vim script for Evim key bindings 2 " Maintainer: The Vim Project <https://github.com/vim/vim> 3 " Last Change: 2023 Aug 10 4 " Former Maintainer: Bram Moolenaar <Bram@vim.org> 5 6 " Don't use Vi-compatible mode. 7 set nocompatible 8 9 " Use the mswin.vim script for most mappings 10 source <sfile>:p:h/mswin.vim 11 12 " Allow for using CTRL-Q in Insert mode to quit Vim. 13 inoremap <C-Q> <C-O>:confirm qall<CR> 14 15 " Vim is in Insert mode by default 16 set insertmode 17 18 " Make a buffer hidden when editing another one 19 set hidden 20 21 " Make cursor keys ignore wrapping 22 inoremap <silent> <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR> 23 inoremap <silent> <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR> 24 25 " CTRL-F does Find dialog instead of page forward 26 noremap <silent> <C-F> :promptfind<CR> 27 vnoremap <silent> <C-F> y:promptfind <C-R>"<CR> 28 onoremap <silent> <C-F> <C-C>:promptfind<CR> 29 inoremap <silent> <C-F> <C-O>:promptfind<CR> 30 cnoremap <silent> <C-F> <C-C>:promptfind<CR> 31 32 33 set backspace=2 " allow backspacing over everything in insert mode 34 set autoindent " always set autoindenting on 35 if has("vms") 36 set nobackup " do not keep a backup file, use versions instead 37 else 38 set backup " keep a backup file 39 endif 40 set history=50 " keep 50 lines of command line history 41 set ruler " show the cursor position all the time 42 set incsearch " do incremental searching 43 set mouse=a " always use the mouse 44 45 " Don't use Ex mode, use Q for formatting 46 map 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. 50 if &t_Co > 2 || has("gui_running") 51 syntax on 52 set hlsearch 53 nohlsearch 54 endif 55 56 " 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. 60 filetype plugin indent on 61 62 " For all text files set 'textwidth' to 78 characters. 63 au FileType text setlocal tw=78 64 65 " Add optional packages. 66 " 67 " The matchit plugin makes the % command work better, but it is not backwards 68 " compatible. 69 " The ! means the package won't be loaded right away but when plugins are 70 " loaded during initialization. 71 if has('syntax') && has('eval') 72 packadd! matchit 73 endif 74 75 " vim: set sw=2 :