2020-04-20 04:27:35 +02:00
|
|
|
"
|
2019-11-23 02:17:36 +01:00
|
|
|
" LEL
|
2019-12-09 19:25:42 +01:00
|
|
|
" _
|
|
|
|
" _ ____ _(_)_ __ ___
|
|
|
|
" | '_ \ \ / / | '_ ` _ \
|
2019-12-01 17:36:00 +01:00
|
|
|
" | | | \ V /| | | | | | |
|
|
|
|
" |_| |_|\_/ |_|_| |_| |_|
|
2019-12-09 19:25:42 +01:00
|
|
|
|
2019-11-23 02:17:36 +01:00
|
|
|
" Plugins{{{
|
2019-10-16 02:28:41 +02:00
|
|
|
"
|
|
|
|
" Install plug if it isn't already
|
|
|
|
if empty(glob('~/.config/nvim/autoload/plug.vim'))
|
|
|
|
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
augroup PLUG
|
|
|
|
au!
|
|
|
|
autocmd VimEnter * PlugInstall
|
|
|
|
augroup END
|
|
|
|
endif
|
|
|
|
|
|
|
|
call plug#begin('~/.config/nvim/plugged')
|
|
|
|
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
|
|
|
Plug 'chrisbra/Colorizer'
|
|
|
|
|
|
|
|
Plug 'junegunn/vim-easy-align'
|
|
|
|
|
|
|
|
" Language server support
|
2020-04-17 06:54:35 +02:00
|
|
|
"
|
2019-12-13 03:25:15 +01:00
|
|
|
" Plug 'sheerun/vim-polyglot'
|
2019-12-13 03:58:26 +01:00
|
|
|
" Plug 'dense-analysis/ale'
|
2020-04-17 06:54:35 +02:00
|
|
|
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
2019-12-13 03:25:15 +01:00
|
|
|
" Plug 'davidhalter/jedi-vim'
|
2020-04-17 06:54:35 +02:00
|
|
|
|
|
|
|
" Plug 'autozimu/LanguageClient-neovim', {
|
|
|
|
" \ 'branch': 'next',
|
|
|
|
" \ 'do': 'bash install.sh',
|
|
|
|
" \}
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2020-03-13 03:13:31 +01:00
|
|
|
" Debugger
|
2020-04-17 06:54:35 +02:00
|
|
|
" Plug 'vim-vdebug/vdebug'
|
2020-03-13 03:13:31 +01:00
|
|
|
|
2019-10-16 02:28:41 +02:00
|
|
|
" Fuzzy find
|
2020-04-17 06:54:35 +02:00
|
|
|
" Plug 'junegunn/fzf'
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
" Completions
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
2020-04-17 06:54:35 +02:00
|
|
|
|
|
|
|
" Pais
|
2019-10-17 20:55:24 +02:00
|
|
|
Plug 'jiangmiao/auto-pairs'
|
2020-04-17 06:54:35 +02:00
|
|
|
Plug 'tpope/vim-surround'
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
" Comments
|
|
|
|
Plug 'tpope/vim-commentary'
|
2019-12-09 19:25:42 +01:00
|
|
|
|
2019-10-16 02:28:41 +02:00
|
|
|
" Status bar
|
2019-12-09 19:25:42 +01:00
|
|
|
" Plug 'vim-airline/vim-airline'
|
|
|
|
" Plug 'vim-airline/vim-airline-themes'
|
|
|
|
" let g:airline#extensions#ale#enabled = 1
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
" Bufferlist (integrates with airline)
|
|
|
|
"Plug 'bling/vim-bufferline'
|
|
|
|
|
|
|
|
" Color scheme
|
|
|
|
Plug 'dikiaap/minimalist'
|
|
|
|
|
|
|
|
|
|
|
|
" Simplify movement
|
|
|
|
"Plug 'easymotion/vim-easymotion'
|
|
|
|
|
|
|
|
" Simplify file management
|
|
|
|
Plug 'scrooloose/nerdtree'
|
|
|
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
|
|
|
|
|
|
|
" Format using prettier
|
|
|
|
" Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
|
|
|
|
|
|
|
|
" Make markdown fun again
|
|
|
|
"Plug 'junegunn/limelight.vim'
|
|
|
|
|
|
|
|
" Better buffer management
|
|
|
|
"Plug 'qpkorr/vim-bufkill'
|
|
|
|
|
|
|
|
" Utilities
|
|
|
|
"Plug 'xolox/vim-misc'
|
|
|
|
|
|
|
|
" Notes
|
|
|
|
"Plug 'xolox/vim-notes'
|
2019-10-17 20:36:20 +02:00
|
|
|
|
|
|
|
" Latex
|
|
|
|
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
|
2019-10-18 15:48:39 +02:00
|
|
|
Plug 'vim-latex/vim-latex', { 'for': 'tex' }
|
2019-12-13 03:58:26 +01:00
|
|
|
Plug 'vim-scripts/AnsiEsc.vim', { 'for': 'man' }
|
2019-12-09 19:25:42 +01:00
|
|
|
" Plug 'powerman/vim-plugin-AnsiEsc'
|
2019-12-13 03:25:15 +01:00
|
|
|
Plug 'mboughaba/i3config.vim'
|
2020-04-20 04:27:35 +02:00
|
|
|
Plug 'dag/vim-fish'
|
2019-10-16 02:28:41 +02:00
|
|
|
call plug#end()
|
2019-12-09 19:25:42 +01:00
|
|
|
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
|
|
|
" Syntax options{{{
|
2019-10-16 02:28:41 +02:00
|
|
|
"
|
|
|
|
|
|
|
|
" Enable syntax and set color scheme
|
|
|
|
syntax on
|
|
|
|
|
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set expandtab
|
|
|
|
set smarttab
|
|
|
|
set virtualedit=block
|
|
|
|
|
|
|
|
"destaque no númer de linhas
|
|
|
|
set number
|
|
|
|
set relativenumber
|
|
|
|
|
|
|
|
"display whitespace
|
|
|
|
set listchars=tab:>-,trail:~,extends:>,precedes:<
|
|
|
|
set listchars=space:_,eol:;,tab:>-,trail:~,extends:>,precedes:<
|
2019-12-09 19:25:42 +01:00
|
|
|
set list
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
"ativa o mouse
|
|
|
|
set mouse =a
|
|
|
|
set clipboard +=unnamedplus
|
|
|
|
set title
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
|
|
|
" Gay colors{{{
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2020-04-19 21:17:46 +02:00
|
|
|
" if (empty($TMUX))
|
2019-10-16 02:28:41 +02:00
|
|
|
if (has('nvim'))
|
|
|
|
let $NVIM_TUI_ENABLE_TRUE_COLOR = 1
|
|
|
|
endif
|
|
|
|
if (has('termguicolors'))
|
|
|
|
set termguicolors
|
|
|
|
endif
|
2020-04-19 21:17:46 +02:00
|
|
|
" endif
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
colorscheme minimalist
|
|
|
|
|
2019-12-13 03:58:26 +01:00
|
|
|
set background=dark
|
2019-12-09 19:25:42 +01:00
|
|
|
|
2019-10-16 02:28:41 +02:00
|
|
|
"background color is transparent
|
2019-12-13 03:25:15 +01:00
|
|
|
highlight Normal guibg=None
|
2019-12-09 19:25:42 +01:00
|
|
|
highlight EndOfBuffer guibg=None guifg=#303030
|
2019-10-16 02:28:41 +02:00
|
|
|
highlight SpecialKey guibg=None guifg=#cc5757
|
2019-11-23 02:17:36 +01:00
|
|
|
|
2019-10-16 02:28:41 +02:00
|
|
|
"Line numers
|
|
|
|
highlight LineNr term=bold ctermfg=9 guifg=#cc5757 guibg=None
|
2019-11-23 02:17:36 +01:00
|
|
|
|
|
|
|
"Make whitespace dark
|
2020-04-19 21:17:46 +02:00
|
|
|
highlight NonText ctermfg=darkgray guifg=#252525 guibg=None
|
2019-12-09 19:25:42 +01:00
|
|
|
" highlight SpecialKey ctermfg=black guifg=#252525 guibg=None
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
"Current line
|
|
|
|
set cursorline
|
2019-12-09 19:25:42 +01:00
|
|
|
highlight CursorLine term=bold cterm=bold gui=Bold guibg=#191919
|
|
|
|
highlight CursorLineNr term=bold cterm=bold gui=Bold guibg=#191919 guifg=white
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
|
|
|
" Keys{{{
|
2019-10-16 02:28:41 +02:00
|
|
|
"
|
2020-05-18 00:40:41 +02:00
|
|
|
"
|
|
|
|
" dvorak
|
|
|
|
|
|
|
|
" noremap s l
|
|
|
|
" noremap n k
|
|
|
|
" noremap t j
|
|
|
|
" noremap h h "h keeps it's meaning
|
|
|
|
|
|
|
|
" Dvorak it!
|
|
|
|
no h h
|
|
|
|
no t j
|
|
|
|
no n k
|
|
|
|
no s l
|
|
|
|
" no s :
|
|
|
|
" no S :
|
|
|
|
no j d
|
|
|
|
no l n
|
|
|
|
no L N
|
|
|
|
" Added benefits
|
|
|
|
no - $
|
|
|
|
no _ ^
|
|
|
|
no N <C-w><C-w>
|
|
|
|
no T <C-w><C-r>
|
|
|
|
no H 8<Down>
|
|
|
|
no T 8<Up>
|
|
|
|
no D <C-w><C-r>
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
" Easy comment toggle
|
|
|
|
nmap <silent> gc :Commentary<CR>
|
|
|
|
xmap <silent> gc :Commentary<CR>
|
|
|
|
|
|
|
|
" Toggle file manager
|
|
|
|
map <silent> <C-n> :NERDTreeToggle %:p:h<CR>
|
|
|
|
|
|
|
|
" EasyAlign
|
|
|
|
xmap ga <Plug>(EasyAlign)
|
|
|
|
nmap ga <Plug>(EasyAlign)
|
|
|
|
|
|
|
|
" Simplify window navigation
|
|
|
|
nnoremap <silent> <C-h> <C-w><C-h>
|
|
|
|
nnoremap <silent> <C-j> <C-w><C-j>
|
|
|
|
nnoremap <silent> <C-k> <C-w><C-k>
|
|
|
|
nnoremap <silent> <C-l> <C-w><C-l>
|
|
|
|
|
2020-04-17 06:54:35 +02:00
|
|
|
|
2019-10-16 02:28:41 +02:00
|
|
|
" Interact with language server
|
2020-04-17 06:54:35 +02:00
|
|
|
nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
|
2019-12-13 03:25:15 +01:00
|
|
|
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
|
2020-04-17 06:54:35 +02:00
|
|
|
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
|
2019-12-13 03:25:15 +01:00
|
|
|
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
|
|
|
" Lanugage Server{{{
|
2019-10-16 02:28:41 +02:00
|
|
|
"
|
2020-04-19 21:17:46 +02:00
|
|
|
set foldmethod=marker
|
2019-10-16 02:28:41 +02:00
|
|
|
set hidden
|
2020-04-17 06:54:35 +02:00
|
|
|
" let g:deoplete#enable_at_startup = 1
|
2019-12-09 19:25:42 +01:00
|
|
|
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2020-04-17 06:54:35 +02:00
|
|
|
" let g:LanguageClient_serverCommands = {
|
|
|
|
" \ 'rust': ['rustup', 'run', 'stable', 'rls'],
|
|
|
|
" \ 'python': ['/usr/bin/pyls'],
|
|
|
|
" \ 'tex': ['/usr/bin/texlab'],
|
|
|
|
" \ 'c': ['cquery', '--log-file=/tmp/cq.log'],
|
|
|
|
" \ 'cpp': ['cquery', '--log-file=/tmp/cq.log'],
|
|
|
|
" \ }
|
2020-03-13 03:13:31 +01:00
|
|
|
|
2019-12-13 03:25:15 +01:00
|
|
|
|
2020-04-17 06:54:35 +02:00
|
|
|
" call deoplete#custom#source('LanguageClient',
|
|
|
|
" \ 'min_pattern_length',
|
|
|
|
" \ 2)
|
|
|
|
" " Configure deoplete to use language server
|
|
|
|
|
|
|
|
|
|
|
|
" let g:ale_fix_on_save = 1
|
|
|
|
" let g:ale_fixers = {
|
|
|
|
" \ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
|
|
|
" \ 'javascript': ['eslint'],
|
|
|
|
" \ 'python': ['black'],
|
|
|
|
" \}
|
2019-12-09 19:25:42 +01:00
|
|
|
|
2019-11-23 02:17:36 +01:00
|
|
|
"python env{{{
|
2019-10-16 02:28:41 +02:00
|
|
|
" MUST NOT BE INDENTED!
|
|
|
|
py3 << EOF
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
if 'VIRTUAL_ENV' in os.environ:
|
|
|
|
project_base_dir = os.environ['VIRTUAL_ENV']
|
|
|
|
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
|
|
|
|
execfile(activate_this, dict(__file__=activate_this))
|
|
|
|
EOF
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
|
|
|
" Latex{{{
|
2019-10-17 20:36:20 +02:00
|
|
|
let g:livepreview_previewer = 'zathura'
|
2019-10-18 15:48:39 +02:00
|
|
|
autocmd FileType tex LLPStartPreview
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
2020-04-17 06:54:35 +02:00
|
|
|
"groff{{{
|
2020-04-19 21:17:46 +02:00
|
|
|
augroup filetrype_groff
|
|
|
|
autocmd VimEnter *.ms set ft=groff
|
|
|
|
|
|
|
|
autocmd VimEnter *.ms silent !zathura (string replace --regex .ms\$ .pdf "%" ) & jobs -lp > /tmp/groff-preview
|
|
|
|
autocmd VimLeave *.ms silent !kill (cat /tmp/groff-preview )
|
|
|
|
|
|
|
|
autocmd BufWritePost *.ms silent !compile %
|
|
|
|
|
|
|
|
" autocmd FileType groff setlocal commentstring=\\\"\ %s
|
|
|
|
augroup END
|
2020-04-17 06:54:35 +02:00
|
|
|
"}}}
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
|
|
|
"Hide statusbar{{{
|
2019-10-18 18:24:58 +02:00
|
|
|
let s:hidden_all = 0
|
2019-10-17 20:36:20 +02:00
|
|
|
function! ToggleHiddenAll()
|
|
|
|
if s:hidden_all == 0
|
|
|
|
let s:hidden_all = 1
|
|
|
|
set noshowmode
|
|
|
|
set noruler
|
|
|
|
set laststatus=0
|
|
|
|
set noshowcmd
|
|
|
|
else
|
|
|
|
let s:hidden_all = 0
|
|
|
|
set showmode
|
|
|
|
set ruler
|
|
|
|
set laststatus=2
|
|
|
|
set showcmd
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
nnoremap <S-h> :call ToggleHiddenAll()<CR>
|
2019-10-18 18:24:58 +02:00
|
|
|
call ToggleHiddenAll()
|
2019-11-23 02:17:36 +01:00
|
|
|
"}}}
|
2019-12-09 19:25:42 +01:00
|
|
|
" vim:foldmethod=marker
|