Initial neovim config -- the end of vimscript for me :)

This commit is contained in:
hollorol
2024-07-29 11:26:35 +02:00
commit 030c0482c8
13 changed files with 151 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
-- Alternatively, using a Lua function
local function lines_with_preview()
local current_file = vim.fn.fnameescape(vim.fn.expand('%'))
local rg_command = string.format("rg --with-filename --column --line-number --no-heading --color=always --smart-case . %s", current_file)
local fzf_command = string.format("call fzf#vim#grep('%s', 1, fzf#vim#with_preview({'options': '--delimiter : --nth 4.. --no-sort'}, 'up:50%%', '?'), 1)", rg_command)
vim.cmd(fzf_command)
end
vim.api.nvim_create_user_command('LinesWithPreview', lines_with_preview, {})