Compare commits

..

10 commits

34 changed files with 404 additions and 410 deletions

30
flake.lock generated
View file

@ -43,11 +43,11 @@
]
},
"locked": {
"lastModified": 1741955947,
"narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=",
"lastModified": 1744902080,
"narHash": "sha256-px7OEMQYhS9StY3sTYYeM/jJspk6SXgoPU7OmOSx+1c=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4",
"rev": "2c71aae678c03a39c2542e136b87bd040ae1b3cb",
"type": "github"
},
"original": {
@ -79,11 +79,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1741851582,
"narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=",
"lastModified": 1744463964,
"narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6607cf789e541e7873d40d3a8f7815ea92204f32",
"rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650",
"type": "github"
},
"original": {
@ -94,11 +94,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1741851582,
"narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=",
"lastModified": 1744463964,
"narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6607cf789e541e7873d40d3a8f7815ea92204f32",
"rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650",
"type": "github"
},
"original": {
@ -115,11 +115,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1741973126,
"narHash": "sha256-CcmVOjj2vrxnm16i8k7+yOQ8OKEkQoC+CZGkk69xx+s=",
"lastModified": 1744904898,
"narHash": "sha256-wLepe0sdFFgXUOLY2t+GrfjBquiGFgNydQkQYGh6UwQ=",
"owner": "nix-community",
"repo": "NUR",
"rev": "1ebb46ef6ac07fe695984eec8b4f936e92f4dce5",
"rev": "9ea0c40c52673079dfe50e82ddbb78679723be05",
"type": "github"
},
"original": {
@ -144,11 +144,11 @@
]
},
"locked": {
"lastModified": 1741861888,
"narHash": "sha256-ynOgXAyToeE1UdLNfrUn/hL7MN0OpIS2BtNdLjpjPf0=",
"lastModified": 1744669848,
"narHash": "sha256-pXyanHLUzLNd3MX9vsWG+6Z2hTU8niyphWstYEP3/GU=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "d016ce0365b87d848a57c12ffcfdc71da7a2b55f",
"rev": "61154300d945f0b147b30d24ddcafa159148026a",
"type": "github"
},
"original": {

View file

@ -15,6 +15,7 @@
git.enable = true;
neovim.enable = true;
starship.enable = true;
tmux.enable = true;
utils.enable = true;
vifm.enable = true;
zsh.enable = true;

View file

@ -16,6 +16,7 @@
userEmail = "ybarbanneau@sellsy.com";
signingKey ="6E1A834E282FBD98B48069444447A19BBEDB8DBA";
signByDefault = true;
signingKey="6E1A834E282FBD98B48069444447A19BBEDB8DBA";
};
neovim.enable = true;
starship.enable = true;

View file

