diff --git a/deploy.yml b/deploy.yml index 81916d2..7fc4df6 100644 --- a/deploy.yml +++ b/deploy.yml @@ -1,4 +1,4 @@ --- - hosts: all roles: - - dotfiles + - minimal diff --git a/full-deploy.yml b/full-deploy.yml new file mode 100644 index 0000000..ac843e5 --- /dev/null +++ b/full-deploy.yml @@ -0,0 +1,4 @@ +--- +- hosts: all + roles: + - full diff --git a/roles/full/meta/main.yml b/roles/full/meta/main.yml new file mode 100644 index 0000000..2f9d522 --- /dev/null +++ b/roles/full/meta/main.yml @@ -0,0 +1,8 @@ +--- +dependencies: + - tmux-user-cfg + - { role: vim-user-cfg, vim_rc_version: "full" } + - zsh-user-cfg + - nix + - nix-user-cfg + - kitty-user-cfg diff --git a/roles/minimal/meta/main.yml b/roles/minimal/meta/main.yml new file mode 100644 index 0000000..45d41b6 --- /dev/null +++ b/roles/minimal/meta/main.yml @@ -0,0 +1,5 @@ +--- +dependencies: + - tmux-user-cfg + - { role: vim-user-cfg, vim_rc_version: "minimal" } + - zsh-user-cfg diff --git a/roles/tmux-user-cfg/defaults/main.yml b/roles/tmux-user-cfg/defaults/main.yml index acd7660..169b22c 100644 --- a/roles/tmux-user-cfg/defaults/main.yml +++ b/roles/tmux-user-cfg/defaults/main.yml @@ -1,2 +1,3 @@ --- +additional_user: syntaxerrormmm dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles" diff --git a/roles/vim-user-cfg/defaults/main.yml b/roles/vim-user-cfg/defaults/main.yml index acd7660..8b9b278 100644 --- a/roles/vim-user-cfg/defaults/main.yml +++ b/roles/vim-user-cfg/defaults/main.yml @@ -1,2 +1,4 @@ --- +additional_user: syntaxerrormmm dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles" +vim_rc_version: minimal diff --git a/roles/vim-user-cfg/tasks/config/main.yml b/roles/vim-user-cfg/tasks/config/main.yml index 00b7891..971d3d8 100644 --- a/roles/vim-user-cfg/tasks/config/main.yml +++ b/roles/vim-user-cfg/tasks/config/main.yml @@ -3,7 +3,7 @@ - name: Linking main file ansible.builtin.file: - src: "{{ dotfdir }}/vimrc" + src: "{{ dotfdir }}/vimrc-{{ vim_rc_version }}" dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.vimrc" state: link @@ -12,3 +12,6 @@ src: "{{ dotfdir }}/vim" dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.vim" state: link + +- name: Installing and configuring package manager - vim-plug + ansible.builtin.import_tasks: pkgman/main.yml diff --git a/roles/vim-user-cfg/tasks/main.yml b/roles/vim-user-cfg/tasks/main.yml index f022e7f..ec07e42 100644 --- a/roles/vim-user-cfg/tasks/main.yml +++ b/roles/vim-user-cfg/tasks/main.yml @@ -12,7 +12,7 @@ - vim-install - name: Configuration - ansible.builtin.import_tasks: configuration.yml + ansible.builtin.import_tasks: config/main.yml tags: - vim - vim-config diff --git a/roles/zsh-user-cfg/tasks/main.yml b/roles/zsh-user-cfg/tasks/main.yml index bda4393..6faf5d8 100644 --- a/roles/zsh-user-cfg/tasks/main.yml +++ b/roles/zsh-user-cfg/tasks/main.yml @@ -1,17 +1,6 @@ --- # Setting up zsh -- name: Installation - ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml" - args: - apply: - tags: - - zsh - - zsh-install - tags: - - zsh - - zsh-install - - name: Configuration ansible.builtin.import_tasks: config/main.yml tags: diff --git a/vimrc-full b/vimrc-full new file mode 100644 index 0000000..54d42d0 --- /dev/null +++ b/vimrc-full @@ -0,0 +1,167 @@ +" Impostazioni di base +set nocompatible +syntax on +set background=dark +set modelines=5 +set modeline +set showcmd +set laststatus=2 +set splitbelow +set splitright + +" 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' + +" Ansible +Plug 'pearofducks/ansible-vim' " syntax highlight +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' + +" Mediawiki pages support +Plug 'm-pilia/vim-mediawiki' + +" Markdown with preview +Plug 'fannheyward/coc-markdownlint', { 'do': 'yarn install --frozen-lockfile' } +Plug 'weirongxu/coc-webview' +Plug 'weirongxu/coc-markdown-preview-enhanced', { 'do': 'yarn install --frozen-lockfile' } + +""" 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() + +" 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 :NERDTreeToggle + +" 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 (ale_next_wrap) +"let g:ale_sign_error = '⬥' +"let g:ale_sign_warning = '⬦' +"let g:ale_yaml_yamllint_options='-d "{extends: relaxed, rules: {line-length: disable}}"' + +" Configurazioni per ansible-vim +let g:ansible_unindent_after_newline = 1 + +" Completion with Conqueror of Code +" use 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 + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : + \ coc#refresh() + +" Conferma scelta con invio +inoremap coc#pum#visible() ? coc#pum#confirm() : "\\=coc#on_enter()\" +" mostra documentazione in preview +nnoremap K :call ShowDocumentation() + +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 = '' + +" 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' + let lines=45 + let columns=80 +endif diff --git a/vimrc-minimal b/vimrc-minimal new file mode 100644 index 0000000..c55f561 --- /dev/null +++ b/vimrc-minimal @@ -0,0 +1,101 @@ +" Impostazioni di base +set nocompatible +syntax on +set background=dark +set modelines=5 +set modeline +set showcmd +set laststatus=2 +set splitbelow +set splitright + +" 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' + +" Ansible +Plug 'pearofducks/ansible-vim' " syntax highlight + +" Rust +Plug 'rust-lang/rust.vim' +Plug 'zooxyt/Ultisnips-rust' + +" latex stuff +Plug 'lervag/vimtex' +Plug 'ckunte/latex-snippets-vim', { 'tag': '*' } + +" HTML 5 template +Plug 'othree/html5.vim' +" +" Blade syntax highlight +Plug 'xsbeats/vim-blade' + +" terraform syntax highlight +Plug 'hashivim/vim-terraform' + +" Mediawiki pages support +Plug 'm-pilia/vim-mediawiki' + +" Solarized theme +Plug 'altercation/vim-colors-solarized' + +" Vim-plug configuration end +call plug#end() + +" 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 :NERDTreeToggle + +" LaTeXsuite - Cambio il tex flavor +" let g:tex_flavor='latex' + +" Configurazioni per ansible-vim +let g:ansible_unindent_after_newline = 1 + +" vimtex configuration +let g:vimtex_view_method = 'zathura' + +" Ultisnips configuration +let g:UltiSnipsExpandTrigger = '' + +" 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 lines=45 + let columns=80 +endif