-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
170 lines (125 loc) · 3.79 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
"version 6.0
set nocompatible " be iMproved, required
" Load the colorscheme from the appropriate directory
" In general, everything in ~/.vim has priority.
if !filereadable(expand("~/.vim/colors/paps.vim"))
set runtimepath+=${HOME}/dotfiles/.vim/
endif
set fileencodings=ucs-bom,utf-8,default,latin1
set helplang=en
"set noloadplugins
" vim: set ft=vim :
set title
set ttyfast
" Don't redraw while executing macros (good performance config)
set lazyredraw
" No annoying sound on errors
set noerrorbells
"set novisualbell
set t_vb=
set t_Co=256 " using 256 colors
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
" Use Unix as the standard file type
set fileformats=unix,mac,dos
set ambiwidth=double
" When formatting text, recognize numbered lists
set formatoptions+=n
filetype on
filetype plugin on
filetype plugin indent on
set autoindent " Auto indent
set smartindent " Smart indent
" 1 tab == 4 spaces
set tabstop=8
set softtabstop=8
set shiftwidth=8
" Uncomment if identation should be immediately applied in the opened file
"set smarttab
" Uncomment to use spaces instead of tabs
"set expandtab
set noexpandtab
set wrap " Wrap lines
" Enable syntax highlighting
syntax enable
" Always show current position
set ruler
" Show line number by default
set number
set relativenumber
" Turn on the Wild menu
set wildmenu
set wildmode=list:longest,full
" Ignore compiled files
set wildignore=*.so,*.swp,*.pyc,*.pyo,*.o,*.7z
set virtualedit=block
set sessionoptions-=options " Don't restore all options and mappings
set completeopt=menu,preview,longest
set pumheight=10
set updatetime=1000
set history=100 " command line history
" Swap files are necessary when crash recovery
if !isdirectory($HOME . "/.vim/swapfiles") | call mkdir($HOME . "/.vim/swapfiles", "p") | endif
set dir=$HOME/.vim/swapfiles//
" Turn persistent undo on, means that you can undo even when you close a buffer/VIM
set undofile
set undolevels=1000
if !isdirectory($HOME. "/.vim/undotree") | call mkdir($HOME . "/.vim/undotree", "p") | endif
set undodir=$HOME/.vim/undotree//
" For regular expressions turn magic on
set magic
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases, meaning that if we use any upper
" case letter in search, then it will care about case
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers, meaning find patterns while
" searching.
set incsearch
" Disable highlight when <Backspace> is pressed
nnoremap <silent> <BS> :nohlsearch<CR>
" Always show status line
set laststatus=2
set statusline=%<%n\ %F\ " filename
set statusline+=%m%r%w%h " option
set statusline+=\ [%{&ff}]/%y " fileformat/filetype
set statusline+=%=%(%l/%L,%c\ %)\%p%% " Right aligned file nav info
set showcmd
" Show matching brackets when text indicator is over them
set showmatch
"for assembly
let asmsyntax = "asm68k"
command! MakeTags !ctags -R .
command! Bwclose bp | sp | bn | bd
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
" Syntax and colorscheme
syn on
colorscheme paps
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
let g:netrw_banner=0
let g:netrw_browse_split=4
let g:netrw_altv=1
let g:netrw_liststyle=3
let g:netrw_list_hide=netrw_gitignore#Hide()
iab bashs #!/bin/bash
if filereadable(expand("~/.vim/keymaps"))
source ${HOME}/.vim/keymaps
else
source ${HOME}/dotfiles/.vim/keymaps
endif