-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
81 lines (67 loc) · 1.88 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
" Install vim-plug if necessary
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
"=======================================
"=============== PLUGINS ===============
"=======================================
call plug#begin()
"-- Autoclose brackets & such --
Plug 'Townk/vim-autoclose'
"-- Fuzzy search --
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
"-- Emmet --
Plug 'mattn/emmet-vim'
"-- File tree --
"-- Plug 'preservim/nerdtree'
"-- Polyglot --
Plug 'sheerun/vim-polyglot'
"-- Theme --
Plug 'nightsense/carbonized'
call plug#end()
"=======================================
"=============== OPTIONS ===============
"=======================================
"---------- Interface ----------
set nocompatible
set number
set updatetime=50
set tabstop=2 softtabstop=2
set shiftwidth=2
set clipboard=unnamed
set termguicolors
syntax on
set re=0
set scrolloff=8
set relativenumber
set expandtab
set smartindent
set termguicolors
"--------- Theme ---------
colorscheme carbonized-light
"---------- Emmet ----------
let g:user_emmet_mode='a'
"---------- Maping ----------
let mapleader = ","
nmap <Leader>f :FZF <CR>
nmap <Leader>g :GFiles <CR>
nmap <Leader>a :Ag <CR>
nnoremap <leader>h :wincmd h<CR>
nnoremap <leader>j :wincmd j<CR>
nnoremap <leader>k :wincmd k<CR>
nnoremap <leader>l :wincmd l<CR>
nnoremap <leader>q' ciw''<Esc>P
nnoremap <leader>q" ciw""<Esc>P
nnoremap <leader>qd daW"=substitute(@@,"'\\\|\"","","g")<CR>P
nnoremap <leader>n :noh<CR>
"--------- Commands ---------
command E Ex
command A Ag
"-- Ag needs brew install the_silver_searcher
"-------- Auto commands -----
autocmd BufWritePost * call system("ctags -R")
nnoremap <leader>s :split<CR>
nnoremap <leader>v :vsplit<CR>