-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
113 lines (94 loc) · 2.81 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
" Pathogen 'Package Manager'
execute pathogen#infect()
:set backspace=indent,eol,start
" Mouse
set ttyfast
set mouse=a
set ttymouse=xterm2
" Solarized Dark
set background=dark
colorscheme solarized
set t_Co=256
" General
syntax on
set ai
set sw=4
set ts=4
set sts=4
set expandtab
set nu
filetype plugin indent on
" Tags
set tags=./tags,tags;$HOME
" Wild Mode
set wildmode=longest,full
set wildmenu
" Remove whitespace at end of lines
autocmd BufWritePre * :%s/\s\+$//e
" Erlang
autocmd BufWritePost *.erl :Autoformat
au BufNewFile,BufRead *.config set filetype=erlang
au BufNewFile,BufRead *.config.src set filetype=erlang
au BufNewFile,BufRead *.dtl set filetype=html
:set formatoptions+=r
let erl_company = "Nicholas Gates"
" Markdown
let g:vim_markdown_folding_disabled=1
map <C-S-c> :Toch<CR>
" HTML
autocmd FileType html setlocal shiftwidth=2 tabstop=2
" Python
let python_highlight_all = 1
let g:jedi#show_call_signatures = "2"
" Vim Autoformat
let g:formatterpath = ['~/.vim/formatters']
let g:formatdef_erlangfmt = '"erlang_emacs.sh ".bufname("%")'
let g:formatters_erlang = ['erlangfmt']
" Syntastic
hi clear SignColumn
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_erlang_checkers=['syntaxerl']
let g:syntastic_python_checkers=['python', 'pyflakes', 'pep8']
let g:syntastic_aggregate_errors = 1
" Toggle Location List
let g:lt_location_list_toggle_map = '<C-c>'
let g:lt_quickfix_list_toggle_map = '<C-q>'
" quit if quicklist is the last pane open
autocmd BufEnter * if (winnr("$") == 1 && &filetype == "qf") | q | endif
" Status Line
set statusline=%f " relative path of the filename
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, " file encoding
set statusline+=%{&ff}] "file format
set statusline+=%h " help file flag
set statusline+=%m " modified flag
set statusline+=%r " readonly flag
set statusline+=%y " filetype
set statusline+=%= " left/right separator
set statusline+=%c " cursor col
set statusline+=%l/%L " cursor line / total lines
set statusline+=\ %P " percent through file
set laststatus=2
" NerdTree
let g:NERDTreeDirArrows=0
map <C-a> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Autocompletion with tab
function! SuperCleverTab()
if strpart(getline('.'), 0, col('.') - 1) =~ '^\s*$'
return "\<Tab>"
else
if &omnifunc != ''
return "\<C-x>\<C-O>"
elseif &dictionary != ''
return "\<C-K>"
else
return "\<C-N>"
endif
endif
endfunction
inoremap <Tab> <C-R>=SuperCleverTab()<cr>