aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
blob: b9930fbbf9fd281c3f2e63c0a39310f3c989a643 (plain)
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
" General Config

set nocompatible
set number 
set backspace=indent,eol,start
syntax on
set fileencodings=ucs=bom,utf-8,utf-16,gbk,big5,gb18030,latin1
set t_Co=256
set showcmd
set autoread
set mouse=a
filetype indent on
set modeline
set textwidth=72
set formatoptions+=mB
set formatoptions-=tc
set secure

set nofoldenable

set hidden

set completeopt=menu,menuone

if $COLORTERM is 'truecolor'
    set termguicolors
endif

" Correct background rendering in some terminal
let &t_ut=''

" MacVim

if has("gui_running")
    if has("gui_macvim")
        set guifont=Monaco:h15
        set transparency=10
        set noimdisable

        noremap <D-1> :tabn 1<CR>
        noremap <D-2> :tabn 2<CR>
        noremap <D-3> :tabn 3<CR>
        noremap <D-4> :tabn 4<CR>
        noremap <D-5> :tabn 5<CR>
        noremap <D-6> :tabn 6<CR>
        noremap <D-7> :tabn 7<CR>
        noremap <D-8> :tabn 8<CR>
        noremap <D-9> :tabn 9<CR>
        noremap <D-0> :tablat<CR>
    endif
endif

" Identation

set autoindent
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4

autocmd FileType html setlocal shiftwidth=2 softtabstop=2 expandtab
autocmd FileType css setlocal shiftwidth=2 softtabstop=2 expandtab
autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 expandtab

set wrap
"set nowrap
"set wrapmargin=4
set scrolloff=5
"set sidescrolloff=5
set laststatus=2
set ruler

set hlsearch
set incsearch
set ignorecase
set smartcase

" Completion

set wildmenu
set wildmode=longest:list,full
set wildignore=*.o,*.obj,*~
set wildignore+=*DS_Store*
set wildignore+=*.gem
set wildignore+=*.png,*.jpg,*.gif

" change default directory
let s:vim_swapfiles_dir = expand('~/.vim/.swp/')
if !isdirectory(s:vim_swapfiles_dir)
    silent! call mkdir(s:vim_swapfiles_dir, 'p')
endif
set directory=~/.vim/.swp//

" tags
set tags=./.tags;,.tags

" mapping
let mapleader=',' " change the key <leader>
nnoremap <leader>cd :cd %:p:h<CR> :pwd<CR>

source ~/.vim/plugin/init.vim
source ~/.vim/keybindings.vim

silent colorscheme onedark

highlight Pmenu ctermbg=grey
set exrc

if !empty(glob('~/.vim_local'))
    source ~/.vim_local
endif