@ -10,13 +10,13 @@ let
url = "https://ftp.nluug.nl/vim/runtime/spell/fr.utf-8.sug";
sha256 = "0294bc32b42c90bbb286a89e23ca3773b7ef50eff1ab523b1513d6a25c6b3f58";
};
yaml-companion = pkgs.vimUtils.buildVimPlugin {
pname = "yaml-companion";
nvim-k8s-lsp = pkgs.vimUtils.buildVimPlugin {
pname = "nvim-k8s-lsp";
version = "main";
src = builtins.fetchGit {
url = "https://github.com/someone-stole-my-name/yaml-companion.nvim.git";
rev = "131b0d67bd2e0f1a02e0daf2f3460482221ce3c0";
ref = "main";
url = "https://github.com/tonychg/nvim-k8s-lsp.git";
rev = "5e8221cce09cb71b7604c0c7469bf9053dd877ca";
ref = "feat/add-helm-ls-support";
};
};
in
@ -27,6 +27,16 @@ in
config = mkIf cfg.enable {
home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.spl".source = nvim-spell-fr-utf8-dictionary;
home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.sug".source = nvim-spell-fr-utf8-suggestions;
home.file."${config.xdg.configHome}/nvim/lsp/bash.lua".source = ./files/lsp/bash.lua;
home.file."${config.xdg.configHome}/nvim/lsp/helm.lua".source = ./files/lsp/helm.lua;
home.file."${config.xdg.configHome}/nvim/lsp/lua.lua".source = ./files/lsp/lua.lua;
home.file."${config.xdg.configHome}/nvim/lsp/nills.lua".source = ./files/lsp/nills.lua;
home.file."${config.xdg.configHome}/nvim/lsp/pylsp.lua".source = ./files/lsp/pylsp.lua;
home.file."${config.xdg.configHome}/nvim/lsp/terraformls.lua".source = ./files/lsp/terraformls.lua;
home.file."${config.xdg.configHome}/nvim/lsp/tflint.lua".source = ./files/lsp/tflint.lua;
home.file."${config.xdg.configHome}/nvim/lsp/yaml.lua".source = ./files/lsp/yaml.lua;
programs.neovim = {
enable = true;
defaultEditor = true;
@ -55,7 +65,11 @@ in
shfmt
yamlfmt
];
extraLuaConfig = (builtins.readFile ./files/options.lua);
extraLuaConfig =
(builtins.readFile ./files/options.lua)
+ (builtins.readFile ./files/keybindings.lua)
+ (builtins.readFile ./files/lsp.lua)
;
plugins = with pkgs.vimPlugins; [
{
plugin = nvim-autopairs;
@ -67,32 +81,29 @@ in
{
plugin = catppuccin-nvim;
type = "lua";
config = (builtins.readFile ./files/theme.lua);
config = (builtins.readFile ./files/plugins/theme.lua);
}
{
plugin = nvim-cmp;
plugin = blink-cmp;
type = "lua";
config = (builtins.readFile ./files/cmp.lua);
config = (builtins.readFile ./files/plugins/blink-cmp.lua);
}
cmp-buffer
cmp-nvim-lsp
cmp-path
cmp-cmdline
cmp_luasnip
blink-emoji-nvim
blink-cmp-dictionary
{
plugin = conform-nvim;
type = "lua";
config = (builtins.readFile ./files/conform.lua);
config = (builtins.readFile ./files/plugins/conform.lua);
}
{
plugin = fzf-lua;
type = "lua";
config = (builtins.readFile ./files/fzf-lua.lua);
config = (builtins.readFile ./files/plugins/fzf-lua.lua);
}
{
plugin = gitsigns-nvim;
type = "lua";
config = (builtins.readFile ./files/luasnip.lua);
config = (builtins.readFile ./files/plugins/luasnip.lua);
}
{
plugin = indent-blankline-nvim;
@ -103,26 +114,15 @@ in
}
'';
}
{
plugin = lsp_lines-nvim;
type = "lua";
config = (builtins.readFile ./files/lsp-line.lua);
}
{
plugin = nvim-lspconfig;
type = "lua";
config = (builtins.readFile ./files/lspconfig.lua);
}
{
plugin = lualine-nvim;
type = "lua";
config = (builtins.readFile ./files/lualine.lua);
config = (builtins.readFile ./files/plugins/lualine.lua);
}
luasnip
{
plugin = neo-tree-nvim;
type = "lua";
config = (builtins.readFile ./files/neotree.lua);
config = (builtins.readFile ./files/plugins/neotree.lua);
}
nui-nvim
{
@ -135,12 +135,12 @@ in
{
plugin = nvim-lint;
type = "lua";
config = ( builtins.readFile ./files/nvim-lint.lua);
config = ( builtins.readFile ./files/plugins/nvim-lint.lua);
}
{
plugin = nvim-sops;
type = "lua";
config = (builtins.readFile ./files/nvim-sops.lua);
config = (builtins.readFile ./files/plugins/nvim-sops.lua);
}
plenary-nvim
{
@ -169,12 +169,12 @@ in
])
);
type = "lua";
config = ( builtins.readFile ./files/treesitter.lua);
config = ( builtins.readFile ./files/plugins/treesitter.lua);
}
{
plugin = nvim-treesitter-context;
type = "lua";
config = ( builtins.readFile ./files/treesitter_context.lua);
config = ( builtins.readFile ./files/plugins/treesitter_context.lua);
}
{
@ -194,15 +194,12 @@ in
{
plugin = which-key-nvim;
type = "lua";
config = ( builtins.readFile ./files/whichkey.lua );
config = ( builtins.readFile ./files/plugins/whichkey.lua );
}
{
plugin = yaml-companion.overrideAttrs {
dependencies = [
nvim-lspconfig
];
};
plugin = nvim-k8s-lsp ;
type = "lua";
config = ( builtins.readFile ./files/plugins/nvim-k8s-lsp.lua );
}
vim-helm
];

View file

@ -1,98 +0,0 @@
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(
0,
line - 1,
line,
true
)[1]:sub(col, col):match('%s') == nil
end
local get_ws = function (max, len)
return (" "):rep(max - len)
end
-- Add additional capabilities supported by nvim-cmp
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local luasnip = require("luasnip")
local kind_icons = {
Text = "",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰇽",
Variable = "󰂡",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰅲",
}
-- nvim-cmp setup
local cmp = require 'cmp'
cmp.setup {
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), {'i', 'c'}),
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}),
["<C-e>"] = cmp.mapping({ i = cmp.mapping.close(), c = cmp.mapping.close() }),
},
formatting = {
format = function(_, vim_item)
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind)
local content = vim_item.abbr
if #content > 25 then
vim_item.abbr = vim.fn.strcharpart(content, 0, 25) .. ""
else
vim_item.abbr = content .. get_ws(25, #content)
end
return vim_item
end,
},
sources = {
{name = 'path'},
{name = 'nvim_lsp', keyword_length = 1},
{name = 'buffer', keyword_length = 3},
{name = 'luasnip', keyword_length = 2},
},
}

