diff --git a/lua/autocmd.lua b/lua/autocmd.lua index 58256e3..ef6d522 100644 --- a/lua/autocmd.lua +++ b/lua/autocmd.lua @@ -25,17 +25,4 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) -vim.api.nvim_create_user_command('CDToGitRoot', function() - local handle = io.popen 'git rev-parse --show-toplevel 2>/dev/null' - local git_root = handle:read('*a'):gsub('\n', '') - handle:close() - - if git_root == '' then - print 'Not in a Git repository' - else - vim.cmd('cd ' .. git_root) - print('Changed directory to Git root: ' .. git_root) - end -end, { desc = 'Change directory to the current Git repository root' }) - -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index c3ef163..9ffbf96 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -90,7 +90,7 @@ return { -- Fuzzy Finder (files, lsp, etc) end, { desc = '[/] Fuzzily search in current buffer' }) -- Vimwiki searches for notes in path specified by $NOTES environment variable - vim.keymap.set('n', 'svv', function() + vim.keymap.set('n', 'sv', function() local notes_path = os.getenv 'NOTES' if not notes_path then error 'Please set the $NOTES environment variable' @@ -99,36 +99,6 @@ return { -- Fuzzy Finder (files, lsp, etc) end end, { desc = '[S]earch [V]imWiki' }) - vim.keymap.set('n', 'svn', function() - local notes_path = os.getenv 'NOTES' - if not notes_path then - error 'Please set the $NOTES environment variable' - return - end - - local function prompt_for_filename() - local filename = vim.fn.input 'Enter note filename: ' - if filename == '' then - error 'Filename cannot be empty' - end - return filename - end - - local function open_or_create_note() - local filename = prompt_for_filename() - local file_path = notes_path .. '/' .. filename .. '.md' - if vim.fn.filereadable(file_path) == 0 then - vim.cmd('edit ' .. file_path) - print('Created new note: ' .. file_path) - else - vim.cmd('edit ' .. file_path) - print('Opened existing note: ' .. file_path) - end - end - - open_or_create_note() - end, { desc = '[S]earch or [V]iew/Create Note' }) - -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function()