diff options
| author | 2025-03-03 13:07:17 -0500 | |
|---|---|---|
| committer | 2025-03-03 13:07:17 -0500 | |
| commit | 7c128e197b605ca95b5b72d3b3c613f2103d83ff (patch) | |
| tree | 3b56628d287845be2449d52b3220b7250f0d2867 /files | |
| parent | 8be9ca2624d39d0bf0931b585507741169ca5f9f (diff) | |
| download | dotfiles-7c128e197b605ca95b5b72d3b3c613f2103d83ff.tar.gz dotfiles-7c128e197b605ca95b5b72d3b3c613f2103d83ff.tar.bz2 dotfiles-7c128e197b605ca95b5b72d3b3c613f2103d83ff.zip | |
Big neovim changes, container tests
Diffstat (limited to 'files')
| -rw-r--r-- | files/nixpkgs-patches/383432.diff | 217 | ||||
| -rw-r--r-- | files/nvim/init.vim | 226 | ||||
| -rw-r--r-- | files/nvim/mini_starter_picture.diff | 46 |
3 files changed, 361 insertions, 128 deletions
diff --git a/files/nixpkgs-patches/383432.diff b/files/nixpkgs-patches/383432.diff new file mode 100644 index 0000000..faa7e77 --- /dev/null +++ b/files/nixpkgs-patches/383432.diff @@ -0,0 +1,217 @@ +diff --git a/pkgs/development/libraries/mesa/common.nix b/pkgs/development/libraries/mesa/common.nix +index 8439861cf36c8..db33ea5d30751 100644 +--- a/pkgs/development/libraries/mesa/common.nix ++++ b/pkgs/development/libraries/mesa/common.nix +@@ -5,14 +5,14 @@ + # nix build .#legacyPackages.x86_64-darwin.mesa .#legacyPackages.aarch64-darwin.mesa + rec { + pname = "mesa"; +- version = "24.3.4"; ++ version = "25.0.0"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "mesa"; + repo = "mesa"; + rev = "mesa-${version}"; +- hash = "sha256-1RUHbTgcCxdDrWjqB0EG4Ny/nwdjQHHpyPauiW/yogU="; ++ hash = "sha256-ut6fB2m850Bx08V43TZ0WNoeDLZov76FtYPz6UFFjvQ="; + }; + + meta = { +diff --git a/pkgs/development/libraries/mesa/cross_clc.patch b/pkgs/development/libraries/mesa/cross_clc.patch +deleted file mode 100644 +index cb29e57ec3493..0000000000000 +--- a/pkgs/development/libraries/mesa/cross_clc.patch ++++ /dev/null +@@ -1,90 +0,0 @@ +-commit f063e9f74b45f34e4ac570a90901253bf8e64efd +-Author: Mary Guillemard <mary.guillemard@collabora.com> +-Date: 2024-12-02 09:11:35 +0100 +- +- meson: Add mesa-clc and install-mesa-clc options +- +- Due to the cross build issues in current meson, we adds new options to +- allow mesa_clc and vtn_bindgen to be installed or searched on the +- system. +- +- Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com> +- Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> +- Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> +- Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719> +- +-diff --git a/meson.build b/meson.build +-index de9c9af53a1..e37325ec176 100644 +---- a/meson.build +-+++ b/meson.build +-@@ -808,7 +808,7 @@ if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv') +- endif +- +- with_clover_spirv = with_gallium_clover and get_option('opencl-spirv') +--with_clc = with_microsoft_clc or with_intel_clc or with_gallium_asahi or with_asahi_vk or with_gallium_rusticl or with_clover_spirv +-+with_clc = get_option('mesa-clc') != 'auto' or with_microsoft_clc or with_intel_clc or with_gallium_asahi or with_asahi_vk or with_gallium_rusticl +- +- dep_clc = null_dep +- if with_gallium_clover or with_clc +-diff --git a/meson_options.txt b/meson_options.txt +-index 79ee65e6094..8f22b36e5fb 100644 +---- a/meson_options.txt +-+++ b/meson_options.txt +-@@ -744,3 +744,20 @@ option( +- 'none', 'dri2' +- ], +- ) +-+ +-+option( +-+ 'mesa-clc', +-+ type : 'combo', +-+ value : 'auto', +-+ choices : [ +-+ 'enabled', 'system', 'auto' +-+ ], +-+ description : 'Build the mesa-clc compiler or use a system version.' +-+) +-+ +-+option( +-+ 'install-mesa-clc', +-+ type : 'boolean', +-+ value : false, +-+ description : 'Install the mesa-clc compiler (if needed for cross builds).' +-+) +-diff --git a/src/compiler/clc/meson.build b/src/compiler/clc/meson.build +-index 74767d08de2..4875d71ca21 100644 +---- a/src/compiler/clc/meson.build +-+++ b/src/compiler/clc/meson.build +-@@ -117,15 +117,20 @@ idep_mesaclc = declare_dependency( +- link_args : _idep_mesaclc_link_args, +- ) +- +--prog_mesa_clc = executable( +-- 'mesa_clc', +-- ['mesa_clc.c'], +-- include_directories : [inc_include, inc_src], +-- c_args : [pre_args, no_override_init_args], +-- link_args : [ld_args_build_id], +-- dependencies : [idep_mesaclc, dep_llvm, dep_spirv_tools, idep_getopt], +-- # If we can run host binaries directly, just build mesa_clc for the host. +-- # Most commonly this happens when doing a cross compile from an x86_64 build +-- # machine to an x86 host +-- native : not meson.can_run_host_binaries(), +--) +-+if get_option('mesa-clc') == 'system' +-+ prog_mesa_clc = find_program('mesa_clc', native : true) +-+else +-+ prog_mesa_clc = executable( +-+ 'mesa_clc', +-+ ['mesa_clc.c'], +-+ include_directories : [inc_include, inc_src], +-+ c_args : [pre_args, no_override_init_args], +-+ link_args : [ld_args_build_id], +-+ dependencies : [idep_mesaclc, dep_llvm, dep_spirv_tools, idep_getopt], +-+ # If we can run host binaries directly, just build mesa_clc for the host. +-+ # Most commonly this happens when doing a cross compile from an x86_64 build +-+ # machine to an x86 host +-+ native : not meson.can_run_host_binaries(), +-+ install : get_option('install-mesa-clc'), +-+ ) +-+endif +diff --git a/pkgs/development/libraries/mesa/darwin.nix b/pkgs/development/libraries/mesa/darwin.nix +index 55392071010a9..1a458523632ec 100644 +--- a/pkgs/development/libraries/mesa/darwin.nix ++++ b/pkgs/development/libraries/mesa/darwin.nix +@@ -27,18 +27,6 @@ stdenv.mkDerivation { + meta + ; + +- # Darwin build fixes. FIXME: remove in 25.1. +- patches = [ +- (fetchpatch { +- url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/e89eba0796b3469f1d2cdbb600309f6231a8169d.patch"; +- hash = "sha256-0EP0JsYy+UTQ+eGd3sMfoLf1R+2e8n1flmQAHq3rCR4="; +- }) +- (fetchpatch { +- url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/568a4ca899762fe96fc9b34d2288d07e6656af87.patch"; +- hash = "sha256-uLxa5vA3/cYAIJT9h7eBQ1EBu4MnMg9R5uGAHzTb5Fc="; +- }) +- ]; +- + outputs = [ + "out" + "dev" +diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix +index 633770b6862c8..c1e950c2e5167 100644 +--- a/pkgs/development/libraries/mesa/default.nix ++++ b/pkgs/development/libraries/mesa/default.nix +@@ -138,9 +138,6 @@ in stdenv.mkDerivation { + + patches = [ + ./opencl.patch +- # cherry-picked from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719 +- # safe to remove for versions > 24.3.2 +- ./cross_clc.patch + ]; + + postPatch = '' +@@ -206,14 +203,13 @@ in stdenv.mkDerivation { + (lib.mesonOption "freedreno-kmds" "msm,kgsl,virtio,wsl") + + # Enable Intel RT stuff when available +- (lib.mesonBool "install-intel-clc" true) +- (lib.mesonBool "install-mesa-clc" true) + (lib.mesonEnable "intel-rt" stdenv.hostPlatform.isx86_64) ++ ++ # Required for OpenCL + (lib.mesonOption "clang-libdir" "${lib.getLib llvmPackages.clang-unwrapped}/lib") + + # Clover, old OpenCL frontend + (lib.mesonOption "gallium-opencl" "icd") +- (lib.mesonBool "opencl-spirv" true) + + # Rusticl, new OpenCL frontend + (lib.mesonBool "gallium-rusticl" true) +@@ -221,12 +217,18 @@ in stdenv.mkDerivation { + # meson auto_features enables this, but we do not want it + (lib.mesonEnable "android-libbacktrace" false) + (lib.mesonEnable "microsoft-clc" false) # Only relevant on Windows (OpenCL 1.2 API on top of D3D12) ++ ++ # Build and install extra tools for cross ++ (lib.mesonBool "install-mesa-clc" true) ++ (lib.mesonBool "install-precomp-compiler" true) ++ ++ # Disable valgrind on targets where it's not available + (lib.mesonEnable "valgrind" withValgrind) + ] ++ lib.optionals enablePatentEncumberedCodecs [ + (lib.mesonOption "video-codecs" "all") + ] ++ lib.optionals needNativeCLC [ +- (lib.mesonOption "intel-clc" "system") + (lib.mesonOption "mesa-clc" "system") ++ (lib.mesonOption "precomp-compiler" "system") + ]; + + strictDeps = true; +@@ -308,6 +310,7 @@ in stdenv.mkDerivation { + + postInstall = '' + # Move driver-related bits to $drivers ++ moveToOutput "lib/gallium-pipe" $drivers + moveToOutput "lib/gbm" $drivers + moveToOutput "lib/lib*_mesa*" $drivers + moveToOutput "lib/libgallium*" $drivers +@@ -339,7 +342,7 @@ in stdenv.mkDerivation { + + moveToOutput bin/intel_clc $driversdev + moveToOutput bin/mesa_clc $driversdev +- moveToOutput lib/gallium-pipe $opencl ++ moveToOutput bin/vtn_bindgen $driversdev + moveToOutput "lib/lib*OpenCL*" $opencl + moveToOutput "lib/libOSMesa*" $osmesa + moveToOutput bin/spirv2dxil $spirv2dxil +@@ -392,7 +395,7 @@ in stdenv.mkDerivation { + + env.NIX_CFLAGS_COMPILE = toString ([ + "-UPIPE_SEARCH_DIR" +- "-DPIPE_SEARCH_DIR=\"${placeholder "opencl"}/lib/gallium-pipe\"" ++ "-DPIPE_SEARCH_DIR=\"${placeholder "drivers"}/lib/gallium-pipe\"" + ]); + + passthru = { diff --git a/files/nvim/init.vim b/files/nvim/init.vim index e679f4d..f7c4d54 100644 --- a/files/nvim/init.vim +++ b/files/nvim/init.vim @@ -5,6 +5,8 @@ set signcolumn=yes set updatetime=250 set scrolloff=5 +" https://github.com/SmiteshP/nvim-navic + " Change directory based on current file. if !empty($NIX_SHELL) " Attempt to conflict less with plugins. @@ -33,7 +35,9 @@ set autoindent " C syntax preference. let g:c_syntax_for_h=1 -set cinoptions=:0,=4,l1,g2,h2,(4,u4,+4,m1 +let g:c_no_curly_error=1 +let g:c_function_pointers=1 +set cinoptions=:0,=4,l1,g2,h2,(4,u4,+4,m1,j1,J1 set cindent " Set different format for mail and text files. @@ -126,17 +130,6 @@ function! StatuslineGit() return strlen(l:branchname) > 0 ? ' '.l:branchname.' ' : ' ' endfunction -lua << EOF -function get_lsp_name() - local active_clients = vim.lsp.get_active_clients({bufnr = vim.api.nvim_get_current_buf()}) - if next(active_clients) == nil then - return '' - else - return '+'..active_clients[1].name - end -end -EOF - function! StatuslineLsp() abort return luaeval('get_lsp_name()') endfunction @@ -159,7 +152,97 @@ function! Statusline() abort endfunction set statusline=%!Statusline() +" Make shift + nav keys no-ops. +nmap H <nop> +nmap J <nop> +nmap K <nop> +nmap L <nop> +" Normal mode tab no-op. +nmap <Tab> <nop> +" ctrl + c no-op. +nmap <C-c> <nop> +" Disable F1 for help. +nmap <F1> <nop> +" Disable q: for histroy. +nmap q: <nop> +" Simplify split movement. +nmap <silent> <C-h> :wincmd h<CR> +nmap <silent> <C-j> :wincmd j<CR> +nmap <silent> <C-k> :wincmd k<CR> +nmap <silent> <C-l> :wincmd l<CR> +nmap <silent> <C-o> :vsplit<CR> +" Make ctrl + '.' and ',' map to previous buffer. +nmap <C-,> <C-^> +nmap <C-.> <C-^> +" Swap ctrl + f and b. +nnoremap <C-b> <C-f> +nnoremap <C-f> <C-b> +" Toggle colorcolumn. +nmap <silent> C :execute 'set colorcolumn=' . (&colorcolumn == '' ? '101' : '')<CR> +" Personally intuitive pop-up menu binds. +inoremap <expr> <CR> pumvisible() ? '<C-y><CR>' : '<CR>' +inoremap <expr> <Up> pumvisible() ? '<C-p>' : '<Up>' +inoremap <expr> <Down> pumvisible() ? '<C-n>' : '<Down>' +" Lsp Binds. +nmap <C-d> <C-]> +" Fzf binds. +nmap <silent> \ :Buffers<CR> +nmap <silent> <C-i> :GGrep<CR> +nmap <silent> <C-\> :GFiles<CR> +" Only Neogit bind, handle all further operations from this menu. +nmap <silent> Y :Neogit<CR> +" Undotree +nmap <silent> U :UndotreeToggle<CR> + +command Tabify set noexpandtab | %retab! | set expandtab +command Untabify set expandtab | %retab! + +" https://stackoverflow.com/a/37040415 +function! SyntaxGroup() + let l:s = synID(line('.'), col('.'), 1) + echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') +endfun + +" https://github.com/junegunn/fzf.vim?tab=readme-ov-file#example-git-grep-wrapper +command! -bang -nargs=* GGrep + \ call fzf#vim#grep( + \ 'git grep --line-number -- '.fzf#shellescape(<q-args>), + \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0) + +" https://vim.fandom.com/wiki/Replace_a_builtin_command_using_cabbrev +function! CommandCabbr(abbreviation, expansion) + execute 'cabbr ' . a:abbreviation . ' <C-R>=getcmdpos() == 1 && getcmdtype() == ":" ? "' . a:expansion . '" : "' . a:abbreviation . '"<CR>' +endfunction +command! -nargs=+ CommandCabbr call CommandCabbr(<f-args>) +CommandCabbr no nohlsearch + +call Juliana#Init() " Custom insert mode tab behavior inherited from Emacs. +inoremap <silent><Tab> <C-R>=Juliana#CompleteTab('START')<CR> + \<C-R>=Juliana#CompleteTab('TAB')<CR> + \<C-R>=Juliana#CompleteTab('ALIGN')<CR> + \<C-R>=Juliana#CompleteTab('NEXT')<CR> +inoremap <silent><S-Tab> <C-R>=Juliana#CompleteSTab('PREV')<CR> + lua << EOF +function get_lsp_name() + local active_clients = vim.lsp.get_active_clients({bufnr = vim.api.nvim_get_current_buf()}) + if next(active_clients) == nil then + return '' + else + return '+'..active_clients[1].name + end +end + +buf_is_big = function(bufnr) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(bufnr)) + if ok and stats and stats.size > max_filesize then + return true + else + return false + end +end + -- LSP configs. if os.getenv('NIX_SHELL') ~= nil then local lsp = require('lspconfig') @@ -185,21 +268,25 @@ if os.getenv('NIX_SHELL') ~= nil then } }) lsp.ruff.setup({}) + -- https://github.com/neovim/nvim-lspconfig/issues/2626#issuecomment-2117022664 + -- https://github.com/neovim/nvim-lspconfig/issues/2508 + vim.api.nvim_create_autocmd('BufReadPre', { + callback = function(t) + if buf_is_big(t.buf) then + vim.o.eventignore = "FileType" + vim.schedule(function() + vim.o.eventignore = "" + print("Dropped FileType events because the buffer is too big") + end) + end + end + }) require('inc_rename').setup({}) + vim.keymap.set('n', '<C-n>', function() + return ':IncRename ' .. vim.fn.expand('<cword>') + end, { expr = true }) end --- Try to make treesitter suck less. -require('nvim-treesitter.configs').setup({ - highlight = { - enable = true, - additional_vim_regex_highlighting = false - }, - indent = { - enable = true, - disable = { 'c', 'cpp' } - } -}) - -- Set sessions folder and autowrite. require('mini.sessions').setup({ autoread = false, @@ -210,12 +297,6 @@ require('mini.sessions').setup({ -- Completion. require('mini.completion').setup({}) --- Disable icons in diffview. -require('diffview').setup({ - diff_binaries = false, - use_icons = false -}) - -- Don't use tabs in Neogit. require('neogit').setup({ disable_hint = true, @@ -230,91 +311,12 @@ require('neogit').setup({ refs_view = { kind = 'split' }, -- Allow basic movement in Neogit without mapping conflicts. mappings = { - popup = { ['l'] = false, ['L'] = 'LogPopup' }, + popup = { ['l'] = false, ['L'] = 'LogPopup', ['d'] = false }, status = { ['$'] = false, ['#'] = 'CommandHistory' } - } + }, + integrations = {} }) -- Preview colors in #<hex> format. require('ccc').setup({ highlighter = { auto_enable = false, lsp = true } }) - ---require("perfanno").setup({ --- telescope = { --- enabled = false, --- }, ---}) - --- Make shift + nav keys no-ops. -vim.keymap.set('n', 'H', '<nop>', { silent = true }) -vim.keymap.set('n', 'J', '<nop>', { silent = true }) -vim.keymap.set('n', 'K', '<nop>', { silent = true }) -vim.keymap.set('n', 'L', '<nop>', { silent = true }) --- Normal mode tab no-op. -vim.keymap.set('n', '<Tab>', '<nop>', { silent = true }) --- ctrl + c no-op. -vim.keymap.set('n', '<C-c>', '<nop>', { silent = true }) --- Disable F1 for help. -vim.keymap.set('n', '<F1>', '<nop>', { silent = true }) --- Disable q: for histroy. -vim.keymap.set('n', 'q:', '<nop>', { silent = true }) --- Simplify split movement. -vim.keymap.set('n', '<C-h>', [[:wincmd h<CR>]], { silent = true }) -vim.keymap.set('n', '<C-j>', [[:wincmd j<CR>]], { silent = true }) -vim.keymap.set('n', '<C-k>', [[:wincmd k<CR>]], { silent = true }) -vim.keymap.set('n', '<C-l>', [[:wincmd l<CR>]], { silent = true }) -vim.keymap.set('n', '<C-o>', [[:vsplit<CR>]], { silent = true }) --- Make ctrl + '.' and ',' map to previous buffer. -vim.keymap.set('n', '<C-,>', '<C-^>', {}) -vim.keymap.set('n', '<C-.>', '<C-^>', {}) --- Swap ctrl + f and b. -vim.keymap.set('n', '<C-f>', '<C-b>', {}) -vim.keymap.set('n', '<C-b>', '<C-f>', {}) --- Undotree -vim.keymap.set('n', 'U', vim.cmd.UndotreeToggle) --- Toggle colorcolumn. -vim.keymap.set('n', 'C', [[:execute 'set colorcolumn=' . (&colorcolumn == '' ? '101' : '')<CR>]], { silent = true }) --- Personally intuitive pop-up menu binds. -vim.keymap.set('i', '<CR>', [[pumvisible() ? '<C-y><CR>' : '<CR>']], { expr = true }) -vim.keymap.set('i', '<Up>', [[pumvisible() ? '<C-p>' : '<Up>']], { expr = true }) -vim.keymap.set('i', '<Down>', [[pumvisible() ? '<C-n>' : '<Down>']], { expr = true }) --- Lsp Binds. -vim.keymap.set('n', '<C-d>', '<C-]>', {}) -vim.keymap.set('n', '<C-n>', function() - return ':IncRename ' .. vim.fn.expand('<cword>') -end, { expr = true }) --- Fzf binds. -vim.keymap.set('n', '\\', [[:Buffers<CR>]], { silent = true }) -vim.keymap.set('n', '<C-i>', [[:GGrep<CR>]], { silent = true }) -vim.keymap.set('n', '<C-\\>', [[:GFiles<CR>]], { silent = true }) --- Only Neogit bind, handle all further operations from this menu. -vim.keymap.set('n', 'Y', [[:Neogit<CR>]], { silent = true }) EOF - -command Tabify set noexpandtab | %retab! | set expandtab -command Untabify set expandtab | %retab! - -" https://stackoverflow.com/a/37040415 -function! SyntaxGroup() - let l:s = synID(line('.'), col('.'), 1) - echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') -endfun - -" https://github.com/junegunn/fzf.vim?tab=readme-ov-file#example-git-grep-wrapper -command! -bang -nargs=* GGrep - \ call fzf#vim#grep( - \ 'git grep --line-number -- '.fzf#shellescape(<q-args>), - \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0) - -" https://vim.fandom.com/wiki/Replace_a_builtin_command_using_cabbrev -function! CommandCabbr(abbreviation, expansion) - execute 'cabbr ' . a:abbreviation . ' <C-R>=getcmdpos() == 1 && getcmdtype() == ":" ? "' . a:expansion . '" : "' . a:abbreviation . '"<CR>' -endfunction -command! -nargs=+ CommandCabbr call CommandCabbr(<f-args>) -CommandCabbr no nohlsearch - -call Juliana#Init() " Custom insert mode tab behavior inherited from Emacs. -inoremap <silent><Tab> <C-R>=Juliana#CompleteTab('START')<CR> - \<C-R>=Juliana#CompleteTab('TAB')<CR> - \<C-R>=Juliana#CompleteTab('ALIGN')<CR> - \<C-R>=Juliana#CompleteTab('NEXT')<CR> -inoremap <silent><S-Tab> <C-R>=Juliana#CompleteSTab('PREV')<CR> diff --git a/files/nvim/mini_starter_picture.diff b/files/nvim/mini_starter_picture.diff index 555009a..7831ca1 100644 --- a/files/nvim/mini_starter_picture.diff +++ b/files/nvim/mini_starter_picture.diff @@ -1,5 +1,5 @@ diff --git a/lua/mini/starter.lua b/lua/mini/starter.lua -index 64939dc..493486b 100644 +index 8520569e..939e16de 100644 --- a/lua/mini/starter.lua +++ b/lua/mini/starter.lua @@ -138,7 +138,7 @@ @@ -11,7 +11,17 @@ index 64939dc..493486b 100644 --- timer:stop() --- return --- end -@@ -249,6 +249,12 @@ MiniStarter.config = { +@@ -239,6 +239,9 @@ MiniStarter.config = { + -- If `nil` (default), default items will be used (see |mini.starter|). + items = nil, + ++ -- Empty lines at the top of the content. ++ top_padding = 0, ++ + -- Header to be displayed before items. Converted to single string via + -- `tostring` (use `\n` to display several lines). If function, it is + -- evaluated first. If `nil` (default), polite greeting will be used. +@@ -249,6 +252,12 @@ MiniStarter.config = { -- evaluated first. If `nil` (default), default usage help will be shown. footer = nil, @@ -24,7 +34,7 @@ index 64939dc..493486b 100644 -- Array of functions to be applied consecutively to initial content. -- Each function should take and return content for Starter buffer (see -- |mini.starter| and |MiniStarter.get_content()| for more details). -@@ -372,7 +378,7 @@ MiniStarter.refresh = function(buf_id) +@@ -372,7 +381,7 @@ MiniStarter.refresh = function(buf_id) data.footer = H.normalize_header_footer(config.footer or H.default_footer) -- Evaluate content @@ -33,7 +43,7 @@ index 64939dc..493486b 100644 local hooks = config.content_hooks or H.default_content_hooks for _, f in ipairs(hooks) do content = f(content, buf_id) -@@ -399,6 +405,12 @@ MiniStarter.refresh = function(buf_id) +@@ -399,6 +408,12 @@ MiniStarter.refresh = function(buf_id) -- Apply current query (clear command line afterwards) H.make_query(buf_id) @@ -46,7 +56,7 @@ index 64939dc..493486b 100644 end --- Close Starter buffer -@@ -730,18 +742,45 @@ MiniStarter.gen_hook.aligning = function(horizontal, vertical) +@@ -730,18 +745,45 @@ MiniStarter.gen_hook.aligning = function(horizontal, vertical) local win_id = vim.fn.bufwinid(buf_id) if win_id < 0 then return end @@ -88,13 +98,13 @@ index 64939dc..493486b 100644 + H.picture_x = left_pad + picture_left_pad + end + if H.picture_x < 0.0 then H.picture_x = 0.0 end -+ H.picture_y = top_pad + config.picture.padding.top ++ H.picture_y = top_pad + config.picture.padding.top + config.top_padding + end + return MiniStarter.gen_hook.padding(left_pad, top_pad)(content) end end -@@ -1004,7 +1043,7 @@ H.default_footer = [[ +@@ -1004,7 +1046,7 @@ H.default_footer = [[ Type query to filter items <BS> deletes latest character from query <Esc> resets current query @@ -103,7 +113,7 @@ index 64939dc..493486b 100644 <CR> executes action of current item <C-c> closes this buffer]] -@@ -1052,8 +1091,54 @@ end +@@ -1048,8 +1090,54 @@ end H.apply_config = function(config) MiniStarter.config = config end @@ -159,7 +169,7 @@ index 64939dc..493486b 100644 if config.autoopen then local on_vimenter = function() -@@ -1065,7 +1150,7 @@ H.create_autocommands = function(config) +@@ -1061,7 +1149,7 @@ H.create_autocommands = function(config) vim.cmd('noautocmd lua MiniStarter.open()') end @@ -168,7 +178,7 @@ index 64939dc..493486b 100644 vim.api.nvim_create_autocmd('VimEnter', au_opts) end -@@ -1111,7 +1196,7 @@ H.normalize_header_footer = function(x) +@@ -1107,9 +1195,11 @@ H.normalize_header_footer = function(x) end -- Work with buffer content --------------------------------------------------- @@ -176,8 +186,12 @@ index 64939dc..493486b 100644 +H.make_initial_content = function(header, items, footer, config) local content = {} ++ H.content_add_empty_lines(content, config.top_padding) ++ -- Add header lines -@@ -1124,7 +1209,7 @@ H.make_initial_content = function(header, items, footer) + for _, l in ipairs(header) do + H.content_add_line(content, { H.content_unit(l, 'header', 'MiniStarterHeader') }) +@@ -1120,7 +1210,7 @@ H.make_initial_content = function(header, items, footer) H.content_add_items(content, items) -- Add footer lines @@ -186,7 +200,7 @@ index 64939dc..493486b 100644 for _, l in ipairs(footer) do H.content_add_line(content, { H.content_unit(l, 'footer', 'MiniStarterFooter') }) end -@@ -1327,11 +1412,22 @@ H.make_buffer_autocmd = function(buf_id) +@@ -1323,11 +1413,22 @@ H.make_buffer_autocmd = function(buf_id) au('VimResized', function() MiniStarter.refresh(buf_id) end, 'Refresh') au('CursorMoved', function() H.position_cursor_on_current_item(buf_id) end, 'Position cursor') @@ -209,7 +223,7 @@ index 64939dc..493486b 100644 end H.apply_buffer_options = function(buf_id) -@@ -1345,17 +1441,11 @@ H.apply_buffer_options = function(buf_id) +@@ -1341,17 +1442,11 @@ H.apply_buffer_options = function(buf_id) -- Set unique buffer name. Prefer "Starter" prefix as more user friendly. H.buffer_number = H.buffer_number + 1 @@ -229,7 +243,7 @@ index 64939dc..493486b 100644 local options = { -- Taken from 'vim-startify' -@@ -1401,12 +1491,8 @@ H.apply_buffer_mappings = function(buf_id) +@@ -1398,12 +1493,8 @@ H.apply_buffer_mappings = function(buf_id) buf_keymap('<CR>', 'MiniStarter.eval_current_item()') @@ -244,7 +258,7 @@ index 64939dc..493486b 100644 -- Make all special symbols to update query for _, key in ipairs(vim.split(H.get_config().query_updaters, '')) do -@@ -1487,7 +1573,7 @@ H.echo = function(msg, is_important) +@@ -1491,7 +1582,7 @@ H.echo = function(msg, is_important) -- Construct message chunks msg = type(msg) == 'string' and { { msg } } or msg @@ -253,7 +267,7 @@ index 64939dc..493486b 100644 -- Avoid hit-enter-prompt local max_width = vim.o.columns * math.max(vim.o.cmdheight - 1, 0) + vim.v.echospace -@@ -1525,7 +1611,7 @@ H.eval_fun_or_string = function(x, string_as_cmd) +@@ -1540,7 +1631,7 @@ H.eval_fun_or_string = function(x, string_as_cmd) if type(x) == 'function' then return x() end if type(x) == 'string' then if string_as_cmd then |