mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 12:51:45 +00:00
cd to startup directory keymap
This commit is contained in:
parent
7d2974684e
commit
021d2774e7
3
init.lua
3
init.lua
@ -6,6 +6,9 @@ vim.g.maplocalleader = ' '
|
|||||||
-- Set to true if you have a Nerd Font installed
|
-- Set to true if you have a Nerd Font installed
|
||||||
vim.g.have_nerd_font = true
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
|
-- Save start directory as base
|
||||||
|
vim.g.base_dir = vim.fn.getcwd()
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
require 'options'
|
require 'options'
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ vim.keymap.set('v', '<leader>pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' })
|
|||||||
|
|
||||||
-- Populate CMD to prepare for change directory
|
-- Populate CMD to prepare for change directory
|
||||||
vim.keymap.set('n', '<leader>cd ', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' })
|
vim.keymap.set('n', '<leader>cd ', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' })
|
||||||
|
-- Navigate to 'base' directory, the initial dir that nvim was run in
|
||||||
|
vim.keymap.set('n', '<leader>cdh', '<cmd>cd ' .. vim.g.base_dir .. '<cr>', { desc = '[C]hange [D]irectory to [H]ome' })
|
||||||
|
|
||||||
-- Delete current buffer without closing window
|
-- Delete current buffer without closing window
|
||||||
vim.keymap.set('n', '<leader>bd', '<cmd>bp<bar>sp<bar>bn<bar>bd<cr>', { desc = '[B]uffer [D]elete' })
|
vim.keymap.set('n', '<leader>bd', '<cmd>bp<bar>sp<bar>bn<bar>bd<cr>', { desc = '[B]uffer [D]elete' })
|
||||||
|
Loading…
Reference in New Issue
Block a user