Compare commits

..

1 commit

Author SHA1 Message Date
1029099729 [#1] show completion lsp source 2024-08-24 09:54:59 +02:00
67 changed files with 9091 additions and 1339 deletions

26
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,26 @@
stages:
- lint
- test
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- .cache/pip
- node_modules/
lint:
stage: lint
image: node:current-alpine
before_script:
- npm install
script:
- npx prettier '**/*.yml' --check
syntax-test:
stage: test
image: python:latest
before_script:
- pip install ansible --quiet
- ansible-galaxy install --role-file requirements.yml
script:
- ansible-playbook playbook.yml --syntax-check

5
.prettierrc.yml Normal file
View file

@ -0,0 +1,5 @@
singleQuote: true
printWidth: 90
tabWidth: 2
useTabs: false
bracketSpacing: true

View file

@ -1,6 +1,5 @@
[defaults]
roles_path = ./roles
inventory = inventory.yml
[privilege_escalation]
become_ask_pass = True

33
archlinux.yml Normal file
View file

@ -0,0 +1,33 @@
- hosts: localhost
pre_tasks:
- name: install packages
become: true
package:
name: '{{ item }}'
state: present
loop: '{{ packages }}'
- name: add gitlab to known hosts
include_role:
name: common
tasks_from: 'known_hosts.yml'
vars:
user: '{{ ansible_user_id }}'
items:
- { domain: '{{ gitlab_domain }}', key: '{{ gitlab_host_key }}' }
roles:
- common
tasks:
- import_tasks: 'tasks/dotfiles.yml'
- import_tasks: 'tasks/neovim.yml'
- name: gather package facts
package_facts:
manager: pacman
- import_tasks: 'tasks/aur.yml'
- import_tasks: 'tasks/docker.yml'
- name: setup python versions
include_tasks: 'tasks/python.yml'
loop: '{{ python_versions }}'
- import_tasks: 'tasks/nvm.yml'
vars_files:
- 'vars/main.yml'
- 'vars/archlinux.yml'

14
debian.yml Normal file
View file

@ -0,0 +1,14 @@
- hosts: localhost
pre_tasks:
- name: install packages
become: true
package:
name: '{{ item }}'
state: present
loop: '{{ packages }}'
tasks:
- import_tasks: 'tasks/dotfiles.yml'
- import_tasks: 'tasks/neovim.yml'
vars_files:
- 'vars/main.yml'
- 'vars/debian.yml'

View file

@ -1,14 +0,0 @@
-- example of a project specific nvim configuration file using :exrc and conform
local conform = require 'conform';
conform.setup {
formatters_by_ft = {
python = { 'isort', 'black' },
javascript = { 'prettier', },
},
format_on_save = {
lsp_format = 'never',
}
}

View file

@ -1,33 +0,0 @@
-- example of a project specific nvim configuration file using :exrc and lsp formatting
local format_clients = {
'ruff',
'lua_ls',
'bashls',
'jsonls',
'ts_ls',
'ansiblels',
'yamlls',
'cssls',
'html',
}
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('lsp', { clear = true }),
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client:supports_method('textDocument/formatting')
and vim.tbl_contains(format_clients, client.name) then
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = args.buf,
callback = function()
vim.lsp.buf.format {
async = false,
id = args.data.client_id
}
end,
})
end
end
})

File diff suppressed because it is too large Load diff

268
files/nvim/colors/ayu.vim Normal file
View file

