Skip to content

Commit

Permalink
🌟feature(zsh): create js test project, function default editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
cutbypham committed Mar 18, 2022
1 parent 4dc81d0 commit dc39860
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
4 changes: 2 additions & 2 deletions zsh/functions/fzfConfig.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export FZF_ALT_C_COMMAND="fd -t d"

alias ej="emoji-fzf preview --prepend | fzfDown | awk '{ print \$1 }' | wl-copy"
# alias ej="emoji-fzf preview --prepend | fzfDown | awk '{ print \$1 }' | xclip -sel clip"
alias v='e'
alias v='findFile'
alias vi='nvim'
alias vim='nvim'

function e () {
if [ ! -n "$1" ]; then
f
findFile
else
nvim "$1"
fi
Expand Down
30 changes: 28 additions & 2 deletions zsh/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function repeatIn1s () {
done
}

function mk () {
function makeDir () {
if [ ! -n "$1" ]; then
echo "Enter a directory name"
elif [ -d $1 ]; then
Expand All @@ -106,7 +106,7 @@ function mk () {
mkdir -p $1 && cd $1
fi
}
alias makeDir="mk"
alias mk="makeDir"

SERVER_IP () { hostname -I }

Expand Down Expand Up @@ -188,6 +188,32 @@ function hi () {
neofetch
}

functions importDefaultEditorConfig() {
touch .editorconfig
echo "root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
# editorconfig-tools is unable to ignore longs strings or urls
max_line_length = off" > .editorconfig
}


functions createJsTestProject() {
cd /tmp
mkdir js_test
cd js_test
yarn init --yes
yarn add eslint-config-airbnb
importDefaultEditorConfig
nvim js_test.js
}

source ~/dotfiles/zsh/functions/arch.zsh
source ~/dotfiles/zsh/functions/debian.zsh
source ~/dotfiles/zsh/functions/fedora.zsh
Expand Down

0 comments on commit dc39860

Please sign in to comment.