-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vimrc
229 lines (200 loc) · 5.86 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
" Black Hell Team
" https://github.com/Black-Hell-Team
" Coded by: Lucaz dev and Jo Power Tech
" https://github.com/luc4sd3v
" https://github.com/JoPowerTech
" Encoding
set encoding=UTF-8
" General
set nocompatible
filetype off
"Plugin
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'preservim/nerdtree'
Plugin 'morhetz/gruvbox'
Plugin 'luochen1990/rainbow'
Plugin 'jiangmiao/auto-pairs'
Plugin 'ryanoasis/vim-devicons'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
Plugin 'mhinz/vim-startify'
Plugin 'neoclide/coc.nvim'
Plugin 'sheerun/vim-polyglot'
Plugin 'gabrielelana/vim-markdown'
Plugin 'airblade/vim-gitgutter'
Plugin 'Yggdroot/indentLine.git'
Plugin 'AndrewRadev/tagalong.vim'
Plugin 'mattesgroeger/vim-bookmarks'
Plugin 'tpope/vim-commentary'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tpope/vim-surround'
Plugin 'mboughaba/i3config.vim'
Plugin 'mattn/emmet-vim'
Plugin 'jreybert/vimagit'
Plugin 'dracula/vim', { 'name': 'dracula' }
" Plugin 'ap/vim-css-color' Coloque ele se quiser mas que fique avisado que ele deixa o vim lento dependendo do pc ou do celular
call vundle#end()
filetype plugin on
filetype plugin indent on
" Text Rendering
set display+=lastline
set linebreak
set scrolloff=1
set sidescrolloff=5
syntax enable
set wrap
" Interface
set laststatus=2
set ruler
set wildmenu
set tabpagemax=50
set termguicolors
colorscheme dracula
set cursorline
set number
set noerrorbells
set visualbell
set mouse=a
set title
set background=dark
set confirm
set noshowmode
" Rainbow Brackets
let g:rainbow_active = 1
" Vim Airline
let g:airline_theme='violet'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline_powerline_fonts = 1
" Indent
set smartindent
set autoindent
filetype on
filetype indent on
set expandtab
set shiftround
set shiftwidth=4
set smarttab
set tabstop=4
" Search
set hlsearch
set ignorecase
set incsearch
set smartcase
" Split Options
set splitbelow
set splitright
" Perfomance
set ttyfast
set complete-=i
set lazyredraw
" Vim Startify
let g:startify_custom_header = [
\ ' ',
\ ' ██▒ █▓ ██▓ ███▄ ▄███▓',
\ ' ▓██░ █▒▓██▒▓██▒▀█▀ ██▒',
\ ' ▓██ █▒░▒██▒▓██ ▓██░',
\ ' ▒██ █░░░██░▒██ ▒██ ',
\ ' ▒▀█░ ░██░▒██▒ ░██▒',
\ ' ░ ▐░ ░▓ ░ ▒░ ░ ░',
\ ' ░ ░░ ▒ ░░ ░ ░',
\ ' ░░ ▒ ░░ ░ ',
\ ' ░ ░ ░ ',
\ ' ░ ',
\ ' ',
\ ]
function! s:gitModified()
let files = systemlist('git ls-files -m 2>/dev/null')
return map(files, "{'line': v:val, 'path': v:val}")
endfunction
function! s:gitUntracked()
let files = systemlist('git ls-files -o --exclude-standard 2>/dev/null')
return map(files, "{'line': v:val, 'path': v:val}")
endfunction
let g:startify_lists = [
\ { 'type': 'files', 'header': [' MRU'] },
\ { 'type': 'dir', 'header': [' MRU '. getcwd()] },
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ { 'type': function('s:gitModified'), 'header': [' git modified']},
\ { 'type': function('s:gitUntracked'), 'header': [' git untracked']},
\ { 'type': 'commands', 'header': [' Commands'] },
\ ]
" Coc
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_global_extensions = ['coc-sh', 'coc-highlight', 'coc-clangd']
" Indent Line
let g:indentLine_showFirstIndentLevel = 1
let g:indentLine_setColors = 0
" tagalong
let g:tagalong_verbose = 1
" Commentary
nnoremap <C-c> :Commentary<CR>
" Bookmarks
let g:bookmark_sign = ''
let g:bookmark_annotation_sign = ''
let g:bookmark_highlight_lines = 1
nnoremap <C-m> :BookmarkToggle<CR>
nnoremap <C-n> :BookmarkAnnotate<CR>
nnoremap <C-a> :BookmarkClearAll<CR>
" Runner CTRL + g
function! Executar(arq)
:w
if &filetype == 'go'
:exec '!go run' a:arq
elseif &filetype == 'python'
:exec '!pypy' a:arq '|| python3' a:arq
elseif &filetype == 'javascript'
:exec '!node' a:arq
elseif &filetype == 'c'
:exec '!clang' a:arq '|| gcc' a:arq
elseif &filetype == 'rust'
:exec "!cargo-fmt"
:exec '!cargo-clippy && cargo run || cargo run || rustc' a:arq
elseif &filetype == 'typescript'
:exec '!tsc -w' a:arq
elseif &filetype == 'cpp'
:exec '!clang++' a:arq '|| g++' a:arq
elseif &filetype == 'ruby'
:exec '!ruby' a:arq
elseif &filetype == 'php'
:exec '!php' a:arq
elseif &filetype == 'java'
:exec '!javac' a:arq
elseif &filetype == 'cs'
:exec '!dotnet run'
elseif &filetype == 'matlab'
:exec '!gcc `gnustep-config --objc-flags` -lgnustep-base' a:arq
elseif &filetype == 'swift'
:exec '!swift' a:arq
elseif &filetype == 'perl'
:exec '!perl' a:arq
elseif &filetype == 'sh'
:exec '!bash' a:arq
elseif &filetype == "lisp"
:exec "!sbcl --script" a:arq
elseif &filetype == "prolog"
:exec "!swipl" a:arq
elseif &filetype == "haskell"
:exec "!stack run || cabal run || ghc" a:arq
elseif &filetype == "elixir"
:exec "!elixir" a:arq
endif
endfunction
noremap <C-g> :call Executar(shellescape(@%, 1))<CR>
" i3-config
aug i3config_ft_detection
au!
au BufNewFile,BufRead ~/.config/i3/config set filetype=i3config_ft_detectionfig
aug end