Add vim setup

This commit is contained in:
Eryn Wells 2024-10-02 19:37:41 -07:00
parent 65182a7c52
commit f7a29e3c1d
3 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,27 @@
" ~/.vimrc
" Eryn Wells <eryn@erynwells.me>
source ~/.vimrc.common
if !has('nvim')
set nocompatible " use enhanced vim features
let s:localdir=expand("~/.local/vim")
if !isdirectory(s:localdir)
call mkdir(s:localdir, "p")
endif
let &backupdir=expand(s:localdir . "/backup//" . ",.")
let &undodir=expand(s:localdir . "/undo//")
let &viminfofile=expand(s:localdir . "/viminfo")
" Shada data. Parameters as follows: (see :help shada)
" % number of buffers to save and restore when no file argument is given
" ' maximum number of previously edited files for which marks are remembered
" h disable highlighted search patterns on start
" / omitted, so all search history is saved
" < maximum number of lines saved for each register
" : maximum number of lines of command history to save
" s shada entries over 100 KiB are skipped
set viminfo=%100,'100,h,<1000,:100,s100
endif

View file

@ -1,3 +1,6 @@
---
- name: ZSH
ansible.builtin.include_tasks: zsh.yml
- name: Vim
ansible.builtin.include_tasks: vim.yml

View file

@ -0,0 +1,30 @@
---
- name: (vim) Link plain vim config
ansible.builtin.file:
path: ~/.vimrc
src: "{{ role_path }}/files/vim/vimrc"
state: link
force: true
- name: (neovim) Create standard config directory
ansible.builtin.file:
path: ~/.config
state: directory
- name: (neovim) Link config
ansible.builtin.file:
path: ~/.config/nvim
src: "{{ role_path }}/files/neovim"
state: link
force: true
- name: (neovim) Create .local directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
loop:
- ~/.local/share/nvim
- ~/.local/state/nvim
- ~/.local/state/nvim/backup
- ~/.local/state/nvim/swap
- ~/.local/state/nvim/undo