View file

@ -0,0 +1,49 @@
-- clear search
vim.keymap.set('n', '<leader>l', ':nohlsearch<CR>', { desc = 'Clear search', remap = true, silent = true })
-- Switch between windows.
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Move to the left window', remap = true })
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Move to the bottom window', remap = true })
vim.keymap.set('n', '<C-k>', '<C-w>k', { desc = 'Move to the top window', remap = true })
vim.keymap.set('n', '<C-l>', '<C-w>l', { desc = 'Move to the right window', remap = true })
-- autocenter on search
vim.keymap.set('n', 'n', 'nzzzv', { desc = 'Next result' })
vim.keymap.set('n', 'N', 'Nzzzv', { desc = 'Previous result' })
-- Move tabs with \[ and \]
vim.keymap.set('n', '<Leader>]', ':tabnext<CR>', { desc = "Goto next tab", remap = true, silent = true })
vim.keymap.set('n', '<Leader>[', ':tabprev<CR>', { desc = "Goto previous tab", remap = true, silent = true})
vim.keymap.set('n', '<Leader>tc', ':tabclose<CR>', { desc = "Tab [c]lose", remap = true, silent = true})
vim.keymap.set('n', '<Leader>tn', ':tabnew<CR>', { desc = "Tab [n]ew", remap = true, silent = true})
-- Show all caracters
vim.keymap.set('n', '<leader>l', ':set list!<CR>', { desc = "Show a[l]l caraters", remap = true, silent = true})
-- neotree
-- -------
vim.keymap.set('n', '<leader>nc', ':Neotree close<cr>', {desc='Neotree [c]lose'})
vim.keymap.set('n', '<leader>nf', ':Neotree focus filesystem<cr>', {desc='Neotree [f]ocus'})
vim.keymap.set('n', '<leader>nb', ':Neotree focus buffers<cr>', {desc='Neotree Nvim [b]uffers'})
vim.keymap.set('n', '<leader>ng', ':Neotree focus git_status<cr>', {desc='Neotree [g]it status'})
-- fzf-lua
-- ------
vim.keymap.set('n', '<leader>fb', function() require('fzf-lua').buffers() end, {desc='open [b]uffers'})
vim.keymap.set('n', '<leader>ff', function() require('fzf-lua').files() end, {desc='[r]esume last command'})
vim.keymap.set('n', '<leader>fr', function() require('fzf-lua').files() end, {desc='[f]iles'})
-- git related keymaps
vim.keymap.set('n', '<leader>fgb', function() require('fzf-lua').git_branches() end, {desc='Git [b]ranches'})
vim.keymap.set('n', '<leader>fgc', function() require('fzf-lua').git_commits() end, {desc='Git [c]ommits'})
vim.keymap.set('n', '<leader>fgC', function() require('fzf-lua').git_bcommits() end, {desc='Git current buffer [C]ommits'})
vim.keymap.set('n', '<leader>fgf', function() require('fzf-lua').git_files() end, {desc='Git [f]iles'})
vim.keymap.set('n', '<leader>fgs', function() require('fzf-lua').git_stash() end, {desc='Git [s]tash'})
vim.keymap.set('n', '<leader>fgS', function() require('fzf-lua').git_status() end, {desc='Git [S]tash'})
-- grep related keymaps
vim.keymap.set('n', '<leader>fGb', function() require('fzf-lua').grep_curbuf() end, {desc='grep in current [b]uffer'})
vim.keymap.set('n', '<leader>fGc', function() require('fzf-lua').grep_cword() end, {desc='grep word under the [c]ursor'})
vim.keymap.set('n', '<leader>fGg', function() require('fzf-lua').grep() end, {desc='[g]rep'})
vim.keymap.set('n', '<leader>fGl', function() require('fzf-lua').live_grep() end, {desc='[l]ive grep'})
vim.keymap.set('n', '<leader>fGr', function() require('fzf-lua').grep_last() end, {desc='[r]erun last grep'})

