diff options
Diffstat (limited to 'config/zsh')
| -rw-r--r-- | config/zsh/aliases/dev.zsh | 15 | ||||
| -rw-r--r-- | config/zsh/aliases/system.zsh | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/config/zsh/aliases/dev.zsh b/config/zsh/aliases/dev.zsh index 9dd4307..d0398ea 100644 --- a/config/zsh/aliases/dev.zsh +++ b/config/zsh/aliases/dev.zsh @@ -60,3 +60,18 @@ fix-interpreter() { nix-shell -p patchelf --run "patchelf --set-interpreter \$(patchelf --print-interpreter \$(which mkdir)) $@" } + +# Terminal through neovim +vt() { + nvim +term \ + +'norm i' \ + +"lua vim.fn.feedkeys([[$1]])" \ + +'set nonumber norelativenumber signcolumn=no' \ + +'autocmd TermClose * execute "qa"' \ + +'hi @_phenax.term-title guibg=#1a1824 guifg=#8e7ae3 gui=bold' \ + +'set winbar=%#@_phenax.term-title#%=nvim-term%='; +} + +p__nvim_virtual_terminal() { vt "$BUFFER"; } +zle -N p__nvim_virtual_terminal; +bindkey '^T' p__nvim_virtual_terminal; diff --git a/config/zsh/aliases/system.zsh b/config/zsh/aliases/system.zsh index 4123e19..e7a6635 100644 --- a/config/zsh/aliases/system.zsh +++ b/config/zsh/aliases/system.zsh @@ -50,3 +50,7 @@ setup_webcam_night() { --set-ctrl gain=64 } +limit_memory() { + local lim=${1:-100M}; shift 1; + systemd-run --user --scope -p MemoryHigh="$lim" -p MemorySwapMax="$lim" "$@"; +} |
