1
0
Fork 0
mirror of https://codeberg.org/Mo8it/dotfiles.git synced 2024-10-17 20:52:40 +00:00

New fish functions

This commit is contained in:
Mo8it 2022-04-04 22:52:57 +02:00
parent 33e5c00e8b
commit e72e92a9b9
2 changed files with 45 additions and 9 deletions

View file

@ -11,13 +11,7 @@ if status is-interactive
# Abbreviations # Abbreviations
## Replacements ## Replacements
abbr -a -g cat bat
abbr -a -g ls lsd
abbr -a -g ll "lsd -l"
abbr -a -g rm trash abbr -a -g rm trash
abbr -a -g cd z
abbr -a -g ssh "kitty +kitten ssh"
abbr -a -g ta "task add"
## Safety options ## Safety options
abbr -a -g cp "cp -i" abbr -a -g cp "cp -i"
@ -39,9 +33,6 @@ if status is-interactive
set -l asciidoctor_image docker.io/asciidoctor/docker-asciidoctor:latest set -l asciidoctor_image docker.io/asciidoctor/docker-asciidoctor:latest
abbr -a -g adoc "podman pull $asciidoctor_image; podman run -it --rm -v (pwd):/documents/:Z $asciidoctor_image" abbr -a -g adoc "podman pull $asciidoctor_image; podman run -it --rm -v (pwd):/documents/:Z $asciidoctor_image"
## Scripts
abbr -a -g up "kitty --detach --start-as maximized --session ~/.config/kitty/up.session"
# ENV variables # ENV variables
set -x EDITOR /usr/bin/nvim set -x EDITOR /usr/bin/nvim
set -x JULIA_NUM_THREADS 16 set -x JULIA_NUM_THREADS 16
@ -52,4 +43,48 @@ if status is-interactive
## starship ## starship
starship init fish | source starship init fish | source
# Functions
## Replacements
function cd
z $argv
end
function ssh -w ssh
echo "SSH with kitty"
kitty +kitten ssh $argv
end
function ls -w lsd
lsd $argv
end
function ll -w lsd
lsd -l $argv
end
function cat -w bat
bat $argv
end
## Taskwarrior
function ta -w task -d "Add no priority task"
task add project:$argv[1] $argv[2..]
end
function tal -w task -d "Add low priority task"
ta $argv priority:L
end
function tam -w task -d "Add medium priority task"
ta $argv priority:M
end
function tah -w task -d "Add high priority task"
ta $argv priority:H
end
function vitp
vit project:$argv[1]
end
end end

View file

@ -34,6 +34,7 @@ map("n", "<C-f>", "<cmd>lua require('telescope.builtin').current_buffer_fuzzy_fi
map("n", "<space>s", "<cmd>lua require('telescope.builtin').lsp_document_symbols()<CR>", opts) map("n", "<space>s", "<cmd>lua require('telescope.builtin').lsp_document_symbols()<CR>", opts)
map("n", "<space>f", "<cmd>lua require('telescope.builtin').live_grep()<CR>", opts) map("n", "<space>f", "<cmd>lua require('telescope.builtin').live_grep()<CR>", opts)
map("n", "<space>d", "<cmd>lua require('telescope.builtin').lsp_definitions()<CR>", opts) map("n", "<space>d", "<cmd>lua require('telescope.builtin').lsp_definitions()<CR>", opts)
map("n", "<space>r", "<cmd>lua require('telescope.builtin').lsp_references()<CR>", opts)
-- hlslens -- hlslens
map("n", "n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], opts) map("n", "n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], opts)