From 6a54d52c34829185d70893c2cbe319308076bbc7 Mon Sep 17 00:00:00 2001 From: Dominik Madarasz Date: Sat, 15 Jul 2023 17:21:56 +0200 Subject: [PATCH] more lazy stuff --- deps.sh | 1 + init.lua | 14 +++++++------- lua/zak/keymap.lua | 27 ++++++++++++++++----------- lua/zak/plugins/transparent.lua | 4 ++++ 4 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 deps.sh create mode 100644 lua/zak/plugins/transparent.lua diff --git a/deps.sh b/deps.sh new file mode 100644 index 0000000..0b2ac02 --- /dev/null +++ b/deps.sh @@ -0,0 +1 @@ +apt update && apt install ripgrep build-essential git diff --git a/init.lua b/init.lua index bb5514e..3e9f663 100644 --- a/init.lua +++ b/init.lua @@ -1,12 +1,12 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -require("zak.lazy"); -require("zak.options"); -require("zak.keymap"); -require("zak.treesitter"); -require("zak.lsp"); -require("zak.ale"); -require("zak.ocaml"); +require("zak.lazy") +require("zak.options") +require("zak.keymap") +require("zak.treesitter") +require("zak.lsp") +require("zak.ale") +require("zak.ocaml") -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/zak/keymap.lua b/lua/zak/keymap.lua index d32b8a8..3a63299 100644 --- a/lua/zak/keymap.lua +++ b/lua/zak/keymap.lua @@ -59,24 +59,29 @@ vim.keymap.set('n', '', '') vim.keymap.set('n', '', '') -- See `:help telescope.builtin` -vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) -vim.keymap.set('n', '', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +local builtin = require('telescope.builtin') +vim.keymap.set('n', '?', builtin.oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', '/', function() -- You can pass additional configuration to telescope to change theme, layout, etc. - require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' }) -vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'ff', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) -vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) +vim.keymap.set('n', '', builtin.git_files, { desc = 'Search [G]it [F]iles' }) +vim.keymap.set('n', 'gf', builtin.git_files, { desc = 'Search [G]it [F]iles' }) +vim.keymap.set('n', 'ff', builtin.buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) +vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) +vim.keymap.set('n', 'ps', function () + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end) -- Diagnostic keymaps vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" }) diff --git a/lua/zak/plugins/transparent.lua b/lua/zak/plugins/transparent.lua new file mode 100644 index 0000000..fd62b33 --- /dev/null +++ b/lua/zak/plugins/transparent.lua @@ -0,0 +1,4 @@ +return { + 'xiyaowong/transparent.nvim', + lazy = false +}