This repository was archived by the owner on Jul 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
57 lines (46 loc) · 1.29 KB
/
.vimrc
File metadata and controls
57 lines (46 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
set bg=dark
syntax on
set autoindent
set nocompatible
set cindent
set smarttab
set shiftwidth=2
set softtabstop=2
set expandtab
set hidden
set history=1000
set wildmenu
set ignorecase
set smartcase
set title
set scrolloff=3
set backupdir=~/.vim-tmp,/tmp
set directory=~/.vim-tmp,/tmp
" Enable incremental search.
set incsearch
" Map a key to unhilight searched-for terms.
map _ :nohls
hi Normal ctermbg=black ctermfg=gray
" Don't beep.
set visualbell
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" Extra mappings
com Wq :wq
nmap <Esc>o :exe "norm o<Bslash><Char-0x3c>Esc>k0".(col('.')-1)."l"<CR>
" Make encryption more secure
setlocal cm=blowfish
autocmd BufReadPre * if system("head -c 9 " . expand("<afile>")) == "VimCrypt~" | call SetupEncryption() | endif
function SetupEncryption()
setlocal noswapfile nobackup nowritebackup viminfo=
endfunction
" Autocomplete
:set completeopt=longest,menuone
:inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
\ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'