-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
157 lines (135 loc) · 3.82 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
" Plugins
"
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 'scrooloose/nerdtree'
"Plug 'phanviet/vim-monokai-pro'
Plug 'ayu-theme/ayu-vim'
Plug 'vim-syntastic/syntastic'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'itchyny/lightline.vim'
Plug 'mengelbrecht/lightline-bufferline'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'editorconfig/editorconfig-vim'
Plug 'ryanoasis/vim-devicons'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'tpope/vim-commentary'
Plug 'posva/vim-vue'
Plug 'evanleck/vim-svelte', {'branch': 'main'}
Plug 'rust-lang/rust.vim'
call plug#end()
" UI
"
syntax on
set relativenumber
set number
set mouse=a
set guitablabel=%t
set hlsearch
set showmatch
set showcmd
set nowrap
set encoding=utf8
set autoread
set tabstop=4
set noswapfile
" colors
set termguicolors
set background=dark
"colorscheme monokai_pro
let ayucolor="dark"
colorscheme ayu
" delete automatic indentation with backspace
set backspace=indent,eol,start
" osx block indentations
nnoremap <leader>[ <<<cr>
nnoremap <leader>] >><cr>
nnoremap <leader>[ <gv<cr>
nnoremap <leader>] >gv<cr>
" working with buffers
set hidden
nnoremap <c-n> :bnext<cr>
nnoremap <c-p> :bprev<cr>
" git commit spell checking
autocmd Filetype gitcommit setlocal spell
" NerdTree
nnoremap <c-o> :NERDTreeToggle<cr>
nnoremap <c-f> :NERDTreeFind<cr>
let g:NERDTreeMinimalUI = 1
let g:NERDTreeChDirMode = 2
let g:NERDTreeWinSize=24
" ag
let g:ackprg = 'ag --vimgrep'
" custom files command to include hidden files
command! -bang -nargs=? -complete=dir HFiles
\ call fzf#vim#files(<q-args>, {'source': 'ag --hidden --ignore .git -g ""'}, <bang>0)
" fzf
nmap <C-p> :HFiles<CR>
" lightline
set noshowmode
set laststatus=2
set showtabline=2
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [
\ ['mode', 'paste'],
\ ['fugitive', 'readonly', 'filename']
\ ]
\},
\ 'component_function': {
\ 'readonly': 'LightlineReadonly',
\ 'modified': 'LightlineModified',
\ 'fugitive': 'LightlineFugitive',
\ 'filename': 'LightlineFilename',
\},
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' }
\}
function! LightlineReadonly()
return (&readonly ? '' : '')
endfunction
function! LightlineModified()
return (&modified ? '' : '')
endfunction
function! LightlineFugitive()
if exists('*fugitive#head')
return (fugitive#head() != '' ? ' '.fugitive#head() : '')
endif
endfunction
function! LightlineFilename()
return (expand('%:t') != '' ? expand('%:t') : '[No Name]') .
\ (LightlineModified() != '' ? ' '.LightlineModified() : '')
endfunction
let g:lightline#bufferline#show_number = 2
let g:lightline#bufferline#shorten_path = 0
let g:lightline#bufferline#unnamed = '[No Name]'
let g:lightline#bufferline#enable_devicons = 1
let g:lightline#bufferline#unicode_symbols = 1
nmap <Leader>1 <Plug>lightline#bufferline#go(1)
nmap <Leader>2 <Plug>lightline#bufferline#go(2)
nmap <Leader>3 <Plug>lightline#bufferline#go(3)
nmap <Leader>4 <Plug>lightline#bufferline#go(4)
nmap <Leader>5 <Plug>lightline#bufferline#go(5)
nmap <Leader>6 <Plug>lightline#bufferline#go(6)
nmap <Leader>7 <Plug>lightline#bufferline#go(7)
nmap <Leader>8 <Plug>lightline#bufferline#go(8)
nmap <Leader>9 <Plug>lightline#bufferline#go(9)
nmap <Leader>0 <Plug>lightline#bufferline#go(10)
let g:lightline.tabline = {
\ 'left': [['buffers']],
\ 'right': [['close']]
\}
let g:lightline.component_expand = {
\ 'buffers': 'lightline#bufferline#buffers'
\}
let g:lightline.component_type = {
\ 'buffers': 'tabsel'
\}