-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
100 lines (82 loc) · 1.69 KB
/
.vimrc
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
"Pathogen
execute pathogen#infect()
set nocompatible
filetype on
filetype indent on
filetype plugin on
"set t_Co=256
syntax on
set incsearch
set ignorecase
set hlsearch
set smartcase
set showmatch
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set autoindent
set fileencoding=utf-8
set encoding=utf-8
set backspace=indent,eol,start
set scrolloff=7
set wildmenu
set number
set noswapfile
set visualbell
set noerrorbells
set cursorline
set wrap
set linebreak
set showbreak=>\
set hidden
set history=1000
set undolevels=1000
"set undofile
set title
set titleold=""
set titlestring=VIM:\ %F
let mapleader = ","
set mouse=a
set pastetoggle=<F2>
set cc=80
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
set laststatus=2
set statusline=%f\ \ line:%l/%L\ col:%c\ %p%%\ %y
"Map NERDTree to <leader>p
nnoremap <silent> <Leader>p :NERDTreeToggle<CR>
"autocmd event pattern command
autocmd BufRead,BufNewFile *.md set filetype=markdown
augroup vimscript
autocmd!
autocmd BufWritePost %MYVIMRC source $MYVIMRC
augroup END
"Force to use hjkl to learn
noremap <left> <nop>
noremap <right> <nop>
noremap <up> <nop>
noremap <down> <nop>
nnoremap / /\v
vnoremap / /\v
nnoremap ? ?\v
vnoremap ? ?\v
"Some abbreviations to fix common writting errors
inoreabbrev teh the
cnoreabbrev Wq wq
cnoreabbrev WQ wq
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev wrap set wrap
cnoreabbrev nowrap set nowrap
"function! InsertTabWrapper()
" let col = col(".") - 1
" if !col || getline(".")[col -1] !~ '\k'
" return "\<tab>"
" else
" return "\<c-n>"
"endfunction
"inoremap <tab> <c-r>=InsertTabWrapper()<cr>
"inoremap <s-tab> <c-p>
let g:SuperTabDefaultCompletionType = "<c-n>"