-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
executable file
·105 lines (81 loc) · 3.08 KB
/
vimrc
File metadata and controls
executable file
·105 lines (81 loc) · 3.08 KB
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
set nocompatible "Be iMproved
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
"Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-easytags'
Plugin 'majutsushi/tagbar'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'hashivim/vim-terraform'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
call vundle#end()
filetype plugin indent on
" --- Plugin configuration
set tags=./tags;,~/.vimtags
" Sensible defaults
let g:easytags_events = ['BufReadPost', 'BufWritePost']
let g:easytags_async = 1
let g:easytags_dynamic_files = 2
let g:easytags_resolve_links = 1
let g:easytags_suppress_ctags_warning = 1
" --- Standard configurations
syntax enable
set background=dark
"colorscheme solarized
set showcmd "Show command below status line
set backspace=eol,start,indent "Backspace freely
set autoindent "Turn on auto-indent
set smartindent "Interpret indent level
set tabstop=4 "Four spaces
set shiftwidth=4
set expandtab "Convert tabs to spaces
set hlsearch "Search highlighting
set mouse=a
set showmatch "Highlight matching {[()]}
set ruler "Show ruler
set number "Display line numbers
set title "Set the terminal title
set laststatus=2 "Next to last line is status line
set statusline=
set statusline+=%-3.3n "Buffer number
set statusline+=%F "Full file path
set statusline+=%m "Modified flag
set statusline+=%= "Shift to right aligned
set statusline+=[%l/%L,%2v] "Current line/Total lines, Current Column
set statusline+=\ %y "File type
set statusline+=\ %3.p%% "Percent through file
set noerrorbells "Turn off error noises
set novisualbell
set t_vb=
set encoding=utf-8
set fileencoding=utf-8
syntax on "Turn on syntax highlighting
filetype on "Guess file type
set backup "Create backup files
set backupdir=~/.vim/backup "Directory for backup files
set directory=~/.vim/tmp "Directory for swap files
" --- Additional settings
" Highlight trailing whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" --- Commands
" Use :C to clear highlighted search
command! C nohlsearch
" --- File Types
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
autocmd FileType html setlocal shiftwidth=2 tabstop=2
autocmd FileType css,scss setlocal shiftwidth=2 tabstop=2
" --- Key mappings
" Use \t to display n tree
nmap <silent> <leader>t :NERDTreeTabsToggle<CR>
" Use \b to display tagbar
nmap <silent> <leader>b :TagbarToggle<CR>