-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
161 lines (123 loc) · 3.66 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
set nocompatible " be iMproved, required
set tabstop=4
set shiftwidth=4
set smarttab
set autoindent
set smartindent
set ruler
set relativenumber
set number
set mousehide
set cursorline
set hlsearch
" Turn on syntax highlighting
syntax on
set background=dark
" Set terminal colors
set t_Co=256
set directory=~/.vim/.swap " use a custom directory for swap files
set mouse=a
set laststatus=2
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
if has('gui_running')
set guifont=Meslo\ LG\ S\ Regular\ for\ Powerline:h11
endif
" Map twig syntax to jinja
au BufRead,BufNewFile *.twig set filetype=htmljinja
" CSS Auto Bracket Completion
inoremap {<CR> {<CR><BS>}<Esc>ko
" Paranthesis Auto Bracket Completion
inoremap (<CR> (<CR>);<Esc>ko<Tab>
" Twig Auto Bracket Completion
inoremap {{ {{<space><space>}}<esc>2hi
inoremap {% {%<space><space>%}<esc>2hi
" Remap Leader
let mapleader = ","
" vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'gmarik/vundle'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'altercation/vim-colors-solarized'
Plug 'flazz/vim-colorschemes'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'mattn/emmet-vim'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'mxw/vim-jsx'
Plug 'honza/vim-snippets'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'lumiliet/vim-twig'
Plug 'mhartington/oceanic-next'
Plug 'cespare/vim-toml'
Plug 'pangloss/vim-javascript'
Plug 'plasticboy/vim-markdown'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
call plug#end()
" Ultisnips
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" ColorStepper Keys
"nmap <F6> <Plug>ColorstepPrev
"nmap <F7> <Plug>ColorstepNext
"nmap <S-F7> <Plug>ColorstepReload
" Nerd Tree toggle
nnoremap <silent> <leader>n :call g:WorkaroundNERDTreeToggle()<cr>
nnoremap <C-f> :NERDTreeFind<cr>
" after deleting all buffers with wipeout function, :NERDTreeToggle bugs out
" but the first call to :NERDTree fixes everything
function! g:WorkaroundNERDTreeToggle()
try | :NERDTreeToggle | catch | :NERDTree | endtry
endfunction
" JSX Javascript highlighting
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
" Rempap Emmet keys
let g:user_emmet_leader_key='<leader>'
" Airline
let g:airline_theme='light' "airline colors
"let g:airline_theme='oceanicnext'
let g:airline_powerline_fonts = 1 "enable patch fonts
let g:airline#extensions#tabline#enabled = 0
let g:airline#extensions#tabline#buffer_nr_show = 0
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
let g:Powerline_symbols = "fancy"
" Remap leader to switch windows instead of ctrl
noremap <leader>h <C-W>h
noremap <leader>j <C-W>j
noremap <leader>k <C-W>k
noremap <leader>l <C-W>l
noremap <leader>1 1gt
noremap <leader>2 2gt
noremap <leader>3 3gt
noremap <leader>4 4gt
noremap <leader>5 5gt
noremap <leader>5 6gt
noremap <leader>6 7gt
noremap <leader>7 8gt
noremap <leader>8 9gt
noremap <leader>9 10gt
" for vim 8
if (has("termguicolors"))
set termguicolors
endif
let g:solarized_termcolors=16
" Map FZF to Ctrl+P
nnoremap <C-P> :FZF<CR>
" Color Scheme
"colorscheme solarized
"colorscheme atom
"colorscheme oceandeep
"colorscheme sorcerer
colorscheme OceanicNext