From 92c34e0c2892de07e72702348ff5389154af9ffb Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:57:37 +0100 Subject: [PATCH] remove nvf Former-commit-id: 5851e00adf85ee33156d35b968da720917d1224b --- home/programs/nvf/default.nix | 15 -- home/programs/nvf/languages/completion.nix | 10 -- home/programs/nvf/languages/default.nix | 76 -------- home/programs/nvf/mini.nix | 29 ---- home/programs/nvf/notes/default.nix | 3 - home/programs/nvf/notes/obsidian.nix | 191 --------------------- home/programs/nvf/options.nix | 60 ------- home/programs/nvf/snippets/default.nix | 57 ------ home/programs/nvf/visual.nix | 51 ------ 9 files changed, 492 deletions(-) delete mode 100644 home/programs/nvf/default.nix delete mode 100644 home/programs/nvf/languages/completion.nix delete mode 100644 home/programs/nvf/languages/default.nix delete mode 100644 home/programs/nvf/mini.nix delete mode 100644 home/programs/nvf/notes/default.nix delete mode 100644 home/programs/nvf/notes/obsidian.nix delete mode 100644 home/programs/nvf/options.nix delete mode 100644 home/programs/nvf/snippets/default.nix delete mode 100644 home/programs/nvf/visual.nix diff --git a/home/programs/nvf/default.nix b/home/programs/nvf/default.nix deleted file mode 100644 index 71853c3..0000000 --- a/home/programs/nvf/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ inputs, ... }: -{ - imports = [ - inputs.nvf.homeManagerModules.default - ./mini.nix - ./options.nix - ./languages - ./snippets - ./visual.nix - ]; - - programs.nvf = { - enable = true; - }; -} diff --git a/home/programs/nvf/languages/completion.nix b/home/programs/nvf/languages/completion.nix deleted file mode 100644 index c6243b7..0000000 --- a/home/programs/nvf/languages/completion.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - programs.nvf.settings = { - vim = { - assistant.copilot.cmp.enable = true; - assistant.copilot.enable = true; - autocomplete.nvim-cmp.enable = true; - # autocomplete.nvim-cmp.setupOpts.signature.enabled = true; - }; - }; -} diff --git a/home/programs/nvf/languages/default.nix b/home/programs/nvf/languages/default.nix deleted file mode 100644 index 029c3aa..0000000 --- a/home/programs/nvf/languages/default.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./completion.nix - ]; - - programs.nvf.settings = { - vim = { - languages = { - # Options applied to all languages - enableLSP = true; - enableFormat = true; - enableTreesitter = true; - enableExtraDiagnostics = true; - enableDAP = true; - - # Languages - nix = { - enable = true; - format = { - type = "nixfmt"; - package = pkgs.nixfmt-rfc-style; - }; - }; - markdown = { - enable = true; - lsp.enable = true; - format.type = "prettierd"; - format.enable = false; - }; - ts.enable = true; - html.enable = true; - css.enable = true; - tailwind.enable = true; - go.enable = true; - bash.enable = true; - svelte = { - enable = true; - lsp.enable = true; - treesitter.enable = true; - format.enable = true; - extraDiagnostics.enable = true; - }; - - }; - - lsp = { - formatOnSave = true; - # lspkind.enable = true; - trouble.enable = true; - # lspSignature.enable = true; - otter-nvim.enable = true; - }; - - debugger = { - nvim-dap = { - enable = true; - ui.enable = true; - }; - }; - - # startPlugins = [ pkgs.vimPlugins.nvim-treesitter.withAllGrammars ]; - - treesitter = { - enable = true; - addDefaultGrammars = true; - autotagHtml = true; - # Maybe just install every single one? - grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ - yaml # Affects obsidian note frontmatter - latex - ]; - }; - }; - }; -} diff --git a/home/programs/nvf/mini.nix b/home/programs/nvf/mini.nix deleted file mode 100644 index d25dae0..0000000 --- a/home/programs/nvf/mini.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ lib, ... }: -{ - programs.nvf.settings = { - vim = { - mini = { - icons.enable = true; - statusline.enable = true; - git.enable = true; - diff.enable = true; - align.enable = true; - notify.enable = true; - operators.enable = true; - starter.enable = true; - comment.enable = true; - move.enable = true; - pairs.enable = true; - splitjoin.enable = true; - bracketed.enable = true; - indentscope = { - enable = true; - setupOpts.draw.animation = lib.generators.mkLuaInline ''require("mini.indentscope").gen_animation.none()''; - }; - }; - - keymaps = [ - ]; - }; - }; -} diff --git a/home/programs/nvf/notes/default.nix b/home/programs/nvf/notes/default.nix deleted file mode 100644 index 0db3279..0000000 --- a/home/programs/nvf/notes/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/home/programs/nvf/notes/obsidian.nix b/home/programs/nvf/notes/obsidian.nix deleted file mode 100644 index 164c7c8..0000000 --- a/home/programs/nvf/notes/obsidian.nix +++ /dev/null @@ -1,191 +0,0 @@ -{ - lib, - util, - colorScheme', - ... -}: -let - vault_path = "notes/obsidian"; -in -{ - vim = { - notes.obsidian = { - enable = true; - setupOpts = { - mappings = [ ]; - log_level = lib.generators.mkLuaInline "vim.log.levels.ERROR"; - - workspaces = [ - { - name = "personal"; - path = "~/${vault_path}"; - } - ]; - notes_subdir = "Notes"; - attachments.img_folder = "Assets"; - daily_notes = { - folder = "Daily"; - date_format = "%Y-%m-%d"; - default_tags = [ "daily-notes" ]; - }; - - picker = { - name = "fzf-lua"; - mappings.new = ""; - mappings.insert_link = ""; - tag_mappings.tag_note = ""; - tag_mappings.insert_tag = ""; - }; - - # [[this]] type of links - preferred_link_style = "wiki"; - - disable_frontmatter = false; - note_frontmatter_func = - lib.generators.mkLuaInline # lua - '' - function (note) - if note.title then - note:add_alias(note.title) - end - - local out = { id = note.id, aliases = note.aliases, tags = note.tags } - - if not note.date then - local date = tostring(os.date("%Y-%m-%d")) - out.date = date - end - - if note.title then - out.title = note.title - end - - -- Keep existing items - if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then - for k, v in pairs(note.metadata) do - out[k] = v - end - end - - return out - end - ''; - - note_id_func = - lib.generators.mkLuaInline # lua - '' - function(title) - local name = "" - if title ~= nil then - name = title - else - -- Ask the user for a name - name = vim.fn.input("Enter note name: ") - if name == "" then - -- If no name is given, generate a random one. - for _ = 1, 5 do - name = name .. string.char(math.random(65, 90)) - end - end - end - -- transform the name into a valid file name and append the date in ISO 8601 format - local suffix = name:gsub(" ", "-"):lower():gsub("[^a-z0-9-æøå]", "") - return tostring(os.date("%Y%m%dT%H%M")) .. "-" .. suffix - end - ''; - - follow_url_func = - lib.generators.mkLuaInline # lua - '' - function(url) - vim.fn.jobstart({"wl-copy", url}) - vim.fn.jobstart({"notify-send", "Copied " .. url .. " to clipboard."}) - end - ''; - - follow_img_func = - lib.generators.mkLuaInline # lua - '' - function(url) - vim.ui.open(url) - end - ''; - - attachments = { - img_name_func = - lib.generators.mkLuaInline # lua - '' - function() - return tostring(os.date("%Y%m%dT%H%M")) .. "-" - end - ''; - }; - - ui.hl_groups = with colorScheme'; { - ObsidianTodo.fg = base0A; - ObsidianDone.fg = base0B; - ObsidianRightArrow.fg = base09; - # ObsidianTilde.fg = base0F; - # ObsidianImportant.fg = base08; - ObsidianBullet.fg = base0D; - ObsidianRefText.fg = base0E; - ObsidianExtLinkIcon.fg = base0E; - ObsidianTag.fg = base0C; - ObsidianBlockID.fg = base0C; - ObsidianHighlightText.bg = base0A; - ObsidianHighlightText.fg = base01; - }; - }; - }; - - highlight = - with colorScheme'; - lib.mapAttrs' (name: value: lib.nameValuePair "@markup.heading.${name}.markdown" { fg = value; }) { - "1" = base08; - "2" = base0A; - "3" = base0B; - "4" = base0C; - "5" = base0D; - "6" = base0E; - }; - - keymaps = [ - (util.mkKeymap "n" "od" ":ObsidianToday" "Daily note") - (util.mkKeymap "n" "oD" ":ObsidianDailies" "Daily note history") - - (util.mkKeymap "n" "oo" ":ObsidianQuickSwitch" "Open note") - (util.mkKeymap "n" "os" ":ObsidianSearch" "Search notes") - (util.mkKeymap "n" "oa" ":ObsidianOpen" "Open in app") - (util.mkKeymap "n" "or" ":ObsidianRename" "Rename note") - - (util.mkKeymap "n" "ob" ":ObsidianBacklinks" "Backlinks") - (util.mkKeymap "n" "ot" ":ObsidianTags" "Tags") - - (util.mkKeymap "n" "op" ":ObsidianPasteImg" "Paste image") - ]; - - utility.images.image-nvim = { - enable = true; - setupOpts = { - backend = "kitty"; - integrations.markdown = { - enabled = true; - only_render_image_at_cursor = true; - download_remote_images = true; - clear_in_insert_mode = true; - resolve_image_path = - lib.generators.mkLuaInline # lua - '' - function(document_path, image_path, fallback) - if string.find(document_path, "${vault_path}") then - return os.getenv("HOME") .. "/${vault_path}/" .. image_path - else - return fallback(document_path, image_path) - end - end - ''; - }; - }; - }; - }; -} diff --git a/home/programs/nvf/options.nix b/home/programs/nvf/options.nix deleted file mode 100644 index c153494..0000000 --- a/home/programs/nvf/options.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - programs.nvf.settings = { - vim = { - useSystemClipboard = true; - - options = { - # 2-space indents - tabstop = 2; - softtabstop = 2; - shiftwidth = 2; - expandtab = true; - autoindent = true; - smartindent = true; - breakindent = true; - - # Searching - hlsearch = true; - incsearch = true; - ignorecase = true; - smartcase = true; - - # Splitting - splitbelow = true; - splitright = true; - - # Undo - undofile = true; - undolevels = 10000; - swapfile = false; - backup = false; - - # Disable folding - foldlevel = 99; - foldlevelstart = 99; - - # Misc - termguicolors = true; - timeoutlen = 1000; - preserveindent = true; - showmode = false; - scrolloff = 4; - conceallevel = 3; - cmdheight = 0; - sidescrolloff = 4; - cursorline = true; - linebreak = true; - wrap = false; - writebackup = false; - encoding = "utf-8"; - fileencoding = "utf-8"; - signcolumn = "yes"; - fillchars = "eob: "; # Disable the "~" chars at end of buffer - }; - - globals = { - tex_flavor = "latex"; - }; - }; - }; -} diff --git a/home/programs/nvf/snippets/default.nix b/home/programs/nvf/snippets/default.nix deleted file mode 100644 index 6d58230..0000000 --- a/home/programs/nvf/snippets/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - programs.nvf.settings = { - vim = { - snippets.luasnip = { - enable = true; - setupOpts = { - update_events = "TextChanged,TextChangedI"; - store_selection_keys = ""; - delete_check_events = "TextChanged"; - enable_autosnippets = true; - history = false; - }; - }; - - lazy.plugins.luasnip.event = "BufEnter"; - - keymaps = [ - { - mode = "i"; - key = ""; - lua = true; - expr = true; - action = # lua - '' - function() - local ls = require("luasnip") - if ls.expand_or_locally_jumpable() then - vim.schedule(function() - ls.expand_or_jump() - end) - return "" - else - return vim.api.nvim_replace_termcodes("", true, true, true) - end - end - ''; - } - { - mode = "i"; - key = ""; - lua = true; - action = # lua - '' - function() - local ls = require("luasnip") - if ls.jumpable(-1) then - vim.schedule(function() - ls.jump(-1) - end) - end - end - ''; - } - ]; - }; - }; -} diff --git a/home/programs/nvf/visual.nix b/home/programs/nvf/visual.nix deleted file mode 100644 index f48d363..0000000 --- a/home/programs/nvf/visual.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ config, ... }: -{ - programs.nvf.settings.vim = { - filetree.neo-tree = { - enable = true; - setupOpts = { - add_blank_line_at_top = true; - }; - }; - telescope = { - enable = true; - mappings.findFiles = " "; - }; - ui.noice.enable = true; - binds.whichKey.enable = true; - - keymaps = [ - { - key = "e"; - mode = "n"; - silent = true; - action = ":Neotree toggle"; - } - ]; - visuals = { - nvim-web-devicons.enable = true; - }; - theme = { - enable = true; - name = "base16"; - base16-colors = { - base00 = config.lib.stylix.colors.base00; - base01 = config.lib.stylix.colors.base01; - base02 = config.lib.stylix.colors.base02; - base03 = config.lib.stylix.colors.base03; - base04 = config.lib.stylix.colors.base04; - base05 = config.lib.stylix.colors.base05; - base06 = config.lib.stylix.colors.base06; - base07 = config.lib.stylix.colors.base07; - base08 = config.lib.stylix.colors.base08; - base09 = config.lib.stylix.colors.base09; - base0A = config.lib.stylix.colors.base0A; - base0B = config.lib.stylix.colors.base0B; - base0C = config.lib.stylix.colors.base0C; - base0D = config.lib.stylix.colors.base0D; - base0E = config.lib.stylix.colors.base0E; - base0F = config.lib.stylix.colors.base0F; - }; - }; - }; -}