huge updates
This commit is contained in:
1 parent
ca26b00c27
commit
18bd0cb00b
49 files changed
+4210
-2140
No files matched your search
@@ -0,0 +1,39 @@
|
||||
-- Reload neovim config
|
||||
vim.api.nvim_create_user_command('ReloadConfig', function()
|
||||
for name, _ in pairs(package.loaded) do
|
||||
if name:match('^plugins') then
|
||||
package.loaded[name] = nil
|
||||
end
|
||||
end
|
||||
|
||||
dofile(vim.env.MYVIMRC)
|
||||
vim.notify('Nvim configuration reloaded!', vim.log.levels.INFO)
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command('CopyRelativePath', function()
|
||||
local path = vim.fn.expand('%')
|
||||
vim.fn.setreg('+', path)
|
||||
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command('CopyAbsolutePath', function()
|
||||
local path = vim.fn.expand('%:p')
|
||||
vim.fn.setreg('+', path)
|
||||
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command('CopyFileName', function()
|
||||
local path = vim.fn.expand('%:t')
|
||||
vim.fn.setreg('+', path)
|
||||
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
||||
end, {})
|
||||
|
||||
-- Switch to git root or file parent dir
|
||||
vim.api.nvim_create_user_command('RootDir', function()
|
||||
local root = require('core.util').get_root_dir()
|
||||
|
||||
if root == '' then
|
||||
return
|
||||
end
|
||||
vim.cmd('lcd ' .. root)
|
||||
end, {})
|
||||
Reference in new issue
Block a user