View file

@ -1,7 +0,0 @@
require('lsp_lines').setup()
vim.diagnostic.config({ virtual_lines = true })
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
})

View file

@ -0,0 +1,9 @@
-- LSP configuration
vim.lsp.enable('bash')
vim.lsp.enable('helm')
vim.lsp.enable('lua')
vim.lsp.enable('nills')
vim.lsp.enable('pylsp')
vim.lsp.enable('terraformls')
vim.lsp.enable('tflint')
vim.lsp.enable('yaml')

View file

@ -0,0 +1,17 @@
return {
cmd = { 'bash-language-server', 'start' },
settings = {
bashIde = {
-- Glob pattern for finding and parsing shell script files in the workspace.
-- Used by the background analysis features across files.
-- Prevent recursive scanning which will cause issues when opening a file
-- directly in the home directory (e.g. ~/foo.sh).
--
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
},
},
filetypes = { 'bash', 'sh' },
root_markers = { '.git' },
}

View file

@ -0,0 +1,30 @@
return {
cmd = { 'helm_ls', 'serve' },
filetypes = { 'helm' },
root_markers = { 'Chart.yaml' },
capabilities = {
workspace = {
didChangeWatchedFiles = {
dynamicRegistration = true,
},
},
},
settings = {
['helm-ls'] = {
yamlls = {
enabled = true,
enabledforfilesglob = "*.{yaml,yml}",
diagnosticslimit = 50,
showdiagnosticsdirectly = false,
path = "yaml-language-server",
config = {
schemas = {
kubernetes = "template/**",
},
completion = true,
hover = true,
}
}
}
}
}

View file

@ -0,0 +1,32 @@
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = {
'.luarc.json',
'.luarc.jsonc',
'.luacheckrc',
'.stylua.toml',
'stylua.toml',
'selene.toml',
'selene.yml',
'.git',
},
settings = {
Lua = {
diagnostics = {
globals = {'vim'} -- Add any globals you want to ignore as undefined
},
workspace = {
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true
}
},
telemetry = {
enable = false -- Disable telemetry
}
}
},
flags = {
debounce_text_changes = 150,
}
}

View file

@ -0,0 +1,5 @@
return {
cmd = { 'marksman' },
filetypes = { 'markdown', 'markdown.mdx' },
root_markers = { '.marksman.toml', '.git' },
}

