Compare commits
1 commit
main
...
legacy-for
| Author | SHA1 | Date | |
|---|---|---|---|
| 12297f538e |
34 changed files with 385 additions and 525 deletions
|
|
@ -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',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
})
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
session_name=${PWD##*/}
|
session_name=${PWD##*/}
|
||||||
project_directory="$HOME/development/$session_name"
|
project_directory="$HOME/development/$session_name"
|
||||||
|
enable_formatting="false"
|
||||||
|
|
||||||
tmux has-session -t $session_name
|
tmux has-session -t $session_name
|
||||||
|
|
||||||
|
|
@ -10,7 +11,8 @@ then
|
||||||
tmux new-session \
|
tmux new-session \
|
||||||
-c $project_directory \
|
-c $project_directory \
|
||||||
-ds $session_name \
|
-ds $session_name \
|
||||||
-e "project_dir=$project_directory"
|
-e "project_dir=$project_directory" \
|
||||||
|
-e "enable_formatting=$enable_formatting"
|
||||||
|
|
||||||
# FIRST WINDOW
|
# FIRST WINDOW
|
||||||
tmux send-keys -t $session_name:0 'source ./env/bin/activate' C-m
|
tmux send-keys -t $session_name:0 'source ./env/bin/activate' C-m
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
---
|
dotfiles_repo: 'git@forgejo.fudiggity.nl:sonny/dotfiles.git'
|
||||||
dotfiles_repo: "git@forgejo.fudiggity.nl:sonny/dotfiles.git"
|
|
||||||
|
|
||||||
git_domain: "forgejo.fudiggity.nl"
|
git_domain: 'forgejo.fudiggity.nl'
|
||||||
git_host_key: "forgejo.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqEej87ukSK7KGi7e0q+oTrru4h7Fm6fK8GgiMtu01+"
|
git_host_key: 'forgejo.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqEej87ukSK7KGi7e0q+oTrru4h7Fm6fK8GgiMtu01+'
|
||||||
|
|
||||||
git_name: Sonny Bakker
|
git_name: Sonny Bakker
|
||||||
git_email: sonny871@hotmail.com
|
git_email: sonny871@hotmail.com
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,46 @@
|
||||||
---
|
|
||||||
neovim_plugins:
|
neovim_plugins:
|
||||||
- url: "https://forgejo.fudiggity.nl/sonny/source-link.lua"
|
- url: 'https://forgejo.fudiggity.nl/sonny/source-link.lua'
|
||||||
name: "source-link"
|
name: 'source-link'
|
||||||
- url: "https://github.com/nvim-tree/nvim-tree.lua"
|
- url: 'https://github.com/nvim-tree/nvim-tree.lua'
|
||||||
name: "nvim-tree"
|
name: 'nvim-tree'
|
||||||
- url: "https://github.com/nvim-tree/nvim-web-devicons"
|
- url: 'https://github.com/nvim-tree/nvim-web-devicons'
|
||||||
name: "nvim-tree-icons"
|
name: 'nvim-tree-icons'
|
||||||
- url: "https://github.com/neovim/nvim-lspconfig"
|
- url: 'https://github.com/neovim/nvim-lspconfig'
|
||||||
name: "nvim-lspconfig"
|
name: 'nvim-lspconfig'
|
||||||
- url: "https://github.com/hrsh7th/nvim-cmp"
|
- url: 'https://github.com/hrsh7th/nvim-cmp'
|
||||||
name: "nvim-cmp"
|
name: 'nvim-cmp'
|
||||||
- url: "https://github.com/hrsh7th/cmp-buffer"
|
- url: 'https://github.com/hrsh7th/cmp-buffer'
|
||||||
name: "cmp-buffer"
|
name: 'cmp-buffer'
|
||||||
- url: "https://github.com/hrsh7th/cmp-path"
|
- url: 'https://github.com/hrsh7th/cmp-path'
|
||||||
name: "cmp-path"
|
name: 'cmp-path'
|
||||||
- url: "https://github.com/hrsh7th/cmp-omni"
|
- url: 'https://github.com/hrsh7th/cmp-omni'
|
||||||
name: "cmp-omni"
|
name: 'cmp-omni'
|
||||||
- url: "https://github.com/hrsh7th/cmp-nvim-lsp"
|
- url: 'https://github.com/hrsh7th/cmp-nvim-lsp'
|
||||||
name: "cmp-nvim-lsp"
|
name: 'cmp-nvim-lsp'
|
||||||
- url: "https://github.com/hrsh7th/cmp-nvim-lua"
|
- url: 'https://github.com/hrsh7th/cmp-nvim-lua'
|
||||||
name: "cmp-nvim-lua"
|
name: 'cmp-nvim-lua'
|
||||||
- url: "https://github.com/nvim-treesitter/nvim-treesitter"
|
- url: 'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||||
name: "nvim-treesitter"
|
name: 'nvim-treesitter'
|
||||||
version: master # main seems broken?
|
- url: 'https://github.com/nvim-lua/plenary.nvim'
|
||||||
- url: "https://github.com/nvim-lua/plenary.nvim"
|
name: 'plenary.nvim'
|
||||||
name: "plenary.nvim"
|
- url: 'https://github.com/nvim-telescope/telescope-fzf-native.nvim'
|
||||||
- url: "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
name: 'telescope-fzf-native.nvim'
|
||||||
name: "telescope-fzf-native.nvim"
|
- url: 'https://github.com/nvim-telescope/telescope.nvim'
|
||||||
- url: "https://github.com/nvim-telescope/telescope.nvim"
|
name: 'telescope.nvim'
|
||||||
name: "telescope.nvim"
|
version: '0.1.x'
|
||||||
version: "0.1.x"
|
- url: 'https://github.com/L3MON4D3/LuaSnip'
|
||||||
- url: "https://github.com/L3MON4D3/LuaSnip"
|
name: 'luasnip'
|
||||||
name: "luasnip"
|
version: 'v1.0.0'
|
||||||
version: "v1.0.0"
|
- url: 'https://github.com/lewis6991/gitsigns.nvim'
|
||||||
- url: "https://github.com/lewis6991/gitsigns.nvim"
|
name: 'gitsigns.nvim'
|
||||||
name: "gitsigns.nvim"
|
version: 'v0.9.0'
|
||||||
version: "v0.9.0"
|
- url: 'https://github.com/nvim-lualine/lualine.nvim'
|
||||||
- url: "https://github.com/nvim-lualine/lualine.nvim"
|
name: 'lualine'
|
||||||
name: "lualine"
|
- url: 'https://github.com/lukas-reineke/indent-blankline.nvim'
|
||||||
- url: "https://github.com/lukas-reineke/indent-blankline.nvim"
|
name: 'indent-blankline.nvim'
|
||||||
name: "indent-blankline.nvim"
|
version: 'v3.7.2'
|
||||||
version: "v3.7.2"
|
- url: 'https://github.com/projekt0n/github-nvim-theme.git'
|
||||||
- url: "https://github.com/projekt0n/github-nvim-theme.git"
|
name: 'github-colors'
|
||||||
name: "github-colors"
|
version: 'v1.1.2'
|
||||||
version: "v1.1.2"
|
|
||||||
- url: "https://github.com/stevearc/conform.nvim.git"
|
|
||||||
name: "conform.nvim"
|
|
||||||
version: "v9.0.0"
|
|
||||||
|
|
||||||
language_servers: []
|
language_servers: []
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
---
|
xdg_config_dir: '{{ ansible_env.HOME }}/.config'
|
||||||
xdg_config_dir: "{{ ansible_env.HOME }}/.config"
|
xdg_data_dir: '{{ ansible_env.HOME }}/.local/share'
|
||||||
xdg_data_dir: "{{ ansible_env.HOME }}/.local/share"
|
|
||||||
|
|
||||||
packages: []
|
packages: []
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,40 @@
|
||||||
---
|
|
||||||
aur_packages:
|
aur_packages:
|
||||||
- url: "https://aur.archlinux.org/nvm.git"
|
- url: 'https://aur.archlinux.org/nvm.git'
|
||||||
name: "nvm"
|
name: 'nvm'
|
||||||
package_name: "nvm"
|
package_name: 'nvm'
|
||||||
version: "0.40.0-1"
|
version: '0.40.0-1'
|
||||||
arch: "any"
|
arch: 'any'
|
||||||
|
|
||||||
aur_build_dir: "/usr/local/src"
|
aur_build_dir: '/usr/local/src'
|
||||||
python_build_dir: "/usr/local/src"
|
python_build_dir: '/usr/local/src'
|
||||||
python_install_dir: "/opt"
|
python_install_dir: '/opt'
|
||||||
|
|
||||||
python_download_url: "https://www.python.org/ftp/python"
|
python_download_url: 'https://www.python.org/ftp/python'
|
||||||
python_versions:
|
python_versions:
|
||||||
- version: 3.12.9
|
- version: 3.12.9
|
||||||
path: "python3.12"
|
path: 'python3.12'
|
||||||
binary: "python3.12"
|
binary: 'python3.12'
|
||||||
|
|
||||||
- version: 3.11.9
|
- version: 3.11.9
|
||||||
path: "python3.11"
|
path: 'python3.11'
|
||||||
binary: "python3.11"
|
binary: 'python3.11'
|
||||||
|
|
||||||
- version: 3.10.0
|
- version: 3.10.0
|
||||||
path: "python3.10"
|
path: 'python3.10'
|
||||||
binary: "python3.10"
|
binary: 'python3.10'
|
||||||
|
|
||||||
- version: 3.9.14
|
- version: 3.9.14
|
||||||
path: "python3.9"
|
path: 'python3.9'
|
||||||
binary: "python3.9"
|
binary: 'python3.9'
|
||||||
|
|
||||||
- version: 3.8.14
|
- version: 3.8.14
|
||||||
path: "python3.8"
|
path: 'python3.8'
|
||||||
binary: "python3.8"
|
binary: 'python3.8'
|
||||||
|
|
||||||
- version: 3.7.14
|
- version: 3.7.14
|
||||||
path: "python3.7"
|
path: 'python3.7'
|
||||||
binary: "python3.7"
|
binary: 'python3.7'
|
||||||
|
|
||||||
- version: 3.6.15
|
- version: 3.6.15
|
||||||
path: "python3.6"
|
path: 'python3.6'
|
||||||
binary: "python3.6"
|
binary: 'python3.6'
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,48 @@
|
||||||
---
|
|
||||||
language_servers:
|
language_servers:
|
||||||
- package: ansible-language-server
|
- package: ansible-language-server
|
||||||
server_name: "ansiblels"
|
server_name: 'ansiblels'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: typescript-language-server
|
- package: typescript-language-server
|
||||||
server_name: "ts_ls"
|
server_name: 'ts_ls'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: vscode-json-languageserver
|
- package: vscode-json-languageserver
|
||||||
server_name: "jsonls"
|
server_name: 'jsonls'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: vscode-css-languageserver
|
- package: vscode-css-languageserver
|
||||||
server_name: "cssls"
|
server_name: 'cssls'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: bash-language-server
|
- package: bash-language-server
|
||||||
server_name: "bashls"
|
server_name: 'bashls'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: marksman
|
- package: marksman
|
||||||
server_name: "marksman"
|
server_name: 'marksman'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: esbonio
|
- package: esbonio
|
||||||
server_name: "esbonio"
|
server_name: 'esbonio'
|
||||||
auto_setup: false
|
auto_setup: true
|
||||||
|
|
||||||
- package: lua-language-server
|
- package: lua-language-server
|
||||||
server_name: "lua_ls"
|
server_name: 'lua_ls'
|
||||||
auto_setup: false
|
auto_setup: false
|
||||||
|
|
||||||
- package: yaml-language-server
|
- package: yaml-language-server
|
||||||
server_name: "yamlls"
|
server_name: 'yamlls'
|
||||||
auto_setup: false
|
auto_setup: false
|
||||||
|
|
||||||
- package: vscode-html-languageserver
|
- package: vscode-html-languageserver
|
||||||
server_name: "html"
|
server_name: 'html'
|
||||||
auto_setup: false
|
auto_setup: false
|
||||||
|
|
||||||
- package: ruff
|
- package: ruff-lsp
|
||||||
server_name: "ruff"
|
server_name: 'ruff'
|
||||||
auto_setup: true
|
auto_setup: false
|
||||||
|
|
||||||
- package: pyright
|
- package: pyright
|
||||||
server_name: "pyright"
|
server_name: 'pyright'
|
||||||
auto_setup: false
|
auto_setup: false
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
packages:
|
packages:
|
||||||
- python
|
- python
|
||||||
- git
|
- git
|
||||||
|
|
@ -15,12 +14,4 @@ packages:
|
||||||
- slirp4netns
|
- slirp4netns
|
||||||
- tree-sitter
|
- tree-sitter
|
||||||
- ripgrep
|
- ripgrep
|
||||||
- fd
|
|
||||||
- uv
|
- uv
|
||||||
- fakeroot
|
|
||||||
- debugedit
|
|
||||||
- which
|
|
||||||
- gcc
|
|
||||||
- make
|
|
||||||
- esbonio
|
|
||||||
- marksman
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
---
|
|
||||||
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
|
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
|
||||||
language_servers:
|
language_servers:
|
||||||
- package: "@ansible/ansible-language-server"
|
- package: '@ansible/ansible-language-server'
|
||||||
server_name: "ansiblels"
|
server_name: 'ansiblels'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: yaml-language-server
|
- package: yaml-language-server
|
||||||
server_name: "yamlls"
|
server_name: 'yamlls'
|
||||||
auto_setup: false
|
auto_setup: false
|
||||||
|
|
||||||
- package: bash-language-server
|
- package: bash-language-server
|
||||||
server_name: "bashls"
|
server_name: 'bashls'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
neovim:
|
neovim:
|
||||||
version: "v0.11.4"
|
version: 'v0.10.4'
|
||||||
install_path: "/opt/nvim"
|
install_path: '/opt/nvim'
|
||||||
download_checksum: sha256:a74740047e73b2b380d63a474282814063d10650cd6cc95efa16d1713c7e616c
|
download_checksum: sha256:95aaa8e89473f5421114f2787c13ae0ec6e11ebbd1a13a1bd6fcf63420f8073f
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
packages:
|
packages:
|
||||||
- python3
|
- python3
|
||||||
- git
|
- git
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
personal:
|
personal:
|
||||||
hosts:
|
hosts:
|
||||||
xps: &xps
|
xps: &xps
|
||||||
|
|
@ -7,9 +6,6 @@ personal:
|
||||||
desktop: &desktop
|
desktop: &desktop
|
||||||
ansible_connection: local
|
ansible_connection: local
|
||||||
ansible_become_method: community.general.run0
|
ansible_become_method: community.general.run0
|
||||||
htpc: &htpc
|
|
||||||
ansible_connection: local
|
|
||||||
ansible_become_method: community.general.run0
|
|
||||||
fudiggity: &fudiggity
|
fudiggity: &fudiggity
|
||||||
ansible_connection: local
|
ansible_connection: local
|
||||||
|
|
||||||
|
|
@ -17,11 +13,10 @@ debian:
|
||||||
hosts:
|
hosts:
|
||||||
fudiggity:
|
fudiggity:
|
||||||
<<: *fudiggity
|
<<: *fudiggity
|
||||||
|
|
||||||
arch:
|
arch:
|
||||||
hosts:
|
hosts:
|
||||||
xps:
|
xps:
|
||||||
<<: *xps
|
<<: *xps
|
||||||
desktop:
|
desktop:
|
||||||
<<: *desktop
|
<<: *desktop
|
||||||
htpc:
|
|
||||||
<<: *htpc
|
|
||||||
|
|
|
||||||
39
playbook.yml
39
playbook.yml
|
|
@ -1,44 +1,43 @@
|
||||||
---
|
|
||||||
- name: Development provisioning
|
- name: Development provisioning
|
||||||
hosts:
|
hosts:
|
||||||
- personal
|
- xps
|
||||||
- arch
|
- desktop
|
||||||
- debian
|
- fudiggity
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Verifying that a limit is set
|
- name: Verifying that a limit is set
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
msg: "This playbook cannot be run with no limit"
|
msg: 'This playbook cannot be run with no limit'
|
||||||
run_once: true
|
run_once: true
|
||||||
when: ansible_limit is not defined
|
when: ansible_limit is not defined
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: "{{ item }}"
|
name: '{{ item }}'
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ packages }}"
|
loop: '{{ packages }}'
|
||||||
|
|
||||||
- name: Add git forge to known hosts
|
- name: Add git forge to known hosts
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: common
|
name: common
|
||||||
tasks_from: "known_hosts.yml"
|
tasks_from: 'known_hosts.yml'
|
||||||
vars:
|
vars:
|
||||||
user: "{{ ansible_user_id }}"
|
user: '{{ ansible_user_id }}'
|
||||||
items:
|
items:
|
||||||
- domain: "{{ git_domain }}"
|
- domain: '{{ git_domain }}'
|
||||||
key: "{{ git_host_key }}"
|
key: '{{ git_host_key }}'
|
||||||
when: ansible_hostname != 'fudiggity'
|
when: ansible_hostname != 'fudiggity'
|
||||||
tasks:
|
tasks:
|
||||||
- name: Setup dotfiles
|
- name: Setup dotfiles
|
||||||
ansible.builtin.import_tasks: "tasks/dotfiles.yml"
|
ansible.builtin.import_tasks: 'tasks/dotfiles.yml'
|
||||||
tags: dotfiles
|
tags: dotfiles
|
||||||
|
|
||||||
- name: Include generic neovim tasks
|
- name: Include generic neovim tasks
|
||||||
ansible.builtin.import_tasks: "tasks/neovim.yml"
|
ansible.builtin.import_tasks: 'tasks/neovim.yml'
|
||||||
tags: neovim
|
tags: neovim
|
||||||
|
|
||||||
- name: Include debian neovim tasks
|
- name: Include debian neovim tasks
|
||||||
ansible.builtin.import_tasks: "tasks/debian/neovim.yml"
|
ansible.builtin.import_tasks: 'tasks/debian/neovim.yml'
|
||||||
when: "'debian' in group_names"
|
when: "'debian' in group_names"
|
||||||
tags: neovim
|
tags: neovim
|
||||||
|
|
||||||
|
|
@ -50,23 +49,23 @@
|
||||||
manager: pacman
|
manager: pacman
|
||||||
|
|
||||||
- name: Include arch neovim tasks
|
- name: Include arch neovim tasks
|
||||||
ansible.builtin.import_tasks: "tasks/arch/neovim.yml"
|
ansible.builtin.import_tasks: 'tasks/arch/neovim.yml'
|
||||||
when: "'arch' in group_names"
|
when: "'arch' in group_names"
|
||||||
tags: neovim
|
tags: neovim
|
||||||
|
|
||||||
- name: Install AUR packages
|
- name: Install AUR packages
|
||||||
ansible.builtin.import_tasks: "tasks/arch/aur.yml"
|
ansible.builtin.import_tasks: 'tasks/arch/aur.yml'
|
||||||
tags: aur
|
tags: aur
|
||||||
|
|
||||||
- name: Setup docker
|
- name: Setup docker
|
||||||
ansible.builtin.import_tasks: "tasks/arch/docker.yml"
|
ansible.builtin.import_tasks: 'tasks/arch/docker.yml'
|
||||||
tags: docker
|
tags: docker
|
||||||
|
|
||||||
- name: Setup python versions
|
- name: Setup python versions
|
||||||
ansible.builtin.include_tasks: "tasks/arch/python.yml"
|
ansible.builtin.include_tasks: 'tasks/arch/python.yml'
|
||||||
loop: "{{ python_versions }}"
|
loop: '{{ python_versions }}'
|
||||||
tags: python
|
tags: python
|
||||||
|
|
||||||
- name: Setup NVM
|
- name: Setup NVM
|
||||||
ansible.builtin.import_tasks: "tasks/arch/nvm.yml"
|
ansible.builtin.import_tasks: 'tasks/arch/nvm.yml'
|
||||||
tags: nvm
|
tags: nvm
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
---
|
- src: git+https://git.fudiggity.nl/ansible/common.git
|
||||||
- src: git+https://forgejo.fudiggity.nl/sonny/common-ansible.git
|
|
||||||
name: common
|
name: common
|
||||||
version: master
|
version: master
|
||||||
scm: git
|
scm: git
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
---
|
|
||||||
- name: Set package directory
|
- name: Set package directory
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
build_dir: "{{ aur_build_dir }}/{{ item.name }}"
|
build_dir: '{{ aur_build_dir }}/{{ item.name }}'
|
||||||
|
|
||||||
- name: "Retrieve package name for {{ item.name }}"
|
- name: 'Retrieve package name for {{ item.name }}'
|
||||||
ansible.builtin.command:
|
command:
|
||||||
argv:
|
argv:
|
||||||
- grep
|
- grep
|
||||||
- --only-matching
|
- --only-matching
|
||||||
|
|
@ -13,8 +12,8 @@
|
||||||
- "{{ build_dir }}/PKGBUILD"
|
- "{{ build_dir }}/PKGBUILD"
|
||||||
register: pkg_name
|
register: pkg_name
|
||||||
|
|
||||||
- name: "Retrieve package version for {{ item.name }}"
|
- name: 'Retrieve package version for {{ item.name }}'
|
||||||
ansible.builtin.command:
|
command:
|
||||||
argv:
|
argv:
|
||||||
- grep
|
- grep
|
||||||
- --only-matching
|
- --only-matching
|
||||||
|
|
@ -23,8 +22,8 @@
|
||||||
- "{{ build_dir }}/PKGBUILD"
|
- "{{ build_dir }}/PKGBUILD"
|
||||||
register: pkg_version
|
register: pkg_version
|
||||||
|
|
||||||
- name: "Retrieve package release for {{ item.name }}"
|
- name: 'Retrieve package release for {{ item.name }}'
|
||||||
ansible.builtin.command:
|
command:
|
||||||
argv:
|
argv:
|
||||||
- grep
|
- grep
|
||||||
- --only-matching
|
- --only-matching
|
||||||
|
|
@ -35,20 +34,20 @@
|
||||||
|
|
||||||
- name: Set package filename & version
|
- name: Set package filename & version
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
package_filename: "{{ pkg_name.stdout }}-{{ pkg_version.stdout }}-{{ pkg_release.stdout }}-{{ item.arch }}.pkg.tar.zst"
|
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('')
|
installed_version: ansible_facts.packages[item.package_name].version|default('')
|
||||||
|
|
||||||
- name: "Build package {{ item.name }}"
|
- name: 'Build package {{ item.name }}'
|
||||||
ansible.builtin.command: "makepkg --syncdeps --rmdeps --clean --noconfirm --force"
|
ansible.builtin.command: 'makepkg --syncdeps --rmdeps --clean --noconfirm --force'
|
||||||
args:
|
args:
|
||||||
chdir: "{{ build_dir }}"
|
chdir: '{{ build_dir }}'
|
||||||
creates: "{{ build_dir }}/{{ package_filename }}"
|
creates: '{{ build_dir }}/{{ package_filename }}'
|
||||||
register: package_build
|
register: package_build
|
||||||
when: item.version != installed_version
|
when: item.version != installed_version
|
||||||
|
|
||||||
- name: "Install {{ item.name }}"
|
- name: 'Install {{ item.name }}'
|
||||||
become: true
|
become: true
|
||||||
community.general.pacman:
|
community.general.pacman:
|
||||||
name: "{{ build_dir }}/{{ package_filename }}"
|
name: '{{ build_dir }}/{{ package_filename }}'
|
||||||
state: present
|
state: present
|
||||||
when: item.version != installed_version
|
when: item.version != installed_version
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,26 @@
|
||||||
---
|
|
||||||
- name: Retrieve directory stats
|
- name: Retrieve directory stats
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ aur_build_dir }}/{{ item.name }}"
|
path: '{{ aur_build_dir }}/{{ item.name }}'
|
||||||
loop: "{{ aur_packages }}"
|
loop: '{{ aur_packages }}'
|
||||||
|
|
||||||
- name: Clone aur packages
|
- name: Clone aur packages
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "{{ item.url }}"
|
repo: '{{ item.url }}'
|
||||||
dest: "{{ aur_build_dir }}/{{ item.name }}"
|
dest: '{{ aur_build_dir }}/{{ item.name }}'
|
||||||
update: true
|
update: true
|
||||||
loop: "{{ aur_packages }}"
|
loop: '{{ aur_packages }}'
|
||||||
|
|
||||||
- name: Change aur package directories owner
|
- name: Change aur package directories owner
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ aur_build_dir }}/{{ item.name }}"
|
path: '{{ aur_build_dir }}/{{ item.name }}'
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ ansible_user_id }}"
|
owner: '{{ ansible_user_id }}'
|
||||||
group: "{{ ansible_user_id }}"
|
group: '{{ ansible_user_id }}'
|
||||||
recurse: true
|
recurse: true
|
||||||
loop: "{{ aur_packages }}"
|
loop: '{{ aur_packages }}'
|
||||||
|
|
||||||
- name: Build & install aur packages
|
- name: Build & install aur packages
|
||||||
ansible.builtin.include_tasks: "tasks/arch/aur-package.yml"
|
ansible.builtin.include_tasks: 'tasks/arch/aur-package.yml'
|
||||||
loop: "{{ aur_packages }}"
|
loop: '{{ aur_packages }}'
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
---
|
|
||||||
- name: Remove docker mapping files
|
- name: Remove docker mapping files
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: '{{ item }}'
|
||||||
state: absent
|
state: absent
|
||||||
loop:
|
loop:
|
||||||
- /etc/subgid
|
- /etc/subgid
|
||||||
|
|
@ -11,38 +10,38 @@
|
||||||
- name: Setup desktop configuration
|
- name: Setup desktop configuration
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "files/desktop/docker-daemon.json"
|
path: 'files/desktop/docker-daemon.json'
|
||||||
dest: "/etc/docker/daemon.json"
|
dest: '/etc/docker/daemon.json'
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
when: ansible_hostname == 'desktop'
|
when: ansible_hostname == 'desktop'
|
||||||
|
|
||||||
- name: Remove user setup desktop configuration
|
- name: Remove user setup desktop configuration
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ xdg_config_dir }}/docker/daemon.json"
|
path: '{{ xdg_config_dir }}/docker/daemon.json'
|
||||||
state: absent
|
state: absent
|
||||||
when: ansible_hostname == 'desktop'
|
when: ansible_hostname == 'desktop'
|
||||||
|
|
||||||
- name: Check for .bashrc.override
|
- name: Check for .bashrc.override
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ ansible_env.HOME }}/.bashrc.override"
|
path: '{{ ansible_env.HOME }}/.bashrc.override'
|
||||||
register: bashrc_override
|
register: bashrc_override
|
||||||
|
|
||||||
- name: Create .bashrc.override
|
- name: Create .bashrc.override
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ ansible_env.HOME }}/.bashrc.override"
|
path: '{{ ansible_env.HOME }}/.bashrc.override'
|
||||||
state: touch
|
state: touch
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
when: not bashrc_override.stat.exists
|
when: not bashrc_override.stat.exists
|
||||||
|
|
||||||
- name: Remove rootless DOCKER_HOST variable assignment
|
- name: Remove rootless DOCKER_HOST variable assignment
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ ansible_env.HOME }}/.bashrc.override"
|
path: '{{ ansible_env.HOME }}/.bashrc.override'
|
||||||
regexp: "^export DOCKER_HOST="
|
regexp: '^export DOCKER_HOST='
|
||||||
line: ""
|
line: ''
|
||||||
|
|
||||||
- name: Disable user docker socket
|
- name: Disable user docker socket
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: "{{ item }}"
|
name: '{{ item }}'
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: false
|
enabled: false
|
||||||
scope: user
|
scope: user
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
|
||||||
- name: Install language servers
|
- name: Install language servers
|
||||||
become: true
|
become: true
|
||||||
community.general.pacman:
|
community.general.pacman:
|
||||||
name: "{{ item }}"
|
name: '{{ item }}'
|
||||||
state: present
|
state: present
|
||||||
loop: '{{ language_servers | map(attribute="package") | list }}'
|
loop: '{{ language_servers | map(attribute="package") | list }}'
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
---
|
|
||||||
- name: Set NVM install directory
|
- name: Set NVM install directory
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
install_dir: "{{ xdg_config_dir }}/nvm"
|
install_dir: '{{ xdg_config_dir }}/nvm'
|
||||||
|
|
||||||
- name: Remove manually installed nvm install directory
|
- name: Remove manually installed nvm install directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ install_dir }}"
|
path: '{{ install_dir }}'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Remove nvm entry from bashrc
|
- name: Remove nvm entry from bashrc
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ ansible_env.HOME }}/.bashrc.override"
|
path: '{{ ansible_env.HOME }}/.bashrc.override'
|
||||||
line: >
|
line: >
|
||||||
[ -s "{{ install_dir }}/nvm.sh" ] && \. "{{ install_dir }}/nvm.sh" # This loads nvm
|
[ -s "{{ install_dir }}/nvm.sh" ] && \. "{{ install_dir }}/nvm.sh" # This loads nvm
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,66 +1,65 @@
|
||||||
---
|
- name: 'check for {{ item.binary }} binary'
|
||||||
- name: "Check for {{ item.binary }} binary"
|
command: 'which {{ item.binary }}'
|
||||||
ansible.builtin.command: "which {{ item.binary }}"
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: python_installed.rc not in [ 0, 1 ]
|
failed_when: python_installed.rc not in [ 0, 1 ]
|
||||||
register: python_installed
|
register: python_installed
|
||||||
|
|
||||||
- name: "Check for {{ item.binary }} download"
|
- name: 'check for {{ item.binary }} download'
|
||||||
ansible.builtin.stat:
|
stat:
|
||||||
path: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
|
path: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
|
||||||
register: python_download
|
register: python_download
|
||||||
|
|
||||||
- when: python_installed.rc not in [ 0 ]
|
- block:
|
||||||
block:
|
|
||||||
# TODO: verify for checksum
|
# TODO: verify for checksum
|
||||||
- name: "Retrieve python {{ item.version }} source"
|
- name: 'retrieve python {{ item.version }} source'
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.get_url:
|
get_url:
|
||||||
url: "{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz"
|
url: '{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz'
|
||||||
dest: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
|
dest: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
|
||||||
owner: "{{ ansible_user_id }}"
|
owner: '{{ ansible_user_id }}'
|
||||||
group: "{{ ansible_user_id }}"
|
group: '{{ ansible_user_id }}'
|
||||||
when: not python_download.stat.exists
|
when: not python_download.stat.exists
|
||||||
|
|
||||||
- name: "Extract python {{ item.version }} sources"
|
- name: 'extract python {{ item.version }} sources'
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.unarchive:
|
unarchive:
|
||||||
src: "{{ python_build_dir }}/python-{{ item.version }}.tgz"
|
src: '{{ python_build_dir }}/python-{{ item.version }}.tgz'
|
||||||
dest: "{{ python_build_dir }}"
|
dest: '{{ python_build_dir }}'
|
||||||
include: "Python-{{ item.version }}"
|
include: 'Python-{{ item.version }}'
|
||||||
|
|
||||||
- name: Rename source directory
|
- name: rename source directory
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.command: "mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}"
|
ansible.builtin.command: 'mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}'
|
||||||
|
|
||||||
- name: Set correct permissions
|
- name: set correct permissions
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
file:
|
||||||
path: "{{ python_build_dir }}/{{ item.path }}"
|
path: '{{ python_build_dir }}/{{ item.path }}'
|
||||||
recurse: true
|
recurse: true
|
||||||
owner: "{{ ansible_user_id }}"
|
owner: '{{ ansible_user_id }}'
|
||||||
group: "{{ ansible_user_id }}"
|
group: '{{ ansible_user_id }}'
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Configure build
|
- name: configure build
|
||||||
ansible.builtin.command: "sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}"
|
ansible.builtin.command: 'sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}'
|
||||||
args:
|
args:
|
||||||
chdir: "{{ python_build_dir }}/{{ item.path }}/"
|
chdir: '{{ python_build_dir }}/{{ item.path }}/'
|
||||||
|
|
||||||
- name: Make build
|
- name: make build
|
||||||
ansible.builtin.command: "make"
|
ansible.builtin.command: 'make'
|
||||||
args:
|
args:
|
||||||
chdir: "{{ python_build_dir }}/{{ item.path }}/"
|
chdir: '{{ python_build_dir }}/{{ item.path }}/'
|
||||||
|
|
||||||
- name: Install build
|
- name: install build
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.command: "make install"
|
ansible.builtin.command: 'make install'
|
||||||
args:
|
args:
|
||||||
chdir: "{{ python_build_dir }}/{{ item.path }}/"
|
chdir: '{{ python_build_dir }}/{{ item.path }}/'
|
||||||
|
|
||||||
- name: "Create symlink for python {{ item.version }}"
|
- name: 'create symlink for python {{ item.version }}'
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
file:
|
||||||
src: "{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}"
|
src: '{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}'
|
||||||
dest: "/usr/bin/{{ item.binary }}"
|
dest: '/usr/bin/{{ item.binary }}'
|
||||||
state: link
|
state: link
|
||||||
|
when: python_installed.rc not in [ 0 ]
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
---
|
|
||||||
- name: Install language servers on debian hosts
|
- name: Install language servers on debian hosts
|
||||||
become: true
|
become: true
|
||||||
community.general.npm:
|
community.general.npm:
|
||||||
name: "{{ item }}"
|
name: '{{ item }}'
|
||||||
global: true
|
global: true
|
||||||
loop: '{{ language_servers | map(attribute="package") | list }}'
|
loop: '{{ language_servers | map(attribute="package") | list }}'
|
||||||
|
|
||||||
|
|
@ -10,16 +9,16 @@
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: directory
|
state: directory
|
||||||
path: "{{ neovim.install_path }}"
|
path: '{{ neovim.install_path }}'
|
||||||
owner: "{{ ansible_user_id }}"
|
owner: '{{ ansible_user_id }}'
|
||||||
group: "{{ ansible_user_gid }}"
|
group: '{{ ansible_user_gid }}'
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
|
|
||||||
- name: Register the current neovim version
|
- name: Register the current neovim version
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
argv:
|
argv:
|
||||||
- "{{ neovim.install_path }}/bin/nvim"
|
- '{{ neovim.install_path }}/bin/nvim'
|
||||||
- "--version"
|
- '--version'
|
||||||
register: neovim_stats
|
register: neovim_stats
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -31,21 +30,21 @@
|
||||||
|
|
||||||
- name: Download neovim {{ neovim.version }}
|
- name: Download neovim {{ neovim.version }}
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: "https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux-x86_64.tar.gz"
|
url: 'https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux-x86_64.tar.gz'
|
||||||
dest: /tmp/nvim-linux64.tar.gz
|
dest: /tmp/nvim-linux64.tar.gz
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
checksum: "{{ neovim.download_checksum }}"
|
checksum: '{{ neovim.download_checksum }}'
|
||||||
when: neovim_stats.rc > 0 or neovim_installed_version != neovim.version
|
when: neovim_stats.rc > 0 or neovim_installed_version != neovim.version
|
||||||
register: neovim_download
|
register: neovim_download
|
||||||
|
|
||||||
- name: Extract downloaded neovim version
|
- name: Extract downloaded neovim version
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: /tmp/nvim-linux64.tar.gz
|
src: /tmp/nvim-linux64.tar.gz
|
||||||
dest: "{{ neovim.install_path }}"
|
dest: '{{ neovim.install_path }}'
|
||||||
extra_opts:
|
extra_opts:
|
||||||
- "--strip-components=1"
|
- '--strip-components=1'
|
||||||
- "--show-stored-names"
|
- '--show-stored-names'
|
||||||
- "--overwrite"
|
- '--overwrite'
|
||||||
when: |
|
when: |
|
||||||
neovim_download.state == 'file'
|
neovim_download.state == 'file'
|
||||||
and (neovim_installed_version is undefined or neovim_installed_version != neovim.version)
|
and (neovim_installed_version is undefined or neovim_installed_version != neovim.version)
|
||||||
|
|
@ -53,6 +52,6 @@
|
||||||
- name: Add neovim to PATH
|
- name: Add neovim to PATH
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "templates/debian/nvim.profile.j2"
|
src: 'templates/debian/nvim.profile.j2'
|
||||||
dest: "/etc/profile.d/neovim.sh"
|
dest: '/etc/profile.d/neovim.sh'
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
|
|
|
||||||
|
|
@ -1,70 +1,51 @@
|
||||||
---
|
|
||||||
- name: Clone dotfiles
|
- name: Clone dotfiles
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "{{ dotfiles_repo }}"
|
repo: '{{ dotfiles_repo }}'
|
||||||
dest: "{{ ansible_env.HOME }}/dotfiles"
|
dest: '{{ ansible_env.HOME }}/dotfiles'
|
||||||
version: master
|
version: master
|
||||||
update: true
|
update: true
|
||||||
|
|
||||||
- name: Create xdg configuration directories
|
- name: Create xdg configuration directories
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: '{{ item }}'
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
loop:
|
loop:
|
||||||
- "{{ xdg_config_dir }}/git"
|
- '{{ xdg_config_dir }}/git'
|
||||||
- "{{ xdg_config_dir }}/tmux"
|
- '{{ xdg_config_dir }}/tmux'
|
||||||
|
|
||||||
- name: Remove previous dotfiles
|
- name: Remove previous dotfiles
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: '{{ item }}'
|
||||||
state: absent
|
state: absent
|
||||||
loop:
|
loop:
|
||||||
- "{{ ansible_env.HOME }}/.tmux.conf"
|
- '{{ ansible_env.HOME }}/.tmux.conf'
|
||||||
- "{{ ansible_env.HOME }}/.gitconfig"
|
- '{{ ansible_env.HOME }}/.gitconfig'
|
||||||
|
|
||||||
- name: Setup dotfiles
|
- name: Setup dotfiles
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item.dest }}"
|
path: '{{ item.dest }}'
|
||||||
src: "{{ item.src }}"
|
src: '{{ item.src }}'
|
||||||
state: link
|
state: link
|
||||||
force: true
|
force: true
|
||||||
loop:
|
loop:
|
||||||
- src: "{{ ansible_env.HOME }}/dotfiles/.vimrc"
|
- src: '{{ ansible_env.HOME }}/dotfiles/.vimrc'
|
||||||
dest: "{{ ansible_env.HOME }}/.vimrc"
|
dest: '{{ ansible_env.HOME }}/.vimrc'
|
||||||
|
|
||||||
- src: "{{ ansible_env.HOME }}/dotfiles/.bashrc"
|
- src: '{{ ansible_env.HOME }}/dotfiles/.bashrc'
|
||||||
dest: "{{ ansible_env.HOME }}/.bashrc"
|
dest: '{{ ansible_env.HOME }}/.bashrc'
|
||||||
|
|
||||||
- src: "{{ ansible_env.HOME }}/dotfiles/.profile"
|
- src: '{{ ansible_env.HOME }}/dotfiles/.profile'
|
||||||
dest: "{{ ansible_env.HOME }}/.profile"
|
dest: '{{ ansible_env.HOME }}/.profile'
|
||||||
|
|
||||||
- src: "{{ ansible_env.HOME }}/dotfiles/tmux/tmux.conf"
|
- src: '{{ ansible_env.HOME }}/dotfiles/.tmux.conf'
|
||||||
dest: "{{ xdg_config_dir }}/tmux/tmux.conf"
|
dest: '{{ xdg_config_dir }}/tmux/tmux.conf'
|
||||||
|
|
||||||
- src: "{{ ansible_env.HOME }}/dotfiles/tmux/light.conf"
|
- src: '{{ ansible_env.HOME }}/dotfiles/.gitignore'
|
||||||
dest: "{{ xdg_config_dir }}/tmux/light.conf"
|
dest: '{{ xdg_config_dir }}/git/ignore'
|
||||||
|
|
||||||
- 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
|
- name: Copy git configuration
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "templates/gitconfig.j2"
|
src: 'templates/gitconfig.j2'
|
||||||
dest: "{{ xdg_config_dir }}/git/config"
|
dest: '{{ xdg_config_dir }}/git/config'
|
||||||
mode: "0755"
|
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"
|
|
||||||
|
|
|
||||||
145
tasks/neovim.yml
145
tasks/neovim.yml
|
|
@ -1,36 +1,35 @@
|
||||||
---
|
|
||||||
- name: Ensure neovim configuration directories exist
|
- name: Ensure neovim configuration directories exist
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: '{{ item }}'
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
loop:
|
loop:
|
||||||
- "{{ xdg_config_dir }}/nvim/"
|
- '{{ xdg_config_dir }}/nvim/'
|
||||||
- "{{ xdg_config_dir }}/nvim/lua"
|
- '{{ xdg_config_dir }}/nvim/lua'
|
||||||
- "{{ xdg_config_dir }}/nvim/after"
|
- '{{ xdg_config_dir }}/nvim/after'
|
||||||
- "{{ xdg_config_dir }}/nvim/after/ftplugin"
|
- '{{ xdg_config_dir }}/nvim/after/ftplugin'
|
||||||
- "{{ xdg_data_dir }}/nvim/site"
|
- '{{ xdg_data_dir }}/nvim/site'
|
||||||
- "{{ xdg_data_dir }}/nvim/site/pack"
|
- '{{ xdg_data_dir }}/nvim/site/pack'
|
||||||
- "{{ xdg_data_dir }}/nvim/site/pack/default"
|
- '{{ xdg_data_dir }}/nvim/site/pack/default'
|
||||||
- "{{ xdg_data_dir }}/nvim/site/pack/default/start"
|
- '{{ xdg_data_dir }}/nvim/site/pack/default/start'
|
||||||
|
|
||||||
- name: Remove old neovim packages
|
- name: Remove old neovim packages
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: '{{ item }}'
|
||||||
state: absent
|
state: absent
|
||||||
loop:
|
loop:
|
||||||
- "{{ xdg_data_dir }}/nvim/site/pack/default/start/catpuccin"
|
- '{{ xdg_data_dir }}/nvim/site/pack/default/start/catpuccin'
|
||||||
- "{{ xdg_data_dir }}/nvim/site/pack/default/start/vim-colors-xcode"
|
- '{{ xdg_data_dir }}/nvim/site/pack/default/start/vim-colors-xcode'
|
||||||
|
|
||||||
# Note that helptags may need to be regenerated (see `:h helptags`)
|
# Note that helptags may need to be regenerated (see `:h helptags`)
|
||||||
- name: Clone neovim packages
|
- name: Clone neovim packages
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "{{ item.url }}"
|
repo: '{{ item.url }}'
|
||||||
dest: "{{ xdg_data_dir }}/nvim/site/pack/default/start/{{ item.name }}"
|
dest: '{{ xdg_data_dir }}/nvim/site/pack/default/start/{{ item.name }}'
|
||||||
update: true
|
update: true
|
||||||
version: '{{ item.version | default("HEAD") }}'
|
version: '{{ item.version | default("HEAD") }}'
|
||||||
force: true # some maintainers overwrite existing tags :/
|
force: true # some maintainers overwrite existing tags :/
|
||||||
loop: "{{ neovim_plugins }}"
|
loop: '{{ neovim_plugins }}'
|
||||||
|
|
||||||
- name: Install neovim node package
|
- name: Install neovim node package
|
||||||
become: true
|
become: true
|
||||||
|
|
@ -40,93 +39,87 @@
|
||||||
|
|
||||||
- name: Remove old neovim configuration file
|
- name: Remove old neovim configuration file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ xdg_config_dir }}/nvim/init.vim"
|
path: '{{ xdg_config_dir }}/nvim/init.vim'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Remove coc.nvim extension
|
- name: Remove coc.nvim extension
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ xdg_data_dir }}/nvim/site/pack/default/start/coc.nvim"
|
path: '{{ xdg_data_dir }}/nvim/site/pack/default/start/coc.nvim'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Setup neovim configuration files
|
- name: Setup neovim configuration files
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
dest: "{{ item.dest }}"
|
dest: '{{ item.dest }}'
|
||||||
src: "{{ item.src }}"
|
src: '{{ item.src }}'
|
||||||
mode: "0755"
|
mode: '0755'
|
||||||
loop:
|
loop:
|
||||||
- src: "templates/nvim/ftplugin/bash.lua.j2"
|
- src: 'templates/nvim/ftplugin/bash.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/bash.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/bash.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/css.lua.j2"
|
- src: 'templates/nvim/ftplugin/css.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/css.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/css.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/html.lua.j2"
|
- src: 'templates/nvim/ftplugin/html.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/html.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/html.lua'
|
||||||
- src: "templates/nvim/ftplugin/htmldjango.lua.j2"
|
- src: 'templates/nvim/ftplugin/htmldjango.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/htmldjango.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/htmldjango.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/javascript.lua.j2"
|
- src: 'templates/nvim/ftplugin/javascript.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/javascript.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/javascript.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/json.lua.j2"
|
- src: 'templates/nvim/ftplugin/json.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/json.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/json.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/lua.lua.j2"
|
- src: 'templates/nvim/ftplugin/lua.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/lua.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/lua.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/markdown.lua.j2"
|
- src: 'templates/nvim/ftplugin/python.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/markdown.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/python.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/python.lua.j2"
|
- src: 'templates/nvim/ftplugin/scss.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/python.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/scss.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/rst.lua.j2"
|
- src: 'templates/nvim/ftplugin/sh.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/rst.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/sh.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/scss.lua.j2"
|
- src: 'templates/nvim/ftplugin/yaml.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/scss.lua"
|
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/yaml.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/sh.lua.j2"
|
- src: 'templates/nvim/init.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/sh.lua"
|
dest: '{{ xdg_config_dir }}/nvim/init.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/ftplugin/yaml.lua.j2"
|
- src: 'templates/nvim/lua/lsp.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/after/ftplugin/yaml.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/lsp.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/init.lua.j2"
|
- src: 'templates/nvim/lua/options.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/init.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/options.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/lsp.lua.j2"
|
- src: 'templates/nvim/lua/tree-sitter.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/lsp.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/tree-sitter.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/options.lua.j2"
|
- src: 'templates/nvim/lua/git-signs.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/options.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/git-signs.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/tree-sitter.lua.j2"
|
- src: 'templates/nvim/lua/lua-line.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/tree-sitter.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/lua-line.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/git-signs.lua.j2"
|
- src: 'templates/nvim/lua/telescope.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/git-signs.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/_telescope.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/lua-line.lua.j2"
|
- src: 'templates/nvim/lua/indent-blankline.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/lua-line.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/indent-blankline.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/telescope.lua.j2"
|
- src: 'templates/nvim/lua/nvim-tree.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/_telescope.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/_nvim-tree.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/indent-blankline.lua.j2"
|
- src: 'templates/nvim/lua/colorscheme.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/indent-blankline.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/colorscheme.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/nvim-tree.lua.j2"
|
- src: 'templates/nvim/lua/source-link.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/_nvim-tree.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/_source-link.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/colorscheme.lua.j2"
|
- src: 'templates/nvim/lua/filetype.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/colorscheme.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/_filetype.lua'
|
||||||
|
|
||||||
- src: "templates/nvim/lua/source-link.lua.j2"
|
- src: 'templates/nvim/lua/formatting.lua.j2'
|
||||||
dest: "{{ xdg_config_dir }}/nvim/lua/_source-link.lua"
|
dest: '{{ xdg_config_dir }}/nvim/lua/formatting.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"
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,6 @@
|
||||||
email = {{ git_email }}
|
email = {{ git_email }}
|
||||||
name = {{ git_name }}
|
name = {{ git_name }}
|
||||||
|
|
||||||
[gpg]
|
|
||||||
format = ssh
|
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
editor = nvim
|
editor = nvim
|
||||||
{% if ansible_facts['os_family'] == 'Archlinux' %}
|
{% if ansible_facts['os_family'] == 'Archlinux' %}
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -11,4 +11,4 @@ require('indent-blankline')
|
||||||
require('_nvim-tree')
|
require('_nvim-tree')
|
||||||
require('lua-line')
|
require('lua-line')
|
||||||
require('_source-link')
|
require('_source-link')
|
||||||
require('diagnostic')
|
require('formatting')
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ local background_callback = function()
|
||||||
if vim.o.background == 'dark' then
|
if vim.o.background == 'dark' then
|
||||||
vim.cmd('colorscheme github_dark_dimmed')
|
vim.cmd('colorscheme github_dark_dimmed')
|
||||||
else
|
else
|
||||||
vim.cmd('colorscheme github_light_tritanopia')
|
vim.cmd('colorscheme github_light')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- force a full redraw:
|
-- force a full redraw:
|
||||||
|
|
@ -29,7 +29,7 @@ Use the `Introspect` option to inspect available options:
|
||||||
|
|
||||||
dbus-send \
|
dbus-send \
|
||||||
--session \
|
--session \
|
||||||
--print-reply \
|
--print-reply ]
|
||||||
--reply-timeout=2000 \
|
--reply-timeout=2000 \
|
||||||
--type=method_call \
|
--type=method_call \
|
||||||
--dest=org.freedesktop.portal.Desktop \
|
--dest=org.freedesktop.portal.Desktop \
|
||||||
|
|
|
||||||
|
|
@ -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 }
|
|
||||||
}
|
|
||||||
39
templates/nvim/lua/formatting.lua.j2
Normal file
39
templates/nvim/lua/formatting.lua.j2
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
-- {{ ansible_managed }}
|
||||||
|
|
||||||
|
local enable_formatting = vim.env.enable_formatting == 'true';
|
||||||
|
local legacy_formatting = nil;
|
||||||
|
|
||||||
|
-- TODO: move to utils file
|
||||||
|
-- TODO: add efm-languageserver to lsp.lua
|
||||||
|
if vim.env.VIRTUAL_ENV ~= nil and enable_formatting == true then
|
||||||
|
local formatters = vim.fs.find(
|
||||||
|
{ 'isort', 'black' },
|
||||||
|
{ limit = 1, type = 'file', path = vim.fs.joinpath(vim.env.VIRTUAL_ENV, 'bin') }
|
||||||
|
)
|
||||||
|
|
||||||
|
legacy_formatting = #formatters > 0;
|
||||||
|
end
|
||||||
|
|
||||||
|
if (enable_formatting) then
|
||||||
|
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.server_capabilities.documentFormattingProvider then
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
buffer = args.buf,
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format {
|
||||||
|
async = false,
|
||||||
|
id = args.data.client_id,
|
||||||
|
filter = function(format_client)
|
||||||
|
return format_client.name ~= 'ruff' or not legacy_formatting
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
@ -7,29 +7,29 @@ local on_attach = function(client, bufnr)
|
||||||
|
|
||||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, 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', 'K', vim.lsp.buf.hover, opts)
|
||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, 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', '<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>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>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||||
vim.keymap.set('n', '<space>wl', function()
|
vim.keymap.set('n', '<space>wl', function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, opts)
|
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', '<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', '<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_prev, opts)
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, 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>q', vim.diagnostic.setloclist, opts)
|
||||||
|
vim.keymap.set('n', '<space>la', vim.lsp.buf.code_action, opts)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--enable some language servers with the additional completion capabilities
|
--enable some language servers with the additional completion capabilities
|
||||||
--offered by nvim-cmp
|
--offered by nvim-cmp
|
||||||
local auto_setup_servers = {
|
local servers = {
|
||||||
{% for item in language_servers %}
|
{% for item in language_servers %}
|
||||||
{% if item.auto_setup and not loop.last %}
|
{% if item.auto_setup and not loop.last %}
|
||||||
'{{ item.server_name }}',
|
'{{ item.server_name }}',
|
||||||
|
|
@ -43,8 +43,10 @@ local auto_setup_servers = {
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
for _, lsp in ipairs(auto_setup_servers) do
|
local nvim_lsp = require('lspconfig')
|
||||||
vim.lsp.config[lsp] = {
|
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
nvim_lsp[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
|
@ -53,45 +55,47 @@ end
|
||||||
local util = require('lspconfig/util')
|
local util = require('lspconfig/util')
|
||||||
|
|
||||||
{% if ansible_facts.os_family == 'Archlinux' %}
|
{% 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.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
root_dir = python_root_dir
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
nvim_lsp.pyright.setup {
|
||||||
settings = {
|
settings = {
|
||||||
pyright = {
|
pyright = {
|
||||||
-- Using Ruff's import organizer
|
-- Using Ruff's import organizer
|
||||||
disableOrganizeImports = true,
|
disableOrganizeImports = true,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local snippet_capabilities = vim.deepcopy(capabilities);
|
local snippet_capabilities = vim.deepcopy(capabilities);
|
||||||
snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
|
snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
|
||||||
vim.lsp.config['html'] = {
|
nvim_lsp.html.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
filetypes = { 'html', 'htmldjango' },
|
filetypes = { 'html', 'htmldjango' },
|
||||||
settings = {
|
|
||||||
html = {
|
|
||||||
format = {
|
|
||||||
templating = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['cssls'] = {
|
nvim_lsp.cssls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['jsonls'] = {
|
nvim_lsp.jsonls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['lua_ls'] = {
|
nvim_lsp.lua_ls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -103,31 +107,13 @@ vim.lsp.config['lua_ls'] = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Use system binary for esbonio
|
|
||||||
vim.lsp.config['esbonio'] = {
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
cmd = { '/usr/bin/esbonio' }
|
|
||||||
}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
vim.lsp.config['yamlls'] = {
|
nvim_lsp.yamlls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose', 'yaml.gitlab' }
|
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 cmp = require('cmp')
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
|
|
@ -193,3 +179,11 @@ cmp.setup {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vim.diagnostic.config {
|
||||||
|
float = {
|
||||||
|
suffix = function(diagnostic)
|
||||||
|
return (' %s | [%s]'):format(diagnostic.code, diagnostic.source)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,12 +55,5 @@ vim.o.termguicolors = true
|
||||||
vim.g.loaded_netrw = 1
|
vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 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 = ''
|
|
||||||
|
|
||||||
-- python interpreter
|
-- python interpreter
|
||||||
vim.g.python3_host_prog = '/usr/bin/python3'
|
vim.g.python3_host_prog = '/usr/bin/python3'
|
||||||
|
|
|
||||||
|
|
@ -5,34 +5,20 @@ local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
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', 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', builtin.live_grep, opts)
|
||||||
vim.keymap.set('n', 'fG', live_grep_unignored, opts)
|
vim.keymap.set('n', 'fb', builtin.buffers, 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', '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', 'fj', builtin.jumplist, opts)
|
||||||
vim.keymap.set('n', 'fl', builtin.loclist, opts)
|
vim.keymap.set('n', 'fl', builtin.loclist, opts)
|
||||||
vim.keymap.set('n', 'fq', builtin.quickfix, opts)
|
vim.keymap.set('n', 'fq', builtin.quickfix, opts)
|
||||||
vim.keymap.set('n', 'fm', builtin.marks, opts)
|
vim.keymap.set('n', 'fm', builtin.marks, opts)
|
||||||
vim.keymap.set('n', 'ft', builtin.treesitter, opts)
|
|
||||||
|
|
||||||
telescope.setup({
|
telescope.setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
layout_strategy = 'vertical',
|
layout_strategy = 'vertical',
|
||||||
layout_config = {
|
layout_config = {
|
||||||
prompt_position = 'bottom',
|
vertical = { width = 0.5, height = 0.7 }
|
||||||
vertical = { width = 0.8, height = 0.9 }
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue