From dc398604e913a3d4fdc68b3774dee62fc7995f50 Mon Sep 17 00:00:00 2001 From: Thuan Pham Date: Fri, 18 Mar 2022 19:49:13 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=9Ffeature(zsh):=20create=20js=20test?= =?UTF-8?q?=20project,=20function=20default=20editorconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zsh/functions/fzfConfig.zsh | 4 ++-- zsh/zshrc | 30 ++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/zsh/functions/fzfConfig.zsh b/zsh/functions/fzfConfig.zsh index 6fef4d16..5aac45fc 100644 --- a/zsh/functions/fzfConfig.zsh +++ b/zsh/functions/fzfConfig.zsh @@ -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 diff --git a/zsh/zshrc b/zsh/zshrc index e588225e..5f97ece8 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -96,7 +96,7 @@ function repeatIn1s () { done } -function mk () { +function makeDir () { if [ ! -n "$1" ]; then echo "Enter a directory name" elif [ -d $1 ]; then @@ -106,7 +106,7 @@ function mk () { mkdir -p $1 && cd $1 fi } -alias makeDir="mk" +alias mk="makeDir" SERVER_IP () { hostname -I } @@ -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