View file

@ -0,0 +1,15 @@
---@brief
---
-- https://github.com/oxalica/nil
--
-- A new language server for Nix Expression Language.
--
-- If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install.
-- Check the repository README for more information.
--
-- _See an example config at https://github.com/oxalica/nil/blob/main/dev/nvim-lsp.nix._
return {
cmd = { 'nil' },
filetypes = { 'nix' },
root_markers = { 'flake.nix', '.git' },
}

View file

@ -0,0 +1,21 @@
return {
cmd = { 'pylsp' },
filetypes = { 'python' },
root_markers = {
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'.git',
},
settings = {
pylsp = {
plugins = {
pylint = {
enabled = true
}
}
}
}
}

View file

@ -0,0 +1,5 @@
return {
cmd = { 'terraform-ls', 'serve' },
filetypes = { 'terraform', 'terraform-vars' },
root_markers = { '.terraform', '.git' },
}

View file

@ -0,0 +1,5 @@
return {
cmd = { 'tflint', '--langserver' },
filetypes = { 'terraform' },
root_markers = { '.terraform', '.git', '.tflint.hcl' },
}

View file

@ -0,0 +1,33 @@
-- most used yaml schemas
local gitlab_ci = "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"
local taskfile = "https://taskfile.dev/schema.json"
local lefthook = "https://raw.githubusercontent.com/evilmartians/lefthook/refs/heads/master/schema.json"
local github_workflow = "https://json.schemastore.org/github-workflow.json"
return {
cmd = { 'yaml-language-server', '--stdio' },
filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.gitlab' },
root_markers = { '.git' },
settings = {
yaml = {
schemas = {
[gitlab_ci] = {
"ci/*.{yaml,yml}",
".gitlab/**/*.{yaml,yml}",
".gitlab-ci.{yaml,yml}",
},
[taskfile] = {
"Taskfile*.{yaml,yml}",
"taskfile*.{yaml,yml}",
"taskfiles/**/*.{yaml,yml}",
},
[lefthook] = {
"lefthook.{yaml,yml}",
},
[github_workflow] = {
".github/workflow/**/*.{yaml,yml}",
}
},
},
},
}

View file

