Git improvements

This commit is contained in:
Trevor Vallender 2023-09-22 13:55:28 +01:00
parent d3c372c350
commit d875987ab5
2 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,8 @@
email = trevor@tsvallender.co.uk email = trevor@tsvallender.co.uk
[includeIf "gitdir:~/foxsoft/"] [includeIf "gitdir:~/foxsoft/"]
path = ~/.config/git/config_foxsoft path = ~/.config/git/config_foxsoft
[includeIf "gitdir:~/fs/"]
path = ~/.config/git/config_foxsoft
[core] [core]
autocrlf = input autocrlf = input
safecrlf = true safecrlf = true

View File

@ -8,6 +8,7 @@ vim.keymap.set('n', '<leader>pD', ":pu!=strftime('%c')<CR>");
-- Telescope -- Telescope
local builtin = require('telescope.builtin') local builtin = require('telescope.builtin')
local telescope = require('telescope')
vim.keymap.set('n', '<leader>tf', builtin.find_files, {}) -- Open files vim.keymap.set('n', '<leader>tf', builtin.find_files, {}) -- Open files
vim.keymap.set('n', '<leader>ts', builtin.live_grep, {}) -- Grep files vim.keymap.set('n', '<leader>ts', builtin.live_grep, {}) -- Grep files
vim.keymap.set('n', '<leader>tb', builtin.buffers, {}) -- Neovim buffers vim.keymap.set('n', '<leader>tb', builtin.buffers, {}) -- Neovim buffers
@ -21,6 +22,8 @@ vim.keymap.set('n', '<leader>tgc', builtin.git_commits, {})
vim.keymap.set('n', '<leader>tgh', builtin.git_bcommits, {}) -- Current buffer's commits vim.keymap.set('n', '<leader>tgh', builtin.git_bcommits, {}) -- Current buffer's commits
vim.keymap.set('n', '<leader>tgb', builtin.git_branches, {}) -- CR: checkout, C-t: track, C-r: rebase, C-a: create, C-s: switch, C-d: delete, C-y: merge vim.keymap.set('n', '<leader>tgb', builtin.git_branches, {}) -- CR: checkout, C-t: track, C-r: rebase, C-a: create, C-s: switch, C-d: delete, C-y: merge
vim.keymap.set('n', '<leader>tgs', builtin.git_stash, {}) -- List stash, apply with CR vim.keymap.set('n', '<leader>tgs', builtin.git_stash, {}) -- List stash, apply with CR
require("telescope").load_extension("git_worktree")
vim.keymap.set('n', '<leader>tgw', telescope.extensions.git_worktree.git_worktrees, {})
-- LSP functionality (tl prefix) -- LSP functionality (tl prefix)
vim.keymap.set('n', '<leader>tlr', builtin.lsp_references, {}) vim.keymap.set('n', '<leader>tlr', builtin.lsp_references, {})
vim.keymap.set('n', '<leader>tli', builtin.lsp_incoming_calls, {}) vim.keymap.set('n', '<leader>tli', builtin.lsp_incoming_calls, {})
@ -66,3 +69,4 @@ vim.keymap.set('n', '<leader>gr', ':diffget //3<CR>'); -- 'Get right' window
-- Nvim-tree -- Nvim-tree
vim.keymap.set("n", "<leader>nt", vim.cmd.NvimTreeToggle, {}) vim.keymap.set("n", "<leader>nt", vim.cmd.NvimTreeToggle, {})