@ -0,0 +1,268 @@
" Initialisation:"{{{
" ----------------------------------------------------------------------------
hi clear
if exists("syntax_on")
syntax reset
endif
let s:style = get(g:, 'ayucolor', 'dark')
let g:colors_name = "ayu"
"}}}
" Palettes:"{{{
" ----------------------------------------------------------------------------
let s:palette = {}
let s:palette.bg = {'dark': "#0F1419", 'light': "#FAFAFA", 'mirage': "#212733"}
let s:palette.comment = {'dark': "#5C6773", 'light': "#ABB0B6", 'mirage': "#5C6773"}
let s:palette.markup = {'dark': "#F07178", 'light': "#F07178", 'mirage': "#F07178"}
let s:palette.constant = {'dark': "#FFEE99", 'light': "#A37ACC", 'mirage': "#D4BFFF"}
let s:palette.operator = {'dark': "#E7C547", 'light': "#E7C547", 'mirage': "#80D4FF"}
let s:palette.tag = {'dark': "#36A3D9", 'light': "#36A3D9", 'mirage': "#5CCFE6"}
let s:palette.regexp = {'dark': "#95E6CB", 'light': "#4CBF99", 'mirage': "#95E6CB"}
let s:palette.string = {'dark': "#B8CC52", 'light': "#86B300", 'mirage': "#BBE67E"}
let s:palette.function = {'dark': "#FFB454", 'light': "#F29718", 'mirage': "#FFD57F"}
let s:palette.special = {'dark': "#E6B673", 'light': "#E6B673", 'mirage': "#FFC44C"}
let s:palette.keyword = {'dark': "#FF7733", 'light': "#FF7733", 'mirage': "#FFAE57"}
let s:palette.error = {'dark': "#FF3333", 'light': "#FF3333", 'mirage': "#FF3333"}
let s:palette.accent = {'dark': "#F29718", 'light': "#FF6A00", 'mirage': "#FFCC66"}
let s:palette.panel = {'dark': "#14191F", 'light': "#FFFFFF", 'mirage': "#272D38"}
let s:palette.guide = {'dark': "#2D3640", 'light': "#D9D8D7", 'mirage': "#3D4751"}
let s:palette.line = {'dark': "#151A1E", 'light': "#F3F3F3", 'mirage': "#242B38"}
let s:palette.selection = {'dark': "#253340", 'light': "#F0EEE4", 'mirage': "#343F4C"}
let s:palette.fg = {'dark': "#E6E1CF", 'light': "#5C6773", 'mirage': "#D9D7CE"}
let s:palette.fg_idle = {'dark': "#3E4B59", 'light': "#828C99", 'mirage': "#607080"}
"}}}
" Highlighting Primitives:"{{{
" ----------------------------------------------------------------------------
function! s:build_prim(hi_elem, field)
let l:vname = "s:" . a:hi_elem . "_" . a:field " s:bg_gray
let l:gui_assign = "gui".a:hi_elem."=".s:palette[a:field][s:style] " guibg=...
exe "let " . l:vname . " = ' " . l:gui_assign . "'"
endfunction
let s:bg_none = ' guibg=NONE ctermbg=NONE'
let s:fg_none = ' guifg=NONE ctermfg=NONE'
for [key_name, d_value] in items(s:palette)
call s:build_prim('bg', key_name)
call s:build_prim('fg', key_name)
endfor
" }}}
" Formatting Options:"{{{
" ----------------------------------------------------------------------------
let s:none = "NONE"
let s:t_none = "NONE"
let s:n = "NONE"
let s:c = ",undercurl"
let s:r = ",reverse"
let s:s = ",standout"
let s:b = ",bold"
let s:u = ",underline"
let s:i = ",italic"
exe "let s:fmt_none = ' gui=NONE". " cterm=NONE". " term=NONE" ."'"
exe "let s:fmt_bold = ' gui=NONE".s:b. " cterm=NONE".s:b. " term=NONE".s:b ."'"
exe "let s:fmt_bldi = ' gui=NONE".s:b. " cterm=NONE".s:b. " term=NONE".s:b ."'"
exe "let s:fmt_undr = ' gui=NONE".s:u. " cterm=NONE".s:u. " term=NONE".s:u ."'"
exe "let s:fmt_undb = ' gui=NONE".s:u.s:b. " cterm=NONE".s:u.s:b. " term=NONE".s:u.s:b."'"
exe "let s:fmt_undi = ' gui=NONE".s:u. " cterm=NONE".s:u. " term=NONE".s:u ."'"
exe "let s:fmt_curl = ' gui=NONE".s:c. " cterm=NONE".s:c. " term=NONE".s:c ."'"
exe "let s:fmt_ital = ' gui=NONE".s:i. " cterm=NONE".s:i. " term=NONE".s:i ."'"
exe "let s:fmt_stnd = ' gui=NONE".s:s. " cterm=NONE".s:s. " term=NONE".s:s ."'"
exe "let s:fmt_revr = ' gui=NONE".s:r. " cterm=NONE".s:r. " term=NONE".s:r ."'"
exe "let s:fmt_revb = ' gui=NONE".s:r.s:b. " cterm=NONE".s:r.s:b. " term=NONE".s:r.s:b."'"
"}}}
" Vim Highlighting: (see :help highlight-groups)"{{{
" ----------------------------------------------------------------------------
exe "hi! Normal" .s:fg_fg .s:bg_bg .s:fmt_none
exe "hi! ColorColumn" .s:fg_none .s:bg_line .s:fmt_none
" Conceal, Cursor, CursorIM
exe "hi! CursorColumn" .s:fg_none .s:bg_line .s:fmt_none
exe "hi! CursorLine" .s:fg_none .s:bg_line .s:fmt_none
exe "hi! CursorLineNr" .s:fg_accent .s:bg_line .s:fmt_none
exe "hi! LineNr" .s:fg_guide .s:bg_none .s:fmt_none
exe "hi! Directory" .s:fg_fg_idle .s:bg_none .s:fmt_none
exe "hi! DiffAdd" .s:fg_string .s:bg_panel .s:fmt_none
exe "hi! DiffChange" .s:fg_tag .s:bg_panel .s:fmt_none
exe "hi! DiffText" .s:fg_fg .s:bg_panel .s:fmt_none
exe "hi! ErrorMsg" .s:fg_fg .s:bg_error .s:fmt_stnd
exe "hi! VertSplit" .s:fg_bg .s:bg_none .s:fmt_none
exe "hi! Folded" .s:fg_fg_idle .s:bg_panel .s:fmt_none
exe "hi! FoldColumn" .s:fg_none .s:bg_panel .s:fmt_none
exe "hi! SignColumn" .s:fg_none .s:bg_panel .s:fmt_none
" Incsearch"
exe "hi! MatchParen" .s:fg_fg .s:bg_bg .s:fmt_undr
exe "hi! ModeMsg" .s:fg_string .s:bg_none .s:fmt_none
exe "hi! MoreMsg" .s:fg_string .s:bg_none .s:fmt_none
exe "hi! NonText" .s:fg_bg .s:bg_none .s:fmt_none
exe "hi! Pmenu" .s:fg_fg .s:bg_selection .s:fmt_none
exe "hi! PmenuSel" .s:fg_fg .s:bg_selection .s:fmt_revr
" PmenuSbar"
" PmenuThumb"
exe "hi! Question" .s:fg_string .s:bg_none .s:fmt_none
exe "hi! Search" .s:fg_bg .s:bg_constant .s:fmt_none
exe "hi! SpecialKey" .s:fg_selection .s:bg_none .s:fmt_none
exe "hi! SpellCap" .s:fg_tag .s:bg_none .s:fmt_undr
exe "hi! SpellLocal" .s:fg_keyword .s:bg_none .s:fmt_undr
exe "hi! SpellBad" .s:fg_error .s:bg_none .s:fmt_undr
exe "hi! SpellRare" .s:fg_regexp .s:bg_none .s:fmt_undr
exe "hi! StatusLine" .s:fg_fg .s:bg_panel .s:fmt_none
exe "hi! StatusLineNC" .s:fg_fg_idle .s:bg_panel .s:fmt_none
exe "hi! WildMenu" .s:fg_bg .s:bg_markup .s:fmt_none
exe "hi! TabLine" .s:fg_fg .s:bg_panel .s:fmt_revr
" TabLineFill"
" TabLineSel"
exe "hi! Title" .s:fg_keyword .s:bg_none .s:fmt_none
exe "hi! Visual" .s:fg_none .s:bg_selection .s:fmt_none
" VisualNos"
exe "hi! WarningMsg" .s:fg_error .s:bg_none .s:fmt_none
" TODO LongLineWarning to use variables instead of hardcoding
hi LongLineWarning guifg=NONE guibg=#371F1C gui=underline ctermfg=NONE ctermbg=NONE cterm=underline
" WildMenu"
"}}}
" Generic Syntax Highlighting: (see :help group-name)"{{{
" ----------------------------------------------------------------------------
exe "hi! Comment" .s:fg_comment .s:bg_none .s:fmt_none
exe "hi! Constant" .s:fg_constant .s:bg_none .s:fmt_none
exe "hi! String" .s:fg_string .s:bg_none .s:fmt_none
" Character"
" Number"
" Boolean"
" Float"
exe "hi! Identifier" .s:fg_tag .s:bg_none .s:fmt_none
exe "hi! Function" .s:fg_function .s:bg_none .s:fmt_none
exe "hi! Statement" .s:fg_keyword .s:bg_none .s:fmt_none
" Conditional"
" Repeat"
" Label"
exe "hi! Operator" .s:fg_operator .s:bg_none .s:fmt_none
" Keyword"
" Exception"
exe "hi! PreProc" .s:fg_special .s:bg_none .s:fmt_none
" Include"
" Define"
" Macro"
" PreCondit"
exe "hi! Type" .s:fg_tag .s:bg_none .s:fmt_none
" StorageClass"
exe "hi! Structure" .s:fg_special .s:bg_none .s:fmt_none
" Typedef"
exe "hi! Special" .s:fg_special .s:bg_none .s:fmt_none
" SpecialChar"
" Tag"
" Delimiter"
" SpecialComment"
" Debug"
"
exe "hi! Underlined" .s:fg_tag .s:bg_none .s:fmt_undr
exe "hi! Ignore" .s:fg_none .s:bg_none .s:fmt_none
exe "hi! Error" .s:fg_fg .s:bg_error .s:fmt_none
exe "hi! Todo" .s:fg_markup .s:bg_none .s:fmt_none
" Quickfix window highlighting
exe "hi! qfLineNr" .s:fg_keyword .s:bg_none .s:fmt_none
" qfFileName"
" qfLineNr"
" qfError"
exe "hi! Conceal" .s:fg_guide .s:bg_none .s:fmt_none
exe "hi! CursorLineConceal" .s:fg_guide .s:bg_line .s:fmt_none
" Terminal in NVIM
" ---------
if has("nvim")
let g:terminal_color_0 = s:palette.bg[s:style]
let g:terminal_color_1 = s:palette.markup[s:style]
let g:terminal_color_2 = s:palette.string[s:style]
let g:terminal_color_3 = s:palette.accent[s:style]
let g:terminal_color_4 = s:palette.tag[s:style]
let g:terminal_color_5 = s:palette.constant[s:style]
let g:terminal_color_6 = s:palette.regexp[s:style]
let g:terminal_color_7 = "#FFFFFF"
let g:terminal_color_8 = s:palette.fg_idle[s:style]
let g:terminal_color_9 = s:palette.error[s:style]
let g:terminal_color_10 = s:palette.string[s:style]
let g:terminal_color_11 = s:palette.accent[s:style]
let g:terminal_color_12 = s:palette.tag[s:style]
let g:terminal_color_13 = s:palette.constant[s:style]
let g:terminal_color_14 = s:palette.regexp[s:style]
let g:terminal_color_15 = s:palette.comment[s:style]
let g:terminal_color_background = g:terminal_color_0
let g:terminal_color_foreground = s:palette.fg[s:style]
endif
" NerdTree
" ---------
exe "hi! NERDTreeOpenable" .s:fg_fg_idle .s:bg_none .s:fmt_none
exe "hi! NERDTreeClosable" .s:fg_accent .s:bg_none .s:fmt_none
" exe "hi! NERDTreeBookmarksHeader" .s:fg_pink .s:bg_none .s:fmt_none
" exe "hi! NERDTreeBookmarksLeader" .s:fg_bg .s:bg_none .s:fmt_none
" exe "hi! NERDTreeBookmarkName" .s:fg_keyword .s:bg_none .s:fmt_none
" exe "hi! NERDTreeCWD" .s:fg_pink .s:bg_none .s:fmt_none
exe "hi! NERDTreeUp" .s:fg_fg_idle .s:bg_none .s:fmt_none
exe "hi! NERDTreeDir" .s:fg_fg_idle .s:bg_none .s:fmt_none
exe "hi! NERDTreeFile" .s:fg_fg_idle .s:bg_none .s:fmt_none
exe "hi! NERDTreeDirSlash" .s:fg_guide .s:bg_none .s:fmt_none
" GitGutter
" ---------
exe "hi! GitGutterAdd" .s:fg_string .s:bg_none .s:fmt_none
exe "hi! GitGutterChange" .s:fg_tag .s:bg_none .s:fmt_none
exe "hi! GitGutterDelete" .s:fg_markup .s:bg_none .s:fmt_none
exe "hi! GitGutterChangeDelete" .s:fg_function .s:bg_none .s:fmt_none
"}}}
" Diff Syntax Highlighting:"{{{
" ----------------------------------------------------------------------------
" Diff
" diffOldFile
" diffNewFile
" diffFile
" diffOnly
" diffIdentical
" diffDiffer
" diffBDiffer
" diffIsA
" diffNoEOL
" diffCommon
hi! link diffRemoved Constant
" diffChanged
hi! link diffAdded String
" diffLine
" diffSubname
" diffComment
"}}}
"
" This is needed for some reason: {{{
let &background = s:style
" }}}

View file

@ -0,0 +1,87 @@
highlight clear
if exists('syntax_on')
syntax reset
endif
let g:colors_name = 'breezy'
" Background Font color
hi LineNr guibg=#31363b guifg=#7a7c7d gui=NONE
hi FoldColumn guibg=#31363b guifg=#7a7c7d gui=NONE
hi Folded guibg=#31363b guifg=#7a7c7d gui=NONE
hi MatchParen guibg=#8e44ad guifg=#cfcfc2 gui=NONE
hi signColumn guibg=#31363b guifg=#7a7c7d gui=NONE
hi Comment guibg=NONE guifg=#7a7c7d gui=NONE
hi Conceal guibg=NONE guifg=#cfcfc2 gui=NONE
hi Constant guibg=NONE guifg=#f67400 gui=NONE
hi Boolean guibg=NONE guifg=#27aeae gui=NONE
hi Debug guibg=NONE guifg=#a5a6a8 gui=bold
hi Error guibg=#4d1f24 guifg=#95da4c gui=bold
hi Identifier guibg=NONE guifg=#9b44ad gui=NONE
hi Ignore guibg=NONE guifg=NONE gui=NONE
hi Operator guibg=NONE guifg=NONE gui=bold
hi PreProc guibg=NONE guifg=#27ae85 gui=NONE
hi Special guibg=NONE guifg=#3daee9 gui=NONE
hi SpecialComment guibg=NONE guifg=#a5a6a8 gui=NONE
hi Statement guibg=NONE guifg=#fdbc4b gui=bold
hi String guibg=NONE guifg=#27ae60 gui=NONE
hi Todo guibg=#451e1a guifg=#ca9219 gui=NONE
hi Type guibg=NONE guifg=#2980b9 gui=NONE
hi Underlined guibg=NONE guifg=#27ae60 gui=underline
hi NonText guibg=NONE guifg=#7a7c7d gui=NONE
hi Pmenu guibg=#31363b guifg=#cfcfc2 gui=NONE
hi PmenuSbar guibg=#606365 guifg=NONE gui=NONE
hi PmenuSel guibg=#2d5c76 guifg=#cfcfc2 gui=NONE
hi PmenuThumb guibg=#a8a9ab guifg=#a8a9ab gui=NONE
hi ErrorMsg guibg=#4d1f24 guifg=#95da4c gui=bold
hi ModeMsg guibg=NONE guifg=NONE gui=bold
hi MoreMsg guibg=NONE guifg=#fdbc4b gui=bold
hi Question guibg=NONE guifg=#fdbc4b gui=bold
hi WarningMsg guibg=NONE guifg=#ffffff gui=NONE
hi TabLine guibg=#31363b guifg=#7a7c7d gui=NONE
hi TabLineFill guibg=#31363b guifg=#31363b gui=NONE
hi TabLineSel guibg=#2d5c76 guifg=NONE gui=NONE
hi Cursor guibg=NONE guifg=NONE gui=reverse
hi CursorColumn guibg=#2a2e32 guifg=NONE gui=NONE
hi CursorLineNr guibg=#31363b guifg=#a5a6a8 gui=NONE
hi CursorLine guibg=#2a2e32 guifg=NONE gui=NONE cterm=NONE
hi helpLeadBlank guibg=NONE guifg=NONE gui=NONE
hi helpNormal guibg=NONE guifg=NONE gui=NONE
hi StatusLine guibg=#7a7c7d guifg=#2a2e32 gui=NONE
hi StatusLineNC guibg=#7a7c7d guifg=#2a2e32 gui=NONE
hi Visual guibg=#2d5c76 guifg=NONE gui=NONE
hi VisualNOS guibg=NONE guifg=NONE gui=underline
hi VertSplit guibg=#2d5c76 guifg=#2d5c76 gui=NONE
hi WildMenu guibg=NONE guifg=NONE gui=NONE
hi SpecialKey guibg=NONE guifg=#7a7c7d gui=NONE
hi Title guibg=NONE guifg=#ffffff gui=NONE
hi DiffAdd guibg=#123723 guifg=NONE gui=NONE
hi DiffChange guibg=#424218 guifg=NONE gui=NONE
hi DiffDelete guibg=#4d1f24 guifg=NONE gui=NONE
hi DiffText guibg=NONE guifg=NONE gui=reverse
hi IncSearch guibg=#808021 guifg=#cfcfc2 gui=NONE
hi Search guibg=#218058 guifg=#cfcfc2 gui=NONE
hi Directory guibg=NONE guifg=#ffffff gui=NONE
hi SpellBad guibg=NONE guifg=NONE gui=undercurl
hi SpellCap guibg=NONE guifg=NONE gui=undercurl
hi SpellLocal guibg=NONE guifg=NONE gui=undercurl
hi SpellRare guibg=NONE guifg=NONE gui=undercurl
hi ColorColumn guibg=#2a2e32 guifg=NONE gui=NONE

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,234 @@
" -----------------------------------------------------------------------------
" File: vim-material.vim
" Description: equinusocio's Material Theme porting
" Porting From: https://github.com/equinusocio/vsc-material-theme
" Author: hzchris <hzchirs@gmail.com>
" Source: https://github.com/hzchirs/vim-material
" Last Modified: 10 February 2019
" -----------------------------------------------------------------------------
if version > 580
highlight clear
if exists("syntax_on")
syntax reset
endif
endif
let g:colors_name = "vim-material"
let s:gui = {}
let s:cterm = {}
let s:gui.background = { 'dark': '#263238', 'light': '#FAFAFA', 'palenight': '#292D3E', 'oceanic': '#0F111A' }
let s:gui.foreground = { 'dark': '#ECEFF1', 'light': '#666666', 'palenight': '#A6ACCD', 'oceanic': '#A6ACCD' }
let s:gui.none = { 'dark': 'NONE', 'light': 'NONE', 'palenight': 'NONE' , 'oceanic': 'NONE' }
let s:gui.selection = { 'dark': '#455A64', 'light': '#CCEAE7', 'palenight': '#434A6C', 'oceanic': '#292D3E' }
let s:gui.line = { 'dark': '#212121', 'light': '#EAEFF0', 'palenight': '#191919', 'oceanic': '#191919' }
let s:gui.comment = { 'dark': '#5D818E', 'light': '#90A4AE', 'palenight': '#676E95', 'oceanic': '#525975' }
let s:gui.red = { 'dark': '#FF5370', 'light': '#E53935', 'palenight': '#FF5370', 'oceanic': '#FF5370' }
let s:gui.dark_red = { 'dark': '#B71C1C', 'light': '#E53935', 'palenight': '#FF5370', 'oceanic': '#FF5370' }
let s:gui.pink = { 'dark': '#F07178', 'light': '#FF5370', 'palenight': '#F07178', 'oceanic': '#F07178' }
let s:gui.orange = { 'dark': '#F78C6C', 'light': '#F76D47', 'palenight': '#F78C6C', 'oceanic': '#F78C6C' }
let s:gui.light_yellow = { 'dark': '#FFE57F', 'light': '#FFAD13', 'palenight': '#FFE57F', 'oceanic': '#FFE57F' }
let s:gui.yellow = { 'dark': '#FFCB6B', 'light': '#FFAD13', 'palenight': '#FFCB6B', 'oceanic': '#FFCB6B' }
let s:gui.green = { 'dark': '#C3E88D', 'light': '#82A550', 'palenight': '#C3E88D', 'oceanic': '#C3E88D' }
let s:gui.teal = { 'dark': '#004D40', 'light': '#CCEAE7', 'palenight': '#004D40', 'oceanic': '#004D40' }
let s:gui.light_teal = { 'dark': '#69F0AE', 'light': '#73B6B0', 'palenight': '#69F0AE', 'oceanic': '#69F0AE' }
let s:gui.pale_blue = { 'dark': '#B2CCD6', 'light': '#8796B0', 'palenight': '#B2CCD6', 'oceanic': '#B2CCD6' }
let s:gui.cyan = { 'dark': '#89DDFF', 'light': '#39ADB5', 'palenight': '#89DDFF', 'oceanic': '#89DDFF' }
let s:gui.blue = { 'dark': '#82AAFF', 'light': '#6182B8', 'palenight': '#82AAFF', 'oceanic': '#82AAFF' }
let s:gui.purple = { 'dark': '#C792EA', 'light': '#7C4DFF', 'palenight': '#C792EA', 'oceanic': '#C792EA' }
let s:gui.violet = { 'dark': '#BB80B3', 'light': '#945EB8', 'palenight': '#BB80B3', 'oceanic': '#BB80B3' }
let s:gui.brown = { 'dark': '#AB7967', 'light': '#AB7967', 'palenight': '#C17E70', 'oceanic': '#C17E70' }
if !exists('g:material_style')
let g:material_style='default'
endif
function! s:hi(group, guifg, guibg, ctermfg, ctermbg, attr)
if s:gui(a:guifg) != ""
exec "hi " . a:group . " guifg=" . s:gui(a:guifg)
endif
if s:gui(a:guibg) != ""
exec "hi " . a:group . " guibg=" . s:gui(a:guibg)
endif
if a:ctermfg != ""
exec "hi " . a:group . " ctermfg=" . a:ctermfg
endif
if a:ctermbg != ""
exec "hi " . a:group . " ctermbg=" . a:ctermbg
endif
if a:attr != ""
exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
endif
endfunction
function! s:gui(color)
if &background == "light"
return a:color['light']
else
if g:material_style == 'default'
return a:color['dark']
else
return a:color[g:material_style]
endif
endif
endfunction
" Neovim Terminal colors
if has("nvim")
let g:terminal_color_0 = s:gui(s:gui.background)
let g:terminal_color_1 = s:gui(s:gui.red)
let g:terminal_color_2 = s:gui(s:gui.green)
let g:terminal_color_3 = s:gui(s:gui.light_yellow)
let g:terminal_color_4 = s:gui(s:gui.blue)
let g:terminal_color_5 = s:gui(s:gui.pink)
let g:terminal_color_6 = s:gui(s:gui.light_teal)
let g:terminal_color_7 = s:gui(s:gui.pale_blue)
let g:terminal_color_8 = s:gui(s:gui.selection)
let g:terminal_color_9 = s:gui(s:gui.red)
let g:terminal_color_10 = s:gui(s:gui.green)
let g:terminal_color_11 = s:gui(s:gui.light_yellow)
let g:terminal_color_12 = s:gui(s:gui.cyan)
let g:terminal_color_13 = s:gui(s:gui.purple)
let g:terminal_color_14 = s:gui(s:gui.cyan)
let g:terminal_color_15 = s:gui(s:gui.foreground)
endif
" Editor colors
call s:hi("ColorColumn", s:gui.none, s:gui.line, "", "", "")
call s:hi("Cursor", s:gui.yellow, "", "", "", "")
call s:hi("CursorColumn", s:gui.none, s:gui.line, "", "", "")
call s:hi("LineNr", s:gui.comment, "", "", "", "")
call s:hi("CursorLine", s:gui.none, s:gui.line, "", "", "")
call s:hi("CursorLineNr", s:gui.cyan, s:gui.line, "", "", "")
call s:hi("Directory", s:gui.blue, "", "", "", "")
call s:hi("FoldColumn", "", s:gui.background, "", "", "")
call s:hi("Folded", s:gui.comment, s:gui.line, "", "", "")
call s:hi("PMenu", s:gui.foreground, s:gui.line, "", "", "")
call s:hi("PMenuSel", s:gui.cyan, s:gui.selection, "", "", "bold")
call s:hi("ErrorMsg", s:gui.red, s:gui.none, "", "", "")
call s:hi("Error", s:gui.red, s:gui.none, "", "", "")
call s:hi("WarningMsg", s:gui.orange, "", "", "", "")
call s:hi("VertSplit", s:gui.background, s:gui.foreground, "", "", "")
call s:hi("Conceal", s:gui.comment, s:gui.background, "", "", "")
call s:hi("DiffAdded", s:gui.green, "", "", "", "")
call s:hi("DiffRemoved", s:gui.red, "", "", "", "")
call s:hi("DiffAdd", "", s:gui.teal, "", "", "")
call s:hi("DiffChange", "", s:gui.teal, "", "", "")
call s:hi("DiffDelete", s:gui.red, s:gui.background, "", "", "")
call s:hi("DiffText", "", s:gui.selection, "", "", "")
call s:hi("NonText", s:gui.comment, "", "", "", "")
call s:hi("helpExample", s:gui.blue, "", "", "", "")
call s:hi("MatchParen", "", s:gui.selection, "", "", "")
call s:hi("Title", s:gui.cyan, "", "", "", "")
call s:hi("Comment", s:gui.comment, "", "", "", "italic")
call s:hi("String", s:gui.green, "", "", "", "")
call s:hi("Normal", s:gui.foreground, s:gui.background, "", "", "")
call s:hi("Visual", "", s:gui.selection, "", "", "")
call s:hi("Constant", s:gui.pink, "", "", "", "")
call s:hi("Type", s:gui.yellow, "", "", "", "none")
call s:hi("Define", s:gui.cyan, "", "", "", "")
call s:hi("Statement", s:gui.cyan, "", "", "", "none")
call s:hi("Function", s:gui.blue, "", "", "", "")
call s:hi("Conditional", s:gui.cyan, "", "", "", "")
call s:hi("Float", s:gui.orange, "", "", "", "")
call s:hi("Noise", s:gui.cyan, "", "", "", "")
call s:hi("Number", s:gui.orange, "", "", "", "")
call s:hi("Identifier", s:gui.pink, "", "", "", "")
call s:hi("Operator", s:gui.cyan, "", "", "", "")
call s:hi("PreProc", s:gui.blue, "", "", "", "")
call s:hi("Search", s:gui.none, s:gui.none, "", "", "underline")
call s:hi("InSearch", s:gui.background, s:gui.foreground, "", "", "")
call s:hi("Todo", s:gui.red, s:gui.foreground, "", "", "reverse")
call s:hi("Special", s:gui.orange, "", "", "", "")
" Ruby colors
call s:hi("rubyClassName", s:gui.yellow, "", "", "", "bold")
call s:hi("rubyConstant", s:gui.yellow, "", "", "", "")
call s:hi("rubyKeywordAsMethod", s:gui.blue, "", "", "", "")
call s:hi("rubyOperator", s:gui.purple, "", "", "", "")
call s:hi("rubyPseudoVariable", s:gui.red, "", "", "", "italic")
call s:hi("rubySymbol", s:gui.orange, "", "", "", "")
call s:hi("rubySymbolDelimiter", s:gui.cyan, "", "", "", "")
"eRuby colors
call s:hi("eRubyDelimiter", s:gui.cyan, "", "", "", "")
" Elixir colors
call s:hi("elixirKeyword", s:gui.blue, "", "", "", "")
" Javascript colors
" yajs
call s:hi("javascriptArrayMethod", s:gui.blue, "", "", "", "")
call s:hi("javascriptBlock", s:gui.cyan, "", "", "", "")
call s:hi("javascriptBraces", s:gui.cyan, "", "", "", "")
call s:hi("javascriptBrackets", s:gui.cyan, "", "", "", "")
call s:hi("javascriptClassName", s:gui.yellow, "", "", "", "bold")
call s:hi("javascriptClassSuperName", s:gui.yellow, "", "", "", "")
call s:hi("javascriptExport", s:gui.cyan, "", "", "", "")
call s:hi("javascriptFuncKeyword", s:gui.purple, "", "", "", "")
call s:hi("javascriptIdentifierName", s:gui.foreground, "", "", "", "")
call s:hi("javascriptLabel", s:gui.foreground, "", "", "", "")
call s:hi("javascriptMethod", s:gui.blue, "", "", "", "")
call s:hi("javascriptObjectLabel", s:gui.foreground, "", "", "", "")
call s:hi("javascriptObjectLabelColon", s:gui.cyan, "", "", "", "")
call s:hi("javascriptObjectMethodName", s:gui.blue, "", "", "", "")
call s:hi("javascriptOperator", s:gui.purple, "", "", "", "")
call s:hi("javascriptProperty", s:gui.cyan, "", "", "", "")
call s:hi("javascriptStringMethod", s:gui.blue, "", "", "", "")
call s:hi("javascriptVariable", s:gui.purple, "", "", "", "")
" vim-javascript
call s:hi("jsArrowFuncArgs", s:gui.red, "", "", "", "")
call s:hi("jsArrowFunction", s:gui.purple, "", "", "", "")
call s:hi("jsBooleanFalse", s:gui.orange, "", "", "", "")
call s:hi("jsBooleanTrue", s:gui.orange, "", "", "", "")
call s:hi("jsClassBraces", s:gui.cyan, "", "", "", "")
call s:hi("jsClassDefinition", s:gui.yellow, "", "", "", "")
call s:hi("jsClassKeyword", s:gui.purple, "", "", "", "")
call s:hi("jsConditional", s:gui.cyan, "", "", "", "italic")
call s:hi("jsFuncArgs", s:gui.red, "", "", "", "")
call s:hi("jsFuncBraces", s:gui.cyan, "", "", "", "")
call s:hi("jsFuncCall", s:gui.blue, "", "", "", "")
call s:hi("jsFuncParens", s:gui.cyan, "", "", "", "")
call s:hi("jsFunction", s:gui.purple, "", "", "", "")
call s:hi("jsFunctionKey", s:gui.blue, "", "", "", "")
call s:hi("jsGlobalObjects", s:gui.yellow, "", "", "", "")
call s:hi("jsNoise", s:gui.cyan, "", "", "", "")
call s:hi("jsObjectKey", s:gui.foreground, "", "", "", "")
call s:hi("jsOperator", s:gui.purple, "", "", "", "")
call s:hi("jsParens", s:gui.cyan, "", "", "", "")
call s:hi("jsReturn", s:gui.cyan, "", "", "", "italic")
call s:hi("jsStorageClass", s:gui.purple, "", "", "", "")
call s:hi("jsThis", s:gui.red, "", "", "", "italic")
" yats
call s:hi("typescriptAccessibilityModifier", s:gui.purple, "", "", "", "")
call s:hi("typescriptCall", s:gui.pink, "", "", "", "")
call s:hi("typescriptClassName", s:gui.yellow, "", "", "", "")
call s:hi("typescriptExport", s:gui.blue, "", "", "", "")
call s:hi("typescriptImport", s:gui.blue, "", "", "", "")
call s:hi("typescriptInterfaceName", s:gui.yellow, "", "", "", "")
call s:hi("typescriptPredefinedType", s:gui.pale_blue, "", "", "", "")
call s:hi("typescriptVariable", s:gui.purple, "", "", "", "")
call s:hi("typescriptOperator", s:gui.purple, "", "", "", "")
" HTML colors
call s:hi("htmlTag", s:gui.cyan, "", "", "", "")
call s:hi("htmlEndTag", s:gui.cyan, "", "", "", "")
call s:hi("htmlTagName", s:gui.red, "", "", "", "")
call s:hi("htmlSpecialTagName", s:gui.red, "", "", "", "")
call s:hi("htmlArg", s:gui.yellow, "", "", "", "")
" jsx colors
call s:hi("xmlTag", s:gui.cyan, "", "", "", "")
call s:hi("xmlEndTag", s:gui.cyan, "", "", "", "")
call s:hi("xmlTagName", s:gui.red, "", "", "", "")
call s:hi("xmlAttrib", s:gui.yellow, "", "", "", "")

View file

@ -1,32 +0,0 @@
#!/bin/bash
session_name=${PWD##*/}
project_directory="$HOME/development/$session_name"
tmux has-session -t $session_name
if [ $? != 0 ];
then
tmux new-session \
-c $project_directory \
-ds $session_name \
-e "project_dir=$project_directory"
# FIRST WINDOW
tmux send-keys -t $session_name:0 'source ./env/bin/activate' C-m
tmux send-keys -t $session_name:0 'nvim' C-m
# SECOND WINDOW
tmux new-window -t $session_name
# THIRD WINDOW
tmux new-window -t $session_name
# FOURTH WINDOW
tmux new-window -t $session_name
# SELECT DEFAULT PANE AFTER OPENING
tmux select-window -t $session_name:0
fi
tmux attach -t $session_name

View file

@ -1,8 +0,0 @@
---
dotfiles_repo: "git@forgejo.fudiggity.nl:sonny/dotfiles.git"
git_domain: "forgejo.fudiggity.nl"
git_host_key: "forgejo.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqEej87ukSK7KGi7e0q+oTrru4h7Fm6fK8GgiMtu01+"
git_name: Sonny Bakker
git_email: sonny871@hotmail.com

View file

@ -1,51 +0,0 @@
---
neovim_plugins:
- url: "https://forgejo.fudiggity.nl/sonny/source-link.lua"
name: "source-link"
- url: "https://github.com/nvim-tree/nvim-tree.lua"
name: "nvim-tree"
- url: "https://github.com/nvim-tree/nvim-web-devicons"
name: "nvim-tree-icons"
- url: "https://github.com/neovim/nvim-lspconfig"
name: "nvim-lspconfig"
- url: "https://github.com/hrsh7th/nvim-cmp"
name: "nvim-cmp"
- url: "https://github.com/hrsh7th/cmp-buffer"
name: "cmp-buffer"
- url: "https://github.com/hrsh7th/cmp-path"
name: "cmp-path"
- url: "https://github.com/hrsh7th/cmp-omni"
name: "cmp-omni"
- url: "https://github.com/hrsh7th/cmp-nvim-lsp"
name: "cmp-nvim-lsp"
- url: "https://github.com/hrsh7th/cmp-nvim-lua"
name: "cmp-nvim-lua"
- url: "https://github.com/nvim-treesitter/nvim-treesitter"
name: "nvim-treesitter"
version: master # main seems broken?
- url: "https://github.com/nvim-lua/plenary.nvim"
name: "plenary.nvim"
- url: "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
name: "telescope-fzf-native.nvim"
- url: "https://github.com/nvim-telescope/telescope.nvim"
name: "telescope.nvim"
version: "0.1.x"
- url: "https://github.com/L3MON4D3/LuaSnip"
name: "luasnip"
version: "v1.0.0"
- url: "https://github.com/lewis6991/gitsigns.nvim"
name: "gitsigns.nvim"
version: "v0.9.0"
- url: "https://github.com/nvim-lualine/lualine.nvim"
name: "lualine"
- url: "https://github.com/lukas-reineke/indent-blankline.nvim"
name: "indent-blankline.nvim"
version: "v3.7.2"
- url: "https://github.com/projekt0n/github-nvim-theme.git"
name: "github-colors"
version: "v1.1.2"
- url: "https://github.com/stevearc/conform.nvim.git"
name: "conform.nvim"
version: "v9.0.0"
language_servers: []

View file

@ -1,5 +0,0 @@
---
xdg_config_dir: "{{ ansible_env.HOME }}/.config"
xdg_data_dir: "{{ ansible_env.HOME }}/.local/share"
packages: []

View file

@ -1,41 +0,0 @@
---
aur_packages:
- url: "https://aur.archlinux.org/nvm.git"
name: "nvm"
package_name: "nvm"
version: "0.40.0-1"
arch: "any"
aur_build_dir: "/usr/local/src"
python_build_dir: "/usr/local/src"
python_install_dir: "/opt"
python_download_url: "https://www.python.org/ftp/python"
python_versions:
- version: 3.12.9
path: "python3.12"
binary: "python3.12"
- version: 3.11.9
path: "python3.11"
binary: "python3.11"
- version: 3.10.0
path: "python3.10"
binary: "python3.10"
- version: 3.9.14
path: "python3.9"
binary: "python3.9"
- version: 3.8.14
path: "python3.8"
binary: "python3.8"
- version: 3.7.14
path: "python3.7"
binary: "python3.7"
- version: 3.6.15
path: "python3.6"
binary: "python3.6"

View file

@ -1,49 +0,0 @@
---
language_servers:
- package: ansible-language-server
server_name: "ansiblels"
auto_setup: true
- package: typescript-language-server
server_name: "ts_ls"
auto_setup: true
- package: vscode-json-languageserver
server_name: "jsonls"
auto_setup: true
- package: vscode-css-languageserver
server_name: "cssls"
auto_setup: true
- package: bash-language-server
server_name: "bashls"
auto_setup: true
- package: marksman
server_name: "marksman"
auto_setup: true
- package: esbonio
server_name: "esbonio"
auto_setup: false
- package: lua-language-server
server_name: "lua_ls"
auto_setup: false
- package: yaml-language-server
server_name: "yamlls"
auto_setup: false
- package: vscode-html-languageserver
server_name: "html"
auto_setup: false
- package: ruff
server_name: "ruff"
auto_setup: true
- package: pyright
server_name: "pyright"
auto_setup: false

View file

@ -1,26 +0,0 @@
---
packages:
- python
- git
- vim
- neovim
- python-pynvim
- wl-clipboard
- npm
- docker
- docker-compose
- iptables-nft
- fuse-overlayfs
- ttf-ibm-plex
- slirp4netns
- tree-sitter
- ripgrep
- fd
- uv
- fakeroot
- debugedit
- which
- gcc
- make
- esbonio
- marksman

View file

@ -1,19 +0,0 @@
---
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
language_servers:
- package: "@ansible/ansible-language-server"
server_name: "ansiblels"
auto_setup: true
- package: yaml-language-server
server_name: "yamlls"
auto_setup: false
- package: bash-language-server
server_name: "bashls"
auto_setup: true
neovim:
version: "v0.11.4"
install_path: "/opt/nvim"
download_checksum: sha256:a74740047e73b2b380d63a474282814063d10650cd6cc95efa16d1713c7e616c

View file

@ -1,8 +0,0 @@
---
packages:
- python3
- git
- vim
- npm
- libtree-sitter0
- ripgrep

View file

@ -1,27 +0,0 @@
---
personal:
hosts:
xps: &xps
ansible_connection: local
ansible_become_method: community.general.run0
desktop: &desktop
ansible_connection: local
ansible_become_method: community.general.run0
htpc: &htpc
ansible_connection: local
ansible_become_method: community.general.run0
fudiggity: &fudiggity
ansible_connection: local
debian:
hosts:
fudiggity:
<<: *fudiggity
arch:
hosts:
xps:
<<: *xps
desktop:
<<: *desktop
htpc:
<<: *htpc

33
package-lock.json generated Normal file
View file

@ -0,0 +1,33 @@
{
"name": "development",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"prettier": "^2.6.2"
}
},
"node_modules/prettier": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz",
"integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==",
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
}
},
"dependencies": {
"prettier": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz",
"integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew=="
}
}
}

5
package.json Normal file
View file

@ -0,0 +1,5 @@
{
"dependencies": {
"prettier": "^2.6.2"
}
}

View file

@ -1,72 +0,0 @@
---
- name: Development provisioning
hosts:
- personal
- arch
- debian
pre_tasks:
- name: Verifying that a limit is set
ansible.builtin.fail:
msg: "This playbook cannot be run with no limit"
run_once: true
when: ansible_limit is not defined
- name: Install packages
become: true
ansible.builtin.package:
name: "{{ item }}"
state: present
loop: "{{ packages }}"
- name: Add git forge to known hosts
ansible.builtin.include_role:
name: common
tasks_from: "known_hosts.yml"
vars:
user: "{{ ansible_user_id }}"
items:
- domain: "{{ git_domain }}"
key: "{{ git_host_key }}"
when: ansible_hostname != 'fudiggity'
tasks:
- name: Setup dotfiles
ansible.builtin.import_tasks: "tasks/dotfiles.yml"
tags: dotfiles
- name: Include generic neovim tasks
ansible.builtin.import_tasks: "tasks/neovim.yml"
tags: neovim
- name: Include debian neovim tasks
ansible.builtin.import_tasks: "tasks/debian/neovim.yml"
when: "'debian' in group_names"
tags: neovim
- name: Provision Archlinux hosts
when: "'arch' in group_names"
block:
- name: Gather package facts
ansible.builtin.package_facts:
manager: pacman
- name: Include arch neovim tasks
ansible.builtin.import_tasks: "tasks/arch/neovim.yml"
when: "'arch' in group_names"
tags: neovim
- name: Install AUR packages
ansible.builtin.import_tasks: "tasks/arch/aur.yml"
tags: aur
- name: Setup docker
ansible.builtin.import_tasks: "tasks/arch/docker.yml"
tags: docker
- name: Setup python versions
ansible.builtin.include_tasks: "tasks/arch/python.yml"
loop: "{{ python_versions }}"
tags: python
- name: Setup NVM
ansible.builtin.import_tasks: "tasks/arch/nvm.yml"
tags: nvm

View file

@ -1,5 +1,4 @@
---
- src: git+https://forgejo.fudiggity.nl/sonny/common-ansible.git
- src: git+https://git.fudiggity.nl/ansible/common.git
name: common
version: master
scm: git

View file

@ -1,54 +0,0 @@
---
- name: Set package directory
ansible.builtin.set_fact:
build_dir: "{{ aur_build_dir }}/{{ item.name }}"
- name: "Retrieve package name for {{ item.name }}"
ansible.builtin.command:
argv:
- grep
- --only-matching
- --perl-regexp
- "(?<=pkgname=).*"
- "{{ build_dir }}/PKGBUILD"
register: pkg_name
- name: "Retrieve package version for {{ item.name }}"
ansible.builtin.command:
argv:
- grep
- --only-matching
- --perl-regexp
- "(?<=pkgver=).*"
- "{{ build_dir }}/PKGBUILD"
register: pkg_version
- name: "Retrieve package release for {{ item.name }}"
ansible.builtin.command:
argv:
- grep
- --only-matching
- --perl-regexp
- "(?<=pkgrel=).*"
- "{{ build_dir }}/PKGBUILD"
register: pkg_release
- name: Set package filename & version
ansible.builtin.set_fact:
package_filename: "{{ pkg_name.stdout }}-{{ pkg_version.stdout }}-{{ pkg_release.stdout }}-{{ item.arch }}.pkg.tar.zst"
installed_version: ansible_facts.packages[item.package_name].version|default('')
- name: "Build package {{ item.name }}"
ansible.builtin.command: "makepkg --syncdeps --rmdeps --clean --noconfirm --force"
args:
chdir: "{{ build_dir }}"
creates: "{{ build_dir }}/{{ package_filename }}"
register: package_build
when: item.version != installed_version
- name: "Install {{ item.name }}"
become: true
community.general.pacman:
name: "{{ build_dir }}/{{ package_filename }}"
state: present
when: item.version != installed_version

View file

@ -1,27 +0,0 @@
---
- name: Retrieve directory stats
ansible.builtin.stat:
path: "{{ aur_build_dir }}/{{ item.name }}"
loop: "{{ aur_packages }}"
- name: Clone aur packages
become: true
ansible.builtin.git:
repo: "{{ item.url }}"
dest: "{{ aur_build_dir }}/{{ item.name }}"
update: true
loop: "{{ aur_packages }}"
- name: Change aur package directories owner
become: true
ansible.builtin.file:
path: "{{ aur_build_dir }}/{{ item.name }}"
state: directory
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
recurse: true
loop: "{{ aur_packages }}"
- name: Build & install aur packages
ansible.builtin.include_tasks: "tasks/arch/aur-package.yml"
loop: "{{ aur_packages }}"

View file

@ -1,67 +0,0 @@
---
- name: Remove docker mapping files
become: true
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- /etc/subgid
- /etc/subuid
- name: Setup desktop configuration
become: true
ansible.builtin.file:
path: "files/desktop/docker-daemon.json"
dest: "/etc/docker/daemon.json"
mode: "0755"
when: ansible_hostname == 'desktop'
- name: Remove user setup desktop configuration
ansible.builtin.file:
path: "{{ xdg_config_dir }}/docker/daemon.json"
state: absent
when: ansible_hostname == 'desktop'
- name: Check for .bashrc.override
ansible.builtin.stat:
path: "{{ ansible_env.HOME }}/.bashrc.override"
register: bashrc_override
- name: Create .bashrc.override
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.bashrc.override"
state: touch
mode: "0755"
when: not bashrc_override.stat.exists
- name: Remove rootless DOCKER_HOST variable assignment
ansible.builtin.lineinfile:
path: "{{ ansible_env.HOME }}/.bashrc.override"
regexp: "^export DOCKER_HOST="
line: ""
- name: Disable user docker socket
ansible.builtin.systemd:
name: "{{ item }}"
state: stopped
enabled: false
scope: user
daemon_reload: true
register: disable_stats
ignore_errors: true # TODO: add better error handling
loop:
- docker.socket
- docker.service
- name: Remove docker rootless package
become: true
ansible.builtin.package:
name: docker-rootless-extras
state: absent
- name: Enable system docker socket
become: true
ansible.builtin.systemd:
name: docker.socket
state: started
enabled: true

View file

@ -1,7 +0,0 @@
---
- name: Install language servers
become: true
community.general.pacman:
name: "{{ item }}"
state: present
loop: '{{ language_servers | map(attribute="package") | list }}'

View file

@ -1,16 +0,0 @@
---
- name: Set NVM install directory
ansible.builtin.set_fact:
install_dir: "{{ xdg_config_dir }}/nvm"
- name: Remove manually installed nvm install directory
ansible.builtin.file:
path: "{{ install_dir }}"
state: absent
- name: Remove nvm entry from bashrc
ansible.builtin.lineinfile:
path: "{{ ansible_env.HOME }}/.bashrc.override"
line: >
[ -s "{{ install_dir }}/nvm.sh" ] && \. "{{ install_dir }}/nvm.sh" # This loads nvm
state: absent

View file

@ -1,66 +0,0 @@
---
- name: "Check for {{ item.binary }} binary"
ansible.builtin.command: "which {{ item.binary }}"
changed_when: false
failed_when: python_installed.rc not in [ 0, 1 ]
register: python_installed
- name: "Check for {{ item.binary }} download"
ansible.builtin.stat:
path: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
register: python_download
- when: python_installed.rc not in [ 0 ]
block:
# TODO: verify for checksum
- name: "Retrieve python {{ item.version }} source"
become: true
ansible.builtin.get_url:
url: "{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz"
dest: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
when: not python_download.stat.exists
- name: "Extract python {{ item.version }} sources"
become: true
ansible.builtin.unarchive:
src: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
dest: "{{ python_build_dir }}"
include: "Python-{{ item.version }}"
- name: Rename source directory
become: true
ansible.builtin.command: "mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}"
- name: Set correct permissions
become: true
ansible.builtin.file:
path: "{{ python_build_dir }}/{{ item.path }}"
recurse: true
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
state: directory
- name: Configure build
ansible.builtin.command: "sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}"
args:
chdir: "{{ python_build_dir }}/{{ item.path }}/"
- name: Make build
ansible.builtin.command: "make"
args:
chdir: "{{ python_build_dir }}/{{ item.path }}/"
- name: Install build
become: true
ansible.builtin.command: "make install"
args:
chdir: "{{ python_build_dir }}/{{ item.path }}/"
- name: "Create symlink for python {{ item.version }}"
become: true
ansible.builtin.file:
src: "{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}"
dest: "/usr/bin/{{ item.binary }}"
state: link

52
tasks/aur-package.yml Normal file
View file

@ -0,0 +1,52 @@
- name: set package directory
set_fact:
build_dir: '{{ aur_build_dir }}/{{ item.name }}'
- name: 'retrieve package name for {{ item.name }}'
command:
argv:
- grep
- --only-matching
- --perl-regexp
- "(?<=pkgname=).*"
- "{{ build_dir }}/PKGBUILD"
register: pkg_name
- name: 'retrieve package version for {{ item.name }}'
command:
argv:
- grep
- --only-matching
- --perl-regexp
- "(?<=pkgver=).*"
- "{{ build_dir }}/PKGBUILD"
register: pkg_version
- name: 'retrieve package release for {{ item.name }}'
command:
argv:
- grep
- --only-matching
- --perl-regexp
- "(?<=pkgrel=).*"
- "{{ build_dir }}/PKGBUILD"
register: pkg_release
- set_fact:
package_filename: '{{ pkg_name.stdout }}-{{ pkg_version.stdout }}-{{ pkg_release.stdout }}-{{ item.arch }}.pkg.tar.zst'
installed_version: ansible_facts.packages[item.package_name].version|default('')
- name: 'build package {{ item.name }}'
command: 'makepkg --syncdeps --rmdeps --clean --noconfirm --force'
args:
chdir: '{{ build_dir }}'
creates: '{{ build_dir }}/{{ package_filename }}'
register: package_build
when: item.version != installed_version
- name: 'install {{ item.name }}'
become: true
pacman:
name: '{{ build_dir }}/{{ package_filename }}'
state: present
when: package_build.changed

34
tasks/aur.yml Normal file
View file

@ -0,0 +1,34 @@
- name: retrieve directory stats
stat:
path: '{{ aur_build_dir }}/{{ item.name }}'
loop: '{{ aur_packages }}'
- name: clone aur packages
become: true
git:
repo: '{{ item.url }}'
dest: '{{ aur_build_dir }}/{{ item.name }}'
update: true
loop: '{{ aur_packages }}'
- name: change aur package directories owner
become: true
file:
path: '{{ aur_build_dir }}/{{ item.name }}'
state: directory
owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_id }}'
recurse: true
loop: '{{ aur_packages }}'
- name: build & install aur packages
include_tasks: 'tasks/aur-package.yml'
loop: '{{ aur_packages }}'
- name: enable docker socket
systemd:
name: docker.socket
state: restarted
enabled: true
scope: user
daemon_reload: true

View file

@ -1,58 +0,0 @@
---
- name: Install language servers on debian hosts
become: true
community.general.npm:
name: "{{ item }}"
global: true
loop: '{{ language_servers | map(attribute="package") | list }}'
- name: Create neovim install directory
become: true
ansible.builtin.file:
state: directory
path: "{{ neovim.install_path }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_gid }}"
mode: "0755"
- name: Register the current neovim version
ansible.builtin.command:
argv:
- "{{ neovim.install_path }}/bin/nvim"
- "--version"
register: neovim_stats
changed_when: false
ignore_errors: true
- name: Parse the current neovim version
ansible.builtin.set_fact:
neovim_installed_version: neovim_stats.stdout_lines[0] | regex_search('(v\d+\.\d+\.\d+)')
when: neovim_stats.rc == 0
- name: Download neovim {{ neovim.version }}
ansible.builtin.get_url:
url: "https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux-x86_64.tar.gz"
dest: /tmp/nvim-linux64.tar.gz
mode: "0755"
checksum: "{{ neovim.download_checksum }}"
when: neovim_stats.rc > 0 or neovim_installed_version != neovim.version
register: neovim_download
- name: Extract downloaded neovim version
ansible.builtin.unarchive:
src: /tmp/nvim-linux64.tar.gz
dest: "{{ neovim.install_path }}"
extra_opts:
- "--strip-components=1"
- "--show-stored-names"
- "--overwrite"
when: |
neovim_download.state == 'file'
and (neovim_installed_version is undefined or neovim_installed_version != neovim.version)
- name: Add neovim to PATH
become: true
ansible.builtin.template:
src: "templates/debian/nvim.profile.j2"
dest: "/etc/profile.d/neovim.sh"
mode: "0755"

39
tasks/docker.yml Normal file
View file

@ -0,0 +1,39 @@
- name: copy docker mapping files
become: true
template:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
loop:
- { src: 'templates/subgid.j2', dest: '/etc/subgid' }
- { src: 'templates/subuid.j2', dest: '/etc/subuid' }
- name: setup desktop configuration
copy:
src: 'files/docker-daemon.json'
dest: '{{ xdg_config_dir }}/docker/daemon.json'
when: ansible_hostname == 'desktop'
- name: check for .bashrc.override
stat:
path: '{{ ansible_env.HOME }}/.bashrc.override'
register: bashrc_override
- name: create .bashrc.override
file:
path: '{{ ansible_env.HOME }}/.bashrc.override'
state: touch
when: not bashrc_override.stat.exists
- name: ensure correct DOCKER_HOST is set
lineinfile:
path: '{{ ansible_env.HOME }}/.bashrc.override'
regexp: '^export DOCKER_HOST='
line: 'export DOCKER_HOST=unix:///run/user/{{ ansible_user_uid }}/docker.sock'
- name: enable docker socket
systemd:
name: docker.socket
state: restarted
enabled: true
scope: user
daemon_reload: true

View file

@ -1,70 +1,44 @@
---
- name: Clone dotfiles
ansible.builtin.git:
repo: "{{ dotfiles_repo }}"
dest: "{{ ansible_env.HOME }}/dotfiles"
- name: clone dotfiles
git:
repo: '{{ dotfiles_repo }}'
dest: '{{ ansible_env.HOME }}/dotfiles'
version: master
update: true
update: yes
register: dotfile_ssh_clone
ignore_errors: true
- name: Create xdg configuration directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0755"
loop:
- "{{ xdg_config_dir }}/git"
- "{{ xdg_config_dir }}/tmux"
- name: clone dotfiles
git:
repo: '{{ public_dotfiles_repo }}'
dest: '{{ ansible_env.HOME }}/dotfiles'
version: master
update: yes
when: dotfile_ssh_clone.failed
- name: Remove previous dotfiles
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- "{{ ansible_env.HOME }}/.tmux.conf"
- "{{ ansible_env.HOME }}/.gitconfig"
- name: Setup dotfiles
ansible.builtin.file:
path: "{{ item.dest }}"
src: "{{ item.src }}"
- name: setup dotfiles
file:
path: '{{ item.dest }}'
src: '{{ item.src }}'
state: link
force: true
loop:
- src: "{{ ansible_env.HOME }}/dotfiles/.vimrc"
dest: "{{ ansible_env.HOME }}/.vimrc"
- src: "{{ ansible_env.HOME }}/dotfiles/.bashrc"
dest: "{{ ansible_env.HOME }}/.bashrc"
- src: "{{ ansible_env.HOME }}/dotfiles/.profile"
dest: "{{ ansible_env.HOME }}/.profile"
- src: "{{ ansible_env.HOME }}/dotfiles/tmux/tmux.conf"
dest: "{{ xdg_config_dir }}/tmux/tmux.conf"
- src: "{{ ansible_env.HOME }}/dotfiles/tmux/light.conf"
dest: "{{ xdg_config_dir }}/tmux/light.conf"
- src: "{{ ansible_env.HOME }}/dotfiles/tmux/dark.conf"
dest: "{{ xdg_config_dir }}/tmux/dark.conf"
- src: "{{ ansible_env.HOME }}/dotfiles/.gitignore"
dest: "{{ xdg_config_dir }}/git/ignore"
- name: Copy git configuration
ansible.builtin.template:
src: "templates/gitconfig.j2"
dest: "{{ xdg_config_dir }}/git/config"
mode: "0755"
- name: Create script directory
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.local/bin"
state: directory
mode: "0755"
- name: Copy tmux toggle script
ansible.builtin.template:
src: "templates/tmux-toggle.j2"
dest: "{{ ansible_env.HOME }}/.local/bin/tmux-toggle.sh"
mode: "0755"
- {
src: '{{ ansible_env.HOME }}/dotfiles/.vimrc',
dest: '{{ ansible_env.HOME }}/.vimrc',
}
- {
src: '{{ ansible_env.HOME }}/dotfiles/.bashrc',
dest: '{{ ansible_env.HOME }}/.bashrc',
}
- {
src: '{{ ansible_env.HOME }}/dotfiles/.profile',
dest: '{{ ansible_env.HOME }}/.profile',
}
- {
src: '{{ ansible_env.HOME }}/dotfiles/.tmux.conf',
dest: '{{ ansible_env.HOME }}/.tmux.conf',
}
- {
src: '{{ ansible_env.HOME }}/dotfiles/.gitignore',
dest: '{{ ansible_env.HOME }}/.gitignore',
}

View file

@ -1,132 +1,199 @@
---
- name: Ensure neovim configuration directories exist
ansible.builtin.file:
path: "{{ item }}"
- name: ensure neovim configuration directories exist
file:
path: '{{ item }}'
state: directory
mode: "0755"
loop:
- "{{ xdg_config_dir }}/nvim/"
- "{{ xdg_config_dir }}/nvim/lua"
- "{{ xdg_config_dir }}/nvim/after"
- "{{ xdg_config_dir }}/nvim/after/ftplugin"
- "{{ xdg_data_dir }}/nvim/site"
- "{{ xdg_data_dir }}/nvim/site/pack"
- "{{ xdg_data_dir }}/nvim/site/pack/default"
- "{{ xdg_data_dir }}/nvim/site/pack/default/start"
- name: Remove old neovim packages
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- "{{ xdg_data_dir }}/nvim/site/pack/default/start/catpuccin"
- "{{ xdg_data_dir }}/nvim/site/pack/default/start/vim-colors-xcode"
- '{{ xdg_config_dir }}/nvim/'
- '{{ xdg_config_dir }}/nvim/lua'
- '{{ xdg_config_dir }}/nvim/after'
- '{{ xdg_config_dir }}/nvim/after/ftplugin'
- '{{ xdg_data_dir }}/nvim/site'
- '{{ xdg_data_dir }}/nvim/site/pack'
- '{{ xdg_data_dir }}/nvim/site/pack/default'
- '{{ xdg_data_dir }}/nvim/site/pack/default/start'
# Note that helptags may need to be regenerated (see `:h helptags`)
- name: Clone neovim packages
ansible.builtin.git:
repo: "{{ item.url }}"
dest: "{{ xdg_data_dir }}/nvim/site/pack/default/start/{{ item.name }}"
- name: clone neovim packages
git:
repo: '{{ item.url }}'
dest: '{{ xdg_data_dir }}/nvim/site/pack/default/start/{{ item.name }}'
update: true
version: '{{ item.version | default("HEAD") }}'
force: true # some maintainers overwrite existing tags :/
loop: "{{ neovim_plugins }}"
version: '{{ item.version|default("HEAD") }}'
loop: '{{ neovim_plugins }}'
- name: Install neovim node package
- name: install neovim node package
become: true
community.general.npm:
npm:
name: neovim
global: true
- name: Remove old neovim configuration file
ansible.builtin.file:
path: "{{ xdg_config_dir }}/nvim/init.vim"
- name: install language servers
become: true
package:
name: '{{ item }}'
state: present
loop: '{{ language_servers | map(attribute="package") | list }}'
when: ansible_facts['os_family'] == 'Archlinux'
- name: install language servers on debian hosts
become: true
npm:
name: '{{ item }}'
global: true
loop: '{{ language_servers | map(attribute="package") | list }}'
when: ansible_facts['os_family'] == 'Debian'
- name: remove old neovim configuration file
file:
path: '{{ xdg_config_dir }}/nvim/init.vim'
state: absent
- name: Remove coc.nvim extension
ansible.builtin.file:
path: "{{ xdg_data_dir }}/nvim/site/pack/default/start/coc.nvim"
- name: remove coc.nvim extension
file:
path: '{{ xdg_data_dir }}/nvim/site/pack/default/start/coc.nvim'
state: absent
- name: Setup neovim configuration files
ansible.builtin.template:
dest: "{{ item.dest }}"
src: "{{ item.src }}"
mode: "0755"
- name: setup neovim color files
copy:
dest: '{{ xdg_data_dir }}/nvim/site/'
src: 'files/nvim/colors'
- name: setup neovim configuration files
template:
dest: '{{ item.dest }}'
src: '{{ item.src }}'
loop:
- src: "templates/nvim/ftplugin/bash.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/bash.lua"
- {
src: 'templates/nvim/ftplugin/bash.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/bash.lua',
}
- {
src: 'templates/nvim/ftplugin/css.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/css.lua',
}
- {
src: 'templates/nvim/ftplugin/html.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/html.lua',
}
- {
src: 'templates/nvim/ftplugin/htmldjango.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/htmldjango.lua',
}
- {
src: 'templates/nvim/ftplugin/javascript.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/javascript.lua',
}
- {
src: 'templates/nvim/ftplugin/json.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/json.lua',
}
- {
src: 'templates/nvim/ftplugin/lua.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/lua.lua',
}
- {
src: 'templates/nvim/ftplugin/python.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/python.lua',
}
- {
src: 'templates/nvim/ftplugin/scss.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/scss.lua',
}
- {
src: 'templates/nvim/ftplugin/sh.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/sh.lua',
}
- {
src: 'templates/nvim/ftplugin/yaml.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/yaml.lua',
}
- { src: 'templates/nvim/init.lua.j2', dest: '{{ xdg_config_dir }}/nvim/init.lua' }
- {
src: 'templates/nvim/lua/auto-commands.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/auto-commands.lua',
}
- {
src: 'templates/nvim/lua/keybindings.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/keybindings.lua',
}
- {
src: 'templates/nvim/lua/lsp.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/lsp.lua',
}
- {
src: 'templates/nvim/lua/nvim-cmp.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/nvim-cmp.lua',
}
- {
src: 'templates/nvim/lua/options.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/options.lua',
}
- {
src: 'templates/nvim/lua/tree-sitter.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/tree-sitter.lua',
}
- {
src: 'templates/nvim/lua/git-signs.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/git-signs.lua',
}
- {
src: 'templates/nvim/lua/lua-line.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/lua-line.lua',
}
- {
src: 'templates/nvim/lua/telescope.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/_telescope.lua',
}
- {
src: 'templates/nvim/lua/indent-blankline.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/indent-blankline.lua',
}
- src: "templates/nvim/ftplugin/css.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/css.lua"
- block:
- name: create neovim install directory
become: true
file:
state: directory
path: '{{ neovim.install_path }}'
owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_gid }}'
- src: "templates/nvim/ftplugin/html.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/html.lua"
- src: "templates/nvim/ftplugin/htmldjango.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/htmldjango.lua"
- name: register the current neovim version
command:
argv:
- '{{ neovim.install_path }}/bin/nvim'
- '--version'
register: neovim_stats
ignore_errors: true
- src: "templates/nvim/ftplugin/javascript.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/javascript.lua"
- name: parse the current neovim version
set_fact:
neovim_installed_version: neovim_stats.stdout_lines[0] | regex_search('(v\d+\.\d+\.\d+)')
when: neovim_stats.rc == 0
- src: "templates/nvim/ftplugin/json.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/json.lua"
# TODO: verify checksum
- name: download neovim {{ neovim.version }}
get_url:
url: 'https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux64.tar.gz'
dest: /tmp/nvim-linux64.tar.gz
when: neovim_stats.rc > 0 or neovim_installed_version != neovim.version
register: neovim_download
- src: "templates/nvim/ftplugin/lua.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/lua.lua"
- name: extract downloaded neovim version
unarchive:
src: /tmp/nvim-linux64.tar.gz
dest: '{{ neovim.install_path }}'
extra_opts:
- '--strip-components=1'
- '--show-stored-names'
- '--overwrite'
when: neovim_download.state == 'file' and
(neovim_installed_version is undefined or neovim_installed_version != neovim.version)
- src: "templates/nvim/ftplugin/markdown.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/markdown.lua"
- name: add neovim to PATH
become: true
template:
src: 'templates/nvim.profile.j2'
dest: '/etc/profile.d/neovim.sh'
- src: "templates/nvim/ftplugin/python.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/python.lua"
- src: "templates/nvim/ftplugin/rst.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/rst.lua"
- src: "templates/nvim/ftplugin/scss.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/scss.lua"
- src: "templates/nvim/ftplugin/sh.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/sh.lua"
- src: "templates/nvim/ftplugin/yaml.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/yaml.lua"
- src: "templates/nvim/init.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/init.lua"
- src: "templates/nvim/lua/lsp.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/lsp.lua"
- src: "templates/nvim/lua/options.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/options.lua"
- src: "templates/nvim/lua/tree-sitter.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/tree-sitter.lua"
- src: "templates/nvim/lua/git-signs.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/git-signs.lua"
- src: "templates/nvim/lua/lua-line.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/lua-line.lua"
- src: "templates/nvim/lua/telescope.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/_telescope.lua"
- src: "templates/nvim/lua/indent-blankline.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/indent-blankline.lua"
- src: "templates/nvim/lua/nvim-tree.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/_nvim-tree.lua"
- src: "templates/nvim/lua/colorscheme.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/colorscheme.lua"
- src: "templates/nvim/lua/source-link.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/_source-link.lua"
- src: "templates/nvim/lua/filetype.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/_filetype.lua"
- src: "templates/nvim/lua/diagnostic.lua.j2"
dest: "{{ xdg_config_dir }}/nvim/lua/diagnostic.lua"
when: ansible_facts['os_family'] == 'Debian'

14
tasks/nvm.yml Normal file
View file

@ -0,0 +1,14 @@
- set_fact:
install_dir: '{{ xdg_config_dir }}/nvm'
- name: remove manually installed nvm install directory
file:
path: '{{ install_dir }}'
state: absent
- name: remove nvm entry from bashrc
lineinfile:
path: '{{ ansible_env.HOME }}/.bashrc.override'
line: >
[ -s "{{ install_dir }}/nvm.sh" ] && \. "{{ install_dir }}/nvm.sh" # This loads nvm
state: absent

65
tasks/python.yml Normal file
View file

@ -0,0 +1,65 @@
- name: 'check for {{ item.binary }} binary'
command: 'which {{ item.binary }}'
changed_when: false
failed_when: python_installed.rc not in [ 0, 1 ]
register: python_installed
- name: 'check for {{ item.binary }} download'
stat:
path: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
register: python_download
- block:
# TODO: verify for checksum
- name: 'retrieve python {{ item.version }} source'
become: true
get_url:
url: '{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz'
dest: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_id }}'
when: not python_download.stat.exists
- name: 'extract python {{ item.version }} sources'
become: true
unarchive:
src: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
dest: '{{ python_build_dir }}'
include: 'Python-{{ item.version }}'
- name: rename source directory
become: true
ansible.builtin.command: 'mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}'
- name: set correct permissions
become: true
file:
path: '{{ python_build_dir }}/{{ item.path }}'
recurse: true
owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_id }}'
state: directory
- name: configure build
ansible.builtin.command: 'sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}'
args:
chdir: '{{ python_build_dir }}/{{ item.path }}/'
- name: make build
ansible.builtin.command: 'make'
args:
chdir: '{{ python_build_dir }}/{{ item.path }}/'
- name: install build
become: true
ansible.builtin.command: 'make install'
args:
chdir: '{{ python_build_dir }}/{{ item.path }}/'
- name: 'create symlink for python {{ item.version }}'
become: true
file:
src: '{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}'
dest: '/usr/bin/{{ item.binary }}'
state: link
when: python_installed.rc not in [ 0 ]

View file

@ -1,57 +0,0 @@
# {{ ansible_managed }}
[user]
email = {{ git_email }}
name = {{ git_name }}
[gpg]
format = ssh
[core]
editor = nvim
{% if ansible_facts['os_family'] == 'Archlinux' %}
pager = delta
{% endif %}
{% if ansible_facts['os_family'] == 'Archlinux' %}
[interactive]
diffFilter = delta --color-only
{% endif %}
[init]
defaultBranch = main
[commit]
verbose = true
[push]
default = simple
autoSetupRemote = true
[pull]
rebase = false
[fetch]
prune = true
pruneTags = true
all = true
[merge]
tool = nvimdiff
conflictstyle = zdiff3
[diff]
colorMoved = default
mnemonicPrefix = true
renames = true
[help]
autocorrect = prompt
{% if ansible_facts['os_family'] == 'Archlinux' %}
[delta]
navigate = true
hyperlinks = true
line-numbers = true
map-styles = bold purple => syntax magenta, bold cyan => syntax blue, bold yellow => syntax yellow
{% endif %}

View file

@ -1,7 +0,0 @@
-- {{ ansible_managed }}
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.autoindent = true

View file

@ -1,7 +0,0 @@
-- {{ ansible_managed }}
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.autoindent = true

View file

@ -1,14 +1,12 @@
-- {{ ansible_managed }}
require('options')
require('_filetype')
require('colorscheme')
require('lsp')
require('nvim-cmp')
require('keybindings')
require('auto-commands')
require('tree-sitter')
require('lua-line')
require('git-signs')
require('_telescope')
require('indent-blankline')
require('_nvim-tree')
require('lua-line')
require('_source-link')
require('diagnostic')

View file

@ -0,0 +1,17 @@
-- {{ ansible_managed }}
--colorscheme
vim.cmd('colorscheme catppuccin-latte')
--enable this option here as the events are used in this buffer
vim.cmd('syntax on')
vim.api.nvim_create_autocmd('Syntax', {
command = [[:normal zR]],
desc = 'Open folds by default',
})
vim.api.nvim_create_autocmd('Filetype', {
pattern = 'TelescopeResults',
command = [[:setlocal nofoldenable]],
})

View file

@ -1,100 +0,0 @@
-- {{ ansible_managed }}
local background_callback = function()
if vim.o.background == 'dark' then
vim.cmd('colorscheme github_dark_dimmed')
else
vim.cmd('colorscheme github_light_tritanopia')
end
-- force a full redraw:
vim.cmd('mode')
end
-- set the colorscheme whenever the background setting changes
vim.api.nvim_create_autocmd(
{ 'OptionSet' },
{ pattern = { 'background' }, callback = background_callback }
)
{% if ansible_facts['os_family'] == 'Debian' %}
background_callback()
{% endif %}
{% if ansible_facts['os_family'] == 'Archlinux' %}
--[[
Use `busctl --user tree` to show a tree of available services.
Use the `Introspect` option to inspect available options:
dbus-send \
--session \
--print-reply \
--reply-timeout=2000 \
--type=method_call \
--dest=org.freedesktop.portal.Desktop \
/org/freedesktop/portal/desktop \
org.freedesktop.DBus.Introspectable.Introspect
--]]
local oneshot = {
'dbus-send',
'--session',
'--print-reply',
'--reply-timeout=2000',
'--type=method_call',
'--dest=org.freedesktop.portal.Desktop',
'/org/freedesktop/portal/desktop',
'org.freedesktop.portal.Settings.ReadOne',
'string:org.freedesktop.appearance',
'string:color-scheme'
}
local set_background = vim.schedule_wrap(
function(object)
local default_background = 'light'
if object.code ~= 0 then
print(string.format('An error occured: \n %s', object.stderr))
vim.api.nvim_command(string.format('set background=%s', default_background))
end
local colorscheme_output = tonumber(string.match(object.stdout, 'uint32 (%d)'))
if colorscheme_output == 1 then
vim.api.nvim_command('set background=dark')
elseif colorscheme_output == 2 then
vim.api.nvim_command('set background=light')
end
end
)
vim.schedule(
function() vim.system(oneshot, { text = true }, set_background) end
)
-- Note that the last argument is a match rule,
-- see https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules.
local monitor_command = {
'dbus-monitor',
'--session',
'path=/org/freedesktop/portal/desktop,' ..
'interface=org.freedesktop.portal.Settings,' ..
'member=SettingChanged,' ..
'arg0=org.freedesktop.appearance,'..
'arg1=color-scheme'
}
local detect_scheme_change = function(channel_id, data, name)
local line = table.concat(data)
local match_output = tonumber(string.match(line, "uint32 (%d)"))
if match_output == 1 then
vim.api.nvim_command('set background=dark')
elseif match_output == 2 then
vim.api.nvim_command('set background=light')
end
end
vim.fn.jobstart(monitor_command, { on_stdout = detect_scheme_change } )
{% endif %}

View file

@ -1,11 +0,0 @@
-- {{ ansible_managed }}
vim.diagnostic.config {
float = {
suffix = function(diagnostic)
return (' %s | [%s]'):format(diagnostic.code, diagnostic.source)
end
},
virtual_text = { current_line = true }
}

View file

@ -1,42 +0,0 @@
local ansible_keywords = {
'hosts',
'tasks',
'vars',
'vars_files',
'vars_prompt',
'handlers',
'roles',
'import_tasks',
'import_playbook',
'import_role',
}
vim.filetype.add {
pattern = {
['playbook*.y(a?)ml'] = 'yaml.ansible',
['site*.y(a?)ml'] = 'yaml.ansible',
['inventory*.y(a?)ml'] = 'yaml.ansible',
['task*.y(a?)ml'] = 'yaml.ansible',
['requirement*.y(a?)ml'] = 'yaml.ansible',
['.*/tasks/.*.y(a?)ml'] = 'yaml.ansible',
['.*/vars/.*.y(a?)ml'] = 'yaml.ansible',
['.*/host_vars/.*.y(a?)ml'] = 'yaml.ansible',
['.*/group_vars/.*.y(a?)ml'] = 'yaml.ansible',
['.*/playbooks/.*.y(a?)ml'] = 'yaml.ansible',
['*.ansible.y(a?)ml'] = 'yaml.ansible',
['.*.y(a?)ml'] = {
function(path, bufnr)
local content = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1] or ''
for _, keyword in pairs(ansible_keywords) do
local pattern = string.format('^- %s:', keyword)
if content:match(pattern) then return 'yaml.ansible' end
end
end,
},
},
}

View file

@ -1,5 +1,3 @@
-- {{ ansible_managed }}
local gitsigns = require('gitsigns');
gitsigns.setup({

View file

@ -0,0 +1,11 @@
local opts = {noremap=true, silent=true}
vim.api.nvim_set_keymap('n', '<C-E>', '<cmd>:NERDTreeToggle<CR>', opts)
vim.api.nvim_set_keymap('n', 'ff', '<cmd>lua require("telescope.builtin").find_files()<CR>', opts)
vim.api.nvim_set_keymap('n', 'fg', '<cmd>lua require("telescope.builtin").live_grep()<CR>', opts)
vim.api.nvim_set_keymap('n', 'fb', '<cmd>lua require("telescope.builtin").buffers()<CR>', opts)
vim.api.nvim_set_keymap('n', 'fh', '<cmd>lua require("telescope.builtin").help_tags()<CR>', opts)
vim.api.nvim_set_keymap('n', 'fj', '<cmd>lua require("telescope.builtin").jumplist()<CR>', opts)
vim.api.nvim_set_keymap('n', 'fl', '<cmd>lua require("telescope.builtin").loclist()<CR>', opts)
vim.api.nvim_set_keymap('n', 'fq', '<cmd>lua require("telescope.builtin").quickfix()<CR>', opts)
vim.api.nvim_set_keymap('n', 'fm', '<cmd>lua require("telescope.builtin").marks()<CR>', opts)

View file

@ -3,33 +3,40 @@
--use an on_attach function to only map the following keys
--after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local opts = { buffer = bufnr, noremap = true, silent = true }
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
-- enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- mappings
local opts = { buffer = bufnr, noremap = true, silent = true }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>la', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
vim.keymap.set('n', '<space>la', vim.lsp.buf.code_action, opts)
end
--enable some language servers with the additional completion capabilities
--offered by nvim-cmp
local auto_setup_servers = {
-- TODO: use `.join`?
local servers = {
{% for item in language_servers %}
{% if item.auto_setup and not loop.last %}
'{{ item.server_name }}',
@ -43,8 +50,10 @@ local auto_setup_servers = {
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
for _, lsp in ipairs(auto_setup_servers) do
vim.lsp.config[lsp] = {
local nvim_lsp = require('lspconfig')
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
@ -53,120 +62,68 @@ end
local util = require('lspconfig/util')
{% if ansible_facts.os_family == 'Archlinux' %}
local python_root_dir = function(fname)
return util.root_pattern('.git', 'setup.cfg', 'requirements')(fname) or
util.path.dirname(fname)
end
vim.lsp.config['pyright'] = {
nvim_lsp.ruff_lsp.setup({
on_attach = on_attach,
capabilities = capabilities,
root_dir = python_root_dir
})
nvim_lsp.pylsp.setup({
on_attach = on_attach,
capabilities = capabilities,
cmd = { 'pylsp', '--verbose' },
settings = {
pylsp = {
plugins = {
ruff = {
enabled = false
},
jedi_completion = { fuzzy = true }
}
}
},
root_dir = python_root_dir
})
nvim_lsp.pyright.setup({
settings = {
pyright = {
-- Using Ruff's import organizer
disableOrganizeImports = true,
},
}
}
},
})
local snippet_capabilities = vim.deepcopy(capabilities);
snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
vim.lsp.config['html'] = {
nvim_lsp.html.setup({
on_attach = on_attach,
capabilities = snippet_capabilities,
capabilities = capabilities,
filetypes = { 'html', 'htmldjango' },
settings = {
html = {
format = {
templating = true
}
}
}
}
})
vim.lsp.config['cssls'] = {
on_attach = on_attach,
capabilities = snippet_capabilities,
}
vim.lsp.config['jsonls'] = {
on_attach = on_attach,
capabilities = snippet_capabilities,
}
vim.lsp.config['lua_ls'] = {
on_attach = on_attach,
capabilities = snippet_capabilities,
settings = {
Lua = {
diagnostics = {
globals = { 'vim' }
}
}
}
}
-- Use system binary for esbonio
vim.lsp.config['esbonio'] = {
on_attach = on_attach,
capabilities = capabilities,
cmd = { '/usr/bin/esbonio' }
}
{% endif %}
vim.lsp.config['yamlls'] = {
on_attach = on_attach,
capabilities = capabilities,
filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose', 'yaml.gitlab' }
}
local servers = {
{% for item in language_servers %}
{% if not loop.last %}
'{{ item.server_name }}',
{% else %}
'{{ item.server_name }}'
{% endif %}
{% endfor %}
}
vim.lsp.enable { unpack(servers) }
local cmp = require('cmp')
local luasnip = require('luasnip')
cmp.setup {
cmp.setup({
sources = {
{ name = 'nvim_lsp', },
{ name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lua' },
{
name = 'omni',
option = {
disable_omnifuncs = { 'v:lua.vim.lsp.omnifunc' }
}
},
{ name = 'luasnip', }, -- TODO: add snippets
{ names = 'nvim_lsp', },
{ names = 'luasnip', }, -- TODO: add snippets
},
formatting = {
format = function(entry, vim_item)
if entry.source.name == 'nvim_lsp' then
vim_item.menu = string.format('[%s]', entry.source.source.client.name)
else
vim_item.menu = string.format('[%s]', entry.source.name)
end
return vim_item
end,
},
mapping = cmp.mapping.preset.insert({
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -192,4 +149,4 @@ cmp.setup {
luasnip.lsp_expand(args.body)
end,
},
}
})

View file

@ -2,37 +2,10 @@
local lualine = require('lualine');
local function active_lsps()
local buffer = vim.api.nvim_get_current_buf()
local attached_clients = vim.lsp.get_clients({ bufnr = buffer })
if #attached_clients == 0 then return 'LSP: 0' end
local preview_client = attached_clients[1]
return ('LSP: %s (%d)'):format(preview_client.name, #attached_clients)
end
local function diff_source()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed
}
end
end
lualine.setup {
sections = {
lualine_a = {'mode'},
lualine_b = {
{'b:gitsigns_head', icon = ''},
{'diff', source = diff_source},
'diagnostics',
active_lsps
},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {
{
'filename',

View file

@ -0,0 +1,35 @@
-- {{ ansible_managed }}
local cmp = require('cmp')
cmp.setup {
mapping = {
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end,
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end,
},
sources = {
{ name = 'nvim_lsp' },
},
}

View file

@ -1,39 +0,0 @@
-- {{ ansible_managed }}
local nvim_tree = require('nvim-tree');
local nvim_tree_icons = require('nvim-web-devicons');
local api = require('nvim-tree.api')
local function toggle_tree()
api.tree.toggle({ find_file = true, update_root = true, focus = true })
end
vim.keymap.set('n', '<C-E>', toggle_tree, { noremap = true, silent = true })
local function my_on_attach(bufnr)
local function opts(desc)
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
vim.keymap.set('n', '<C-]>', api.tree.change_root_to_node, opts('CD'))
vim.keymap.set('n', '<C-H>', api.tree.toggle_hidden_filter, opts('Toggle filter: Dotfiles'))
vim.keymap.set('n', '<CR>', api.node.open.edit, opts('Open'))
vim.keymap.set('n', 'E', api.tree.expand_all, opts('Expand All'))
vim.keymap.set('n', 'F', api.live_filter.clear, opts('Live filter: Clear'))
vim.keymap.set('n', 'f', api.live_filter.start, opts('Live filter: Start'))
vim.keymap.set('n', 'g?', api.tree.toggle_help, opts('Help'))
vim.keymap.set('n', 'I', api.tree.toggle_gitignore_filter, opts('Toggle filter: Git Ignore'))
vim.keymap.set('n', 'm', api.marks.toggle, opts('Toggle bookmark'))
vim.keymap.set('n', 'q', api.tree.close, opts('Close'))
vim.keymap.set('n', 'R', api.tree.reload, opts('Refresh'))
vim.keymap.set('n', 'S', api.tree.search_node, opts('Search'))
vim.keymap.set('n', 'a', api.fs.create, opts('Create a file'))
vim.keymap.set("n", "r", api.fs.rename, opts("Rename"))
vim.keymap.set('n', 'd', api.fs.remove, opts('Delete a file'))
end
nvim_tree.setup {
on_attach = my_on_attach,
}
nvim_tree_icons.setup();

View file

@ -20,8 +20,7 @@ vim.o.hidden = true
-- folding
vim.o.foldmethod = 'expr'
vim.o.foldlevel = 99
vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
-- don't open folds when jumping over one with (, {, [[ or [{
vim.opt.foldopen = vim.opt.foldopen - { 'block' }
@ -50,17 +49,11 @@ vim.o.cursorline = true
-- theme related
vim.o.termguicolors = true
vim.o.background = 'light'
-- use a dedicated file explorer
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- load project specific configuration files
vim.o.exrc = true
vim.o.secure = true
-- disable mouse options
vim.opt.mouse = ''
-- enable statusbar
vim.o.laststatus = 2
vim.o.statusline = ' %F %m%r%w %= %{hostname()} %{strlen(&ft)?&ft:"none"} %{(&bomb?",BOM":"")} %{&ff} %l/%L %c %P'
-- python interpreter
vim.g.python3_host_prog = '/usr/bin/python3'
vim.g.python3_host_prog = './env/bin/python'

View file

@ -1,7 +0,0 @@
-- {{ ansible_managed }}
local source_link = require('source-link')
source_link.setup()
vim.keymap.set('n', '<C-L>', '<cmd>:SourceOpen<CR>', { noremap = true, silent = true })

View file

@ -1,38 +1,12 @@
-- {{ ansible_managed }}
local telescope = require('telescope')
local builtin = require('telescope.builtin')
local opts = { noremap = true, silent = true }
local find_files_unignored = function()
builtin.find_files { hidden = true, no_ignore = true }
end
local live_grep_unignored = function()
builtin.live_grep { additional_args = { '--unrestricted', '--unrestricted' } }
end
vim.keymap.set('n', 'ff', builtin.find_files, opts)
vim.keymap.set('n', 'fF', find_files_unignored, opts)
vim.keymap.set('n', 'fg', builtin.live_grep, opts)
vim.keymap.set('n', 'fG', live_grep_unignored, opts)
vim.keymap.set('n', 'fb', builtin.current_buffer_fuzzy_find, opts)
vim.keymap.set('n', 'fB', builtin.buffers, opts)
vim.keymap.set('n', 'fh', builtin.help_tags, opts)
vim.keymap.set('n', 'fd', builtin.diagnostics, opts)
vim.keymap.set('n', 'fj', builtin.jumplist, opts)
vim.keymap.set('n', 'fl', builtin.loclist, opts)
vim.keymap.set('n', 'fq', builtin.quickfix, opts)
vim.keymap.set('n', 'fm', builtin.marks, opts)
vim.keymap.set('n', 'ft', builtin.treesitter, opts)
local telescope = require('telescope');
telescope.setup({
defaults = {
layout_strategy = 'vertical',
layout_config = {
prompt_position = 'bottom',
vertical = { width = 0.8, height = 0.9 }
vertical = { width = 0.5, height = 0.7 }
},
},
})

View file

@ -7,10 +7,8 @@ local tree_sitter_config = require('nvim-treesitter.configs')
tree_sitter_config.setup {
ensure_installed = {
'lua', 'yaml', 'bash', 'python', 'javascript', 'typescript', 'css', 'scss',
'html', 'htmldjango', 'sql', 'json', 'dockerfile', 'markdown', 'rst', 'tmux',
'xml', 'toml', 'editorconfig', 'diff', 'gitcommit', 'git_config', 'gitignore',
'gitattributes', 'make', 'nginx', 'vim', 'vimdoc', 'passwd', 'regex'
'lua', 'yaml', 'bash', 'python', 'javascript', 'css', 'scss', 'html',
'htmldjango', 'json', 'dockerfile', 'markdown',
},
auto_install = true,
highlight = {

1
templates/subgid.j2 Normal file
View file

@ -0,0 +1 @@
{{ ansible_user_id }}:231072:65536

1
templates/subuid.j2 Normal file
View file

@ -0,0 +1 @@
{{ ansible_user_id }}:231072:65536

View file

@ -1,19 +0,0 @@
#!/usr/bin/env sh
#
# {{ ansible_managed }}
#
# Toggle the current window (all panes) between light and dark themes.
set -e
current_window_style=$(tmux show -Av window-style)
case $current_window_style in
'fg=#000000,bg=#eff0f1')
tmux source-file ~/.config/tmux/dark.conf
;;
*)
# Change back to the default window style.
tmux source-file ~/.config/tmux/light.conf
;;
esac

100
vars/archlinux.yml Normal file
View file

@ -0,0 +1,100 @@
ansible_connection: local
ansible_python_interpreter: '/usr/bin/python'
packages:
- python
- git
- vim
- neovim
- wl-clipboard
- npm
- docker
- docker-compose
- fuse-overlayfs
- ttf-ibm-plex
- slirp4netns
- tree-sitter
- ripgrep
aur_packages:
- {
url: 'https://aur.archlinux.org/docker-rootless-extras.git',
name: 'docker-rootless',
package_name: 'docker-rootless-extras',
version: '27.1.2-1',
arch: 'x86_64',
}
- {
url: 'https://aur.archlinux.org/nvm.git',
name: 'nvm',
package_name: 'nvm',
version: '0.40.0-1',
arch: 'any',
}
aur_build_dir: '/usr/local/src'
python_build_dir: '/usr/local/src'
python_install_dir: '/opt'
# Note that the "python-lsp-server" and "neovim" python
# packages should be installed to the corresponding virtualenv as well.
language_servers:
- {
package: ansible-language-server,
server_name: 'ansiblels',
auto_setup: true
}
- {
package: yaml-language-server,
server_name: 'yamlls',
auto_setup: true
}
- {
package: typescript-language-server,
server_name: 'tsserver',
auto_setup: true
}
- {
package: vscode-html-languageserver,
server_name: 'html',
auto_setup: false
}
- {
package: vscode-json-languageserver,
server_name: 'jsonls',
auto_setup: true
}
- {
package: vscode-css-languageserver,
server_name: 'cssls',
auto_setup: true
}
- {
package: bash-language-server,
server_name: 'bashls',
auto_setup: true
}
- {
package: lua-language-server,
server_name: 'lua_ls',
auto_setup: true
}
- {
package: ruff-lsp,
server_name: 'ruff_lsp',
auto_setup: false
}
- {
package: pyright,
server_name: 'pyright',
auto_setup: false
}
python_download_url: 'https://www.python.org/ftp/python'
python_versions:
- { version: 3.11.9, path: 'python3.11', binary: 'python3.11' }
- { version: 3.10.0, path: 'python3.10', binary: 'python3.10' }
- { version: 3.9.14, path: 'python3.9', binary: 'python3.9' }
- { version: 3.8.14, path: 'python3.8', binary: 'python3.8' }
- { version: 3.7.14, path: 'python3.7', binary: 'python3.7' }
- { version: 3.6.15, path: 'python3.6', binary: 'python3.6' }

33
vars/debian.yml Normal file
View file

@ -0,0 +1,33 @@
ansible_connection: local
ansible_python_interpreter: '/usr/bin/python3'
packages:
- python3
- git
- vim
- npm
- libtree-sitter0
- ripgrep
neovim:
version: 'v0.10.1'
install_path: '/opt/nvim'
download_checksum: 4867de01a17f6083f902f8aa5215b40b0ed3a36e83cc0293de3f11708f1f9793
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
language_servers:
- {
package: '@ansible/ansible-language-server',
server_name: 'ansiblels',
auto_setup: true
}
- {
package: yaml-language-server,
server_name: 'yamlls',
auto_setup: true
}
- {
package: bash-language-server,
server_name: 'bashls',
auto_setup: true
}

47
vars/main.yml Normal file
View file

@ -0,0 +1,47 @@
ansible_connection: local
ansible_python_interpreter: '/usr/bin/env python'
xdg_config_dir: '{{ ansible_env.HOME }}/.config'
xdg_data_dir: '{{ ansible_env.HOME }}/.local/share'
dotfiles_repo: 'git@git.fudiggity.nl:sonny/dotfiles.git'
public_dotfiles_repo: 'git@git.fudiggity.nl:sonny/dotfiles.git'
neovim_plugins:
- { url: 'https://github.com/preservim/nerdtree', name: 'nerdtree' }
- { url: 'https://github.com/neovim/nvim-lspconfig', name: 'nvim-lspconfig' }
- { url: 'https://github.com/hrsh7th/nvim-cmp/', name: 'nvim-cmp' }
- { url: 'https://github.com/hrsh7th/cmp-nvim-lsp/', name: 'cmp-nvim-lsp' }
- { url: 'https://github.com/nvim-treesitter/nvim-treesitter', name: 'nvim-treesitter' }
- { url: 'https://github.com/nvim-lua/plenary.nvim', name: 'plenary.nvim' }
- {
url: 'https://github.com/nvim-telescope/telescope-fzf-native.nvim',
name: 'telescope-fzf-native.nvim',
}
- {
url: 'https://github.com/nvim-telescope/telescope.nvim',
name: 'telescope.nvim',
version: '0.1.x',
}
- { url: 'https://github.com/L3MON4D3/LuaSnip', name: 'luasnip', version: 'v1.0.0' }
- {
url: 'https://github.com/lewis6991/gitsigns.nvim',
name: 'gitsigns.nvim',
version: 'v0.9.0',
}
- { url: 'https://github.com/sainnhe/edge', name: 'edge' }
- { url: 'https://github.com/nvim-lualine/lualine.nvim', name: 'lualine' }
- {
url: 'https://github.com/catppuccin/nvim',
name: 'catppuccin',
version: '045e3499d9ec8d84635fb08877ae44fd33f6a38d',
}
- {
url: 'https://github.com/lukas-reineke/indent-blankline.nvim',
name: 'indent-blankline.nvim',
version: 'v3.7.2',
}
gitlab_domain: 'git.fudiggity.nl'
gitlab_host_key: 'git.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINh/SlWqWmH2FG+duiJkkSpq0Fm+wUAmc//4/CbzbX5+'