From fe9a05dd7fcf90aa31cc0886dfc0358286af2a27 Mon Sep 17 00:00:00 2001 From: xqtc Date: Wed, 18 Sep 2024 20:43:39 +0200 Subject: [PATCH] nixvim ricing --- home/config-files/nvim/init.lua | 9 ++++++ home/modules/default.nix | 2 +- home/modules/nixvim.nix | 54 +++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/home/config-files/nvim/init.lua b/home/config-files/nvim/init.lua index 39f6db0..664ff84 100644 --- a/home/config-files/nvim/init.lua +++ b/home/config-files/nvim/init.lua @@ -10,6 +10,15 @@ vim.keymap.set('t', '', '') -- move selection linewise vim.keymap.set('v', 'J', ":m '>+1gv=gv") vim.keymap.set('v', 'K', ":m '<-2gv=gv") +require("aerial").setup({ + -- optionally use on_attach to set keymaps when aerial has attached to a buffer + on_attach = function(bufnr) + -- Jump forwards/backwards with '{' and '}' + -- vim.keymap.set("n", "{", "AerialPrev", { buffer = bufnr }) + -- vim.keymap.set("n", "}", "AerialNext", { buffer = bufnr }) + end, +}) +-- You probably also want to set a keymap to toggle aerial --nmap('K', vim.lsp.buf.hover, 'Hover Documentation') --nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') diff --git a/home/modules/default.nix b/home/modules/default.nix index bdff2fc..61e141e 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -9,7 +9,7 @@ ./nixvim.nix ./shell.nix ./firefox.nix - ./dwl.nix + # ./dwl.nix ./wm.nix ./gtk.nix ./foot.nix diff --git a/home/modules/nixvim.nix b/home/modules/nixvim.nix index da8c287..5877c1b 100644 --- a/home/modules/nixvim.nix +++ b/home/modules/nixvim.nix @@ -14,6 +14,9 @@ colorcolumn = "80"; }; # extraPlugins = with pkgs.vimPlugins; [headlines-nvim]; + extraPlugins = with pkgs.vimPlugins; [ + aerial-nvim + ]; clipboard.providers.wl-copy.enable = true; @@ -26,6 +29,14 @@ colorschemes.catppuccin.enable = true; plugins = { + navic = { + enable = true; + settings = { + lsp = { + auto_attach = true; + }; + }; + }; trouble = { enable = true; }; @@ -47,6 +58,49 @@ left = ""; right = ""; }; + settings = { + sections = { + lualine_y = [ + { + __unkeyed-1 = "aerial"; + colored = true; + cond = { + __raw = '' + function() + local buf_size_limit = 1024 * 1024 + if vim.api.nvim_buf_get_offset(0, vim.api.nvim_buf_line_count(0)) > buf_size_limit then + return false + end + + return true + end + ''; + }; + dense = false; + dense_sep = "."; + depth = { + __raw = "nil"; + }; + sep = " ∋ "; + } + ]; + }; + winbar = { + lualine_c = [ + { + __unkeyed-1 = "navic"; + } + ]; + # lualine_x = [ + # { + # __unkeyed-1 = "filename"; + # newfile_status = true; + # path = 3; + # shorting_target = 150; + # } + # ]; + }; + }; }; lsp-format = {enable = true;}; copilot-lua = {