feat(zsh): Add quick commands for vim

This commit is contained in:
Tanguy Herbron 2023-11-19 11:42:53 +01:00
parent 8b05631645
commit 90d4dc5ba5
3 changed files with 22 additions and 1 deletions

View File

@ -185,7 +185,6 @@ require("bufferline").setup({
color_icons = true,
show_close_icon = false,
show_buffer_close_icons = false,
show_buffer_default_icon = false,
show_duplicate_prefix = false,
hover = {
enabled = false
@ -222,3 +221,4 @@ require("telescope-config")
require("telescope-mappings")
require("keybindings")
require("custom-args")

View File

@ -0,0 +1,15 @@
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
if vim.fn.argv(0) == 'p' then
require("telescope-config").project_files()
end
end,
})
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
if vim.fn.argv(0) == 'f' then
require("telescope.builtin").live_grep()
end
end,
})

6
.zshrc
View File

@ -95,6 +95,12 @@ bindkey "^?" backward-delete-char
# Enable backward incremental search
bindkey '^R' history-incremental-search-backward
# Open Vim in file selection on ctrl+p
bindkey -s '^P' 'vim p^M'
# Open Vim in string research on ctrl+f
bindkey -s '^f' 'vim f^M'
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh