I forgot
This commit is contained in:
parent
fc86df21d6
commit
0fbf6cdea0
6 changed files with 24 additions and 16 deletions
|
@ -24,14 +24,10 @@ vim.api.nvim_create_autocmd("Filetype", {
|
|||
|
||||
vim.api.nvim_create_autocmd("Filetype", {
|
||||
group = vim.api.nvim_create_augroup("webDev", {}),
|
||||
pattern = { "html", "css", "javascript", "javascriptreact" },
|
||||
pattern = { "html", "css", "javascript", "javascriptreact", "json" },
|
||||
callback = function()
|
||||
vim.cmd [[setlocal tabstop=2 softtabstop=2 shiftwidth=2]]
|
||||
vim.bo.formatprg = "npx prettier --stdin-filepath %"
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
command = "Format",
|
||||
buffer = 0
|
||||
})
|
||||
vim.bo.formatprg = "prettier --stdin-filepath " .. vim.fn.expand("%:p")
|
||||
require("minimal-format").toggle_autocmd(0)
|
||||
end
|
||||
})
|
||||
|
|
|
@ -7,6 +7,7 @@ vim.keymap.set("i", "kj", "<ESC>")
|
|||
|
||||
vim.keymap.set("", "<leader>q", "<CMD>confirm quit<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("", "n", "nzz")
|
||||
|
@ -39,14 +40,6 @@ window_map("j")
|
|||
window_map("k")
|
||||
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 --
|
||||
------------------------------------------------------------------------------
|
||||
|
|
|
@ -48,4 +48,5 @@ return {
|
|||
"tpope/vim-unimpaired",
|
||||
|
||||
"fladson/vim-kitty",
|
||||
"cljoly/minimal-format.nvim"
|
||||
}
|
||||
|
|
1
zsh/.gitignore
vendored
Normal file
1
zsh/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
zsh-secrets
|
|
@ -15,4 +15,9 @@ path+="$HOME/.local/npm/bin"
|
|||
|
||||
path+="$HOME/.dotnet/tools"
|
||||
|
||||
if [ -f "$ZDOTDIR/zsh-secrets" ]; then
|
||||
source "$ZDOTDIR/zsh-secrets"
|
||||
fi
|
||||
|
||||
|
||||
# vim: filetype=zsh
|
||||
|
|
|
@ -17,7 +17,7 @@ function eik() {
|
|||
}
|
||||
|
||||
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
|
||||
BUFFER="cd $FOLDER; l"
|
||||
zle .accept-line
|
||||
|
@ -27,4 +27,16 @@ function 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
|
||||
|
|
Loading…
Reference in a new issue