# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Zane Zakraisek <zz@eng.utah.edu>
# SPDX-License-Identifier: GPL-2.0-only

  include <abstractions/nameservice-strict>

  @{bin}/sensible-editor        mr,
  @{bin}/vim{,.*}             mrix,
  @{sh_path}                   rix,
  @{bin}/which{,.debianutils}  rix,

  /usr/share/vim/{,**} r,
  /usr/share/terminfo/** r,

  /etc/vimrc r,
  /etc/vim/{,**} r,

  owner @{HOME}/.selected_editor r,
  owner @{HOME}/.viminf@{c}{,.tmp} rw,
  owner @{HOME}/.vimrc r,

  # Vim swap file 
  owner @{HOME}/ r,
  owner @{user_cache_dirs}/ r,
  owner @{user_cache_dirs}/vim/{,**} rw,
  owner @{user_config_dirs}/vim/{,**} r,

  include if exists <abstractions/app/editor.d>

# vim:syntax=apparmor
