From 648367c39c636adc069410a1e26c2074a283d46c Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 1 Jul 2023 23:53:35 +0200 Subject: Made Change file to an executable conditional --- lua/user/keys.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index 208b9d7..f049957 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -170,7 +170,8 @@ map("i", "", "") map("n", "", "!clear") -- Change file to an executable -map("n", "x", ":!chmod +x %") +map("n", "x", ":lua require('user.mods').Toggle_executable() | :echom ('Toggle executable') | :sl! | echo ('')") +--map("n", "x", ":!chmod +x %") -- Paste without replace clipboard map("v", "p", '"_dP') @@ -292,7 +293,7 @@ map("n", "gm", ":Gmove") -- Telescope map("n", "ff", function() require("telescope.builtin").find_files { hidden = true, no_ignore = false } end) -- find all files -map("n", "fF", "lua require('telescope.builtin').find_files()") -- find files with hidden option +--map("n", "fF", "lua require('telescope.builtin').find_files()") -- find files with hidden option map("n", "fg", "lua require('telescope.builtin').live_grep()") map("n", "fb", "lua require('telescope.builtin').buffers()") map("n", "fh", "lua require('telescope.builtin').help_tags()") @@ -310,6 +311,12 @@ map("n", "fs", [[lua require'plugins.telescope'.find_scripts()] map("n", "fw", [[lua require'plugins.telescope'.find_projects()]]) -- find projects map("n", "fm", "lua require('telescope').extensions.media_files.media_files({})") -- find media files map("n", "fi", "lua require('telescope').extensions.notify.notify({})") -- find notifications +map("n", "f/", "lua require('plugins.telescope').curbuf()") -- find files with hidden option + +local builtin = require("telescope.builtin") +local utils = require("telescope.utils") + +map("n", "fF", function() builtin.find_files({ cwd = utils.buffer_dir() }) end, { desc = "Find files in cwd" }) -- FZF map("n", "fz", "lua require('fzf-lua').files()") @@ -396,7 +403,7 @@ map("n", "dq", function() require("nvim-dap-virtual-text").refresh() end, { desc = "Terminate Debug" }) map("n", "dc", function() - require("telescope").extensions.dap.commands() + require("telescope").extensions.dap.commands() end, { desc = "DAP-Telescope: Commands" }) --vim.keymap.set("n", "B", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))") --vim.keymap.set("v", "B", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))") -- cgit v1.2.3