summary refs log tree commit diff
path: root/vimrc
blob: f0308943b06301e841d9456792071431eb326285 (plain) (blame)
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
set encoding=utf-8                 " default is latin1

call plug#begin('~/.vim/plugged')

Plug 'ctrlpvim/ctrlp.vim'          " CtrlP is installed to support tag finding in vim-go
Plug 'neomake/neomake'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'

" Language
Plug 'fatih/vim-go'                            " Go support
Plug 'pangloss/vim-javascript'                 " JavaScript syntax highlighting
Plug 'plasticboy/vim-markdown'                 " Markdown syntax highlighting
Plug 'rodjek/vim-puppet'                       " Puppet syntax highlighting
Plug 'tclh123/vim-thrift'                      " Thrift syntax highlighting
Plug 'zchee/deoplete-go', { 'do': 'make'}      " Go auto completion
Plug 'zchee/deoplete-jedi'                     " Go auto completion

" Initialize plugin system
call plug#end()

filetype plugin indent on

" preferences
set autoindent                    " take indent for new line from previous line
set autoread                      " reload file if the file changes on the disk
set autowrite                     " write when switching buffers
set autowriteall                  " write on :quit
set completeopt-=preview          " remove the horrendous preview window
set cursorline                    " highlight the current line for the cursor
set encoding=utf-8
set expandtab                     " expands tabs to spaces
set formatoptions=tcqronj         " set vims text formatting options
set list                          " show trailing whitespace
set listchars=tab:\|\ ,trail:.
set noerrorbells                  " No bells!
set noswapfile                    " disable swapfile usage
set novisualbell                  " I said, no bells!
set nowrap
set ruler
set shiftwidth=4
set smartindent                   " enable smart indentation
set softtabstop=2
set tabstop=2
set title                         " let vim set the terminal title

" Searching
set incsearch                     " move to match as you type the search query
set hlsearch                      " disable search result highlighting
map <leader>c :nohlsearch<cr>     " clear search highlights

" ctrl-backspace should delete words
imap <C-bs> <C-w>

" Plugin: ctrlp
let g:ctrlp_working_path_mode = 'c'
let g:ctrlp_by_filename = 1

" Plugin: plasticboy/vim-markdown
" Disable folding
let g:vim_markdown_folding_disabled = 1

" Auto shrink the TOC, so that it won't take up 50% of the screen
let g:vim_markdown_toc_autofit = 1

" Plugin: neomake/neomake
" Configure signs.
let g:neomake_error_sign   = {'text': '✖', 'texthl': 'NeomakeErrorSign'}
let g:neomake_warning_sign = {'text': '∆', 'texthl': 'NeomakeWarningSign'}
let g:neomake_message_sign = {'text': '➤', 'texthl': 'NeomakeMessageSign'}
let g:neomake_info_sign    = {'text': 'ℹ', 'texthl': 'NeomakeInfoSign'}

syntax off                        " let's make sure the syntax is off

let &statusline = '[%n] %<%F %m%r%w%y %= (%l,%c) %P of %L'
set laststatus=2           " every window gets a statusline, always(=2)