-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
173 lines (111 loc) · 2.74 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
166
167
168
169
170
171
172
173
""""""""""
" General "
"""""""""""
set nocompatible
set t_Co=256
set number
set relativenumber
set hlsearch
set hidden
set incsearch
set novisualbell
set ignorecase
set noswapfile
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set shiftround
set autoindent
set copyindent
set smarttab
autocmd Filetype python setlocal colorcolumn=79
autocmd Filetype htmldjango setlocal colorcolumn=100
autocmd Filetype html setlocal colorcolumn=100
"""""""""""""""""""""""
" Custom Key Bindings "
"""""""""""""""""""""""
" Leader Key
" https://stackoverflow.com/a/446293
nnoremap <SPACE> <Nop>
let mapleader = " "
" Window Movements
nnoremap <leader>wc <C-w>c
nnoremap <leader>wr <C-w>r
nnoremap <leader>ws <C-w>s
nnoremap <leader>wv <C-w>v
nnoremap <leader>ww <C-w>w
nnoremap <leader>wh <C-w>h
nnoremap <leader>wj <C-w>j
nnoremap <leader>wk <C-w>k
nnoremap <leader>wl <C-w>l
" Tab Movements
nnoremap <leader>to :tabnew<CR>
nnoremap <leader>tc :tabclose<CR>
nnoremap <leader>tn gt
nnoremap <leader>tp gT
" Test Search Highlighting
nnoremap <leader>hn :nohlsearch<CR>
" Use xterm keys.
" Reference: https://superuser.com/a/402084
if &term =~ '^screen'
" tmux will send xterm-style keys when its xterm-keys option is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
""""""""""""""
" Formatting "
""""""""""""""
" Trim trailing whitespaces on save
autocmd BufWritePre * %s/\s\+$//e
"""""""""""
" Folding "
"""""""""""
set nofoldenable
set foldmethod=syntax
set foldlevel=99
""""""""""""""
" Background "
""""""""""""""
set background=dark
""""""""""""""""""""""""""
" Vim Plugins (vim-plug) "
""""""""""""""""""""""""""
call plug#begin('~/.vim/autoload')
" Aesthetics
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'rafi/awesome-vim-colorschemes'
Plug 'crusoexia/vim-monokai'
" File Management
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'scrooloose/nerdtree'
" Code Readability
Plug 'mattesgroeger/vim-bookmarks'
Plug 'tmhedberg/simpylfold'
Plug 'sheerun/vim-polyglot'
" Code Formatting and Editing
Plug 'jiangmiao/auto-pairs'
Plug 'mattn/emmet-vim'
Plug 'tpope/vim-commentary'
Plug 'editorconfig/editorconfig-vim'
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
" API Testins
Plug 'nicwest/vim-http'
call plug#end()
" junegunn/fzf
nnoremap <space><space> :FZF<CR>
" scrooloose/nerdtree
nmap <leader>n :NERDTreeToggle<CR><C-w>=
autocmd Filetype nerdtree set number relativenumber
" colorscheme
colorscheme gruvbox
" vim-airline
let g:airline_powerline_fonts = 1
autocmd vimenter * :AirlineTheme kolor
let g:airline_theme='kolor'
" nicwest/vim-http
let g:vim_http_split_vertically=1