-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.vim
159 lines (120 loc) · 4.55 KB
/
config.vim
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
call plug#begin()
" Plugins aqui
Plug 'sainnhe/sonokai'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ryanoasis/vim-devicons'
Plug 'sheerun/vim-polyglot'
Plug 'preservim/nerdtree'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'dense-analysis/ale'
Plug 'honza/vim-snippets'
Plug 'jiangmiao/auto-pairs'
if (has("nvim"))
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-tree/nvim-web-devicons' " Recommended (for coloured icons)
" Plug 'ryanoasis/vim-devicons' Icons without colours
Plug 'akinsho/bufferline.nvim', { 'tag': '*' }
endif
call plug#end()
" Global Sets """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on " Enable syntax highlight
set nu " Enable line numbers
set tabstop=4 " Show existing tab with 4 spaces width
set softtabstop=4 " Show existing tab with 4 spaces width
set shiftwidth=4 " When indenting with '>', use 4 spaces width
set expandtab " On pressing tab, insert 4 spaces
set smarttab " insert tabs on the start of a line according to shiftwidth
set smartindent " Automatically inserts one extra level of indentation in some cases
set hidden " Hides the current buffer when a new file is openned
set incsearch " Incremental search
set ignorecase " Ingore case in search
set smartcase " Consider case if there is a upper case character
set scrolloff=8 " Minimum number of lines to keep above and below the cursor
set signcolumn=yes " Add a column on the left. Useful for linting
set cmdheight=2 " Give more space for displaying messages
set updatetime=100 " Time in miliseconds to consider the changes
set encoding=utf-8 " The encoding should be utf-8 to activate the font icons
set nobackup " No backup files
set nowritebackup " No backup files
set splitright " Create the vertical splits to the right
set splitbelow " Create the horizontal splits below
set autoread " Update vim after file update from outside
set mouse= " Enable mouse support
filetype on " Detect and set the filetype option and trigger the FileType Event
filetype plugin on " Load the plugin file for the file type, if any
filetype indent on " Load the indent file for the file type, if any
" Themes """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
let g:sonokai_style = 'andromeda'
let g:sonokai_enable_italic = 1
let g:sonokai_disable_italic_comment = 0
let g:sonokai_diagnostic_line_highlight = 1
let g:sonokai_current_word = 'bold'
colorscheme sonokai
if (has("nvim")) "Transparent background. Only for nvim
highlight Normal guibg=NONE ctermbg=NONE
highlight EndOfBuffer guibg=NONE ctermbg=NONE
endif
" Remaps """"""""""
" remaps aqui
" Shortcuts for split navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Create a tab
nmap te :tabe<CR>
" Navigate between buffers
nmap ty :bn<CR>
nmap tr :bp<CR>
" Delete a buffer
nmap td :bd<CR>
" Create splits
nmap th :split<CR>
nmap tv :vsplit<CR>
" Close splits and others
nmap tt :wq<CR>
nmap tq :q!<CR>
" Call command shortcut
nmap tc :!
" autocmd """"""""""
" autocmds aqui
" Definir cor palavra em destaque
highlight WordUnderCursor ctermbg=gray guibg=gray
function! HighlightWordUnderCursor()
if getline(".")[col(".")-1] !~# '[[:punct:][:blank:]]'
exec 'match' 'WordUnderCursor' '/\V\<'.expand('<cword>').'\>/'
else
match none
endif
endfunction
autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor()
" NerdTree """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <C-a> :NERDTreeToggle<CR>
" ALE """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:ale_linters = {
\}
let g:ale_fixers = {
\ '*': ['trim_whitespace'],
\}
let g:ale_fix_on_save = 1
if (has("nvim"))
" Telescope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" Buffer Line
" In your init.lua or init.vim
set termguicolors
" lua << EOF
lua require'bufferline'.setup{}
" EOF
endif