Compare commits

...

3 Commits

Author SHA1 Message Date
b8c520d600 no longer using i3wm 2024-08-08 19:49:06 +10:00
0bf63bd848 Update pass password-store 2024-08-08 19:48:50 +10:00
7f2ecfaa3f Update nvim/puppet config 2024-08-08 19:48:35 +10:00
3 changed files with 81 additions and 3 deletions

View File

@ -46,6 +46,84 @@ function! OpenPuppetProfileOrRole(layout)
" Initialize an empty variable for the directory
let dirpath = ""
" List modules in puppet-control here
let module_list = []
call add(module_list, 'certbot')
call add(module_list, 'glauth')
call add(module_list, 'jellyfin')
call add(module_list, 'lidarr')
call add(module_list, 'networking')
call add(module_list, 'nzbget')
call add(module_list, 'prowlarr')
call add(module_list, 'radarr')
call add(module_list, 'readarr')
call add(module_list, 'redisha')
call add(module_list, 'sonarr')
" Check if the class name starts with 'profiles::' or 'roles::'
if classname =~ '^profiles::'
let dirpath = "site/profiles/manifests/"
let classname = substitute(classname, 'profiles::', '', '')
elseif classname =~ '^roles::'
let dirpath = "site/roles/manifests/"
let classname = substitute(classname, 'roles::', '', '')
else
let matched = 0
for module in module_list
if classname =~ '^' . module . '::'
let dirpath = "modules/" . module . "/manifests/"
let parts = split(classname, '::')
if len(parts) > 1
let classname = join(parts[1:], '::')
else
let classname = 'init'
endif
let matched = 1
break
endif
endfor
if matched == 0
if classname =~ '::'
echo "Unknown module"
return
else
echo "Unknown class prefix, should be profiles:: or roles::, or be a listed module."
return
endif
endif
endif
" Replace :: with / to convert class name to file path
let filepath = substitute(classname, '::', '/', 'g')
" Create the full file path
let fullpath = dirpath . filepath . ".pp"
" Open the file in a new tab
if a:layout == 'horizontal'
execute 'split ' . fullpath
elseif a:layout == 'vertical'
execute 'vsplit ' . fullpath
elseif a:layout == 'tab'
execute 'tabedit ' . fullpath
else
echo "Invalid layout specified."
endif
endfunction
]])
vim.cmd([[
function! OpenPuppetProfileOrRoleOriginal(layout)
" Get the line under the cursor
let line = getline(".")
" Use a regex to find the full class name
let classname = tolower(matchstr(line, '\v\w+(\:\:\w+)+'))
" Initialize an empty variable for the directory
let dirpath = ""
" Check if the class name starts with 'profiles::' or 'roles::'
if classname =~ '^profiles::'
let dirpath = "site/profiles/manifests/"
@ -127,7 +205,7 @@ function! OpenPuppetClassOrTemplate(layout)
endif
" Check if it's an included class (profiles:: or roles::)
if line =~ '\(profiles\|roles\)::'
if line =~ '::'
call OpenPuppetProfileOrRole(a:layout)
return
endif

@ -1 +1 @@
Subproject commit 3546217b65c837617d7bdb467054bbb4b6122a98
Subproject commit 906960d513741ffcb782d42e229bd1153382885a

View File

@ -5,7 +5,7 @@ sudo dnf install -y dnf-plugins-core
# enable copr
sudo dnf copr enable ganto/lxc4 -y
sudo dnf copr enable livegrenier/i3-desktop -y
#sudo dnf copr enable livegrenier/i3-desktop -y
sido dnf copr enable tokariew/i3lock-color -y
# install rpmfusion