This commit is contained in:
thek4n 2024-06-10 08:27:31 +03:00
parent 9d94bfa4f9
commit 9764834e79
3 changed files with 5 additions and 2 deletions

View File

@ -66,7 +66,8 @@ alias svi="sudo -E nvim"
# net
alias ports='ss -tlnp'
alias wget='wget -c'
alias myip='curl ipinfo.io/ip'
# alias myip='curl ipinfo.io/ip'
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
alias sprunge='curl -F "sprunge=<-" http://sprunge.us 2>/dev/null' # CLI pastebin
alias weather='(curl -4 wttr.in/$(cat) 2>/dev/null | head -n -1) <<<'
alias ip='ip -c'

View File

@ -45,7 +45,7 @@
[alias]
a = "!git ls-files --exclude-standard -m --others -t | fzf -0 -m --bind load:last --preview 'git diff --color=always {2}' | cut -d' ' -f2 | xargs -r git add"
s = "!git diff --name-only --cached | fzf -0 -m --bind load:last --preview 'git diff --staged --color=always {1}' | xargs -r git restore --staged"
u = "!git diff --name-only --cached | fzf -0 -m --bind load:last --preview 'git diff --staged --color=always {1}' | xargs -r git restore --staged"
d = diff
di = diff
ds = diff --staged
@ -55,6 +55,7 @@
ci = commit
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)"
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)"
pr = "pull --rebase"
st = status
br = branch
bm = branch --merged

View File

@ -101,6 +101,7 @@ map("c", '%%', [[getcmdtype() == ':' ? expand('%:h').'/' : '%%']], {expr = true}
-- Save from root
vim.api.nvim_create_user_command('W', [[execute 'silent! write !SUDO_ASKPASS=vim_askpass_helper sudo -A tee % >/dev/null' <bar> edit!]], {})
vim.api.nvim_create_user_command('X', [[execute 'silent! write !SUDO_ASKPASS=vim_askpass_helper sudo -A tee % >/dev/null' <bar> edit! | q]], {})
vim.cmd([[autocmd FileChangedRO * set readonly!]])