-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
102 lines (88 loc) · 3.06 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
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync
autocmd VimEnter * CocInstall rust-rls
autocmd VimEnter * CocInstall coc-java
autocmd VimEnter * CocInstall coc-clangd
autocmd VimEnter * CocInstall coc-json
autocmd VimEnter * CocInstall coc-vimtex
autocmd VimEnter * CocInstall coc-powershell
autocmd VimEnter * CocInstall coc-sh
autocmd VimEnter * CocInstall coc-pyright
endif
set cmdheight=0
set showbreak=↪\
call plug#begin()
Plug 'sheerun/vim-polyglot'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'vim-airline/vim-airline'
Plug 'junegunn/goyo.vim'
Plug 'chriskempson/base16-vim'
Plug 'lervag/vimtex'
Plug 'github/copilot.vim'
Plug 'f-person/git-blame.nvim'
Plug 'junegunn/fzf'
call plug#end()
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
set iskeyword-=_
retab
colorscheme vim
autocmd Filetype markdown call SetWritingOpts()
autocmd Filetype tex call SetWritingOpts()
function SetWritingOpts()
set linebreak
set tw=80
inoremap `A A
inoremap `E É
inoremap `a à
inoremap `e é
inoremap `o ó
inoremap `u ú
iabbrev ~a ã
iabbrev tb também
iabbrev nao não
iabbrev sao são
iabbrev ja já
iabbrev numero número
noremap <buffer> <silent> k gk
noremap <buffer> <silent> j gj
noremap <buffer> <silent> 0 g0
noremap <buffer> <silent> $ g$
endfunction
autocmd FileType tex call SetTexOpts()
function SetTexOpts()
map <leader>r :silent !pdflatex --shell-escape %:p > /dev/null &<Return>
command! Re !pdflatex --shell-escape %:p
command! Wre w <bar> !pdflatex --shell-escape %:p
inoremap ,tt \texttt{}<Space><++><Esc>T{i
inoremap ,ve \verb!!<Space><++><Esc>T!i
inoremap ,bf \textbf{}<Space><++><Esc>T{i
inoremap ,it \textit{}<Space><++><Esc>T{i
inoremap ,st \section{}<Return><Return><++><Esc>2kt}a
inoremap ,sst \subsection{}<Return><Return><++><Esc>2kt}a
inoremap ,ssst \subsubsection{}<Return><Return><++><Esc>2kt}a
inoremap ,bit \begin{itemize}<CR><CR>\end{itemize}<Return><++><Esc>kki<Tab>\item<Space>
inoremap ,bfi \begin{figure}[H]<CR><CR>\end{figure}<Return><++><Esc>kki<Tab>\centering<CR><Tab>\includegraphics{}<CR>\caption{<++>}<Esc>k$i
inoremap ,beg \begin{<++>}<Esc>yyp0fbcwend<Esc>O<Tab><++><Esc>k0<Esc>/<++><Enter>"_c4l
endfunction
autocmd FileType coq inoremap ,for ∀
set scrolloff=4
set undodir=~/.cache/vimundo
set undofile
set mouse=
command! Q qa
command! Cd CocList diagnostics
" Fast replace
nnoremap s :s//g<Left><Left>
nnoremap S :%s//g<Left><Left>
vnoremap s :s//g<Left><Left>
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <Tab>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
highlight RedundantSpaces ctermbg=red guibg=red
match RedundantSpaces /\s\+$/