Usersettings: Add variable to disable vim plugings

Some systems just don't need them, but they take quite some time to
install and take up space.
This commit is contained in:
Jannik Beyerstedt 2023-01-07 17:26:51 +01:00
parent bee777ac81
commit d084912154
4 changed files with 53 additions and 45 deletions

View File

@ -29,6 +29,7 @@ The User Setup will change the user shell and global gitconfig. This can be disa
* `gitconfig_name`: User's name in .gitconfig file (default: n.a.) * `gitconfig_name`: User's name in .gitconfig file (default: n.a.)
* `gitconfig_email`: User's email in .gitconfig file (default: n.a.) * `gitconfig_email`: User's email in .gitconfig file (default: n.a.)
- `usersetup_virtualenvwrapper`: Boolean to enable the virtualenvwrapper plugin in oh-my-zsh (default: false) - `usersetup_virtualenvwrapper`: Boolean to enable the virtualenvwrapper plugin in oh-my-zsh (default: false)
- `usersetup_vimplugins`: Boolean to enable installing my VIM plugins (default: true)
The development environment for different programming languages can be setup automatically. The development environment for different programming languages can be setup automatically.
To enable, that Visual Studio Code will be installed and configured, set `user_vscode` to true, otherwise only the bare development toolchain will be installed. To enable, that Visual Studio Code will be installed and configured, set `user_vscode` to true, otherwise only the bare development toolchain will be installed.

View File

@ -15,6 +15,9 @@ usersetup_gitconfig: true
# enable virtualenvwrapper plugin in oh-my-zsh # enable virtualenvwrapper plugin in oh-my-zsh
usersetup_virtualenvwrapper: false usersetup_virtualenvwrapper: false
# install VIM plugins
usersetup_vimplugins: true
# install VS Code and selectively activate different programming languages # install VS Code and selectively activate different programming languages
user_vscode: false user_vscode: false
user_lang_cpp: false user_lang_cpp: false

View File

