Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
editorconfig and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jun 5, 2017
1 parent df4f1ed commit bfdd32e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 32 deletions.
8 changes: 6 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# editorconfig.org
[*]
indent_style = space
indent_size = 2
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.md,*.yml}]
indent_style = space
indent_size = 2
55 changes: 28 additions & 27 deletions zsh/config.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ setopt HIST_EXPIRE_DUPS_FIRST
# dont ask for confirmation in rm globs*
setopt RM_STAR_SILENT

# do I really need this?
# shellcheck disable=SC2004
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
# if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
# function zle-line-init() {
# echoti smkx
# }
# function zle-line-finish() {
# echoti rmkx
# }
# zle -N zle-line-init
# zle -N zle-line-finish
# fi

# Use emacs key bindings
bindkey -e
Expand All @@ -60,31 +61,31 @@ bindkey -e
bindkey '^r' history-incremental-search-backward
# [PageUp] - Up a line of history
if [[ ! -z "$terminfo[kpp]" ]]; then
bindkey "$terminfo[kpp]" up-line-or-history
bindkey "$terminfo[kpp]" up-line-or-history
fi
# [PageDown] - Down a line of history
if [[ ! -z "$terminfo[knp]" ]]; then
bindkey "$terminfo[knp]" down-line-or-history
bindkey "$terminfo[knp]" down-line-or-history
fi
# start typing + [Up-Arrow] - fuzzy find history forward
if [[ ! -z "$terminfo[kcuu1]" ]]; then
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcuu1]" history-substring-search-up
fi
# start typing + [Down-Arrow] - fuzzy find history backward
if [[ ! -z "$terminfo[kcud1]" ]]; then
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey "$terminfo[kcud1]" history-substring-search-down
fi
if [[ ! -z "$terminfo[khome]" ]]; then
# [Home] - Go to beginning of line
bindkey "$terminfo[khome]" beginning-of-line
# OPTION+left
bindkey '[D' beginning-of-line
# [Home] - Go to beginning of line
bindkey "$terminfo[khome]" beginning-of-line
# OPTION+left
bindkey '[D' beginning-of-line
fi
if [[ ! -z "$terminfo[kend]" ]]; then
# [End] - Go to end of line
bindkey "$terminfo[kend]" end-of-line
# OPTION+right
bindkey '[C' end-of-line
# [End] - Go to end of line
bindkey "$terminfo[kend]" end-of-line
# OPTION+right
bindkey '[C' end-of-line
fi

# [Ctrl-RightArrow] - move forward one word
Expand All @@ -93,15 +94,15 @@ bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
# [Shift-Tab] - move through the completion menu backwards
if [[ ! -z "$terminfo[kcbt]" ]]; then
bindkey "$terminfo[kcbt]" reverse-menu-complete
bindkey "$terminfo[kcbt]" reverse-menu-complete
fi
# [Backspace] - delete backward
bindkey '^?' backward-delete-char
# [Delete] - delete forward
if [[ ! -z "$terminfo[kdch1]" ]]; then
bindkey "$terminfo[kdch1]" delete-char
bindkey "$terminfo[kdch1]" delete-char
else
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
fi
8 changes: 5 additions & 3 deletions zsh/fpath.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/zsh
#add each topic folder to fpath so that they can add functions and completion scripts
for topic_folder ($DOTFILES/*) if [ -d "$topic_folder" ]; then
fpath=($topic_folder $fpath)
fi
for topic_folder in $DOTFILES/*; do
if [ -d "$topic_folder" ]; then
fpath=($topic_folder $fpath)
fi
done

0 comments on commit bfdd32e

Please sign in to comment.