Compare commits

..

19 commits

Author SHA1 Message Date
5517419413
Merge pull request #215 from dmitmel/master 2021-02-19 21:33:01 +01:00
Dmytro Meleshko
a06b104376 [nvim] update the mappings for fugitive 2021-02-15 16:22:36 +02:00
Dmytro Meleshko
faa946c7cc [zsh] implement update-grub for Arch systems 2021-02-14 02:09:05 +02:00
Dmytro Meleshko
789d9caefd [zsh] parse ~/.ssh/config with a zsh script instead of awk as well 2021-02-13 17:51:25 +02:00
Dmytro Meleshko
412015d374 [zsh] parse rustup settings with a zsh script instead to further improve performance 2021-02-13 17:31:01 +02:00
Dmytro Meleshko
27f9b351c1 [zsh] export libs from the installed Rust toolchain as well 2021-02-13 16:39:18 +02:00
Dmytro Meleshko
4ad73c7154 [zsh] improve path.zsh loading speed by not calling the entire rustc
The effects of this were very significant on my good ol' winchester.
2021-02-12 21:00:01 +02:00
Dmytro Meleshko
3f40b413f3 [x11] add my xprofile 2021-02-12 15:27:03 +02:00
Dmytro Meleshko
315a95750e [scripts/discord-stream-desktop-audio] allow specifying the audio device 2021-02-12 10:51:34 +02:00
Dmytro Meleshko
8a4f6f8a4a [nvim] disable ESLint integration for Prettier, sync configs 2021-02-12 10:43:39 +02:00
Dmytro Meleshko
bddaea14dd [crosscode] add a mod for binding mouse buttons to actions 2021-02-12 10:25:35 +02:00
Dmytro Meleshko
32cfe4f0d5 [nvim] disable matchpairs in all other JS-like filetypes 2021-02-09 12:29:15 +02:00
Dmytro Meleshko
1abf65b087 [nvim] properly display wavy underlines under spelling mistakes now that I have enabled all termcap features of kitty 2021-02-08 21:51:59 +02:00
Dmytro Meleshko
909783441d [kitty] stop changing TERM to something non-default 2021-02-08 20:08:04 +02:00
Dmytro Meleshko
207298c6f1 [ranger] add ranger config 2021-02-08 20:08:04 +02:00
Dmytro Meleshko
7a3bcc5cc6 [zsh] use Python 3 by default on macOS 2021-02-07 19:49:38 +02:00
Dmytro Meleshko
aed0b5a30e [nvim] fix FixWhitespaceOnSave flooding the search history 2021-02-05 11:57:28 +02:00
Dmytro Meleshko
6dc39b0e04 [nvim] add functions to workaround some interesting behaviors of vim 2021-02-05 11:54:51 +02:00
Dmytro Meleshko
fe2dd2c982 [zsh] add a timestamp printing function 2021-02-05 11:13:25 +02:00
5 changed files with 55 additions and 33 deletions

View file

@ -2,11 +2,12 @@
let g:gitgutter_map_keys = 0 let g:gitgutter_map_keys = 0
nnoremap <leader>gg :G nnoremap <leader>gg :G
nnoremap <leader>g :Git<space> nnoremap <leader>g :Git<space>
nnoremap <leader>gs :vertical Gstatus<CR> nnoremap <leader>gs :vertical Git<CR>
nnoremap <leader>gd :Gdiff nnoremap <leader>gd :Gdiffsplit
nnoremap <leader>gb :Gblame<CR> nnoremap <leader>gb :Git blame<CR>
nnoremap <leader>gw :Gbrowse<CR> nnoremap <leader>gw :GBrowse<CR>
nnoremap <leader>gW :.GBrowse<CR>
nnoremap <leader>gc :Gcommit % nnoremap <leader>gc :Gcommit %
nnoremap <leader>gl :Glog<CR> nnoremap <leader>gl :Gclog<CR>
nnoremap <leader>gp :Gpush nnoremap <leader>gp :Git push
" }}} " }}}

View file

@ -74,7 +74,12 @@ alias du='du -h'
alias df='df -h' alias df='df -h'
alias free='free -h' alias free='free -h'
alias apt-get="echo -e \"use 'apt' instead of 'apt-get'\nif you really want to use 'apt-get', type '"'\\\\'"apt-get'\" #" if command_exists apt && command_exists apt-get; then
apt_get_message="use 'apt' instead of 'apt-get'
if you really want to use 'apt-get', type '\\apt-get'"
alias apt-get="echo -E ${(qqq)apt_get_message} #"
unset apt_get_message
fi
# editor # editor
alias edit="$EDITOR" alias edit="$EDITOR"
@ -97,3 +102,9 @@ alias bin-list-dylib-symbols='nm -gD'
# Duplicated as an alias to prevent autocorrection of the real "command" part. # Duplicated as an alias to prevent autocorrection of the real "command" part.
# See also scripts/prime-run # See also scripts/prime-run
alias prime-run='__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia ' alias prime-run='__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia '
if ! command_exists update-grub; then
# Doesn't exist on Arch by default. Probably implementing this command was
# left as a challenge to the documentation reader.
alias update-grub="grub-mkconfig -o /boot/grub/grub.cfg"
fi

