From a1562df1468b08bd55dca9ed97611a56f4e87d95 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Wed, 22 May 2024 10:43:46 +0200 Subject: [PATCH] nixvim! --- hosts/vali/mars/programs.nix | 1 + modules/editors/default.nix | 2 +- modules/editors/nixvim.nix | 93 ---- modules/editors/nixvim/default.nix | 3 + modules/editors/nixvim/keys.nix | 408 ++++++++++++++++++ modules/editors/nixvim/nixvim.nix | 63 +++ .../editors/nixvim/plug/completion/cmp.nix | 120 ++++++ modules/editors/nixvim/plug/git/gitlinker.nix | 8 + modules/editors/nixvim/plug/git/gitsigns.nix | 76 ++++ modules/editors/nixvim/plug/git/lazygit.nix | 22 + modules/editors/nixvim/plug/git/worktree.nix | 6 + modules/editors/nixvim/plug/lsp/conform.nix | 24 ++ modules/editors/nixvim/plug/lsp/fidget.nix | 101 +++++ modules/editors/nixvim/plug/lsp/hlchunk.nix | 13 + modules/editors/nixvim/plug/lsp/lsp.nix | 98 +++++ modules/editors/nixvim/plug/lsp/lspsaga.nix | 188 ++++++++ modules/editors/nixvim/plug/lsp/none-ls.nix | 50 +++ modules/editors/nixvim/plug/lsp/trouble.nix | 5 + .../editors/nixvim/plug/snippets/luasnip.nix | 15 + .../nixvim/plug/statusline/lualine.nix | 113 +++++ .../nixvim/plug/statusline/staline.nix | 65 +++ .../plug/treesitter/treesitter-context.nix | 5 + .../treesitter/treesitter-textobjects.nix | 50 +++ .../nixvim/plug/treesitter/treesitter.nix | 44 ++ modules/editors/nixvim/plug/ui/alpha.nix | 89 ++++ modules/editors/nixvim/plug/ui/btw.nix | 20 + modules/editors/nixvim/plug/ui/bufferline.nix | 175 ++++++++ modules/editors/nixvim/plug/ui/noice.nix | 36 ++ .../editors/nixvim/plug/ui/nvim-notify.nix | 45 ++ modules/editors/nixvim/plug/ui/telescope.nix | 210 +++++++++ modules/editors/nixvim/plug/utils/comment.nix | 5 + modules/editors/nixvim/plug/utils/copilot.nix | 56 +++ modules/editors/nixvim/plug/utils/flash.nix | 56 +++ modules/editors/nixvim/plug/utils/grapple.nix | 20 + .../editors/nixvim/plug/utils/hardtime.nix | 26 ++ modules/editors/nixvim/plug/utils/harpoon.nix | 17 + .../editors/nixvim/plug/utils/illuminate.nix | 13 + .../nixvim/plug/utils/nvim-autopairs.nix | 5 + modules/editors/nixvim/plug/utils/oil.nix | 50 +++ modules/editors/nixvim/plug/utils/ufo.nix | 5 + .../editors/nixvim/plug/utils/undotree.nix | 20 + .../editors/nixvim/plug/utils/whichkey.nix | 5 + modules/editors/nixvim/settings.nix | 88 ++++ modules/gui/spicetify.nix | 5 +- modules/gui/waybar.nix | 5 +- modules/wms/wayland/hypr/land.nix | 7 +- modules/wms/wayland/variables.nix | 7 +- 47 files changed, 2430 insertions(+), 108 deletions(-) delete mode 100644 modules/editors/nixvim.nix create mode 100644 modules/editors/nixvim/default.nix create mode 100644 modules/editors/nixvim/keys.nix create mode 100644 modules/editors/nixvim/nixvim.nix create mode 100644 modules/editors/nixvim/plug/completion/cmp.nix create mode 100644 modules/editors/nixvim/plug/git/gitlinker.nix create mode 100644 modules/editors/nixvim/plug/git/gitsigns.nix create mode 100644 modules/editors/nixvim/plug/git/lazygit.nix create mode 100644 modules/editors/nixvim/plug/git/worktree.nix create mode 100644 modules/editors/nixvim/plug/lsp/conform.nix create mode 100644 modules/editors/nixvim/plug/lsp/fidget.nix create mode 100644 modules/editors/nixvim/plug/lsp/hlchunk.nix create mode 100644 modules/editors/nixvim/plug/lsp/lsp.nix create mode 100644 modules/editors/nixvim/plug/lsp/lspsaga.nix create mode 100644 modules/editors/nixvim/plug/lsp/none-ls.nix create mode 100644 modules/editors/nixvim/plug/lsp/trouble.nix create mode 100644 modules/editors/nixvim/plug/snippets/luasnip.nix create mode 100644 modules/editors/nixvim/plug/statusline/lualine.nix create mode 100644 modules/editors/nixvim/plug/statusline/staline.nix create mode 100644 modules/editors/nixvim/plug/treesitter/treesitter-context.nix create mode 100644 modules/editors/nixvim/plug/treesitter/treesitter-textobjects.nix create mode 100644 modules/editors/nixvim/plug/treesitter/treesitter.nix create mode 100644 modules/editors/nixvim/plug/ui/alpha.nix create mode 100644 modules/editors/nixvim/plug/ui/btw.nix create mode 100644 modules/editors/nixvim/plug/ui/bufferline.nix create mode 100644 modules/editors/nixvim/plug/ui/noice.nix create mode 100644 modules/editors/nixvim/plug/ui/nvim-notify.nix create mode 100644 modules/editors/nixvim/plug/ui/telescope.nix create mode 100644 modules/editors/nixvim/plug/utils/comment.nix create mode 100644 modules/editors/nixvim/plug/utils/copilot.nix create mode 100644 modules/editors/nixvim/plug/utils/flash.nix create mode 100644 modules/editors/nixvim/plug/utils/grapple.nix create mode 100644 modules/editors/nixvim/plug/utils/hardtime.nix create mode 100644 modules/editors/nixvim/plug/utils/harpoon.nix create mode 100644 modules/editors/nixvim/plug/utils/illuminate.nix create mode 100644 modules/editors/nixvim/plug/utils/nvim-autopairs.nix create mode 100644 modules/editors/nixvim/plug/utils/oil.nix create mode 100644 modules/editors/nixvim/plug/utils/ufo.nix create mode 100644 modules/editors/nixvim/plug/utils/undotree.nix create mode 100644 modules/editors/nixvim/plug/utils/whichkey.nix create mode 100644 modules/editors/nixvim/settings.nix diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index e29e94a..897dca9 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -5,6 +5,7 @@ let in { environment.systemPackages = with pkgs; [ abaddon + alejandra alsa-utils android-tools asciinema diff --git a/modules/editors/default.nix b/modules/editors/default.nix index bb43191..78fb579 100644 --- a/modules/editors/default.nix +++ b/modules/editors/default.nix @@ -1 +1 @@ -_: { imports = [ ./emacs.nix ./helix.nix ./kakoune.nix ./nixvim.nix ]; } +_: { imports = [ ./emacs.nix ./helix.nix ./kakoune.nix ./nixvim ]; } diff --git a/modules/editors/nixvim.nix b/modules/editors/nixvim.nix deleted file mode 100644 index 44b093d..0000000 --- a/modules/editors/nixvim.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ config, lib, ... }: -let cfg = config.modules.editors.nixvim; -in { - options.modules.editors.nixvim.enable = lib.mkEnableOption "nixvim"; - - config = lib.mkIf cfg.enable { - programs.nixvim = { - enable = true; - colorschemes.gruvbox.enable = true; - options = { - number = true; - relativenumber = true; - shiftwidth = 2; - scrolloff = 8; - }; - plugins = { - lightline.enable = true; - lsp = { - enable = true; - servers = { - nixd.enable = true; - lua-ls.enable = true; - }; - }; - cmp = { - enable = true; - settings = { - sources = [ { name = "nvim_lsp"; } { name = "buffer"; } { name = "path"; } ]; - mapping = { - "" = "cmp.mapping.confirm({ select = true })"; - "" = { - action = '' - function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end - ''; - modes = [ "i" "s" ]; - }; - }; - }; - }; - telescope = { - enable = true; - extensions = { - fzf-native = { - enable = true; - settings = { - fuzzy = true; - override_file_sorter = true; - override_generic_sorter = true; - case_mode = "smart_case"; - }; - }; - }; - }; - treesitter.enable = true; - treesitter-context.enable = true; - comment.enable = true; - gitblame.enable = true; - trouble.enable = true; - todo-comments.enable = true; - fugitive.enable = true; - nvim-autopairs.enable = true; - diffview.enable = true; - oil.enable = true; - undotree.enable = true; - fzf-lua.enable = true; - surround.enable = true; - lazygit.enable = true; - # Theming - gitsigns.enable = true; - # barbar.enable = true; - lualine = { - enable = true; - #theme = "palenight"; - }; - nix.enable = true; - zig.enable = true; - - }; - }; - }; -} diff --git a/modules/editors/nixvim/default.nix b/modules/editors/nixvim/default.nix new file mode 100644 index 0000000..2d69264 --- /dev/null +++ b/modules/editors/nixvim/default.nix @@ -0,0 +1,3 @@ +_:{ + imports = [./nixvim.nix ]; +} diff --git a/modules/editors/nixvim/keys.nix b/modules/editors/nixvim/keys.nix new file mode 100644 index 0000000..73878ab --- /dev/null +++ b/modules/editors/nixvim/keys.nix @@ -0,0 +1,408 @@ +{ +programs.nixvim = { + globals.mapleader = " "; + + keymaps = [ + { + mode = "n"; + key = "f"; + action = "+find/file"; + desc = "Find a file"; + } + { + mode = "n"; + key = "s"; + action = "+search"; + desc = "Search in your file"; + } + + { + mode = "n"; + key = "q"; + action = "+quit/session"; + desc = "Quit the current session"; + } + + { + mode = ["n" "v"]; + key = "g"; + action = "+git"; + } + + { + mode = "n"; + key = "u"; + action = "+ui"; + } + + { + mode = "n"; + key = "w"; + action = "+windows"; + } + + { + mode = "n"; + key = ""; + action = "+tab"; + } + + { + mode = ["n" "v"]; + key = "d"; + action = "+debug"; + } + + { + mode = ["n" "v"]; + key = "c"; + action = "+code"; + } + + { + mode = ["n" "v"]; + key = "t"; + action = "+test"; + } + + # Tabs + { + mode = "n"; + key = ""; + action = "tabnew"; + options = { + silent = true; + desc = "New Tab"; + }; + } + + { + mode = "n"; + key = "d"; + action = "tabclose"; + options = { + silent = true; + desc = "Close tab"; + }; + } + + # Windows + { + mode = "n"; + key = "ww"; + action = "p"; + options = { + silent = true; + desc = "Other window"; + }; + } + + { + mode = "n"; + key = "wd"; + action = "c"; + options = { + silent = true; + desc = "Delete window"; + }; + } + + { + mode = "n"; + key = "w-"; + action = "s"; + options = { + silent = true; + desc = "Split window below"; + }; + } + + { + mode = "n"; + key = "w|"; + action = "v"; + options = { + silent = true; + desc = "Split window right"; + }; + } + + { + mode = "n"; + key = ""; + action = "h"; + options = { + silent = true; + desc = "Move to window left"; + }; + } + + { + mode = "n"; + key = ""; + action = "l"; + options = { + silent = true; + desc = "Move to window right"; + }; + } + + { + mode = "n"; + key = ""; + action = "k"; + options = { + silent = true; + desc = "Move to window over"; + }; + } + + { + mode = "n"; + key = ""; + action = "j"; + options = { + silent = true; + desc = "Move to window bellow"; + }; + } + + { + mode = "n"; + key = ""; + action = "w"; + options = { + silent = true; + desc = "Save file"; + }; + } + + # Quit/Session + { + mode = "n"; + key = "qq"; + action = "quitall"; + options = { + silent = true; + desc = "Quit all"; + }; + } + + { + mode = "n"; + key = "ul"; + action = ":lua ToggleLineNumber()"; + options = { + silent = true; + desc = "Toggle Line Numbers"; + }; + } + + { + mode = "n"; + key = "uL"; + action = ":lua ToggleRelativeLineNumber()"; + options = { + silent = true; + desc = "Toggle Relative Line Numbers"; + }; + } + + { + mode = "n"; + key = "uw"; + action = ":lua ToggleWrap()"; + options = { + silent = true; + desc = "Toggle Line Wrap"; + }; + } + + { + mode = "v"; + key = "J"; + action = ":m '>+1gv=gv"; + options = {desc = "Use move command when line is highlighted ";}; + } + + { + mode = "v"; + key = "K"; + action = ":m '>-2gv=gv"; + options = {desc = "Use move command when line is highlighted ";}; + } + + { + mode = "n"; + key = "J"; + action = "mzJ`z"; + options = { + desc = "Allow cursor to stay in the same place after appending to current line "; + }; + } + + { + mode = "n"; + key = ""; + action = "zz"; + options = { + desc = "Allow C-d and C-u to keep the cursor in the middle"; + }; + } + + { + mode = "n"; + key = ""; + action = "zz"; + options = { + desc = "Allow C-d and C-u to keep the cursor in the middle"; + }; + } + + { + mode = "n"; + key = "n"; + action = "nzzzv"; + options = {desc = "Allow search terms to stay in the middle ";}; + } + + { + mode = "n"; + key = "N"; + action = "Nzzzv"; + options = {desc = "Allow search terms to stay in the middle ";}; + } + + # Paste stuff without saving the deleted word into the buffer + { + mode = "x"; + key = "p"; + action = ''"_dP''; + options = {desc = "Deletes to void register and paste over";}; + } + + # Copy stuff to system clipboard with + y or just y to have it just in vim + { + mode = ["n" "v"]; + key = "y"; + action = ''"+y''; + options = {desc = "Copy to system clipboard";}; + } + + { + mode = ["n" "v"]; + key = "Y"; + action = ''"+Y''; + options = {desc = "Copy to system clipboard";}; + } + + # Delete to void register + { + mode = ["n" "v"]; + key = "D"; + action = ''"_d''; + options = {desc = "Delete to void register";}; + } + + # instead of pressing esc just because + { + mode = "i"; + key = ""; + action = ""; + } + + { + mode = "n"; + key = "zz"; + action = " ZenMode | Pencil"; + options = {desc = "Toggle writting mode";}; + } + + { + mode = "n"; + key = "m"; + action = " Grapple toggle "; + options = {desc = "Grapple Toggle tag";}; + } + + { + mode = "n"; + key = "k"; + action = " Grapple toggle_tags "; + options = {desc = "Grapple Toggle tag";}; + } + + { + mode = "n"; + key = "K"; + action = " Grapple toggle_scopes "; + options = {desc = "Grapple Toggle scopes";}; + } + + { + mode = "n"; + key = "j"; + action = " Grapple cycle forward "; + options = {desc = "Grapple Cycle forward";}; + } + + { + mode = "n"; + key = "J"; + action = " Grapple cycle backward "; + options = {desc = "Grapple Cycle backward";}; + } + + { + mode = "n"; + key = "1"; + action = " Grapple select index=1"; + options = {desc = "Grapple Select 1";}; + } + + { + mode = "n"; + key = "2"; + action = " Grapple select index=2"; + options = {desc = "Grapple Select 2";}; + } + + { + mode = "n"; + key = "3"; + action = " Grapple select index=3"; + options = {desc = "Grapple Select 3";}; + } + + { + mode = "n"; + key = "4"; + action = " Grapple select index=4"; + options = {desc = "Grapple Select 4";}; + } + ]; + extraConfigLua = '' + function ToggleLineNumber() + if vim.wo.number then + vim.wo.number = false + else + vim.wo.number = true + vim.wo.relativenumber = false + end + end + + function ToggleRelativeLineNumber() + if vim.wo.relativenumber then + vim.wo.relativenumber = false + else + vim.wo.relativenumber = true + vim.wo.number = false + end + end + + function ToggleWrap() + vim.wo.wrap = not vim.wo.wrap + end + ''; +}; +} diff --git a/modules/editors/nixvim/nixvim.nix b/modules/editors/nixvim/nixvim.nix new file mode 100644 index 0000000..d9a9854 --- /dev/null +++ b/modules/editors/nixvim/nixvim.nix @@ -0,0 +1,63 @@ +{ config, lib, ... }: +let cfg = config.modules.editors.nixvim; +in { + options.modules.editors.nixvim.enable = lib.mkEnableOption "nixvim"; + imports = [ + #./keys.nix + ./settings.nix + ./plug/completion/cmp.nix + #./plug/completion/copilot-cmp.nix + #./plug/completion/lspkind.nix + ./plug/git/gitlinker.nix + ./plug/git/gitsigns.nix + ./plug/git/lazygit.nix + ./plug/git/worktree.nix + + ./plug/lsp/conform.nix + ./plug/lsp/fidget.nix + ./plug/lsp/hlchunk.nix + ./plug/lsp/lsp.nix + ./plug/lsp/lspsaga.nix + ./plug/lsp/none-ls.nix + ./plug/lsp/trouble.nix + + ./plug/snippets/luasnip.nix + + ./plug/statusline/lualine.nix + #./plug/statusline/staline.nix + + #./plug/treesitter/treesitter-context.nix + ./plug/treesitter/treesitter-textobjects.nix + ./plug/treesitter/treesitter.nix + + #./plug/ui/alpha.nix + ./plug/ui/btw.nix + ./plug/ui/bufferline.nix + ./plug/ui/noice.nix + ./plug/ui/nvim-notify.nix + ./plug/ui/telescope.nix + + ./plug/utils/comment.nix + ./plug/utils/copilot.nix + ./plug/utils/flash.nix + ./plug/utils/hardtime.nix + #./plug/utils/harpoon.nix + ./plug/utils/grapple.nix + ./plug/utils/illuminate.nix + ./plug/utils/nvim-autopairs.nix + ./plug/utils/oil.nix + ./plug/utils/undotree.nix + ./plug/utils/ufo.nix + ./plug/utils/whichkey.nix + + ]; + config = lib.mkIf cfg.enable { + programs.nixvim = { + enable = true; + colorschemes.gruvbox = { + enable = true; + settings.transparent_mode = true; + }; + }; + }; +} diff --git a/modules/editors/nixvim/plug/completion/cmp.nix b/modules/editors/nixvim/plug/completion/cmp.nix new file mode 100644 index 0000000..47059c4 --- /dev/null +++ b/modules/editors/nixvim/plug/completion/cmp.nix @@ -0,0 +1,120 @@ +{ + programs.nixvim.plugins = { + cmp-emoji = {enable = true;}; + cmp = { + enable = true; + settings = { + autoEnableSources = true; + experimental = {ghost_text = true;}; + performance = { + debounce = 60; + fetchingTimeout = 200; + maxViewEntries = 30; + }; + snippet = {expand = "luasnip";}; + formatting = {fields = ["kind" "abbr" "menu"];}; + sources = [ + {name = "nvim_lsp";} + {name = "emoji";} + { + name = "buffer"; # text within current buffer + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + keywordLength = 3; + } + { + name = "path"; # file system paths + keywordLength = 3; + } + { + name = "luasnip"; # snippets + keywordLength = 3; + } + ]; + + window = { + completion = {border = "solid";}; + documentation = {border = "solid";}; + }; + + mapping = { + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.abort()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.confirm({ select = true })"; + "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; + }; + }; + }; + cmp-nvim-lsp = {enable = true;}; # lsp + cmp-buffer = {enable = true;}; + cmp-path = {enable = true;}; # file system paths + cmp_luasnip = {enable = true;}; # snippets + cmp-cmdline = {enable = false;}; # autocomplete for cmdline + }; + extraConfigLua = '' + luasnip = require("luasnip") + 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 = "", + } + + local cmp = require'cmp' + + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({'/', "?" }, { + sources = { + { name = 'buffer' } + } + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + -- formatting = { + -- format = function(_, vim_item) + -- vim_item.kind = cmdIcons[vim_item.kind] or "FOO" + -- return vim_item + -- end + -- } + }) ''; +} diff --git a/modules/editors/nixvim/plug/git/gitlinker.nix b/modules/editors/nixvim/plug/git/gitlinker.nix new file mode 100644 index 0000000..5c14efa --- /dev/null +++ b/modules/editors/nixvim/plug/git/gitlinker.nix @@ -0,0 +1,8 @@ +{ + programs.nixvim.plugins.gitlinker = { + enable = true; + callbacks = { + "gihub.com" = "get_github_type_url"; + }; + }; +} diff --git a/modules/editors/nixvim/plug/git/gitsigns.nix b/modules/editors/nixvim/plug/git/gitsigns.nix new file mode 100644 index 0000000..c8ed868 --- /dev/null +++ b/modules/editors/nixvim/plug/git/gitsigns.nix @@ -0,0 +1,76 @@ +{ + programs.nixvim.plugins.gitsigns = { + enable = true; + settings = { + trouble = true; + current_line_blame = true; + signs = { + add = { + text = "│"; + }; + change = { + text = "│"; + }; + delete = { + text = "_"; + }; + topdelete = { + text = "‾"; + }; + changedelete = { + text = "~"; + }; + untracked = { + text = "│"; + }; + }; + }; + }; + keymaps = [ + { + mode = ["n" "v"]; + key = "gh"; + action = "gitsigns"; + options = { + silent = true; + desc = "+hunks"; + }; + } + { + mode = "n"; + key = "ghb"; + action = ":Gitsigns blame_line"; + options = { + silent = true; + desc = "Blame line"; + }; + } + { + mode = "n"; + key = "ghd"; + action = ":Gitsigns diffthis"; + options = { + silent = true; + desc = "Diff This"; + }; + } + { + mode = "n"; + key = "ghR"; + action = ":Gitsigns reset_buffer"; + options = { + silent = true; + desc = "Reset Buffer"; + }; + } + { + mode = "n"; + key = "ghS"; + action = ":Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + ]; +} diff --git a/modules/editors/nixvim/plug/git/lazygit.nix b/modules/editors/nixvim/plug/git/lazygit.nix new file mode 100644 index 0000000..1bacd5f --- /dev/null +++ b/modules/editors/nixvim/plug/git/lazygit.nix @@ -0,0 +1,22 @@ +{pkgs, ...}: { + programs.nixvim = { + extraPlugins = with pkgs.vimPlugins; [ + lazygit-nvim + ]; + + extraConfigLua = '' + require("telescope").load_extension("lazygit") + ''; + + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "LazyGit"; + options = { + desc = "LazyGit (root dir)"; + }; + } + ]; +}; +} diff --git a/modules/editors/nixvim/plug/git/worktree.nix b/modules/editors/nixvim/plug/git/worktree.nix new file mode 100644 index 0000000..de5ac19 --- /dev/null +++ b/modules/editors/nixvim/plug/git/worktree.nix @@ -0,0 +1,6 @@ +{ + programs.nixvim.plugins.git-worktree = { + enable = true; + enableTelescope = true; + }; +} diff --git a/modules/editors/nixvim/plug/lsp/conform.nix b/modules/editors/nixvim/plug/lsp/conform.nix new file mode 100644 index 0000000..5550558 --- /dev/null +++ b/modules/editors/nixvim/plug/lsp/conform.nix @@ -0,0 +1,24 @@ +{ + programs.nixvim.plugins.conform-nvim = { + enable = true; + formatOnSave = { + lspFallback = true; + timeoutMs = 500; + }; + notifyOnError = true; + formattersByFt = { + liquidsoap = ["liquidsoap-prettier"]; + html = [["prettierd" "prettier"]]; + css = [["prettierd" "prettier"]]; + javascript = [["prettierd" "prettier"]]; + javascriptreact = [["prettierd" "prettier"]]; + typescript = [["prettierd" "prettier"]]; + typescriptreact = [["prettierd" "prettier"]]; + python = ["black"]; + lua = ["stylua"]; + nix = ["alejandra"]; + markdown = [["prettierd" "prettier"]]; + yaml = ["yamllint" "yamlfmt"]; + }; + }; +} diff --git a/modules/editors/nixvim/plug/lsp/fidget.nix b/modules/editors/nixvim/plug/lsp/fidget.nix new file mode 100644 index 0000000..1cd9e6b --- /dev/null +++ b/modules/editors/nixvim/plug/lsp/fidget.nix @@ -0,0 +1,101 @@ +{ + programs.nixvim = { + plugins.fidget = { + enable = true; + logger = { + level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + floatPrecision = 0.01; # Limit the number of decimals displayed for floats + }; + progress = { + pollRate = 0; # How and when to poll for progress messages + suppressOnInsert = true; # Suppress new messages while in insert mode + ignoreDoneAlready = false; # Ignore new tasks that are already complete + ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message + clearOnDetach = + # Clear notification group when LSP server detaches + '' + function(client_id) + local client = vim.lsp.get_client_by_id(client_id) + return client and client.name or nil + end + ''; + notificationGroup = + # How to get a progress message's notification group key + '' + function(msg) return msg.lsp_client.name end + ''; + ignore = []; # List of LSP servers to ignore + lsp = { + progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size + }; + display = { + renderLimit = 16; # How many LSP messages to show at once + doneTtl = 3; # How long a message should persist after completion + doneIcon = "✔"; # Icon shown when all LSP progress tasks are complete + doneStyle = "Constant"; # Highlight group for completed LSP tasks + progressTtl = "math.huge"; # How long a message should persist when in progress + progressIcon = { + pattern = "dots"; + period = 1; + }; # Icon shown when LSP progress tasks are in progress + progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks + groupStyle = "Title"; # Highlight group for group name (LSP server name) + iconStyle = "Question"; # Highlight group for group icons + priority = 30; # Ordering priority for LSP notification group + skipHistory = true; # Whether progress notifications should be omitted from history + formatMessage = '' + require ("fidget.progress.display").default_format_message + ''; # How to format a progress message + formatAnnote = '' + function (msg) return msg.title end + ''; # How to format a progress annotation + formatGroupName = '' + function (group) return tostring (group) end + ''; # How to format a progress notification group's name + overrides = { + rust_analyzer = { + name = "rust-analyzer"; + }; + }; # Override options from the default notification config + }; + }; + notification = { + pollRate = 10; # How frequently to update and render notifications + filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + historySize = 128; # Number of removed messages to retain in history + overrideVimNotify = true; + redirect = '' + function(msg, level, opts) + if opts and opts.on_open then + return require("fidget.integration.nvim-notify").delegate(msg, level, opts) + end + end + ''; + configs = { + default = "require('fidget.notification').default_config"; + }; + + window = { + normalHl = "Comment"; + winblend = 0; + border = "none"; # none, single, double, rounded, solid, shadow + zindex = 45; + maxWidth = 0; + maxHeight = 0; + xPadding = 1; + yPadding = 0; + align = "bottom"; + relative = "editor"; + }; + view = { + stackUpwards = true; # Display notification items from bottom to top + iconSeparator = " "; # Separator between group name and icon + groupSeparator = "---"; # Separator between notification groups + groupSeparatorHl = + # Highlight group used for group separator + "Comment"; + }; + }; + }; +}; +} diff --git a/modules/editors/nixvim/plug/lsp/hlchunk.nix b/modules/editors/nixvim/plug/lsp/hlchunk.nix new file mode 100644 index 0000000..190618c --- /dev/null +++ b/modules/editors/nixvim/plug/lsp/hlchunk.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + programs.nixvim.extraPlugins = [ + (pkgs.vimUtils.buildVimPlugin { + name = "hlchunk"; + src = pkgs.fetchFromGitHub { + owner = "shellRaining"; + repo = "hlchunk.nvim"; + rev = "882d1bc86d459fa8884398223c841fd09ea61b6b"; + hash = "sha256-fvFvV7KAOo7xtOCjhGS5bDUzwd10DndAKs3++dunED8="; + }; + }) + ]; +} diff --git a/modules/editors/nixvim/plug/lsp/lsp.nix b/modules/editors/nixvim/plug/lsp/lsp.nix new file mode 100644 index 0000000..ffe2384 --- /dev/null +++ b/modules/editors/nixvim/plug/lsp/lsp.nix @@ -0,0 +1,98 @@ +{ + programs.nixvim = { + plugins = { + lsp-format = {enable = true;}; + lsp = { + enable = true; + servers = { + eslint = {enable = true;}; + html = {enable = true;}; + lua-ls = {enable = true;}; + nil_ls = {enable = true;}; + marksman = {enable = true;}; + pyright = {enable = true;}; + gopls = {enable = true;}; + terraformls = {enable = true;}; + tsserver = {enable = false;}; + yamlls = { + enable = true; + }; + }; + keymaps = { + silent = true; + lspBuf = { + gd = { + action = "definition"; + desc = "Goto Definition"; + }; + gr = { + action = "references"; + desc = "Goto References"; + }; + gD = { + action = "declaration"; + desc = "Goto Declaration"; + }; + gI = { + action = "implementation"; + desc = "Goto Implementation"; + }; + gT = { + action = "type_definition"; + desc = "Type Definition"; + }; + K = { + action = "hover"; + desc = "Hover"; + }; + "cw" = { + action = "workspace_symbol"; + desc = "Workspace Symbol"; + }; + "cr" = { + action = "rename"; + desc = "Rename"; + }; + }; + diagnostic = { + "cd" = { + action = "open_float"; + desc = "Line Diagnostics"; + }; + "[d" = { + action = "goto_next"; + desc = "Next Diagnostic"; + }; + "]d" = { + action = "goto_prev"; + desc = "Previous Diagnostic"; + }; + }; + }; + }; + }; + extraConfigLua = '' + local _border = "rounded" + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = _border + } + ) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = _border + } + ) + + vim.diagnostic.config{ + float={border=_border} + }; + + require('lspconfig.ui.windows').default_options = { + border = _border + } + ''; +}; +} diff --git a/modules/editors/nixvim/plug/lsp/lspsaga.nix b/modules/editors/nixvim/plug/lsp/lspsaga.nix new file mode 100644 index 0000000..e3052e4 --- /dev/null +++ b/modules/editors/nixvim/plug/lsp/lspsaga.nix @@ -0,0 +1,188 @@ +{ + programs.nixvim = { + plugins.lspsaga = { + enable = true; + beacon = { + enable = true; + }; + ui = { + border = "rounded"; # One of none, single, double, rounded, solid, shadow + codeAction = "💡"; # Can be any symbol you want 💡 + }; + hover = { + openCmd = "!floorp"; # Choose your browser + openLink = "gx"; + }; + diagnostic = { + borderFollow = true; + diagnosticOnlyCurrent = false; + showCodeAction = true; + }; + symbolInWinbar = { + enable = true; # Breadcrumbs + }; + codeAction = { + extendGitSigns = false; + showServerName = true; + onlyInCursor = true; + numShortcut = true; + keys = { + exec = ""; + quit = ["" "q"]; + }; + }; + lightbulb = { + enable = false; + sign = false; + virtualText = true; + }; + implement = { + enable = false; + }; + rename = { + autoSave = false; + keys = { + exec = ""; + quit = ["" ""]; + select = "x"; + }; + }; + outline = { + autoClose = true; + autoPreview = true; + closeAfterJump = true; + layout = "normal"; # normal or float + winPosition = "right"; # left or right + keys = { + jump = "e"; + quit = "q"; + toggleOrJump = "o"; + }; + }; + scrollPreview = { + scrollDown = ""; + scrollUp = ""; + }; + }; + keymaps = [ + { + mode = "n"; + key = "gd"; + action = "Lspsaga finder def"; + options = { + desc = "Goto Definition"; + silent = true; + }; + } + { + mode = "n"; + key = "gr"; + action = "Lspsaga finder ref"; + options = { + desc = "Goto References"; + silent = true; + }; + } + + # { + # mode = "n"; + # key = "gD"; + # action = "Lspsaga show_line_diagnostics"; + # options = { + # desc = "Goto Declaration"; + # silent = true; + # }; + # } + + { + mode = "n"; + key = "gI"; + action = "Lspsaga finder imp"; + options = { + desc = "Goto Implementation"; + silent = true; + }; + } + + { + mode = "n"; + key = "gT"; + action = "Lspsaga peek_type_definition"; + options = { + desc = "Type Definition"; + silent = true; + }; + } + + { + mode = "n"; + key = "K"; + action = "Lspsaga hover_doc"; + options = { + desc = "Hover"; + silent = true; + }; + } + + { + mode = "n"; + key = "cw"; + action = "Lspsaga outline"; + options = { + desc = "Outline"; + silent = true; + }; + } + + { + mode = "n"; + key = "cr"; + action = "Lspsaga rename"; + options = { + desc = "Rename"; + silent = true; + }; + } + + { + mode = "n"; + key = "ca"; + action = "Lspsaga code_action"; + options = { + desc = "Code Action"; + silent = true; + }; + } + + { + mode = "n"; + key = "cd"; + action = "Lspsaga show_line_diagnostics"; + options = { + desc = "Line Diagnostics"; + silent = true; + }; + } + + { + mode = "n"; + key = "[d"; + action = "Lspsaga diagnostic_jump_next"; + options = { + desc = "Next Diagnostic"; + silent = true; + }; + } + + { + mode = "n"; + key = "]d"; + action = "Lspsaga diagnostic_jump_prev"; + options = { + desc = "Previous Diagnostic"; + silent = true; + }; + } + ]; +}; +} diff --git a/modules/editors/nixvim/plug/lsp/none-ls.nix b/modules/editors/nixvim/plug/lsp/none-ls.nix new file mode 100644 index 0000000..d7c4245 --- /dev/null +++ b/modules/editors/nixvim/plug/lsp/none-ls.nix @@ -0,0 +1,50 @@ +{ + plugins.none-ls = { + enable = true; + enableLspFormat = true; + updateInInsert = false; + sources = { + code_actions = { + gitsigns.enable = true; + statix.enable = true; + }; + diagnostics = { + statix.enable = true; + yamllint.enable = true; + }; + formatting = { + alejandra.enable = true; + black = { + enable = true; + withArgs = '' + { + extra_args = { "--fast" }, + } + ''; + }; + prettier = { + enable = true; + disableTsServerFormatter = true; + withArgs = '' + { + extra_args = { "--no-semi", "--single-quote" }, + } + ''; + }; + stylua.enable = true; + yamlfmt.enable = true; + }; + }; + }; + keymaps = [ + { + mode = ["n" "v"]; + key = "cf"; + action = "lua vim.lsp.buf.format()"; + options = { + silent = true; + desc = "Format"; + }; + } + ]; +} diff --git a/modules/editors/nixvim/plug/lsp/trouble.nix b/modules/editors/nixvim/plug/lsp/trouble.nix new file mode 100644 index 0000000..343c92f --- /dev/null +++ b/modules/editors/nixvim/plug/lsp/trouble.nix @@ -0,0 +1,5 @@ +{ + plugins.trouble = { + enable = true; + }; +} diff --git a/modules/editors/nixvim/plug/snippets/luasnip.nix b/modules/editors/nixvim/plug/snippets/luasnip.nix new file mode 100644 index 0000000..3a3c41a --- /dev/null +++ b/modules/editors/nixvim/plug/snippets/luasnip.nix @@ -0,0 +1,15 @@ +{pkgs, ...}: { + plugins.luasnip = { + enable = true; + extraConfig = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + fromVscode = [ + { + lazyLoad = true; + paths = "${pkgs.vimPlugins.friendly-snippets}"; + } + ]; + }; +} diff --git a/modules/editors/nixvim/plug/statusline/lualine.nix b/modules/editors/nixvim/plug/statusline/lualine.nix new file mode 100644 index 0000000..b47efbd --- /dev/null +++ b/modules/editors/nixvim/plug/statusline/lualine.nix @@ -0,0 +1,113 @@ +{ + plugins.lualine = { + enable = true; + globalstatus = true; + disabledFiletypes = { + statusline = ["dashboard" "alpha" "starter"]; + }; + theme = { + normal = { + a = { + bg = "#b4befe"; + fg = "#1c1d21"; + }; + b = { + bg = "nil"; + }; + c = { + bg = "nil"; + }; + z = { + bg = "nil"; + }; + y = { + bg = "nil"; + }; + }; + }; + sections = { + lualine_a = [ + { + name = "mode"; + fmt = "string.lower"; + color = { + fg = + "none"; + bg = + "none"; + }; + } + ]; + lualine_b = [ + { + name = "branch"; + icon = ""; + color = { + fg = + "none"; + bg = + "none"; + }; + } + "diff" + ]; + lualine_c = [ + { + name = "diagnostic"; + extraConfig = { + symbols = { + error = " "; + warn = " "; + info = " "; + hint = "󰝶 "; + }; + }; + color = { + fg = + "none"; + bg = + "none"; + }; + } + ]; + lualine_x = [ + { + name = "filetype"; + extraConfig = { + icon_only = true; + }; + } + ]; + lualine_y = [ + { + name = "filename"; + extraConfig = { + symbols = { + modified = ""; + readonly = ""; + unnamed = ""; + }; + }; + color = { + fg = + "none"; + bg = + "none"; + }; + separator.left = ""; + } + ]; + lualine_z = [ + { + name = "location"; + color = { + fg = + "none"; + bg = + "none"; + }; + } + ]; + }; + }; +} diff --git a/modules/editors/nixvim/plug/statusline/staline.nix b/modules/editors/nixvim/plug/statusline/staline.nix new file mode 100644 index 0000000..ae07bb8 --- /dev/null +++ b/modules/editors/nixvim/plug/statusline/staline.nix @@ -0,0 +1,65 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "staline.nvim"; + version = "2024-02-05"; + src = pkgs.fetchFromGitHub { + owner = "tamton-aquib"; + repo = "staline.nvim"; + rev = "a53f869278b8b186a5afd6f21680cd103c381599"; + hash = "sha256-GDMKzxFDtQk5LL+rMsxTGTyLv69w5NUd+u19noeO5ws="; + }; + }) + ]; + extraConfigLua = '' + require("staline").setup({ + sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + inactive_sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + defaults = { + left_separator = " ", + right_separator = " ", + branch_symbol = " ", + mod_symbol = "", + line_column = "[%l/%L]", + inactive_color = "#80a6f2", --#303030 is the default + inactive_bgcolor = "none", + }, + special_table = { + lazy = { "Plugins", "💤 " }, + TelescopePrompt = { "Telescope", " " }, + oil = { "Oil", "󰏇 " }, + lazygit = { "LazyGit", " " }, + }, + mode_icons = { + ["n"] = "NORMAL", + ["no"] = "NORMAL", + ["nov"] = "NORMAL", + ["noV"] = "NORMAL", + ["niI"] = "NORMAL", + ["niR"] = "NORMAL", + ["niV"] = "NORMAL", + ["i"] = "INSERT", + ["ic"] = "INSERT", + ["ix"] = "INSERT", + ["s"] = "INSERT", + ["S"] = "INSERT", + ["v"] = "VISUAL", + ["V"] = "VISUAL", + [""] = "VISUAL", + ["r"] = "REPLACE", + ["r?"] = "REPLACE", + ["R"] = "REPLACE", + ["c"] = "COMMAND", + ["t"] = "TERMINAL", + }, + }) + ''; +} diff --git a/modules/editors/nixvim/plug/treesitter/treesitter-context.nix b/modules/editors/nixvim/plug/treesitter/treesitter-context.nix new file mode 100644 index 0000000..b588c8f --- /dev/null +++ b/modules/editors/nixvim/plug/treesitter/treesitter-context.nix @@ -0,0 +1,5 @@ +{ + plugins.treesitter-context = { + enable = true; + }; +} diff --git a/modules/editors/nixvim/plug/treesitter/treesitter-textobjects.nix b/modules/editors/nixvim/plug/treesitter/treesitter-textobjects.nix new file mode 100644 index 0000000..29820cf --- /dev/null +++ b/modules/editors/nixvim/plug/treesitter/treesitter-textobjects.nix @@ -0,0 +1,50 @@ +{ + plugins.treesitter-textobjects = { + enable = false; + select = { + enable = true; + lookahead = true; + keymaps = { + "aa" = "@parameter.outer"; + "ia" = "@parameter.inner"; + "af" = "@function.outer"; + "if" = "@function.inner"; + "ac" = "@class.outer"; + "ic" = "@class.inner"; + "ii" = "@conditional.inner"; + "ai" = "@conditional.outer"; + "il" = "@loop.inner"; + "al" = "@loop.outer"; + "at" = "@comment.outer"; + }; + }; + move = { + enable = true; + gotoNextStart = { + "]m" = "@function.outer"; + "]]" = "@class.outer"; + }; + gotoNextEnd = { + "]M" = "@function.outer"; + "][" = "@class.outer"; + }; + gotoPreviousStart = { + "[m" = "@function.outer"; + "[[" = "@class.outer"; + }; + gotoPreviousEnd = { + "[M" = "@function.outer"; + "[]" = "@class.outer"; + }; + }; + swap = { + enable = true; + swapNext = { + "a" = "@parameters.inner"; + }; + swapPrevious = { + "A" = "@parameter.outer"; + }; + }; + }; +} diff --git a/modules/editors/nixvim/plug/treesitter/treesitter.nix b/modules/editors/nixvim/plug/treesitter/treesitter.nix new file mode 100644 index 0000000..c4f4d71 --- /dev/null +++ b/modules/editors/nixvim/plug/treesitter/treesitter.nix @@ -0,0 +1,44 @@ +{pkgs, ...}: let + nu-grammar = pkgs.tree-sitter.buildGrammar { + language = "nu"; + version = "0.0.0+rev=358c4f5"; + src = pkgs.fetchFromGitHub { + owner = "nushell"; + repo = "tree-sitter-nu"; + rev = "2d0dd587dbfc3363d2af4e4141833e718647a67e"; + hash = "sha256-A0Lpsx0VFRYUWetgX3Bn5osCsLQrZzg90unGg9kTnVg="; + }; + }; +in { + filetype.extension.liq = "liquidsoap"; + filetype.extension.nu = "nu"; + + plugins.treesitter = { + enable = true; + indent = true; + folding = true; + languageRegister.nu = "nu"; + languageRegister.liq = "liquidsoap"; + nixvimInjections = true; + grammarPackages = + [ + nu-grammar + ] + ++ pkgs.vimPlugins.nvim-treesitter.allGrammars; + }; + + extraFiles = { + "/queries/nu/highlights.scm" = builtins.readFile "${nu-grammar}/queries/nu/highlights.scm"; + "/queries/nu/injections.scm" = builtins.readFile "${nu-grammar}/queries/nu/injections.scm"; + }; + extraConfigLua = '' + local parser_config = require("nvim-treesitter.parsers").get_parser_configs() + + parser_config.liquidsoap = { + filetype = "liquidsoap", + } + parser_config.nu = { + filetype = "nu", + } + ''; +} diff --git a/modules/editors/nixvim/plug/ui/alpha.nix b/modules/editors/nixvim/plug/ui/alpha.nix new file mode 100644 index 0000000..c6e1d9c --- /dev/null +++ b/modules/editors/nixvim/plug/ui/alpha.nix @@ -0,0 +1,89 @@ +{ + plugins.alpha = let + nixFlake = [ + " " + " ▓█████ ██▓ ▓██ ██▓▄▄▄█████▓ ██░ ██ " + " ▓█ ▀ ▓██▒ ▒██ ██▒▓ ██▒ ▓▒▓██░ ██▒ " + " ▒███ ▒██░ ▒██ ██░▒ ▓██░ ▒░▒██▀▀██░ " + " ▒▓█ ▄ ▒██░ ░ ▐██▓░░ ▓██▓ ░ ░▓█ ░██ " + " ░▒████▒░██████▒ ░ ██▒▓░ ▒██▒ ░ ░▓█▒░██▓ " + " ░░ ▒░ ░░ ▒░▓ ░ ██▒▒▒ ▒ ░░ ▒ ░░▒░▒ " + " ░ ░ ░░ ░ ▒ ░▓██ ░▒░ ░ ▒ ░▒░ ░ " + " ░ ░ ░ ▒ ▒ ░░ ░ ░ ░░ ░ " + " ░ ░ ░ ░░ ░ ░ ░ ░ " + " ░ ░ " + " " + " git@github.com:elythh " + ]; + in { + enable = true; + layout = [ + { + type = "padding"; + val = 4; + } + { + opts = { + hl = "AlphaHeader"; + position = "center"; + }; + type = "text"; + val = nixFlake; + } + { + type = "padding"; + val = 2; + } + { + type = "group"; + val = let + mkButton = shortcut: cmd: val: hl: { + type = "button"; + inherit val; + opts = { + inherit hl shortcut; + keymap = [ + "n" + shortcut + cmd + {} + ]; + position = "center"; + cursor = 0; + width = 40; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + }; + in [ + ( + mkButton + "f" + "lua require('telescope.builtin').find_files({hidden = true})" + "🔍 Find File" + "Operator" + ) + ( + mkButton + "q" + "qa" + "💣 Quit Neovim" + "String" + ) + ]; + } + { + type = "padding"; + val = 2; + } + { + opts = { + hl = "GruvboxBlue"; + position = "center"; + }; + type = "text"; + val = "https://github.com/elythh/nixvim"; + } + ]; + }; +} diff --git a/modules/editors/nixvim/plug/ui/btw.nix b/modules/editors/nixvim/plug/ui/btw.nix new file mode 100644 index 0000000..5e063cd --- /dev/null +++ b/modules/editors/nixvim/plug/ui/btw.nix @@ -0,0 +1,20 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "btw.nvim"; + version = "2024-04-36"; + src = pkgs.fetchFromGitHub { + owner = "letieu"; + repo = "btw.nvim"; + rev = "47f6419e90d3383987fd06e8f3e06a4bc032ac83"; + hash = "sha256-91DZUfa4FBvXnkcNHdllr82Dr1Ie+MGVD3ibwkqo04c="; + }; + }) + ]; + + extraConfigLua = '' + require('btw').setup({ + text = "I use Neovim (and NixOS, BTW)", + }) + ''; +} diff --git a/modules/editors/nixvim/plug/ui/bufferline.nix b/modules/editors/nixvim/plug/ui/bufferline.nix new file mode 100644 index 0000000..975b2f4 --- /dev/null +++ b/modules/editors/nixvim/plug/ui/bufferline.nix @@ -0,0 +1,175 @@ +{ + config, + lib, + ... +}: let + colors = import ../../colors/${config.theme}.nix {}; +in { + plugins = { + bufferline = { + enable = true; + separatorStyle = "thick"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin” + highlights = lib.mkIf config.colorschemes.base16.enable { + fill = { + fg = colors.base00; + bg = colors.base00; + }; + background = { + fg = colors.base03; + bg = colors.base00; + }; + bufferSelected = { + fg = colors.base05; + bg = colors.base00; + italic = false; + }; + bufferVisible = { + fg = colors.base03; + bg = colors.base00; + }; + closeButton = { + fg = colors.base03; + bg = colors.base00; + }; + closeButtonVisible = { + fg = colors.base03; + bg = colors.base00; + }; + closeButtonSelected = { + fg = colors.base08; + bg = colors.base00; + }; + + indicatorSelected = { + fg = colors.base00; + bg = colors.base00; + }; + modified = { + fg = colors.base03; + bg = colors.base00; + }; + modifiedVisible = { + fg = colors.base00; + bg = colors.base00; + }; + modifiedSelected = { + fg = colors.base0B; + bg = colors.base00; + }; + tabClose = { + fg = colors.base00; + bg = colors.base00; + }; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = "bd"; + action = "bdelete"; + options = { + desc = "Delete buffer"; + }; + } + + { + mode = "n"; + key = "bb"; + action = "e #"; + options = { + desc = "Switch to Other Buffer"; + }; + } + + # { + # mode = "n"; + # key = "`"; + # action = "e #"; + # options = { + # desc = "Switch to Other Buffer"; + # }; + # } + + { + mode = "n"; + key = "br"; + action = "BufferLineCloseRight"; + options = { + desc = "Delete buffers to the right"; + }; + } + + { + mode = "n"; + key = "bl"; + action = "BufferLineCloseLeft"; + options = { + desc = "Delete buffers to the left"; + }; + } + + { + mode = "n"; + key = "bo"; + action = "BufferLineCloseOthers"; + options = { + desc = "Delete other buffers"; + }; + } + + { + mode = "n"; + key = "bp"; + action = "BufferLineTogglePin"; + options = { + desc = "Toggle pin"; + }; + } + + { + mode = "n"; + key = "bP"; + action = "BufferLineGroupClose ungrouped"; + options = { + desc = "Delete non-pinned buffers"; + }; + } + ]; +} diff --git a/modules/editors/nixvim/plug/ui/noice.nix b/modules/editors/nixvim/plug/ui/noice.nix new file mode 100644 index 0000000..51db89d --- /dev/null +++ b/modules/editors/nixvim/plug/ui/noice.nix @@ -0,0 +1,36 @@ +{ + plugins.noice = { + enable = true; + notify = { + enabled = false; + }; + messages = { + enabled = true; # Adds a padding-bottom to neovim statusline when set to false for some reason + }; + lsp = { + message = { + enabled = true; + }; + progress = { + enabled = false; + view = "mini"; + }; + }; + popupmenu = { + enabled = true; + backend = "nui"; + }; + format = { + filter = { + pattern = [":%s*%%s*s:%s*" ":%s*%%s*s!%s*" ":%s*%%s*s/%s*" "%s*s:%s*" ":%s*s!%s*" ":%s*s/%s*"]; + icon = ""; + lang = "regex"; + }; + replace = { + pattern = [":%s*%%s*s:%w*:%s*" ":%s*%%s*s!%w*!%s*" ":%s*%%s*s/%w*/%s*" "%s*s:%w*:%s*" ":%s*s!%w*!%s*" ":%s*s/%w*/%s*"]; + icon = "󱞪"; + lang = "regex"; + }; + }; + }; +} diff --git a/modules/editors/nixvim/plug/ui/nvim-notify.nix b/modules/editors/nixvim/plug/ui/nvim-notify.nix new file mode 100644 index 0000000..644e708 --- /dev/null +++ b/modules/editors/nixvim/plug/ui/nvim-notify.nix @@ -0,0 +1,45 @@ +{ + plugins.notify = { + enable = true; + backgroundColour = "#000000"; + fps = 60; + render = "default"; + timeout = 1000; + topDown = true; + }; + keymaps = [ + { + mode = "n"; + key = "un"; + action = '' + lua require("notify").dismiss({ silent = true, pending = true }) + ''; + options = { + desc = "Dismiss All Notifications"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + + local filtered_message = { "No information available" } + + -- Override notify function to filter out messages + ---@diagnostic disable-next-line: duplicate-set-field + vim.notify = function(message, level, opts) + local merged_opts = vim.tbl_extend("force", { + on_open = function(win) + local buf = vim.api.nvim_win_get_buf(win) + vim.api.nvim_buf_set_option(buf, "filetype", "markdown") + end, + }, opts or {}) + + for _, msg in ipairs(filtered_message) do + if message == msg then + return + end + end + return notify(message, level, merged_opts) + end + ''; +} diff --git a/modules/editors/nixvim/plug/ui/telescope.nix b/modules/editors/nixvim/plug/ui/telescope.nix new file mode 100644 index 0000000..ddcb801 --- /dev/null +++ b/modules/editors/nixvim/plug/ui/telescope.nix @@ -0,0 +1,210 @@ +{ + plugins.telescope = { + enable = true; + extensions = { + file-browser = { + enable = true; + }; + fzf-native = { + enable = true; + }; + }; + settings = { + defaults = { + layout_config = { + horizontal = { + prompt_position = "top"; + }; + }; + sorting_strategy = "ascending"; + }; + }; + keymaps = { + "" = { + action = "find_files, {}"; + options = { + desc = "Find project files"; + }; + }; + "/" = { + action = "live_grep"; + options = { + desc = "Grep (root dir)"; + }; + }; + ":" = { + action = "command_history, {}"; + options = { + desc = "Command History"; + }; + }; + "b" = { + action = "buffers, {}"; + options = { + desc = "+buffer"; + }; + }; + "ff" = { + action = "find_files, {}"; + options = { + desc = "Find project files"; + }; + }; + "fr" = { + action = "live_grep, {}"; + options = { + desc = "Find text"; + }; + }; + "fR" = { + action = "resume, {}"; + options = { + desc = "Resume"; + }; + }; + "fg" = { + action = "oldfiles, {}"; + options = { + desc = "Recent"; + }; + }; + "fb" = { + action = "buffers, {}"; + options = { + desc = "Buffers"; + }; + }; + "" = { + action = "git_files, {}"; + options = { + desc = "Search git files"; + }; + }; + "gc" = { + action = "git_commits, {}"; + options = { + desc = "Commits"; + }; + }; + "gs" = { + action = "git_status, {}"; + options = { + desc = "Status"; + }; + }; + "sa" = { + action = "autocommands, {}"; + options = { + desc = "Auto Commands"; + }; + }; + "sb" = { + action = "current_buffer_fuzzy_find, {}"; + options = { + desc = "Buffer"; + }; + }; + "sc" = { + action = "command_history, {}"; + options = { + desc = "Command History"; + }; + }; + "sC" = { + action = "commands, {}"; + options = { + desc = "Commands"; + }; + }; + "sD" = { + action = "diagnostics, {}"; + options = { + desc = "Workspace diagnostics"; + }; + }; + "sh" = { + action = "help_tags, {}"; + options = { + desc = "Help pages"; + }; + }; + "sH" = { + action = "highlights, {}"; + options = { + desc = "Search Highlight Groups"; + }; + }; + "sk" = { + action = "keymaps, {}"; + options = { + desc = "Keymaps"; + }; + }; + "sM" = { + action = "man_pages, {}"; + options = { + desc = "Man pages"; + }; + }; + "sm" = { + action = "marks, {}"; + options = { + desc = "Jump to Mark"; + }; + }; + "so" = { + action = "vim_options, {}"; + options = { + desc = "Options"; + }; + }; + "sR" = { + action = "resume, {}"; + options = { + desc = "Resume"; + }; + }; + "uC" = { + action = "colorscheme, {}"; + options = { + desc = "Colorscheme preview"; + }; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "sd"; + action = "Telescope diagnostics bufnr=0"; + options = { + desc = "Document diagnostics"; + }; + } + { + mode = "n"; + key = "fe"; + action = "Telescope file_browser"; + options = { + desc = "File browser"; + }; + } + { + mode = "n"; + key = "fE"; + action = "Telescope file_browser path=%:p:h select_buffer=true"; + options = { + desc = "File browser"; + }; + } + ]; + extraConfigLua = '' + require("telescope").setup{ + pickers = { + colorscheme = { + enable_preview = true + } + } + } + ''; +} diff --git a/modules/editors/nixvim/plug/utils/comment.nix b/modules/editors/nixvim/plug/utils/comment.nix new file mode 100644 index 0000000..7ee4440 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/comment.nix @@ -0,0 +1,5 @@ +{ + plugins.comment = { + enable = true; + }; +} diff --git a/modules/editors/nixvim/plug/utils/copilot.nix b/modules/editors/nixvim/plug/utils/copilot.nix new file mode 100644 index 0000000..92b88d7 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/copilot.nix @@ -0,0 +1,56 @@ +{ + pkgs, + lib, + ... +}: let + copilotChatRepo = { + owner = "copilotc-nvim"; + repo = "CopilotChat.nvim"; + rev = "2771f1fa7af502ea4226a88a792f4e4319199906"; + hash = "sha256-Q+g81BQVQTY5J2c2ZWB7bjJLuNSdI0PAan+75YJ7mI0="; + }; +in { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "copilotchat"; + version = "2.4.0"; + src = pkgs.fetchFromGitHub copilotChatRepo; + meta = { + description = "Chat with GitHub Copilot in Neovim"; + homepage = "https://github.com/CopilotC-Nvim/CopilotChat.nvim/"; + license = lib.licenses.gpl3; + }; + }) + ]; + extraConfigLua = '' + require("CopilotChat").setup { } + ''; + + keymaps = [ + { + mode = "x"; + key = "a"; + action = "+copilot"; + } + { + mode = "x"; + key = "ae"; + action = "CopilotChatExplain"; + } + { + mode = "x"; + key = "af"; + action = "CopilotChatFix"; + } + { + mode = "x"; + key = "ad"; + action = "CopilotChatDocs"; + } + { + mode = "x"; + key = "ac"; + action = "CopilotChatCommit"; + } + ]; +} diff --git a/modules/editors/nixvim/plug/utils/flash.nix b/modules/editors/nixvim/plug/utils/flash.nix new file mode 100644 index 0000000..68de079 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/flash.nix @@ -0,0 +1,56 @@ +{ + plugins.flash = { + enable = true; + labels = "asdfghjklqwertyuiopzxcvbnm"; + search = { + mode = "fuzzy"; + }; + jump = { + autojump = true; + }; + label = { + uppercase = false; + rainbow = { + enabled = false; + shade = 5; + }; + }; + }; + keymaps = [ + { + mode = ["n" "x" "o"]; + key = "s"; + action = "lua require('flash').jump()"; + options = { + desc = "Flash"; + }; + } + + { + mode = ["n" "x" "o"]; + key = "S"; + action = "lua require('flash').treesitter()"; + options = { + desc = "Flash Treesitter"; + }; + } + + { + mode = "o"; + key = "r"; + action = "lua require('flash').remote()"; + options = { + desc = "Remote Flash"; + }; + } + + { + mode = ["x" "o"]; + key = "R"; + action = "lua require('flash').treesitter_search()"; + options = { + desc = "Treesitter Search"; + }; + } + ]; +} diff --git a/modules/editors/nixvim/plug/utils/grapple.nix b/modules/editors/nixvim/plug/utils/grapple.nix new file mode 100644 index 0000000..31bd6b9 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/grapple.nix @@ -0,0 +1,20 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "grapple.nvim"; + version = "1.0"; + src = pkgs.fetchFromGitHub { + owner = "cbochs"; + repo = "grapple.nvim"; + rev = "59d458e378c4884f22b7a68e61c07ed3e41aabf0"; + hash = "sha256-4k8BE9i8kG4pL7Fj0xw9cG8sjA0u4jzJ40WSV/lBFhY="; + }; + }) + ]; + + extraConfigLua = '' + require('grapple').setup({ + scope = "git_branch", + }) + ''; +} diff --git a/modules/editors/nixvim/plug/utils/hardtime.nix b/modules/editors/nixvim/plug/utils/hardtime.nix new file mode 100644 index 0000000..ef8cbfb --- /dev/null +++ b/modules/editors/nixvim/plug/utils/hardtime.nix @@ -0,0 +1,26 @@ +{ + plugins.hardtime = { + enable = true; + enabled = true; + disableMouse = true; + disabledFiletypes = ["Oil"]; + hint = true; + maxCount = 4; + maxTime = 1000; + restrictionMode = "hint"; + restrictedKeys = { + "h" = ["n" "x"]; + "j" = ["n" "x"]; + "k" = ["n" "x"]; + "l" = ["n" "x"]; + "-" = ["n" "x"]; + "+" = ["n" "x"]; + "gj" = ["n" "x"]; + "gk" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + }; + }; +} diff --git a/modules/editors/nixvim/plug/utils/harpoon.nix b/modules/editors/nixvim/plug/utils/harpoon.nix new file mode 100644 index 0000000..b55df68 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/harpoon.nix @@ -0,0 +1,17 @@ +{ + plugins.harpoon = { + enable = true; + enableTelescope = true; + keymapsSilent = true; + keymaps = { + addFile = "ha"; + toggleQuickMenu = ""; + navFile = { + "1" = "hj"; + "2" = "hk"; + "3" = "hl"; + "4" = "hm"; + }; + }; + }; +} diff --git a/modules/editors/nixvim/plug/utils/illuminate.nix b/modules/editors/nixvim/plug/utils/illuminate.nix new file mode 100644 index 0000000..7bfedb7 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/illuminate.nix @@ -0,0 +1,13 @@ +{ + plugins.illuminate = { + enable = true; + underCursor = false; + filetypesDenylist = [ + "Outline" + "TelescopePrompt" + "alpha" + "harpoon" + "reason" + ]; + }; +} diff --git a/modules/editors/nixvim/plug/utils/nvim-autopairs.nix b/modules/editors/nixvim/plug/utils/nvim-autopairs.nix new file mode 100644 index 0000000..b748672 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/nvim-autopairs.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-autopairs = { + enable = true; + }; +} diff --git a/modules/editors/nixvim/plug/utils/oil.nix b/modules/editors/nixvim/plug/utils/oil.nix new file mode 100644 index 0000000..bacaf4e --- /dev/null +++ b/modules/editors/nixvim/plug/utils/oil.nix @@ -0,0 +1,50 @@ +{ + plugins.oil = { + enable = true; + settings = { + useDefaultKeymaps = true; + deleteToTrash = true; + float = { + padding = 2; + maxWidth = 0; # ''math.ceil(vim.o.lines * 0.8 - 4)''; + maxHeight = 0; # ''math.ceil(vim.o.columns * 0.8)''; + border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + winOptions = { + winblend = 0; + }; + }; + preview = { + border = "rounded"; + }; + keymaps = { + "g?" = "actions.show_help"; + "" = "actions.select"; + "" = "actions.select_vsplit"; + "" = "actions.select_split"; # this is used to navigate left + "" = "actions.select_tab"; + "" = "actions.preview"; + "" = "actions.close"; + "" = "actions.refresh"; + "-" = "actions.parent"; + "_" = "actions.open_cwd"; + "`" = "actions.cd"; + "~" = "actions.tcd"; + "gs" = "actions.change_sort"; + "gx" = "actions.open_external"; + "g." = "actions.toggle_hidden"; + "q" = "actions.close"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "-"; + action = ":Oil"; + options = { + desc = "Open parent directory"; + silent = true; + }; + } + ]; +} diff --git a/modules/editors/nixvim/plug/utils/ufo.nix b/modules/editors/nixvim/plug/utils/ufo.nix new file mode 100644 index 0000000..fe621f8 --- /dev/null +++ b/modules/editors/nixvim/plug/utils/ufo.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-ufo = { + enable = true; + }; +} diff --git a/modules/editors/nixvim/plug/utils/undotree.nix b/modules/editors/nixvim/plug/utils/undotree.nix new file mode 100644 index 0000000..1d6923c --- /dev/null +++ b/modules/editors/nixvim/plug/utils/undotree.nix @@ -0,0 +1,20 @@ +{ + plugins.undotree = { + enable = true; + settings = { + autoOpenDiff = true; + focusOnToggle = true; + }; + }; + keymaps = [ + { + mode = "n"; + key = "ut"; + action = "UndotreeToggle"; + options = { + silent = true; + desc = "Undotree"; + }; + } + ]; +} diff --git a/modules/editors/nixvim/plug/utils/whichkey.nix b/modules/editors/nixvim/plug/utils/whichkey.nix new file mode 100644 index 0000000..f075fae --- /dev/null +++ b/modules/editors/nixvim/plug/utils/whichkey.nix @@ -0,0 +1,5 @@ +{ + plugins.which-key = { + enable = true; + }; +} diff --git a/modules/editors/nixvim/settings.nix b/modules/editors/nixvim/settings.nix new file mode 100644 index 0000000..f0ed2e6 --- /dev/null +++ b/modules/editors/nixvim/settings.nix @@ -0,0 +1,88 @@ +{ + config = { + programs.nixvim.opts = { + # Enable relative line numbers + number = true; + relativenumber = true; + # Set tabs to 2 spaces + tabstop = 2; + softtabstop = 2; + showtabline = 2; + expandtab = true; + + # Enable auto indenting and set it to spaces + smartindent = true; + shiftwidth = 2; + # Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim) + breakindent = true; + + # Enable incremental searching + hlsearch = true; + incsearch = true; + + # Enable text wrap + wrap = true; + + # Better splitting + splitbelow = true; + splitright = true; + + # Enable mouse mode + mouse = "a"; # Mouse + + # Enable ignorecase + smartcase for better searching + ignorecase = true; + smartcase = true; # Don't ignore case with capitals + grepprg = "rg --vimgrep"; + grepformat = "%f:%l:%c:%m"; + + # Decrease updatetime + updatetime = 50; # faster completion (4000ms default) + + # Set completeopt to have a better completion experience + completeopt = ["menuone" "noselect" "noinsert"]; # mostly just for cmp + + # Enable persistent undo history + swapfile = false; + backup = false; + undofile = true; + + # Enable 24-bit colors + termguicolors = true; + + # Enable the sign column to prevent the screen from jumping + # signcolumn = "yes"; + + # Enable cursor line highlight + cursorline = true; # Highlight the line where the cursor is located + + # Set fold settings + # These options were reccommended by nvim-ufo + # See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration + foldcolumn = "0"; + foldlevel = 99; + foldlevelstart = 99; + foldenable = true; + + # Always keep 8 lines above/below cursor unless at start/end of file + scrolloff = 8; + + # Place a column line + # colorcolumn = "80"; + + # Reduce which-key timeout to 10ms + timeoutlen = 10; + + # Set encoding type + encoding = "utf-8"; + fileencoding = "utf-8"; + + # More space in the neovim command line for displaying messages + cmdheight = 0; + + # We don't need to see things like INSERT anymore + showmode = false; + + }; + }; +} diff --git a/modules/gui/spicetify.nix b/modules/gui/spicetify.nix index 489ad54..39c89ae 100644 --- a/modules/gui/spicetify.nix +++ b/modules/gui/spicetify.nix @@ -1,13 +1,12 @@ { config, pkgs, lib, inputs, ... }: -with lib; let cfg = config.modules.programs.spicetify; username = config.modules.other.system.username; spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; # inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix; in { - options.modules.programs.spicetify.enable = mkEnableOption "spicetify"; - config = mkIf cfg.enable { + options.modules.programs.spicetify.enable = lib.mkEnableOption "spicetify"; + config = lib.mkIf cfg.enable { home-manager.users.${username} = { imports = [ inputs.spicetify-nix.homeManagerModule ]; programs.spicetify = { diff --git a/modules/gui/waybar.nix b/modules/gui/waybar.nix index 56880b3..2288a93 100644 --- a/modules/gui/waybar.nix +++ b/modules/gui/waybar.nix @@ -1,11 +1,10 @@ { config, lib, inputs, pkgs, ... }: -with lib; let cfg = config.modules.programs.waybar; inherit (config.modules.other.system) username; in { - options.modules.programs.waybar.enable = mkEnableOption "waybar"; - config = mkIf cfg.enable { + options.modules.programs.waybar.enable = lib.mkEnableOption "waybar"; + config = lib.mkIf cfg.enable { home-manager.users.${username} = { programs.waybar = { enable = true; diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index 51e52bc..998f8bd 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -1,18 +1,17 @@ { config, pkgs, lib, inputs, ... }: -with lib; let cfg = config.modules.wms.wayland.hyprland; username = config.modules.other.system.username; inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; inherit (inputs.anyrun.packages.${pkgs.system}) anyrun; inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) - foot wl-clipboard swww wlsunset; + foot swww wlsunset; inherit (inputs.waybar.packages.${pkgs.system}) waybar; inherit (inputs.split-monitor-workspaces.packages.${pkgs.system}) split-monitor-workspaces; in { - options.modules.wms.wayland.hyprland.enable = mkEnableOption "hyprland"; - config = mkIf cfg.enable { + options.modules.wms.wayland.hyprland.enable = lib.mkEnableOption "hyprland"; + config = lib.mkIf cfg.enable { # xdg Portal xdg.portal = { diff --git a/modules/wms/wayland/variables.nix b/modules/wms/wayland/variables.nix index 58e8dc7..bec3560 100644 --- a/modules/wms/wayland/variables.nix +++ b/modules/wms/wayland/variables.nix @@ -1,19 +1,18 @@ { config, lib, ... }: -with lib; let cfg = config.modules.wms.wayland; hyprland = config.modules.wms.wayland.hyprland; in { - options.modules.wms.wayland.enable = mkEnableOption "wayland"; + options.modules.wms.wayland.enable = lib.mkEnableOption "wayland"; # options.modules.wms.wayland.hyprland.enable = mkEnableOption "hyprland"; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # lib.mkMerge [ # { environment.variables = { NIXOS_OZONE_WL = "1"; __GL_GSYNC_ALLOWED = "0"; __GL_VRR_ALLOWED = "0"; - # _JAVA_AWT_WM_NONEREPARENTING = "1"; + # _JAVA_AWT_WM_NONEREPARENTING = "1"; # SSH_AUTH_SOCK = "/run/user/1000/keyring/ssh"; DISABLE_QT5_COMPAT = "0"; GDK_BACKEND = "wayland,x11";