-
Notifications
You must be signed in to change notification settings - Fork 9
/
.vimrc
165 lines (134 loc) · 3.64 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
call plug#begin('~/.vim/plugs')
Plug 'arcticicestudio/nord-vim'
Plug 'babaybus/DoxygenToolkit.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'itchyny/lightline.vim'
Plug 'junegunn/vim-easy-align'
Plug 'niklaas/lightline-gitdiff'
Plug 'riff-lang/vim-riff'
Plug 'simplyzhao/cscope_maps.vim'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-surround'
call plug#end()
filetype indent plugin on
set noswapfile
set path+=**
set wildmenu
set t_Co=256
set bg=dark
syntax on
" Prevent colorschemes from changing background color of screen, line
" numbers or current line
autocmd ColorScheme * hi Normal ctermbg=NONE guibg=NONE
autocmd ColorScheme * hi CursorLine cterm=None ctermbg=Black ctermfg=None
autocmd ColorScheme * hi CursorLineNr ctermbg=Black ctermfg=None
autocmd ColorScheme * hi LineNr cterm=None ctermbg=None ctermfg=DarkGray
" I think nord-vim actually uses the terminal's 16 colors, which is
" what I want it to do
colo nord
set backspace=indent,eol,start
set tabstop=4
set shiftwidth=4
autocmd FileType html setlocal tabstop=2 shiftwidth=2
autocmd FileType xml setlocal tabstop=2 shiftwidth=2
set expandtab
set autoindent
set mouse=a
set nolist
set ignorecase
set smartcase
set hlsearch
set showcmd
set incsearch
set showmatch
set noshowmode
set modelines=0
set nomodeline
set textwidth=80
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
set nu
set rnu
set numberwidth=1
hi LineNr cterm=None ctermbg=None ctermfg=DarkGray
set cursorline
hi CursorLine cterm=None ctermbg=Black ctermfg=None
hi CursorLineNr ctermbg=Black ctermfg=None
set laststatus=2
hi statusline cterm=None ctermfg=Cyan
noremap <space> :
let mapleader = " "
let g:mapleader = " "
nmap <leader>b :b<space>
nmap <leader>e :edit<space>
nmap <leader>f :find<space>
nmap <leader>q :q<cr>
nmap <leader>s :%s/
nmap <leader>v :vs<cr>
nmap <leader>w :w!<cr>
inoremap jk <Esc>
inoremap kj <Esc>
inoremap JK <Esc>
inoremap KJ <Esc>
" Markdown folding
let g:markdown_folding = 1
set foldlevelstart=99
" Ctags
nmap <leader>] <C-]>
nmap <leader>t <C-t>
nmap ga <Plug>(EasyAlign)
let g:lightline = {
\ 'colorscheme': 'powerline',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'filename', 'modified' ],
\ [ 'gitdiff' ] ],
\ 'right': [ [ 'filetype' ],
\ [ 'gitbranch', 'readonly' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ 'component_expand': {
\ 'gitdiff': 'lightline#gitdiff#get',
\ },
\ 'component_type': {
\ 'gitdiff': 'middle',
\ },
\ }
let g:lightline.mode_map = {
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'v' : 'V',
\ 'V' : 'V-LINE',
\ "\<C-v>": 'V-BLOCK',
\ 'c' : 'C',
\ 's' : 'S',
\ 'S' : 'S-LINE',
\ "\<C-s>": 'S-BLOCK',
\ 't': 'T',
\ }
let g:lightline#gitdiff#indicator_added = '+'
let g:lightline#gitdiff#indicator_deleted = '-'
let g:lightline#gitdiff#indicator_modified = 'Δ'
let g:lightline#gitdiff#separator = ' '
" This prevents opening brackets in compound literals from being
" highlighted as errors
let c_no_curly_error = 1
" Spellcheck markdown files
autocmd FileType markdown setlocal spell spelllang=en_us
" Use C++ style comments in C files
autocmd FileType c setlocal commentstring=//\ %s
autocmd FileType cpp setlocal commentstring=//\ %s
" Use C++ style comments in Riff files
autocmd FileType riff setlocal commentstring=//\ %s
" (C) Do not indent case labels past the indent of switch statements
set cino=:0
" Assembly
autocmd FileType asm setlocal shiftwidth=8
autocmd FileType asm setlocal tabstop=8
autocmd BufNewFile,BufRead *[jJ]enkinsfile set ft=groovy