aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vim
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2022-09-04 17:02:35 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2022-09-04 17:02:35 -0400
commit9cbca7991457b05bcfcc5017060437dd3af489a5 (patch)
treecebeeaebd4ad613bea739db8fadc1d630f43724f /roles/vim
parentAdd bsd updates (diff)
downloaddotfiles-9cbca7991457b05bcfcc5017060437dd3af489a5.zip
Convert from src/ to roles structure
Diffstat (limited to 'roles/vim')
-rw-r--r--roles/vim/files/init.vim78
-rw-r--r--roles/vim/tasks/main.yaml35
2 files changed, 113 insertions, 0 deletions
diff --git a/roles/vim/files/init.vim b/roles/vim/files/init.vim
new file mode 100644
index 0000000..0c98b73
--- /dev/null
+++ b/roles/vim/files/init.vim
@@ -0,0 +1,78 @@
+" Flash screen instead of beep sound
+set visualbell
+
+" Change how vim represents characters on the screen
+set encoding=utf-8
+
+" Set the encoding of files written
+set fileencoding=utf-8
+
+" Set line numbers
+set number
+
+" don't break up words at end of window width
+set linebreak
+
+" Specify different areas of the screen where splits should occur
+set splitbelow
+set splitright
+
+" Python-specific whitespace file settings
+autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
+" ts - show existing tab with 4 spaces width
+" sw - when indenting with '>', use 4 spaces width
+" sts - control <tab> and <bs> keys to match tabstop
+
+" General whitespace settings
+set shiftwidth=4
+filetype plugin indent on
+
+" Allow backspace to delete indentation and inserted text
+" i.e. how it works in most programs
+set backspace=indent,eol,start
+" indent allow backspacing over autoindent
+" eol allow backspacing over line breaks (join lines)
+" start allow backspacing over the start of insert; CTRL-W and CTRL-U
+" stop once at the start of insert.
+call plug#begin("$HOME/.config/nvim/plugged")
+
+" Auto complete
+Plug 'Valloric/YouCompleteMe'
+
+" Fuzzy finder
+Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
+
+" Git gutter
+Plug 'airblade/vim-gitgutter'
+
+" Status bar
+Plug 'vim-airline/vim-airline'
+
+" Git wrapper with :G
+Plug 'tpope/vim-fugitive'
+
+" Editorconfig file support
+Plug 'editorconfig/editorconfig-vim'
+
+" Theme
+Plug 'sainnhe/everforest'
+
+" Terraform
+Plug 'hashivim/vim-terraform'
+
+call plug#end()
+
+if has('termguicolors')
+ set termguicolors
+endif
+
+set background=dark
+
+let g:everforest_background = 'soft'
+let g:everforest_better_performance = 1
+let g:everforest_disable_italic_comment = 1
+let g:airline_theme = 'everforest'
+
+syntax on
+colorscheme everforest
+
diff --git a/roles/vim/tasks/main.yaml b/roles/vim/tasks/main.yaml
new file mode 100644
index 0000000..0609f9b
--- /dev/null
+++ b/roles/vim/tasks/main.yaml
@@ -0,0 +1,35 @@
+---
+- name: Create folders
+ file:
+ path: "{{ lookup('env', 'HOME') }}/.config/nvim/autoload"
+ state: directory
+
+- name: Link configuration
+ file:
+ src: "{{ role_path }}/files/init.vim"
+ dest: "{{ lookup('env', 'HOME') }}/.config/nvim/init.vim"
+ state: link
+
+- name: Install packages
+ become: yes
+
+ dnf:
+ name: "{{ item.key }}"
+ state: "{{ item.value.state | default('present') }}"
+
+ with_dict: "{{packages}}"
+ vars:
+ packages:
+ python:
+ python-devel:
+ python-neovim:
+ vim:
+ neovim:
+
+- name: Install vim-plug
+ get_url:
+ url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+ dest: "$HOME/.config/nvim/autoload/plug.vim"
+
+- name: Install vim-plug plugins
+ shell: nvim +PlugInstall +qall --headless