1
Fork 0
This commit is contained in:
Hadeed 2024-05-05 05:57:59 +05:00
parent fc86df21d6
commit 0fbf6cdea0
6 changed files with 24 additions and 16 deletions

View file

@ -24,14 +24,10 @@ vim.api.nvim_create_autocmd("Filetype", {
vim.api.nvim_create_autocmd("Filetype", { vim.api.nvim_create_autocmd("Filetype", {
group = vim.api.nvim_create_augroup("webDev", {}), group = vim.api.nvim_create_augroup("webDev", {}),
pattern = { "html", "css", "javascript", "javascriptreact" }, pattern = { "html", "css", "javascript", "javascriptreact", "json" },
callback = function() callback = function()
vim.cmd [[setlocal tabstop=2 softtabstop=2 shiftwidth=2]] vim.cmd [[setlocal tabstop=2 softtabstop=2 shiftwidth=2]]
vim.bo.formatprg = "npx prettier --stdin-filepath %" vim.bo.formatprg = "prettier --stdin-filepath " .. vim.fn.expand("%:p")
require("minimal-format").toggle_autocmd(0)
vim.api.nvim_create_autocmd("BufWritePre", {
command = "Format",
buffer = 0
})
end end
}) })

View file

@ -7,6 +7,7 @@ vim.keymap.set("i", "kj", "<ESC>")
vim.keymap.set("", "<leader>q", "<CMD>confirm quit<CR>") vim.keymap.set("", "<leader>q", "<CMD>confirm quit<CR>")
vim.keymap.set("", "<leader>x", "<CMD>exit<CR>") vim.keymap.set("", "<leader>x", "<CMD>exit<CR>")
vim.keymap.set("", "<leader>ww", "<CMD>write<CR>")
vim.keymap.set("", "<leader><leader>x", "<CMD>write<BAR>source %<CR>") vim.keymap.set("", "<leader><leader>x", "<CMD>write<BAR>source %<CR>")
vim.keymap.set("", "n", "nzz") vim.keymap.set("", "n", "nzz")
@ -39,14 +40,6 @@ window_map("j")
window_map("k") window_map("k")
window_map("l") window_map("l")
vim.api.nvim_create_user_command("Format", function()
if vim.bo.formatprg ~= "" then
vim.cmd [[normal mzgggqG'zzz]]
else
vim.cmd [[normal mzgg=G'zzz]]
end
end, {})
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Plugin Maps -- -- Plugin Maps --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

View file

@ -48,4 +48,5 @@ return {
"tpope/vim-unimpaired", "tpope/vim-unimpaired",
"fladson/vim-kitty", "fladson/vim-kitty",
"cljoly/minimal-format.nvim"
} }

1
zsh/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
zsh-secrets

View file

@ -15,4 +15,9 @@ path+="$HOME/.local/npm/bin"
path+="$HOME/.dotnet/tools" path+="$HOME/.dotnet/tools"
if [ -f "$ZDOTDIR/zsh-secrets" ]; then
source "$ZDOTDIR/zsh-secrets"
fi
# vim: filetype=zsh # vim: filetype=zsh

View file

@ -17,7 +17,7 @@ function eik() {
} }
function find-directory() { function find-directory() {
FOLDER=$(fd -t d --hidden | fzf --height "50%" --reverse) FOLDER=$(fd -t d --hidden | fzf --height="~50%" --reverse)
if [ -n "$FOLDER" ]; then if [ -n "$FOLDER" ]; then
BUFFER="cd $FOLDER; l" BUFFER="cd $FOLDER; l"
zle .accept-line zle .accept-line
@ -27,4 +27,16 @@ function find-directory() {
} }
zle -N find-directory zle -N find-directory
function forgejo_clone() {
local repo_name
repo_name=$(curl -X GET "https://git.hadeedahmad.xyz/api/v1/user/repos" \
-H "Authorization: token ${FORGEJO_API_KEY}" \
--silent | jq -r ".[].name" | fzf --height="~50%" --reverse)
if [ -n "$repo_name" ]; then
git clone "forgejo:hadeed/$repo_name"
fi
}
zle -N forgejo_clone
# vim: filetype=zsh # vim: filetype=zsh