mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-18 01:29:06 +00:00
feat: update tpl aliases, add hlsearch toggle map
This commit is contained in:
@@ -25,8 +25,6 @@ return {
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
|
||||
print('Setting up DAP', vim.fn.stdpath('data') .. '/mason/packages/js-debug-adapter')
|
||||
|
||||
dap.adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "localhost",
|
||||
|
||||
@@ -80,6 +80,14 @@ vim.keymap.set("n", "<leader>dP", "<esc>dawx", { desc = "Delete JS property (bac
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<F2>", vim.lsp.buf.rename)
|
||||
|
||||
local hl_search = vim.opt.hlsearch
|
||||
|
||||
vim.keymap.set("n", "<leader>n", function()
|
||||
hl_search = not hl_search
|
||||
print("Search highlight: " .. (hl_search and "on" or "off"))
|
||||
vim.opt.hlsearch = hl_search
|
||||
end, { desc = "Toggle search highlight" })
|
||||
|
||||
local function nope()
|
||||
vim.g.mapleader = " "
|
||||
-- vim.keymap.set("n", "<leader>pv", vim.cmd.Ex, { desc = "File explorer" })
|
||||
|
||||
@@ -11,75 +11,78 @@ function tpl() {
|
||||
fi
|
||||
name=""
|
||||
case $tpl_name in
|
||||
editorfiles | ef)
|
||||
ef)
|
||||
tpl_name="editorfiles"
|
||||
name="editorfiles"
|
||||
;;
|
||||
gh)
|
||||
tpl_name="github-workflows"
|
||||
name="github-workflows"
|
||||
;;
|
||||
esac
|
||||
|
||||
npx -y simple-scaffold@latest -gh "chenasraf/templates#${tpl_name}.js" -k "${sub_tpl_name:-default}" $name $@
|
||||
}
|
||||
|
||||
|
||||
# tpl_name="$1"
|
||||
# shift
|
||||
#
|
||||
# case $tpl_name in
|
||||
# nextjs | cra)
|
||||
# app_name="$1"
|
||||
# shift
|
||||
# tpl_data=""
|
||||
# mkdir -p $app_name
|
||||
# cd $app_name
|
||||
# echo "Creating '$tpl_name' app in directory: '$(pwd)'"
|
||||
# case $tpl_name in
|
||||
# nextjs)
|
||||
# tpl_data='{"nextComponents":true}'
|
||||
# src_dir="./"
|
||||
# yarn create next-app --typescript .
|
||||
# ;;
|
||||
# cra)
|
||||
# tpl_data='{"nextComponents":false}'
|
||||
# src_dir="./src"
|
||||
# yarn create react-app --template typescript .
|
||||
# yes | rm -rf ./src/
|
||||
# ;;
|
||||
# esac
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/$tpl_name" -w 1 -o . -d $tpl_data $app_name
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/react-app-common" -w 1 -o $src_dir -d $tpl_data $app_name
|
||||
# echo_gray "Merging package.json..."
|
||||
# jq 'reduce inputs as $s (.; .*$s)' ./package.json $SCAFFOLDS_DIR/_merge/$tpl_name/package.json >./package.json.tmp
|
||||
# mv -f ./package.json.tmp ./package.json && rm -f ./package.json.tmp
|
||||
# echo_gray "Copying sub scaffolds..."
|
||||
# mkdir -p ./scaffolds
|
||||
# cp -R $SCAFFOLDS_DIR/_subs/$tpl_name/ ./scaffolds/
|
||||
# tpl editorfiles
|
||||
# echo_gray "Installing additional dependencies..."
|
||||
# yarn install
|
||||
# echo_gray "Prettifying files..."
|
||||
# prettier -w "**/*.{js,jsx,ts,tsx,json,html}"
|
||||
# echo_gray "Done"
|
||||
# ;;
|
||||
# ef | editorfiles)
|
||||
# tpl_name="editorfiles"
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/editorfiles" -o . - $@
|
||||
# ;;
|
||||
# fl | flutter | flutter-app)
|
||||
# tpl_name="flutter-app"
|
||||
# echo_cyan "Creating app '$@'..."
|
||||
# flutter create $@
|
||||
# cd $1
|
||||
# echo_cyan "Installing packages..."
|
||||
# flutter pub add firebase_core cloud_firestore firebase_crashlytics firebase_remote_config firebase_auth provider shared_preferences google_sign_in sign_in_with_apple dynamic_themes cached_network_image wakelock intl intl_generator
|
||||
# echo_cyan "Copying files..."
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/$tpl_name" -o ./ $@
|
||||
# cp -R $SCAFFOLDS_DIR/_subs/$tpl_name/ ./
|
||||
# echo_cyan "Updating pubspec.yaml..."
|
||||
# echo "$(cat $SCAFFOLDS_DIR/_merge/$tpl_name/pubspec.yaml)" >>./pubspec.yaml
|
||||
# echo_cyan "Done"
|
||||
# ;;
|
||||
# *)
|
||||
# echo_red "Usage: tpl [nextjs|cra|editorfiles|flutter-app]"
|
||||
# ;;
|
||||
# esac
|
||||
}
|
||||
# tpl_name="$1"
|
||||
# shift
|
||||
#
|
||||
# case $tpl_name in
|
||||
# nextjs | cra)
|
||||
# app_name="$1"
|
||||
# shift
|
||||
# tpl_data=""
|
||||
# mkdir -p $app_name
|
||||
# cd $app_name
|
||||
# echo "Creating '$tpl_name' app in directory: '$(pwd)'"
|
||||
# case $tpl_name in
|
||||
# nextjs)
|
||||
# tpl_data='{"nextComponents":true}'
|
||||
# src_dir="./"
|
||||
# yarn create next-app --typescript .
|
||||
# ;;
|
||||
# cra)
|
||||
# tpl_data='{"nextComponents":false}'
|
||||
# src_dir="./src"
|
||||
# yarn create react-app --template typescript .
|
||||
# yes | rm -rf ./src/
|
||||
# ;;
|
||||
# esac
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/$tpl_name" -w 1 -o . -d $tpl_data $app_name
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/react-app-common" -w 1 -o $src_dir -d $tpl_data $app_name
|
||||
# echo_gray "Merging package.json..."
|
||||
# jq 'reduce inputs as $s (.; .*$s)' ./package.json $SCAFFOLDS_DIR/_merge/$tpl_name/package.json >./package.json.tmp
|
||||
# mv -f ./package.json.tmp ./package.json && rm -f ./package.json.tmp
|
||||
# echo_gray "Copying sub scaffolds..."
|
||||
# mkdir -p ./scaffolds
|
||||
# cp -R $SCAFFOLDS_DIR/_subs/$tpl_name/ ./scaffolds/
|
||||
# tpl editorfiles
|
||||
# echo_gray "Installing additional dependencies..."
|
||||
# yarn install
|
||||
# echo_gray "Prettifying files..."
|
||||
# prettier -w "**/*.{js,jsx,ts,tsx,json,html}"
|
||||
# echo_gray "Done"
|
||||
# ;;
|
||||
# ef | editorfiles)
|
||||
# tpl_name="editorfiles"
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/editorfiles" -o . - $@
|
||||
# ;;
|
||||
# fl | flutter | flutter-app)
|
||||
# tpl_name="flutter-app"
|
||||
# echo_cyan "Creating app '$@'..."
|
||||
# flutter create $@
|
||||
# cd $1
|
||||
# echo_cyan "Installing packages..."
|
||||
# flutter pub add firebase_core cloud_firestore firebase_crashlytics firebase_remote_config firebase_auth provider shared_preferences google_sign_in sign_in_with_apple dynamic_themes cached_network_image wakelock intl intl_generator
|
||||
# echo_cyan "Copying files..."
|
||||
# npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/$tpl_name" -o ./ $@
|
||||
# cp -R $SCAFFOLDS_DIR/_subs/$tpl_name/ ./
|
||||
# echo_cyan "Updating pubspec.yaml..."
|
||||
# echo "$(cat $SCAFFOLDS_DIR/_merge/$tpl_name/pubspec.yaml)" >>./pubspec.yaml
|
||||
# echo_cyan "Done"
|
||||
# ;;
|
||||
# *)
|
||||
# echo_red "Usage: tpl [nextjs|cra|editorfiles|flutter-app]"
|
||||
# ;;
|
||||
# esac
|
||||
# }
|
||||
|
||||
Reference in New Issue
Block a user