diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-07-04 16:39:23 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-07-04 16:39:23 +0800 |
commit | 464d830c38d6c11258c60782ef9b4fb9de406957 (patch) | |
tree | 9cd8e5783781b29a5085c1bc03525daab561e7bc /vim/lua/mappings.lua | |
parent | 1f0628b62d42d9a450157b0956b9df3cadff5177 (diff) |
Update
Diffstat (limited to 'vim/lua/mappings.lua')
-rw-r--r-- | vim/lua/mappings.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vim/lua/mappings.lua b/vim/lua/mappings.lua index e9a20f5..4ae28c1 100644 --- a/vim/lua/mappings.lua +++ b/vim/lua/mappings.lua | |||
@@ -97,16 +97,15 @@ vim.keymap.set('n', '<leader>sd', function() | |||
97 | require('telescope.builtin').oldfiles { | 97 | require('telescope.builtin').oldfiles { |
98 | prompt_title = 'CD to', | 98 | prompt_title = 'CD to', |
99 | attach_mappings = function(prompt_bufnr, map) | 99 | attach_mappings = function(prompt_bufnr, map) |
100 | local cd_to_dir = function() | 100 | local cd_prompt = function() |
101 | local file = require('telescope.actions.state').get_selected_entry()[1] | 101 | local file = require('telescope.actions.state').get_selected_entry()[1] |
102 | local path = string.match(file, "(.*[/\\])") | 102 | local path = string.match(file, "(.*[/\\])") |
103 | require('telescope.actions').close(prompt_bufnr) | 103 | require('telescope.actions').close(prompt_bufnr) |
104 | vim.cmd("cd " .. path) | 104 | vim.api.nvim_feedkeys(":cd " .. path, 'n', true) |
105 | vim.cmd("pwd") | ||
106 | end | 105 | end |
107 | 106 | ||
108 | map('i', '<CR>', cd_to_dir) | 107 | map('i', '<CR>', cd_prompt) |
109 | map('n', '<CR>', cd_to_dir) | 108 | map('n', '<CR>', cd_prompt) |
110 | 109 | ||
111 | return true | 110 | return true |
112 | end, | 111 | end, |
@@ -184,3 +183,6 @@ vim.cmd('vmap s S') | |||
184 | -- [ Aerial ]"" "<cmd>AerialNext<CR>", {}) | 183 | -- [ Aerial ]"" "<cmd>AerialNext<CR>", {}) |
185 | vim.keymap.set("n", "gL", "<cmd>Telescope aerial<CR>") | 184 | vim.keymap.set("n", "gL", "<cmd>Telescope aerial<CR>") |
186 | vim.keymap.set("n", "gl", function() require("aerial").toggle({ direction = "left" }) end) | 185 | vim.keymap.set("n", "gl", function() require("aerial").toggle({ direction = "left" }) end) |
186 | |||
187 | --[ TrunZen ] | ||
188 | vim.keymap.set('n', '<leader>z', ':TZAtaraxis<CR>') | ||