Repository navigation
Expand file tree
/
Copy pathvimrc
More file actions
180 lines (155 loc) · 4.83 KB
/
Copy pathvimrc
File metadata and controls
180 lines (155 loc) · 4.83 KB
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
" ----------------------------------------------------------------
" Config: Vim Classic Resilient Configuration
" ----------------------------------------------------------------
" ================================
" GERAL
" ================================
" --------------------------------
" Essenciais
" --------------------------------
set nocompatible
filetype plugin indent on
syntax on
set encoding=UTF-8
let s:vim_dir = fnamemodify(resolve(expand('<sfile>:p')), ':h')
if stridx(&runtimepath, s:vim_dir) == -1
let &runtimepath = s:vim_dir . ',' . &runtimepath . ',' . s:vim_dir . '/after'
endif
if filereadable(s:vim_dir . '/autoload/plug.vim') && !exists('*plug#begin')
execute 'source ' . fnameescape(s:vim_dir . '/autoload/plug.vim')
endif
" --------------------------------
" Interface & Visual
" --------------------------------
set number
set relativenumber
set cursorline
set scrolloff=10
set showmode
set showcmd
set wildmenu
set wildmode=list:longest
" --------------------------------
" Busca
" --------------------------------
set incsearch
set hlsearch
set ignorecase
set smartcase
" --------------------------------
" Comportamento do Editor
" --------------------------------
set hidden
set nobackup
set noswapfile
set nowrap
set backspace=indent,eol,start
set whichwrap+=<,>,h,l,[,]
set mouse=a
set clipboard^=unnamed,unnamedplus
" --------------------------------
" Indentacao
" --------------------------------
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set autoindent
" --------------------------------
" Cores
" --------------------------------
if (has("termguicolors"))
set termguicolors
endif
set background=dark
" ================================
" PLUGINS
" ================================
if exists('*plug#begin')
call plug#begin()
" --------------------------------
" Interface
" --------------------------------
Plug 'ryanoasis/vim-devicons'
Plug 'tomasiser/vim-code-dark'
Plug 'vim-airline/vim-airline'
" --------------------------------
" Ferramentas
" --------------------------------
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'preservim/nerdtree'
Plug 'mg979/vim-visual-multi'
Plug 'tpope/vim-surround'
Plug 'vim-scripts/Tagbar'
" --------------------------------
" Linguagens
" --------------------------------
Plug 'sheerun/vim-polyglot'
" --------------------------------
" Assembly
" --------------------------------
Plug 'GabrielFrigo4/fasm.vim'
Plug 'kylelaker/riscv.vim'
Plug 'ARM9/arm-syntax-vim'
call plug#end()
endif
" ================================
" MAPEAMENTOS
" ================================
let mapleader="\\"
" --------------------------------
" Navegacao de Janelas
" --------------------------------
nnoremap <tab> :wincmd w<CR>
nnoremap ; :wincmd w<CR>
nnoremap <M-]> :wincmd w<CR>
" --------------------------------
" NERDTree
" --------------------------------
nnoremap <C-\> :NERDTreeToggle<CR>
nnoremap , :NERDTreeToggle<CR>
nnoremap <M-[> :NERDTreeToggle<CR>
" --------------------------------
" FZF
" --------------------------------
nnoremap <C-f> :Files<CR>
nnoremap <C-g> :Rg<CR>
" --------------------------------
" Utilitarios
" --------------------------------
nnoremap <leader><space> :nohlsearch<CR>
nnoremap <expr> <Backspace> col('.') == 1 ? 'kgJ' : 'X'
" ================================
" CUSTOMIZACAO & FILETYPES
" ================================
" --------------------------------
" Tema
" --------------------------------
silent! colorscheme codedark
" --------------------------------
" Estilo do Cursor
" --------------------------------
au VimEnter,VimResume * set guicursor=n-c:block,i-ci-ve:ver25,r-cr:hor10,o:hor50,v:hor10,a:blinkwait500-blinkoff500-blinkon500-Cursor/lCursor
au VimLeave,VimSuspend * set guicursor=
let &t_SI = "\<Esc>[5 q"
let &t_SR = "\<Esc>[3 q"
let &t_EI = "\<Esc>[1 q"
" --------------------------------
" ManPages
" --------------------------------
runtime! ftplugin/man.vim
" --------------------------------
" Assembly
" --------------------------------
augroup AssemblyConfig
autocmd!
autocmd BufNewFile,BufRead *.riscv,*.rinc,*.RISCV,*.RINC set filetype=riscv
autocmd BufNewFile,BufRead *.arm,*.ainc,*.ARM,*.AINC set filetype=arm
autocmd BufNewFile,BufRead *.x86,*.x64,*.xinc set filetype=nasm
autocmd BufNewFile,BufRead *.fasm,*.finc set filetype=fasm
autocmd BufNewFile,BufRead *.masm,*.minc set filetype=masm
autocmd BufNewFile,BufRead *.gas,*.ginc set filetype=asm
autocmd FileType asm,nasm,fasm,masm,riscv,arm,c,cpp,rust,go,python,lua
\ setlocal tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab autoindent
augroup END