View file

@ -40,9 +40,12 @@ zstyle ':completion:*:processes' force-list always
_completion_get_hosts() { _completion_get_hosts() {
print localhost print localhost
if [[ -f ~/.ssh/config ]]; then local line
awk "match(\$0, /^Host[[:blank:]]*/) { print substr(\$0, RLENGTH+1); }" ~/.ssh/config < ~/.ssh/config while IFS= read -r line; do
fi if [[ "$line" =~ '^Host[[:blank:]]+(.*)[[:blank:]]*' ]]; then
print -- "${match[1]}"
fi
done
} }
zstyle -e ':completion:*:hosts' hosts 'reply=("${(@f)$(_completion_get_hosts)}")' zstyle -e ':completion:*:hosts' hosts 'reply=("${(@f)$(_completion_get_hosts)}")'

View file

@ -1,9 +1,11 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# tie these env variables to zsh arrays export PATH
typeset -T PKG_CONFIG_PATH pkg_config_path ':' export MANPATH
export PKG_CONFIG_PATH PATH MANPATH # tie these env variables to zsh arrays
export -T PKG_CONFIG_PATH pkg_config_path ':'
export -T LD_LIBRARY_PATH ld_library_path ':'
path_prepend() { path_prepend() {
if (( $# < 1 )); then if (( $# < 1 )); then
@ -75,24 +77,28 @@ if [[ -f ~/.rustup/settings.toml ]]; then
# use of rustup's CLI. Also a shortcut is taken: strings aren't unescaped # use of rustup's CLI. Also a shortcut is taken: strings aren't unescaped
# because Rust toolchain names don't need escaping in strings. # because Rust toolchain names don't need escaping in strings.
# See also <https://github.com/toml-lang/toml/blob/master/toml.abnf>. # See also <https://github.com/toml-lang/toml/blob/master/toml.abnf>.
if rust_toolchain="$( rust_toolchain=""
awk ' < ~/.rustup/settings.toml while IFS= read -r line; do
match($0, /^default_toolchain = "(.+)"$/, matches) { if [[ "$line" =~ '^default_toolchain = "(.+)"$' ]]; then
print matches[1]; rust_toolchain="${match[1]}"
exit; break
} elif [[ "$line" == \[*\] ]]; then
/^\[.+\]$/ { break
exit; fi
} done; unset line
' ~/.rustup/settings.toml
)" && [[ -n "$rust_toolchain" ]]; then if [[ -n "$rust_toolchain" ]]; then
rust_sysroot=~/.rustup/toolchains/"$rust_toolchain" rust_sysroot=~/.rustup/toolchains/"$rust_toolchain"
path_prepend path "$rust_sysroot"/bin path_prepend path "$rust_sysroot"/bin
path_prepend fpath "$rust_sysroot"/zsh/site-functions path_prepend fpath "$rust_sysroot"/zsh/site-functions
path_prepend manpath "$rust_sysroot"/share/man path_prepend manpath "$rust_sysroot"/share/man
path_prepend ld_library_path "$rust_sysroot"/lib
unset rust_sysroot
fi fi
unset rust_toolchain rust_sysroot
unset rust_toolchain
fi fi
path_prepend path ~/.cargo/bin path_prepend path ~/.cargo/bin
# add my binaries and completions # add my binaries and completions
@ -103,3 +109,12 @@ path_prepend fpath "$ZSH_DOTFILES/completions"
path_prepend path ~/.local/bin path_prepend path ~/.local/bin
unfunction path_prepend unfunction path_prepend
# For some reason manpath is not always set when logging with ssh for instance.
# Let's ensure that it is always set and exported. The additional colon ensures
# that the system manpath isn't overwritten (see manpath(1)).
if [[ -n "$MANPATH" && "$MANPATH" != *: ]]; then
# Append a colon if MANPATH isn't empty and doesn't end with a colon already
MANPATH="$MANPATH:"
fi
export MANPATH="$MANPATH"

View file

@ -46,14 +46,6 @@ _perf_timer_start "total"
fi fi
# }}} # }}}
# For some reason manpath is not always set when logging with ssh for instance.
# Let's ensure that it is always set and exported. The additional colon ensures
# that the system manpath isn't overwritten (see manpath(1)), though in reality
# two colons get added for some reason, which is also valid, but means
# something slightly different (again, see manpath(1)). Hope this won't cause
# any problems in the future.
export MANPATH="$MANPATH:"
for script in functions options path env plugins aliases completion zle prompt colorscheme; do for script in functions options path env plugins aliases completion zle prompt colorscheme; do
_perf_timer_start "$script.zsh" _perf_timer_start "$script.zsh"
source "$ZSH_DOTFILES/$script.zsh" source "$ZSH_DOTFILES/$script.zsh"