Skip to content

Commit

Permalink
Update vim and add tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
alehatsman committed Jan 13, 2019
1 parent ea61417 commit 08fdc70
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 10 deletions.
Empty file modified init.sh 100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions playbook.yml
Expand Up @@ -10,6 +10,7 @@
- {role: 'ssh', tags: 'ssh'}
- {role: 'zsh', tags: 'zsh'}
- {role: 'iterm2', tags: 'iterm2'}
- {role: 'tmux', tags: 'tmux'}
- {role: 'vim', tags: 'vim'}
- {role: 'golang', tags: 'golang'}
- {role: 'jvm', tags: 'jvm'}
Expand Down
3 changes: 2 additions & 1 deletion roles/brew/vars/main.yml
Expand Up @@ -5,6 +5,7 @@ taps:
- homebrew/cask
- jesseduffield/lazygit
- wata727/tflint
- wagoodman/dive

apps:
- ansible
Expand Down Expand Up @@ -43,7 +44,7 @@ cask_apps:
- vagrant
- veracrypt
- visual-studio-code
- virtualbox
# - virtualbox
- vlc
- wireshark
- flux
5 changes: 0 additions & 5 deletions roles/docker/tasks/main.yml
Expand Up @@ -8,8 +8,3 @@
homebrew:
name: kubernetes-cli
state: present

- name: Make sure minikube is installed
homebrew_cask:
name: minikube
state: present
7 changes: 5 additions & 2 deletions roles/python/tasks/main.yml
@@ -1,8 +1,11 @@
---
- name: Install python 3
- name: Install python
homebrew:
name: python
name: '{{ item }}'
state: latest
with_items:
- python@2
- python

- name: Install pipenv
pip:
Expand Down
19 changes: 19 additions & 0 deletions roles/tmux/tasks/main.yml
@@ -0,0 +1,19 @@
---
- name: Make sure folders are present
file:
path: '{{ item }}'
state: directory
with_items:
- '{{ tmux_path }}'
- '{{ tmux_path }}/plugins'

- name: Make sure config is generated
template:
src: 'templates/.tmux.conf.j2'
dest: '~/.tmux.conf'

- name: Make sure tmp is installed
git:
repo: 'https://github.com/tmux-plugins/tpm'
dest: '{{ tmux_path }}/plugins/tpm'
depth: 1
8 changes: 8 additions & 0 deletions roles/tmux/templates/.tmux.conf.j2
@@ -0,0 +1,8 @@
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'

set-environment -g PATH "/usr/local/bin:/bin:/usr/bin"

run '{{ tmux_path }}/plugins/tpm/tpm'
2 changes: 2 additions & 0 deletions roles/tmux/vars/main.yml
@@ -0,0 +1,2 @@
---
tmux_path: '~/.tmux'
14 changes: 13 additions & 1 deletion roles/vim/tasks/main.yml
Expand Up @@ -14,10 +14,21 @@
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: "{{ autoload_path }}/plug.vim"

- name: Check that the python_venv exists
stat:
path: '{{ python_venv_path }}'
register: python_venv_present

- name: Check that the python3_venv exists
stat:
path: '{{ python3_venv_path }}'
register: python3_venv_present

- name: Make sure venvs are created for python2 and python3
shell: |
virtualenv -p python {{ python_venv_path }}
virtualenv -p python3 {{ python3_venv_path }}
when: not (python_venv_present and python3_venv_path)

- name: Make sure neovim libs are intalled to python venv
pip:
Expand All @@ -28,7 +39,8 @@
- name: Make sure neovim libs are intalled to python3 venv
pip:
virtualenv: "{{ python3_venv_path }}"
name: "{{ python_libs }}"
virtualenv_python: python3
name: "{{ python3_libs }}"
state: latest

- name: Create directories
Expand Down
4 changes: 3 additions & 1 deletion roles/vim/templates/plugins.vim
Expand Up @@ -3,6 +3,8 @@ call plug#begin('{{ plug_path }}')
Plug 'editorconfig/editorconfig-vim'
Plug 'dracula/vim'

Plug 'christoomey/vim-tmux-navigator'

" File explorer and tabs
Plug 'scrooloose/nerdtree'

Expand All @@ -21,7 +23,7 @@ Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'

" Autocomplete
Plug 'Shougo/deoplete.nvim'
Plug 'Shougo/deoplete.nvim' { 'do': ':UpdateRemovePlugins' }

" Quoting/Parenthesizing
Plug 'tpope/vim-surround'
Expand Down
8 changes: 8 additions & 0 deletions roles/vim/vars/main.yml
Expand Up @@ -9,8 +9,16 @@ autoload_path: "{{ config_path }}/autoload"

python_venv_path: "{{ config_path }}/python_venv"
python3_venv_path: "{{ config_path }}/python3_venv"

python_libs:
- neovim
- flake8
- websocket-client
- sexpdata

python3_libs:
- pynvim
- neovim
- flake8
- websocket-client
- sexpdata

0 comments on commit 08fdc70

Please sign in to comment.