Added vim state

This commit is contained in:
Jonas Forsberg 2020-07-31 15:12:20 +02:00
parent c936a030a4
commit 4e2fdd73e7
7 changed files with 32 additions and 7 deletions

1
.alias
View File

@ -6,3 +6,4 @@ alias dotf='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
alias ls_dotfiels='/usr/bin/git --git-dir=$HOME/.dotfiles ls-tree --full-tree -r --name-only HEAD' alias ls_dotfiels='/usr/bin/git --git-dir=$HOME/.dotfiles ls-tree --full-tree -r --name-only HEAD'
alias t="todo.sh" alias t="todo.sh"
alias gl='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative' alias gl='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative'
alias salt='sudo salt-call --local "$@"'

View File

@ -11,13 +11,13 @@ tags:
I use a very simple way to manage my dotfiles with git and some bash aliases. I use a very simple way to manage my dotfiles with git and some bash aliases.
All you have to create a folder for your git repository in your home folder and initiate a bare git repository All you have to create a folder for your git repository in your home folder and initiate a bare git repository
```bash ```bash
mkdir "$HOME/.dotf" mkdir "$HOME/.dotfiles"
git init --bare "$HOME/.dotf" git init --bare "$HOME/.dotfiles"
``` ```
Then create an alias so you don't have to write a long command each time you want to add a file or configure your git repository, don't forget to add that alias to $HOME/.alias Then create an alias so you don't have to write a long command each time you want to add a file or configure your git repository, don't forget to add that alias to $HOME/.alias
```bash ```bash
alias dotf='/usr/bin/git --git-dir=$HOME/.dotf --work-tree=$HOME' alias dotf='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
``` ```
so, that alias is calling git and sets the repository as well as working directory and it can be called from what ever path you currently be in. so, that alias is calling git and sets the repository as well as working directory and it can be called from what ever path you currently be in.

View File

@ -1,3 +1,3 @@
``` ```
sudo salt-call --local "$@" alias salt='sudo salt-call --local "$@"'
``` ```

View File

@ -1,5 +1,4 @@
packages: packages:
vim: { status: installed }
git: { status: installed } git: { status: installed }
curl: { status: installed } curl: { status: installed }
tmux: { status: installed } tmux: { status: installed }
@ -7,9 +6,9 @@ packages:
terminator: { status: installed } terminator: { status: installed }
borgbackup: { status: installed } borgbackup: { status: installed }
go: { status: installed } go: { status: installed }
nextcloud-client: { status: installed } nextcloud-desktop: { status: installed }
keepassxc: { status: installed } keepassxc: { status: installed }
vim-plugin-gnupg: { status: installed } vim-plugin-gnupg: { status: installed }
# vim-instant-markdown # vim-instant-markdown
xdg-utils: { status: installed } xdg-utils: { status: installed }
nodejs10 { status: installed } nodejs10: { status: installed }

View File

@ -3,6 +3,7 @@ base:
- user - user
- packages - packages
- repositories - repositories
- vim
{% if salt['file.file_exists']('hosts/{0}.sls'.format(grains.id)) %} {% if salt['file.file_exists']('hosts/{0}.sls'.format(grains.id)) %}
'{{ grains.id }}': '{{ grains.id }}':

15
salt/pillars/vim.sls Normal file
View File

@ -0,0 +1,15 @@
packages:
vim: { status: installed }
vim:
plugins:
jonas:
calendar-vim:
name: https://github.com/mattn/calendar-vim.git
vim-commentary:
name: https://github.com/tpope/vim-commentary.git
vim-instant-markdown:
name: https://github.com/suan/vim-instant-markdown.git
vim-surround:
name: https://github.com/tpope/vim-surround.git

9
salt/states/vim.sls Normal file
View File

@ -0,0 +1,9 @@
{% for user, plugins in pillar['vim']['plugins'].items() %}
{% for plugin, args in plugins.items() %}
{{ plugin }}:
git.latest:
- name: {{ args['name'] }}
- target: {{ salt['user.info']( user ).home }}/.vim/bundle/{{ plugin }}
- user: {{ user }}
{% endfor %}
{% endfor %}