dotfiles/vimrc

158 lines
3.6 KiB
VimL

" Gestione plugin con vim-plug
call plug#begin()
" Base for plugin management
Plug 'junegunn/vim-plug'
" Standard vim packages
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
" Git wrapper
Plug 'tpope/vim-fugitive'
" File explorer
Plug 'scrooloose/nerdtree'
" nerdtree git plugin
Plug 'Xuyuanp/nerdtree-git-plugin'
" fzf integration
Plug 'junegunn/fzf.vim'
" Snippets management and support for vim
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
" Conqueror of Completion
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Shell Conqueror of Completion plugin
Plug 'josa42/coc-sh', { 'do': 'yarn install --frozen-lockfile' }
" Python
Plug 'fannheyward/coc-pyright', { 'do': 'yarn install --frozen-lockfile' }
" Ansible
Plug 'pearofducks/ansible-vim' " syntax highlight
Plug 'dense-analysis/ale' " ALE - linting, fixing and completion
Plug 'yaegassy/coc-ansible', {'do': 'yarn install --frozen-lockfile'}
" Rust
Plug 'rust-lang/rust.vim'
Plug 'zooxyt/Ultisnips-rust'
Plug 'fannheyward/coc-rust-analyzer', { 'do': 'yarn install --frozen-lockfile' }
" latex stuff
Plug 'lervag/vimtex'
Plug 'ckunte/latex-snippets-vim', { 'tag': '*' }
Plug 'neoclide/coc-vimtex', { 'do': 'yarn install --frozen-lockfile' }
" HTML 5 template
Plug 'othree/html5.vim'
"
" Blade syntax highlight
Plug 'xsbeats/vim-blade'
" terraform syntax highlight
Plug 'hashivim/vim-terraform'
""" Aesthetic fixes """
" Devicons
Plug 'ryanoasis/vim-devicons'
" Vim Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Solarized theme
Plug 'altercation/vim-colors-solarized'
" Vim-plug configuration end
call plug#end()
" Impostazioni di base
syntax on
set background=dark
set modelines=5
set modeline
set showcmd
set laststatus=2
set splitbelow
set splitright
" Riattivo i plugin per i tipi di file
filetype plugin indent on
" Override grep
set grepprg=grep\ -nH\ $*
" Configurazioni addizionali
" Nerdtree
let g:NERDTreeNodeDelimiter = "\u00a0"
map <C-n> :NERDTreeToggle<CR>
" LaTeXsuite - Cambio il tex flavor
" let g:tex_flavor='latex'
" Airline-theme - Set up airline-theme
let g:airline_powerline_fonts = 1
let g:airline_theme='dark'
" ALE configurations
nmap <silent> <C-e> <Plug>(ale_next_wrap)
let g:ale_sign_error = '⬥'
let g:ale_sign_warning = '⬦'
" Configurazioni per ansible-vim
let g:ansible_unindent_after_newline = 1
" Configurations for GVim
if has('gui_running')
"set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 14
"set guifont = Droid Sans Mono Slashed for Powerline Regular 16,Ubuntu Mono derivative Powerline 14
set guifont=Fira\ Code\ Nerd\ Font\ 12,Ubuntu\ Mono\ derivative\ Powerline\ 14
colorscheme solarized
let g:airline_theme='base16'
endif
" Completion with Conqueror of Code
" use <tab> to trigger completion and navigate to the next complete item
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()
" Conferma scelta con invio
inoremap <expr> <cr> coc#pum#visible() ? coc#pum#confirm() : "\<CR>\<c-r>=coc#on_enter()\<CR>"
" mostra documentazione in preview
nnoremap <silent> K :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
let g:coc_filetype_map = {
\ 'yaml.ansible': 'ansible',
\ }
" vimtex configuration
let g:vimtex_view_method = 'zathura'
" Ultisnips configuration
let g:UltiSnipsExpandTrigger = '<Tab>'