feat(git): alias s for unstage files
This commit is contained in:
parent
ee2b3481cf
commit
8064f04385
@ -45,6 +45,7 @@
|
||||
|
||||
[alias]
|
||||
a = "!git ls-files --exclude-standard -m --others -t | fzf -m --bind load:last --preview 'git diff --color=always {2}' | cut -d' ' -f2 | xargs git add"
|
||||
s = "!git diff --name-only --cached | fzf -m --bind load:last --preview 'git diff --staged --color=always {1}' | xargs git restore --staged"
|
||||
d = diff
|
||||
di = diff
|
||||
ds = diff --staged
|
||||
|
||||
@ -1,117 +1,121 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
enabled = vim.fn.executable "fzf" == 1,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
enabled = vim.fn.executable "make" == 1,
|
||||
build = "make"
|
||||
}
|
||||
},
|
||||
keys = {
|
||||
{ '<Leader>fb', '<cmd>Telescope buffers<CR>' },
|
||||
{ '<Leader>ff', '<cmd>Telescope find_files<CR>' },
|
||||
{ '<Leader>fg', '<cmd>Telescope live_grep<CR>' },
|
||||
{ '<Leader>fc', '<cmd>Telescope git_commits<CR>' },
|
||||
{ '<Leader>fd', '<cmd>Telescope diagnostics<CR>' },
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
telescope.setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
enabled = vim.fn.executable("fzf") == 1,
|
||||
dependencies = {
|
||||
{
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-n>"] = actions.preview_scrolling_down,
|
||||
["<C-p>"] = actions.preview_scrolling_up,
|
||||
["<C-a>"] = actions.toggle_all,
|
||||
["?"] = actions.which_key,
|
||||
["jf"] = { "<esc>", type = "command" },
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
enabled = vim.fn.executable("make") == 1,
|
||||
build = "make"
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ '<Leader>fb', '<cmd>Telescope buffers<CR>' },
|
||||
{ '<Leader>ff', '<cmd>Telescope find_files<CR>' },
|
||||
{ '<Leader>fg', '<cmd>Telescope live_grep<CR>' },
|
||||
{ '<Leader>fc', '<cmd>Telescope git_commits<CR>' },
|
||||
{ '<Leader>fd', '<cmd>Telescope diagnostics<CR>' },
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
telescope.setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
},
|
||||
n = {
|
||||
["jf"] = actions.close,
|
||||
["?"] = actions.which_key,
|
||||
}
|
||||
},
|
||||
selection_caret = " ",
|
||||
path_display = { "truncate" },
|
||||
file_ignore_patterns = {
|
||||
".git/",
|
||||
".svn/",
|
||||
"%.o",
|
||||
"%.a",
|
||||
"%.so",
|
||||
"a.out",
|
||||
"venv/",
|
||||
"CMakeFiles/",
|
||||
"cmake_install.cmake",
|
||||
"CMakeCache.txt",
|
||||
"target/",
|
||||
".pytest_cache/",
|
||||
"vendor/*",
|
||||
"%.lock",
|
||||
"%.db",
|
||||
"%.sqlite3",
|
||||
"%.sqlite",
|
||||
"%.ipynb",
|
||||
"%.svg",
|
||||
"%.burp",
|
||||
"%.mp4",
|
||||
"%.png",
|
||||
"%.jpeg",
|
||||
"%.jpg",
|
||||
"%.gif",
|
||||
"%.mkv",
|
||||
"%.otf",
|
||||
"%.ttf",
|
||||
"%.webp",
|
||||
"%.bin",
|
||||
".dart_tool/",
|
||||
".gradle/",
|
||||
".idea/",
|
||||
".settings/",
|
||||
".vscode/",
|
||||
"pycache/",
|
||||
"build/",
|
||||
"env/",
|
||||
"gradle/",
|
||||
"node_modules/",
|
||||
"%.pdb",
|
||||
"%.dll",
|
||||
"%.class",
|
||||
"%.exe",
|
||||
"%.cache",
|
||||
"%.ico",
|
||||
"%.pdf",
|
||||
"%.dylib",
|
||||
"%.jar",
|
||||
"%.docx",
|
||||
"%.met",
|
||||
"smalljre_*/*",
|
||||
".vale/",
|
||||
"%.rar",
|
||||
"%.zip",
|
||||
"%.7z",
|
||||
"%.tar",
|
||||
"%.xz",
|
||||
"%.gz",
|
||||
"%.bz2",
|
||||
"%.epub",
|
||||
"%.flac",
|
||||
"%.tar.gz",
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-n>"] = actions.preview_scrolling_down,
|
||||
["<C-p>"] = actions.preview_scrolling_up,
|
||||
["<C-a>"] = actions.toggle_all,
|
||||
["?"] = actions.which_key,
|
||||
["jf"] = { "<esc>", type = "command" },
|
||||
},
|
||||
n = {
|
||||
["jf"] = actions.close,
|
||||
["?"] = actions.which_key,
|
||||
}
|
||||
},
|
||||
selection_caret = " ",
|
||||
path_display = { "truncate" },
|
||||
file_ignore_patterns = {
|
||||
".git/",
|
||||
".svn/",
|
||||
"%.o",
|
||||
"%.a",
|
||||
"%.so",
|
||||
"a.out",
|
||||
"venv/",
|
||||
"CMakeFiles/",
|
||||
"cmake_install.cmake",
|
||||
"CMakeCache.txt",
|
||||
"target/",
|
||||
".pytest_cache/",
|
||||
"vendor/*",
|
||||
"%.lock",
|
||||
"%.db",
|
||||
"%.sqlite3",
|
||||
"%.sqlite",
|
||||
"%.ipynb",
|
||||
"%.svg",
|
||||
"%.burp",
|
||||
"%.mp4",
|
||||
"%.png",
|
||||
"%.jpeg",
|
||||
"%.jpg",
|
||||
"%.gif",
|
||||
"%.mkv",
|
||||
"%.otf",
|
||||
"%.ttf",
|
||||
"%.webp",
|
||||
"%.bin",
|
||||
".dart_tool/",
|
||||
".gradle/",
|
||||
".idea/",
|
||||
".settings/",
|
||||
".vscode/",
|
||||
"pycache/",
|
||||
"build/",
|
||||
"env/",
|
||||
"gradle/",
|
||||
"node_modules/",
|
||||
"%.pdb",
|
||||
"%.dll",
|
||||
"%.class",
|
||||
"%.exe",
|
||||
"%.cache",
|
||||
"%.ico",
|
||||
"%.pdf",
|
||||
"%.dylib",
|
||||
"%.jar",
|
||||
"%.docx",
|
||||
"%.met",
|
||||
"smalljre_*/*",
|
||||
".vale/",
|
||||
"%.rar",
|
||||
"%.zip",
|
||||
"%.7z",
|
||||
"%.tar",
|
||||
"%.xz",
|
||||
"%.gz",
|
||||
"%.bz2",
|
||||
"%.epub",
|
||||
"%.flac",
|
||||
"%.tar.gz",
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user