From 011d8405259d03fa422ea2f79b55db2b6c533476 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Mon, 24 Feb 2025 02:34:24 +0400 Subject: feat: few more alias&keymaps --- .editorconfig | 18 -------------- editorconfig/.editorconfig | 18 ++++++++++++++ gnupg/.gnupg/gpg-agent.conf | 3 +++ gnupg/.gnupg/gpg.conf | 30 +++++++++++++++++++++++ nvim/.config/nvim/lua/custom/plugins/neorg.lua | 22 +++++++++++++++++ nvim/.config/nvim/plugin/keymaps.lua | 3 +++ zsh/.config/zsh/.zprofile | 34 -------------------------- zsh/.config/zsh/.zshrc | 13 ++++++++-- 8 files changed, 87 insertions(+), 54 deletions(-) delete mode 100644 .editorconfig create mode 100644 editorconfig/.editorconfig create mode 100644 gnupg/.gnupg/gpg-agent.conf create mode 100644 gnupg/.gnupg/gpg.conf create mode 100644 nvim/.config/nvim/lua/custom/plugins/neorg.lua diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 6a637a0..0000000 --- a/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -charset = utf-8 -indent_size = 2 -indent_style = space - -# 4 space indentation -[*.py] -indent_style = space -indent_size = 4 - -# Tab indentation (no size specified) -[Makefile] -indent_style = tab diff --git a/editorconfig/.editorconfig b/editorconfig/.editorconfig new file mode 100644 index 0000000..6a637a0 --- /dev/null +++ b/editorconfig/.editorconfig @@ -0,0 +1,18 @@ +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_size = 2 +indent_style = space + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab diff --git a/gnupg/.gnupg/gpg-agent.conf b/gnupg/.gnupg/gpg-agent.conf new file mode 100644 index 0000000..682af4e --- /dev/null +++ b/gnupg/.gnupg/gpg-agent.conf @@ -0,0 +1,3 @@ +default-cache-ttl 28800 +max-cache-ttl 28800 +pinentry-timeout 1200 diff --git a/gnupg/.gnupg/gpg.conf b/gnupg/.gnupg/gpg.conf new file mode 100644 index 0000000..ffa0f43 --- /dev/null +++ b/gnupg/.gnupg/gpg.conf @@ -0,0 +1,30 @@ +# UTF-8 support for compatibility +charset utf-8 + +# No comments in messages +no-comments + +# No version in output +no-emit-version + +# Disable banner +no-greeting + +# Long key id format +keyid-format 0xlong + +# Display UID validity +list-options show-uid-validity +verify-options show-uid-validity + +# Display all keys and their fingerprints +with-fingerprint + +# Cross-certify subkeys are present and valid +require-cross-certification + +# Disable caching of passphrase for symmetrical ops +no-symkey-cache + +# Enable smartcard +use-agent diff --git a/nvim/.config/nvim/lua/custom/plugins/neorg.lua b/nvim/.config/nvim/lua/custom/plugins/neorg.lua new file mode 100644 index 0000000..455b80d --- /dev/null +++ b/nvim/.config/nvim/lua/custom/plugins/neorg.lua @@ -0,0 +1,22 @@ +return {} +-- return { +-- "nvim-neorg/neorg", +-- lazy = false, +-- version = "*", +-- config = function() +-- require("neorg").setup { +-- load = { +-- ["core.defaults"] = {}, +-- ["core.concealer"] = {}, +-- ["core.dirman"] = { +-- config = { +-- workspaces = { +-- notes = "~/notes" +-- }, +-- default_workspace = "notes" +-- } +-- }, +-- } +-- } +-- end, +-- } diff --git a/nvim/.config/nvim/plugin/keymaps.lua b/nvim/.config/nvim/plugin/keymaps.lua index 8e24efb..48fff51 100644 --- a/nvim/.config/nvim/plugin/keymaps.lua +++ b/nvim/.config/nvim/plugin/keymaps.lua @@ -4,6 +4,9 @@ set("n", "w", "w", { desc = "Write buffer" }) set("n", "e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" }) +-- execute current file. TODO: think this can be smarter +set("n", "r", '!"%:p"') + -- ui navigation set("n", "", "") set("n", "", "") diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile index 3b82e4d..08f137f 100644 --- a/zsh/.config/zsh/.zprofile +++ b/zsh/.config/zsh/.zprofile @@ -1,37 +1,3 @@ -# Guix -_GUIX_PROFILE="$HOME/.config/guix/current" -export GUIX_PROFILE="$HOME/.guix-profile" - -# XDG variables -export XCURSOR_PATH="${XCURSOR_PATH:-/usr/local/share/icons:/usr/share/icons}" -export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" -export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" -export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" -export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}" -export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}" -export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" -export XDG_DATA_DIRS="$GUIX_PROFILE/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS" - # User defaults export EDITOR="nvim" export PAGER="less" - - -# It can be assumed that this file will be sourced once but for some obscure -# reason tmux starts login shell so this file will be sourced again and again. -# Since I don't want to override default tmux behaviour and is's possible that -# other programs will start login shell its better to put some guard over -# recursive definitions and any other things that should be evaluated once. - -if [ -z ${SHELL_RECURSION_GUARD+x} ]; then - - export SHELL_RECURSION_GUARD=1 - -# GUIX - [ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile" - export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH" - -# PATH - export PATH=$HOME/.cargo/bin/:$PATH - -fi diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index fd47a93..499f753 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -90,7 +90,7 @@ precmd() } setopt prompt_subst -PROMPT='%B%F{40}%~%f%b${vcs_info_msg_0_} %F{40}%f ' +PROMPT='%B%F{40}%~%f%b${vcs_info_msg_0_} ${GUIX_ENVIRONMENT:+[env] }%F{40}%f ' # Bindings @@ -113,7 +113,7 @@ alias v=nvim alias vf='nvim $(fzf --preview="bat --color=always {}")' alias ls="ls --color" alias la="ls -la" -alias c='clear' +alias c='clear; tmux clear-history' alias x='source $ZDOTDIR/.zshrc' function fkill () { (date; ps -ef) | @@ -122,6 +122,15 @@ function fkill () { --preview='echo {}' --preview-window=down,3,wrap \ | awk '{print $2}' | sudo xargs kill -9 } +## Unnecessary after pass -c will work +function cpass () { + pass $1 | tr -d "[:space:]" | wl-copy --type text/plain +} +alias guile='rlwrap guile' +alias md='mkdir' +alias rmd='rmdir' +alias gs='git status' + # Shell integrations source <(fzf --zsh) -- cgit v1.2.3