@ -2,8 +2,8 @@
# Common/Usersettings: Universial Dotfiles. Update regularly. # Common/Usersettings: Universial Dotfiles. Update regularly.
- name: usersettings - Install required tools - name: usersettings - Install required tools
become: yes become: true
ignore_errors: yes # just fail on systems without sudo access ignore_errors: true # just fail on systems without sudo access
ansible.builtin.package: ansible.builtin.package:
name: "{{ packages }}" name: "{{ packages }}"
state: present state: present
@ -33,8 +33,8 @@
when: when:
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "Darwin" and (override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "Darwin" and
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "FreeBSD" (override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "FreeBSD"
become: yes become: true
ignore_errors: yes # just fail on systems without sudo access ignore_errors: true # just fail on systems without sudo access
ansible.builtin.package: ansible.builtin.package:
name: "{{ packages }}" name: "{{ packages }}"
state: present state: present
@ -43,7 +43,7 @@
- python3-pip - python3-pip
- name: usersettings - Install pip virtualenvwrapper (Debian) - name: usersettings - Install pip virtualenvwrapper (Debian)
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian" when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian"
become: yes become: true
ansible.builtin.pip: ansible.builtin.pip:
name: virtualenvwrapper name: virtualenvwrapper
extra_args: --system extra_args: --system
@ -57,7 +57,7 @@
when: when:
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Centos" or (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Centos" or
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Archlinux" (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Archlinux"
become: yes become: true
ansible.builtin.pip: ansible.builtin.pip:
name: virtualenvwrapper name: virtualenvwrapper
- name: usersettings - Copy dotfiles - name: usersettings - Copy dotfiles
@ -69,10 +69,6 @@
src: "{{ role_path }}/files/_gitignore_global", src: "{{ role_path }}/files/_gitignore_global",
dest: "{{ ansible_user_dir }}/.gitignore_global", dest: "{{ ansible_user_dir }}/.gitignore_global",
} }
- {
src: "{{ role_path }}/files/_vimrc",
dest: "{{ ansible_user_dir }}/.vimrc",
}
- { - {
src: "{{ role_path }}/files/_config/mpv.conf", src: "{{ role_path }}/files/_config/mpv.conf",
dest: "{{ ansible_user_dir }}/.config/mpv/", dest: "{{ ansible_user_dir }}/.config/mpv/",
@ -104,6 +100,11 @@
dest: "{{ ansible_user_dir }}/.tmux.conf", dest: "{{ ansible_user_dir }}/.tmux.conf",
force: yes, force: yes,
} }
- {
src: "{{ role_path }}/templates/_vimrc.j2",
dest: "{{ ansible_user_dir }}/.vimrc",
force: yes,
}
- { - {
src: "{{ role_path }}/templates/htoprc.j2", src: "{{ role_path }}/templates/htoprc.j2",
dest: "{{ ansible_user_dir }}/.config/htop/htoprc", dest: "{{ ansible_user_dir }}/.config/htop/htoprc",
@ -115,38 +116,39 @@
src: "{{ role_path }}/templates/_gitconfig.j2" src: "{{ role_path }}/templates/_gitconfig.j2"
dest: "{{ ansible_user_dir }}/.gitconfig" dest: "{{ ansible_user_dir }}/.gitconfig"
- name: usersettings - Create .vim directory - name: usersettings - Vim Plugings
ansible.builtin.file: when: usersetup_vimplugins == true
path: "{{ ansible_user_dir }}/.vim/autoload" block:
state: directory - name: usersettings - Create .vim directory
ansible.builtin.file:
- name: usersettings - Install vim plugin manager path: "{{ ansible_user_dir }}/.vim/autoload"
ansible.builtin.get_url: state: directory
url: https://tpo.pe/pathogen.vim - name: usersettings - Install vim plugin manager
dest: "{{ ansible_user_dir }}/.vim/autoload/pathogen.vim" ansible.builtin.get_url:
url: https://tpo.pe/pathogen.vim
- name: usersettings - Install vim plugins dest: "{{ ansible_user_dir }}/.vim/autoload/pathogen.vim"
ansible.builtin.git: - name: usersettings - Install vim plugins
repo: "{{ item.repo }}" ansible.builtin.git:
dest: "{{ item.dest }}" repo: "{{ item.repo }}"
with_items: dest: "{{ item.dest }}"
- { with_items:
repo: "https://github.com/itchyny/lightline.vim", - {
dest: "{{ ansible_user_dir }}/.vim/bundle/lightline", repo: "https://github.com/itchyny/lightline.vim",
} dest: "{{ ansible_user_dir }}/.vim/bundle/lightline",
- { }
repo: "https://github.com/w0rp/ale", - {
dest: "{{ ansible_user_dir }}/.vim/bundle/ale", repo: "https://github.com/w0rp/ale",
} dest: "{{ ansible_user_dir }}/.vim/bundle/ale",
- { }
repo: "https://github.com/airblade/vim-gitgutter", - {
dest: "{{ ansible_user_dir }}/.vim/bundle/vim-gitgutter", repo: "https://github.com/airblade/vim-gitgutter",
} dest: "{{ ansible_user_dir }}/.vim/bundle/vim-gitgutter",
- { }
repo: "https://github.com/sheerun/vim-polyglot", - {
dest: "{{ ansible_user_dir }}/.vim/bundle/vim-polyglot", repo: "https://github.com/sheerun/vim-polyglot",
} dest: "{{ ansible_user_dir }}/.vim/bundle/vim-polyglot",
- { }
repo: "https://github.com/tpope/vim-commentary", - {
dest: "{{ ansible_user_dir }}/.vim/bundle/vim-commentary", repo: "https://github.com/tpope/vim-commentary",
} dest: "{{ ansible_user_dir }}/.vim/bundle/vim-commentary",
}

View File

@ -121,6 +121,7 @@ filetype plugin indent on
" PLUGIN SETTINGS " PLUGIN SETTINGS
" ---------------------------------------------------------------------------- " ----------------------------------------------------------------------------
{% if usersetup_vimplugins|bool %}
" Use Pathogen for plugin management. See update.sh in this directory. " Use Pathogen for plugin management. See update.sh in this directory.
runtime bundle/vim-pathogen/autoload/pathogen.vim runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect() call pathogen#infect()
@ -182,6 +183,7 @@ function! s:MaybeUpdateLightline()
call lightline#update() call lightline#update()
end end
endfunction endfunction
{% endif %}
" ---------------------------------------------------------------------------- " ----------------------------------------------------------------------------
" COLORS " COLORS