From 8434b5a46e55b9cd4e0d6e7e2ab728af5206d3ab Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Wed, 17 Apr 2024 08:48:09 -0400 Subject: [PATCH] many things, nvim, manpages --- nix/home-manager/flake.lock | 18 +++++++++--------- nix/home-manager/modules/environment.nix | 1 + nix/home-manager/modules/packages/neovim.nix | 12 ++++++++++++ .../modules/packages/neovim/core.lua | 9 ++++++++- zsh/funcs/man | 5 +++++ 5 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 zsh/funcs/man diff --git a/nix/home-manager/flake.lock b/nix/home-manager/flake.lock index 046f273..22fedcc 100644 --- a/nix/home-manager/flake.lock +++ b/nix/home-manager/flake.lock @@ -44,11 +44,11 @@ ] }, "locked": { - "lastModified": 1713019815, - "narHash": "sha256-jzTo97VeKMNfnKw3xU+uiU5C7wtnLudsbwl/nwPLC7s=", + "lastModified": 1713294767, + "narHash": "sha256-LmaabaQZdx52MPGKPRt9Opoc9Gd9RbwvCdysUUYQoXI=", "owner": "nix-community", "repo": "home-manager", - "rev": "8fdf329526f06886b53b94ddf433848a0d142984", + "rev": "fa8c16e2452bf092ac76f09ee1fb1e9f7d0796e7", "type": "github" }, "original": { @@ -102,11 +102,11 @@ ] }, "locked": { - "lastModified": 1712459390, - "narHash": "sha256-e12bNDottaGoBgd0AdH/bQvk854xunlWAdZwr/oHO1c=", + "lastModified": 1713067146, + "narHash": "sha256-9D20xjblGKEVRVCnM3qWhiizEa9i6OpK6xQJajwcwOQ=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "4676d72d872459e1e3a248d049609f110c570e9a", + "rev": "93aed67288be60c9ef6133ba2f8de128f4ef265c", "type": "github" }, "original": { @@ -187,11 +187,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1713023065, - "narHash": "sha256-itHmb9Z1kxuF7vkbGThlpKiEzBO+375Y7zs0toSC0KU=", + "lastModified": 1713356833, + "narHash": "sha256-cHDKWXDOSTvtyebdvWpn1gix0SR9cH3O0eh5Ju+b+Qw=", "owner": "nixOS", "repo": "nixpkgs", - "rev": "61d5de98080fbe185e83a59c7b0f672257405cec", + "rev": "95db6c67d7fa6324302fcfc1848b09884a12d0ac", "type": "github" }, "original": { diff --git a/nix/home-manager/modules/environment.nix b/nix/home-manager/modules/environment.nix index 78f37ac..40397bd 100644 --- a/nix/home-manager/modules/environment.nix +++ b/nix/home-manager/modules/environment.nix @@ -6,5 +6,6 @@ }: { home.sessionVariables = { EDITOR = "nvim"; + PAGE = "page -q 90000 -z 90000"; }; } diff --git a/nix/home-manager/modules/packages/neovim.nix b/nix/home-manager/modules/packages/neovim.nix index 0ddfb20..7a9dbf5 100644 --- a/nix/home-manager/modules/packages/neovim.nix +++ b/nix/home-manager/modules/packages/neovim.nix @@ -184,6 +184,15 @@ trouble = { enable = true; }; + ufo = { + enable = true; + extraLua.pre = '' + require('ufo').setup({ provider_selector = function(bufnr, filetype, buftype) + return {'treesitter', 'indent' } + end + }) + ''; + }; undotree = { enable = true; }; @@ -214,9 +223,12 @@ rainbow-delimiters-nvim gitlinker-linrongbin16 telescope-symbols-nvim + overseer-nvim + officer-nvim nvim-web-devicons lsp-signature-nvim nvim-rg + nvim-biscuits telescope-egrepify-nvim ]); mappings = { diff --git a/nix/home-manager/modules/packages/neovim/core.lua b/nix/home-manager/modules/packages/neovim/core.lua index d6882a0..5520450 100644 --- a/nix/home-manager/modules/packages/neovim/core.lua +++ b/nix/home-manager/modules/packages/neovim/core.lua @@ -1,5 +1,4 @@ vim.o.expandtab = true -vim.o.foldlevel = 2 local guifont = { "Iosevka Custom" } if vim.loop.os_uname().sysname == "Darwin" then table.insert(guifont, "Apple Color Emoji") @@ -33,6 +32,11 @@ vim.o.wildmenu = true vim.o.wildmode = "list:longest,full" vim.g.skip_ts_context_commentstring_module = true +-- `page` config +vim.g.page_icon_pipe = "|" +vim.g.page_icon_redirect = ">" +vim.g.page_icon_instance = "$" + vim.api.nvim_create_autocmd("TextYankPost", { callback = function() vim.highlight.on_yank() @@ -40,6 +44,9 @@ vim.api.nvim_create_autocmd("TextYankPost", { }) require("gitlinker").setup() +require("nvim-biscuits").setup() +require("overseer").setup() +require("officer").setup({ create_mappings = true }) local cmp = require("cmp") diff --git a/zsh/funcs/man b/zsh/funcs/man new file mode 100644 index 0000000..ceaa72b --- /dev/null +++ b/zsh/funcs/man @@ -0,0 +1,5 @@ +man () { + PROGRAM="${@[-1]}" + SECTION="${@[-2]}" + page -W "man://${PROGRAM}${SECTION:+($SECTION)}" +}