@ -1,238 +0,0 @@
local lspconfig = require('lspconfig')
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("yaml-companion").open_ui_select()
lspconfig.bashls.setup {
capabilities = capabilities,
}
lspconfig.clangd.setup {
capabilities = capabilities,
}
lspconfig.eslint.setup{
capabilities = capabilities,
}
-- YAML variables and Helm LS (quite big!)
local schemas = {}
local kubernetes = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.29.6-standalone-strict/all.json"
local flux2 = "https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/refs/heads/main/all.json"
local gitlab_ci = "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"
local taskfile = "https://taskfile.dev/schema.json"
local podmonitor = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/podmonitor_v1.json"
local servicemonitor = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/servicemonitor_v1.json"
local prometheus = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/prometheus_v1.json"
local ingress = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.30.1/ingress-networking-v1.json"
local lefthook = "https://raw.githubusercontent.com/evilmartians/lefthook/refs/heads/master/schema.json"
local github_workflow = "https://json.schemastore.org/github-workflow.json"
schemas[kubernetes] = {
"templates/*deployment.yaml",
"templates/*service.yaml",
"templates/*secret.yaml",
"templates/*configmap.yaml",
"templates/*daemonset.yaml",
"templates/*replicaset.yaml",
"templates/*persistentvolume.yaml",
"templates/*persistentvolumeclaim.yaml",
"templates/*serviceaccount.yaml",
"templates/*role.yaml",
"templates/*rolebinding.yaml",
"templates/*clusterrole.yaml",
"templates/*clusterrolebinding.yaml",
"templates/*job*.yaml",
}
schemas[podmonitor] = "templates/*podmonitor*"
schemas[servicemonitor] = "templates/*servicemonitor*"
schemas[ingress] = "templates/*ingress*"
lspconfig.helm_ls.setup {
capabilities = capabilities,
settings = {
['helm-ls'] = {
yamlls = {
enabled = true,
enabledForFilesGlob = "*.{yaml,yml}",
diagnosticsLimit = 50,
showDiagnosticsDirectly = false,
path = "yaml-language-server",
config = {
schemas = schemas,
completion = true,
hover = true,
}
}
}
}
}
-- restart LSP server avoir problems with Helm-ls
vim.api.nvim_create_autocmd("FileType", {
pattern = "helm",
command = "LspRestart",
})
lspconfig.lua_ls.setup {
capabilities = capabilities,
single_file_support = true,
settings = {
Lua = {
diagnostics = {
globals = {'vim'} -- Add any globals you want to ignore as undefined
},
workspace = {
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true
}
},
telemetry = {
enable = false -- Disable telemetry
}
}
},
flags = {
debounce_text_changes = 150,
}
}
lspconfig.marksman.setup{
capabilities = capabilities,
}
lspconfig.nil_ls.setup {
capabilities = capabilities,
}
lspconfig.pylsp.setup {
capabilities = capabilities,
settings = {
pylsp = {
plugins = {
pylint = {
enabled = true
}
}
}
}
}
lspconfig.terraformls.setup{
capabilities = capabilities,
}
lspconfig.tflint.setup{
capabilities = capabilities,
}
-- YAML configuration (quite big!)
local cfg = require("yaml-companion").setup({
schemas = {
{ name = "Flux2", uri = flux2 },
{ name = "Gitlab", uri = gitlab_ci },
{ name = "Taskfile", uri = taskfile },
{ name = "PodMonitor", uri = podmonitor },
{ name = "ServiceMonitor", uri = servicemonitor },
{ name = "Prometheus", uri = prometheus },
{ name = "Kubernetes", uri = kubernetes },
{ name = "Lefthook", uri = lefthook },
{ name = "Github Workflow", uri = github_workflow},
},
lspconfig = {
capabilities = capabilities,
settings = {
yaml = {
schemas = {
[flux2] = {
"*.{alert,provider,receiver,helmrelease,helmrepository,gitrepository}.yaml",
"gotk-sync.yaml",
"gotk-*.yaml",
},
[gitlab_ci] = {
"ci/*.{yaml,yml}",
".gitlab/**/*.{yaml,yml}",
".gitlab-ci.{yaml,yml}",
},
[taskfile] = {
"Taskfile*.{yaml,yml}",
"taskfile*.{yaml,yml}",
"taskfiles/**/*.{yaml,yml}",
},
[podmonitor] = {
"*podmonitor*.{yaml,yml}",
},
[servicemonitor] = {
"*servicemonitor*.{yaml,yml}",
},
[prometheus] = {
"*prometheus*.{yaml,yml}",
},
[ingress] = {
"*ingress*.{yaml,yml}",
},
[lefthook] = {
"lefthook.{yaml,yml}",
},
[github_workflow] = {
".github/workflow/**/*.{yaml,yml}",
}
},
},
},
},
})
lspconfig.yamlls.setup{cfg}
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function(ev)
local bufmap = function(mode, lhs, rhs)
local opts = {buffer = true}
vim.keymap.set(mode, lhs, rhs, opts)
end
-- Displays hover information about the symbol under the cursor
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
-- Jump to the definition
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
-- Jump to declaration
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
-- Lists all the implementations for the symbol under the cursor
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
-- Jumps to the definition of the type symbol
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
-- Lists all the references
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
-- Displays a function's signature information
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
-- Renames all references to the symbol under the cursor
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
-- Selects a code action available at the current cursor position
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_code_action()<cr>')
-- Show diagnostics in a floating window
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
-- Move to the previous diagnostic
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
-- Move to the next diagnostic
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client and (client.name == "yamlls" or client.name == "helm_ls") then
bufmap ('n', '<F3>', '<cmd>lua require("yaml-companion").open_ui_select()<cr>')
end
end
})

View file

@ -121,3 +121,15 @@ vim.lsp.set_log_level("off")
-- define a timeout for match parens
vim.g.matchparen_timeout = 2
vim.g.matchparen_insert_timeout = 2
-- activate virtual lines for diagnistics
-- no more plugins needed
vim.diagnostic.config({
virtual_lines = true
-- Alternatively, customize specific options
-- virtual_lines = {
-- -- Only show virtual line diagnostics for the current cursor line
-- current_line = true,
-- },
})

View file

@ -0,0 +1,99 @@
require("blink.cmp").setup({
keymap = {
preset = "cmdline",
['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
},
completion = {
menu = {
draw = {
components = {
label = {
width = { fill = true, max = 60, },
},
},
columns = { { "label", "label_description", gap = 1 }, { "kind_icon", "kind" } },
},
},
documentation = { auto_show = true },
list = {
max_items = 30;
selection = {
preselect = false,
auto_insert = true,
},
cycle = {
from_bottom = true,
from_top = true,
},
},
},
sources = {
default = {
"lsp",
"path",
"snippets",
"buffer",
"emoji",
"dictionary",
},
providers = {
emoji = {
module = "blink-emoji",
name = "Emoji",
score_offset = 15, -- Tune by preference
opts = { insert = true }, -- Insert emoji (default) or complete its name
should_show_items = function()
return vim.tbl_contains({ "gitcommit", "markdown" }, vim.o.filetype)
end,
},
dictionary = {
module = "blink-cmp-dictionary",
name = "Dict",
min_keyword_length = 3,
max_items = 10,
opts = {
dictionary_files = function()
if vim.bo.filetype == "markdown" or vim.bo.filetype == "gitcommit" then
return {}
end
return {}
end,
},
},
},
},
cmdline = {
enabled = false,
},
appearance = {
nerd_font_variant = "normal",
kind_icons = {
Text = "",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰇽",
Variable = "󰂡",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰅲",
}
}
})

View file

@ -3,14 +3,14 @@ neotree.setup({
close_if_last_window = true,
filesystem = {
filtered_items = {
-- when true, they will just be displayed differently
-- when true, they will just be displayed differently
-- than normal items
visible = false,
hide_dotfiles = false,
hide_gitignored = true,
},
follow_current_file = {
-- follow file in current buffer even iof the file is
-- follow file in current buffer even iof the file is
-- loaded while tree is open
enabled = true,
-- do not autoclose expanded dirs
@ -18,8 +18,3 @@ neotree.setup({
},
}
})
vim.keymap.set('n', '<leader>nc', ':Neotree close<cr>', {desc='Neotree [c]lose'})
vim.keymap.set('n', '<leader>nf', ':Neotree focus filesystem<cr>', {desc='Neotree [f]ocus'})
vim.keymap.set('n', '<leader>nb', ':Neotree focus buffers<cr>', {desc='Neotree Nvim [b]uffers'})
vim.keymap.set('n', '<leader>ng', ':Neotree focus git_status<cr>', {desc='Neotree [g]it status'})

View file

@ -0,0 +1,6 @@
require("nvim-k8s-lsp").setup({
kubernetes_version = "v1.32.2",
integrations = {
lualine = false,
}
})

View file

@ -45,5 +45,10 @@
"browser.sessionstore.resume_session_once" = true;
# Disable translation
"browser.translations.enabled " = false;
"browser.translations.enabled" = false;
# disable AI shit
"browser.ml.chat.enabled" = false;
"browser.ml.chat.shortcuts" = false;
"browser.ml.chat.sidebar" = false;
}

View file

@ -107,7 +107,7 @@ in
extensions.packages = allExtensions;
search = {
force = true;
default = "DuckDuckGo";
default = "ddg";
engines = {
"Nix Packages" = {
urls = [{
@ -123,13 +123,13 @@ in
"NixOS Wiki" = {
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png";
icon = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.hidden = true;
"bing".metaData.hidden = true;
"google".metaData.hidden = true;
"Amazon.fr".metaData.hidden = true;
"Facebook".metaData.hidden = true;
"youtube".metaData.hidden = true;