Major Update

- Updated repo to support both mac and kde neon
- bootstrap.sh updated to auto-detect OS and read from the required directory
- Added VIM & NeoVIM dot files
This commit is contained in:
Pratik Tripathy
2023-10-22 03:01:04 +05:30
parent 08b1d72827
commit 306fcd5c23
37 changed files with 3719 additions and 181 deletions

View File

@@ -1,15 +0,0 @@
{
// Place your snippets for go here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
}

75
.gitignore vendored Executable file → Normal file
View File

@@ -1,43 +1,46 @@
# ---- macOS ----
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# VS Code Artifacts
.vscode
**state.vscdb
**state.vscdb.backup
# Ignore all Files under .vscode/extensions/
.vscode/extensions/**
# Allow only json files inside the .vscode/extensions/ folder
!.vscode/extensions/**/*.json
.vscode
# KDE directory preferences
.directory
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
.vscode/extensions/** # Ignore all Files under .vscode/extensions/
!.vscode/extensions/**/*.json # Only json files inside the .vscode/extensions/ folder
# Ignore all downloaded node modules
node_modules/*
# Ignore all minified js files
*.min.js
# Other Files to ignore
**app_stat_v2.db
.ssh/*.pub
**/Package Control.cache
@@ -50,12 +53,22 @@ node_modules/*
**/contents/fonts
*kpluginindex.json
.directory
# Intellij IDE Artifacts
.idea/
*.imi
*.jar
*.tar
# KDE directory preferences
.directory
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
resharper-host/
tasks/

View File

@@ -1,4 +0,0 @@
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go/libs
export PATH=$PATH:$GOPATH/bin
export GOPATH=$GOPATH:/media/pratik/Work/Coding/Go/

View File

@@ -1 +0,0 @@
alias up="sudo pkcon refresh && sudo pkcon update && sudo apt dist-upgrade && sudo apt autoremove && rustup update && brew upgrade && npm update -g"

24
.vscode/argv.json vendored
View File

@@ -1,24 +0,0 @@
// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelyhood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
//
// NOTE: Changing this file requires a restart of VS Code.
{
// Use software rendering instead of hardware accelerated rendering.
// This can help in cases where you see rendering issues in VS Code.
// "disable-hardware-acceleration": true,
// Enabled by default by VS Code to resolve color issues in the renderer
// See https://github.com/Microsoft/vscode/issues/51791 for details
"disable-color-correct-rendering": true,
// Allows to disable crash reporting.
// Should restart the app if the value is changed.
"enable-crash-reporter": false,
// Unique id used for correlating crash reports sent from this instance.
// Do not edit this value.
"crash-reporter-id": "663adebd-ee7d-4d1f-9723-fd963e7e8e1a"
}

View File

@@ -1 +0,0 @@
{}

0
LICENSE Executable file → Normal file
View File

0
README.md Executable file → Normal file
View File

View File

@@ -13,7 +13,7 @@ usage() {
echo " -l, --create-links Creates soft-links to files in the current directory instead of copying them"
echo ""
echo "Example: bash ./$0 -q --create-links"
echo "Example: $0 -q --create-links"
}
##################################
@@ -48,31 +48,70 @@ while [[ "${#}" -gt 0 ]]; do
done
main() {
TS=$(date '+%d_%m_%Y-%H_%M_%S')
# Switch inside dotfile directory
cd -P "$( dirname "$0")" || exit
SCRIPT_DIR="$(pwd)"
find . -type f ! -name "$0" ! -path '*/.idea/*' ! -path '*/.git/*' ! -name 'LICENSE' ! -name 'README.md' -print0 | while IFS= read -r -d '' file; do
# Replaces `.` with `~` in the found file names
target_file="${file/./~}"
if [[ -f "${target_file}" ]]; then
mv "$target_file" "${target_file}_${TS}" && [[ "$QUIET" == "n" ]] && echo "Existing setting renamed to ${target_file}_${TS}"
# Check if the current os is KDE Neon or Mac
# if $(command -v pkcon > /dev/null) || [[ $XDG_CURRENT_DESKTOP == "KDE" ]]; then
# OS="kde-neon"
#
# else
# OS="macos"
# fi
if [[ $(uname -s) == *Darwin* ]]; then
OS="macos"
else
OS="kde-neon"
fi
target_directory=$(dirname "${target_file}")
TS=$(date '+%d_%m_%Y-%H_%M_%S')
# Switch inside dotfile repository directory
cd -P "$(dirname "$0")" || exit
# Copy all files in "Common" dotfiles to $HOME directory ("~")
find "./common" -type f ! -path '*.DS_Store' ! -path '*.directory' -print0 | while IFS= read -r -d '' file;
do
local file_target_location="${file/.\/common/$HOME}"
local source_file_location="${file/./$PWD}"
place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS"
done
# Copy platform specific files to $HOME directory ("~")
find "./${OS}" -type f ! -path '*.DS_Store' ! -path '*.directory' -print0 | while IFS= read -r -d '' file;
do
local file_target_location="${file/.\/${OS}/$HOME}"
local source_file_location="${file/./$PWD}"
place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS"
done
}
place_dotfile_at_target_location() {
local source_file_location="$1"
local file_target_location="$2"
local TS="$3"
# echo "${source_file_location}"
# echo "${file_target_location}"
# To avoid over writing existing dot file, we rename them
# Appending the timestamp to file name
if [[ -f "${file_target_location}" || -L "${file_target_location}" ]]; then
# echo "mv ${file_target_location} ${file_target_location}_${TS}" && [[ "$QUIET" == "n" ]] && echo "Existing dotfile renamed to ${file_target_location}_${TS}"
mv "${file_target_location}" "${file_target_location}_${TS}" && [[ "$QUIET" == "n" ]] && echo "Existing setting renamed to ${file_target_location}_${TS}"
fi
local target_directory
target_directory=$(dirname "${file_target_location}")
if [[ ! -d "${target_directory}" ]]; then
mkdir -p "${target_directory}" && [[ "$QUIET" == "n" ]] && echo "Directory ${target_directory} created"
fi
if [[ "$CREATE_LINKS" == "y" ]]; then
ln -s "${file/./${SCRIPT_DIR}}" "${target_file}" && [[ "$QUIET" == "n" ]] && echo "Linked ${target_file}"
# echo "ln -s ${source_file_location} ${target_directory}"
ln -s "${source_file_location}" "${target_directory}" && [[ "$QUIET" == "n" ]] && echo "Linked ${file_target_location}"
else
cp "${file/./${SCRIPT_DIR}}" "${target_file}" && [[ "$QUIET" == "n" ]] && echo "Copied ${target_file}"
# echo "cp ${source_file_location} ${target_directory}"
cp "${source_file_location}" "${target_directory}" && [[ "$QUIET" == "n" ]] && echo "Copied ${file_target_location}"
fi
done
}
main "$@"

74
common/.aliases Normal file
View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bash
# Generic
alias sb="source ~/.bashrc"
alias bashreload="source ~/.bashrc"
alias sz="source ~/.zshrc"
alias zshreload="source ~/.zshrc"
alias bashrc="${EDITOR:-nano} +116 ~/.bashrc"
alias zshrc="${EDITOR:-nano} ~/.zshrc"
alias free="free -ht"
alias type="type -a"
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home Dir: \" \$6 \", Shell Used: \" \$7}' /etc/passwd | grep"
alias untar='tar -zxvf '
url_encode(){
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"
}
# History
alias histsearch="history | grep"
alias hs="histsearch"
alias hsi="histsearch"
# Directories and Directory listings
alias ~="cd ~"
alias ..="cd .."
alias ...='cd ../../../' # Go back 3 directory levels
alias ..4='cd ../../../../' # Go back 4 directory levels
alias ..5='cd ../../../../../' # Go back 5 directory levels
alias ..6='cd ../../../../../../' # Go back 6 directory levels
alias lsc='ls --color=auto'
alias ll='lsc -alhF'
alias la='lsc -Ah'
alias l='lsc -CF'
alias lsa="lsc -lAFhZ"
alias mkdir="mkdir -pv"
alias df="df -h"
mkcd () {
mkdir "$1"
cd "$1" || exit
}
# Network
alias ping="ping -c 10"
alias ping8="ping 8.8.8.8"
alias ping1="ping 1.1.1.1"
alias p8="ping8"
alias p1="ping1"
alias pubip="curl https://ipinfo.io/ip; echo"
alias speedtest="speedtest-cli --secure" # needs speedtest-cli installed
geoip () {
curl -s https://ipinfo.io | sed '/readme/d;/loc/d;/postal/d;s/org/ISP/' | tr -d {},\" | awk -F ':' 'NF {printf ("%10s: %.25s \n", $1, $2)}'
}
# Git
# To use this - Ensure all git server SSH are in ~/.ssh
alias git_signin='(for i in ~/.ssh/{*github*,*gitea*}; do ssh-add -k $i; done; ) && (echo; echo Identities added successfully)'
git_push_all_changes(){
git add . && git commit -am "${1}" && git push
}
alias ta="tmux a"
alias tat="tmux a -t"
alias tls="tmux ls"
alias tnew="tmux new"
alias tnewt="tmux new -t"

18
.bashrc → common/.bashrc Executable file → Normal file
View File

@@ -187,29 +187,23 @@ jazz_my_prompt() {
PS1="\n${group1}-${group2}-${group3}-${group4}-${group5}\n${group6}-${group9}-${group8}\n${isroot}${reset} "
}
# Setup path and export variables
[[ ! -f ~/.env ]] || source ~/.env
[[ ! -f ~/.set_path ]] || source ~/.set_path
[[ ! -f "$HOME/.cargo/env" ]] || source "$HOME/.cargo/env"
# Aliases
[[ ! -f ~/.aliases ]] || source ~/.aliases
[[ ! -f ~/.mac_aliases ]] || source ~/.mac_aliases
[[ ! -f ~/.neon_aliases ]] || source ~/.neon_aliases
[[ ! -f ~/.aliases_personal ]] || source ~/.aliases_personal
[[ ! -f ~/.neon_alias ]] || source ~/.neon_alias
# Dev Setup Configurations
[[ ! -f ~/.gosetup ]] || source ~/.gosetup
[[ ! -f ~/.flutterpathsetup ]] || source ~/.flutterpathsetup
[[ ! -f ~/.env ]] || source ~/.env
[[ ! -f ~/.skaffoldenv ]] || source ~/.skaffoldenv
# nvm Setup
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Kubernetes Autocompletion
command -v kubectl && source <(kubectl completion bash)
[[ ! -f ~/.config/exercism/exercism_completion.bash ]] || source ~/.config/exercism/exercism_completion.bash
[[ ! -f "$HOME/.cargo/env" ]] || source "$HOME/.cargo/env"
export QT_PLUGIN_PATH=~/.local/lib/qt/plugins/:
. "$HOME/.cargo/env"
eval "$(ssh-agent -s)"

View File

@@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

View File

@@ -0,0 +1,2 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

View File

@@ -0,0 +1,53 @@
{
"LazyVim": { "branch": "main", "commit": "e996eed750aabdfaa976357450f9ccbcd333a785" },
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
"bufferline.nvim": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" },
"catppuccin": { "branch": "main", "commit": "dcef0a062de380885193fb0f919217d58b979753" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "4897996612adeb9cb39325f95c9b0481ce892edf" },
"dashboard-nvim": { "branch": "master", "commit": "c71cab740e2add248c54c458b5ca9d6e77c30fa6" },
"dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
"gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" },
"indent-blankline.nvim": { "branch": "master", "commit": "8a7b48f5823cc924f815129192288ec2e2b9288f" },
"lazy.nvim": { "branch": "main", "commit": "4c75c8eeb957a99aa44ce8e526c04340ab358c5e" },
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "09be3766669bfbabbe2863c624749d8da392c916" },
"mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
"mini.ai": { "branch": "main", "commit": "10ad2ed049fb681a829b44aeb23443c0a9c910ae" },
"mini.bufremove": { "branch": "main", "commit": "75be0b153b0cd2499c031e57d44cde8dad4766e4" },
"mini.comment": { "branch": "main", "commit": "a27b9115e40519ef23991af9564f43ec14a41fe2" },
"mini.indentscope": { "branch": "main", "commit": "cbc07203ca8faae952ca373c1f6cc5881ce97af0" },
"mini.pairs": { "branch": "main", "commit": "6f6bd7ed5757b40bc29c73dac0d743e4e6978124" },
"mini.surround": { "branch": "main", "commit": "68ce058ef9716d7d955b79363845d2dd003d6500" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "63ebe879ad4798b66d29c0b2c8d04942389d438e" },
"neoconf.nvim": { "branch": "main", "commit": "671d8456ecbd8279de2ac4cc4f3cf967683c5770" },
"neodev.nvim": { "branch": "main", "commit": "b094a663ccb71733543d8254b988e6bebdbdaca4" },
"noice.nvim": { "branch": "main", "commit": "8f1b53ab85f83e0687d0f267085ad781ec240432" },
"nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" },
"nvim-cmp": { "branch": "main", "commit": "d3a3056204e1a9dbb7c7fe36c114dc43b681768c" },
"nvim-lint": { "branch": "master", "commit": "e236bd9401709f1cfff7b9951445d965658fa3dc" },
"nvim-lspconfig": { "branch": "master", "commit": "38da5bbe1eaab2394056109e48c7e195bdb8fdfe" },
"nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
"nvim-spectre": { "branch": "master", "commit": "696cff781a4a7ecc91549736835e2acbd00fe859" },
"nvim-treesitter": { "branch": "master", "commit": "f636d58c8d5780e5fe79a8de5691b1712c758b05" },
"nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "23f3840b7520e009121b3175f528178136dd9834" },
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" },
"nvim-web-devicons": { "branch": "master", "commit": "f0267921c845c42685968401bc49aa65e18d3e09" },
"persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "master", "commit": "74ce793a60759e3db0d265174f137fb627430355" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"tokyonight.nvim": { "branch": "main", "commit": "531b04704fc9ff994d8b9c0720428fdc3c7d49d1" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}

View File

@@ -0,0 +1,9 @@
{
"extras": [
],
"news": {
"NEWS.md": "2123"
},
"version": 2
}

View File

@@ -0,0 +1,3 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here

View File

@@ -0,0 +1,3 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here

View File

@@ -0,0 +1,46 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
-- { import = "lazyvim.plugins.extras.lang.typescript" },
-- { import = "lazyvim.plugins.extras.lang.json" },
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@@ -0,0 +1,3 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here

View File

@@ -0,0 +1,265 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- add symbols-outline
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
config = true,
},
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add telescope-fzf-native
{
"telescope.nvim",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
config = function()
require("telescope").load_extension("fzf")
end,
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, "😄")
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
-- Use <tab> for completion and snippets (supertab)
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
{
"L3MON4D3/LuaSnip",
keys = function()
return {}
end,
},
-- then: setup supertab in cmp
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji",
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
local cmp = require("cmp")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- this way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
end,
},
}

View File

@@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120

6
common/.env Executable file
View File

@@ -0,0 +1,6 @@
# Setup Shared cache for Rust
export RUSTC_WRAPPER=sccache
export SCCACHE_CACHE_SIZE="20G"
# Optout of dotnetcore telemetry
export DOTNET_CLI_TELEMETRY_OPTOUT=1

0
.gitconfig → common/.gitconfig Executable file → Normal file
View File

45
common/.ideavimrc Normal file
View File

@@ -0,0 +1,45 @@
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
" the same commands as the original .vimrc configuration.
" You can find a list of commands here: https://jb.gg/h38q75
" Find more examples here: https://jb.gg/share-ideavimrc
" Source your .vimrc
source ~/.vimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Quick scope for motions with f, t, F & T
" https://plugins.jetbrains.com/plugin/19417-ideavim-quickscope
" set quickscope
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
" Highlight copied text
Plug 'machakann/vim-highlightedyank'
" Commentary plugin
Plug 'tpope/vim-commentary'
" Surround Plugin
Plug 'tpope/vim-surround'
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
map \r <Action>(ReformatCode)
"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
" Center the cursor when doing 1/2 page down and page up
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz

0
.p10k.zsh → common/.p10k.zsh Executable file → Normal file
View File

1
.profile → common/.profile Executable file → Normal file
View File

@@ -25,4 +25,3 @@ fi
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
. "$HOME/.cargo/env"

0
.tmux.conf → common/.tmux.conf Executable file → Normal file
View File

File diff suppressed because it is too large Load Diff

97
common/.vimrc Normal file
View File

@@ -0,0 +1,97 @@
" Show line numbers
set number
" This enables relative line numbering mode. With both number and
" relativenumber enabled, the current line shows the true line number, while
" all other lines (above and below) are numbered relative to the current line.
" This is useful because you can tell, at a glance, what count is needed to
" jump up or down to a particular line, by {count}k to go up or {count}j to go
" down.
set relativenumber
" Wrap text
set wrap
" Encoding
set encoding=utf-8
" Status bar
set laststatus=2
" Vim is based on Vi. Setting `nocompatible` switches from the default
" Vi-compatibility mode and enables useful Vim functionality. This
" configuration option turns out not to be necessary for the file named
" '~/.vimrc', because Vim automatically enters nocompatible mode if that file
" is present. But we're including it here just in case this config file is
" loaded some other way (e.g. saved as `foo`, and then Vim started with
" `vim -u foo`).
set nocompatible
" Turn on syntax highlighting.
syntax on
" Highlight matching pairs of [] {} ()
set showmatch
" Disable the default Vim startup message.
set shortmess+=I
" The backspace key has slightly unintuitive behavior by default. For example,
" by default, you can't backspace before the insertion point set with 'i'.
" This configuration makes backspace behave more reasonably, in that you can
" backspace over anything.
set backspace=indent,eol,start
" By default, Vim doesn't let you hide a buffer (i.e. have a buffer that isn't
" shown in any window) that has unsaved changes. This is to prevent you from "
" forgetting about unsaved changes and then quitting e.g. via `:qa!`. We find
" hidden buffers helpful enough to disable this protection. See `:help hidden`
" for more information on this.
set hidden
" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase
" Enable searching as you type, rather than waiting till you press enter.
set incsearch
" Highlight search pattern
set hlsearch
" Unbind some useless/annoying default key bindings.
nmap Q <Nop> " 'Q' in normal mode enters Ex mode. You almost never want this.
" Disable audible bell because it's annoying.
set noerrorbells visualbell t_vb=
" Enable mouse support. You should avoid relying on this too much, but it can
" sometimes be convenient.
set mouse+=a
" Try to prevent bad habits like using the arrow keys for movement. This is
" not the only possible bad habit. For example, holding down the h/j/k/l keys
" for movement, rather than using more efficient movement commands, is also a
" bad habit. The former is enforceable through a .vimrc, while we don't know
" how to prevent the latter.
" Do this in normal mode...
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" ...and in insert mode
inoremap <Left> <ESC>:echoe "Use h"<CR>
inoremap <Right> <ESC>:echoe "Use l"<CR>
inoremap <Up> <ESC>:echoe "Use k"<CR>
inoremap <Down> <ESC>:echoe "Use j"<CR>
" Center the cursor when doing 1/2 page down and page up
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
" Call the .vimrc.plug file
if filereadable(expand("~/.vimrc.plug"))
source ~/.vimrc.plug
endif

24
common/.vimrc.plug Normal file
View File

@@ -0,0 +1,24 @@
call plug#begin('~/.vim/plugged')
"Fugitive Vim Github Wrapper
Plug 'tpope/vim-fugitive'
" Surround Plugin
Plug 'tpope/vim-surround'
" Sensible options
Plug 'tpope/vim-sensible'
" Highlight Yank
Plug 'machakann/vim-highlightedyank'
" Paragraph Motion
Plug 'dbakker/vim-paragraph-motion'
" Quick Scope
" Plug 'unblevable/quick-scope'
" Paragraph Motion
Plug 'dbakker/vim-paragraph-motion'
call plug#end()

16
.zshrc → common/.zshrc Executable file → Normal file
View File

@@ -100,19 +100,21 @@ setopt HIST_IGNORE_SPACE # Don't add commands that start with whitespac
# Setup path and export variables
[[ ! -f ~/.env ]] || source ~/.env
[[ ! -f ~/.set_path ]] || source ~/.set_path
[[ ! -f "$HOME/.cargo/env" ]] || source "$HOME/.cargo/env"
PATH=$(pyenv root)/shims:$PATH
# # Aliases
# Aliases
[[ ! -f ~/.aliases ]] || source ~/.aliases
[[ ! -f ~/.mac_aliases ]] || source ~/.mac_aliases
[[ ! -f ~/.neon_aliases ]] || source ~/.neon_aliases
[[ ! -f ~/.aliases_personal ]] || source ~/.aliases_personal
[[ ! -f ~/.neon_alias ]] || source ~/.neon_alias
# # Dev Setup Configurations
[[ ! -f ~/.gosetup ]] || source ~/.gosetup
[[ ! -f ~/.flutterpathsetup ]] || source ~/.flutterpathsetup
[[ ! -f ~/.skaffoldenv ]] || source ~/.skaffoldenv
# nvm Setup
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[[ ! -f ~/.config/exercism/exercism_completion.bash ]] || source ~/.config/exercism/exercism_completion.bash
eval "$(ssh-agent -s)"
ulimit -n 10240

54
kde-neon/.gitignore vendored Normal file
View File

@@ -0,0 +1,54 @@
# KDE directory preferences
.directory
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# VS Code Artifacts
.vscode
**state.vscdb
**state.vscdb.backup
.vscode/extensions/** # Ignore all Files under .vscode/extensions/
!.vscode/extensions/**/*.json # Only json files inside the .vscode/extensions/ folder
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Ignore all downloaded node modules
node_modules/*
# Ignore all minified js files
*.min.js
# Other Files to ignore
**app_stat_v2.db
.ssh/*.pub
**/Package Control.cache
**Cache
*.db
*.qmlc
*.qml
*.jsc
**/contents/images
**/contents/fonts
*kpluginindex.json
# Intellij IDE Artifacts
.idea/
*.imi
*.jar
*.tar
resharper-host/
tasks/

69
.aliases → kde-neon/.neon_aliases Executable file → Normal file
View File

@@ -1,46 +1,6 @@
#!/usr/bin/env bash
# Generic
alias sb="source ~/.bashrc"
alias bashreload="source ~/.bashrc"
alias sz="source ~/.zshrc"
alias zshreload="source ~/.zshrc"
alias bashrc="${EDITOR:-nano} +116 ~/.bashrc"
alias zshrc="${EDITOR:-nano} ~/.zshrc"
alias free="free -ht"
alias type="type -a"
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home Dir: \" \$6 \", Shell Used: \" \$7}' /etc/passwd | grep"
# alias code="codium"
url_encode(){
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"
}
# History
alias histsearch="history | grep"
alias hs="histsearch"
alias hsi="histsearch"
alias untar='tar -zxvf '
# Directories and Directory listings
alias ~="cd ~"
alias ..="cd .."
alias ...='cd ../../../' # Go back 3 directory levels
alias ..4='cd ../../../../' # Go back 4 directory levels
alias ..5='cd ../../../../../' # Go back 5 directory levels
alias ..6='cd ../../../../../../' # Go back 6 directory levels
alias lsc='ls --color=auto'
alias ll='lsc -alhF'
alias la='lsc -Ah'
alias l='lsc -CF'
alias lsa="lsc -lAFhZ"
alias mkdir="mkdir -pv"
alias df="df -h"
dir_size(){
local dir
if [[ -z "$1" ]]; then
@@ -51,33 +11,19 @@ dir_size(){
du -ah "${dir}" --max-depth=1 | sort -hr
}
mkcd () {
mkdir "$1"
cd "$1" || exit
}
# Network
alias ping="ping -c 10"
alias ping8="ping 8.8.8.8"
alias ping1="ping 1.1.1.1"
alias p8="ping8"
alias p1="ping1"
alias flush-dns="sudo systemd-resolve --flush-caches"
alias dnsreset="sudo systemctl restart dnscrypt-proxy"
alias dnscheck="dnscrypt-proxy -resolve google.com"
alias pubip="curl https://ipinfo.io/ip; echo"
alias ips='printf "Local IP:- "; hostname -I | cut -f1 -d " "; printf "Public IP:- "; curl -s https://ipinfo.io/ip'
alias ipdetails='printf "Local IP:- "; hostname -I | cut -f1 -d " "; printf "Public IP Details:- \n"; geoip'
alias speedtest="speedtest-cli --secure" # needs speedtest-cli installed
geoip () {
curl -s https://ipinfo.io | sed '/readme/d;/loc/d;/postal/d;s/org/ISP/' | tr -d {},\" | awk -F ':' 'NF {printf ("%10s: %.25s \n", $1, $2)}'
}
alias listening_apps="sudo netstat -nutlp | grep ':' | awk '{print \$1,\$4,\$NF}' | awk -F: '{print \$1,\$(NF-1),\$NF}' | awk -v OFS=\"\t\" 'BEGIN {printf (\"%s\t%s\t\t%s \n\", \"PROTO\", \"PORT\", \"APPLICATION\")} {print \$1 , \$(NF-1) ,\" \" , \$NF}' | (read -r; printf \"%s\n\" \"\$REPLY\"; sort -k2 -n)"
# Update & Upgrades
alias up="sudo apt-get update && sudo apt-get upgrade -y && distup && autorem"
alias up="sudo pkcon refresh && sudo pkcon update && sudo apt dist-upgrade && sudo apt autoremove && rustup update && brew upgrade && npm update -g"
alias distup="sudo apt dist-upgrade"
alias autorem="sudo apt autoremove"
alias update="sudo apt-get update"
@@ -85,14 +31,6 @@ alias install="sudo apt-get install "
alias remove="sudo apt-get remove "
# Git
# To use this - Ensure all git server SSH are in ~/.ssh
alias git_signin='(for i in ~/.ssh/{*github*,*bitbucket*,*gitea*,*gitlab*}; do ssh-add -k $i; done; ) && (echo; echo Identities added successfully)'
git_push_all_changes(){
git add . && git commit -am "${1}" && git push
}
# For servers
alias ngt="sudo nginx -t"
alias ngrestart="sudo systemctl restart nginx"
@@ -102,11 +40,6 @@ alias fpmreset71="sudo systemctl restart php7.1-fpm"
alias fpmreset72="sudo systemctl restart php7.2-fpm"
alias fpmreset73="sudo systemctl restart php7.3-fpm"
alias fpmreset74="sudo systemctl restart php7.4-fpm"
alias ta="tmux a"
alias tat="tmux a -t"
alias tls="tmux ls"
alias tnew="tmux new"
alias tnewt="tmux new -t"
f2b_banned_ips() {
local provided_jail=$1

72
macos/.gitignore vendored Normal file
View File

@@ -0,0 +1,72 @@
# ---- macOS ----
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# VS Code Artifacts
.vscode
**state.vscdb
**state.vscdb.backup
.vscode/extensions/** # Ignore all Files under .vscode/extensions/
!.vscode/extensions/**/*.json # Only json files inside the .vscode/extensions/ folder
# Ignore all downloaded node modules
node_modules/*
# Ignore all minified js files
*.min.js
# Other Files to ignore
**app_stat_v2.db
.ssh/*.pub
**/Package Control.cache
**Cache
*.db
*.qmlc
*.qml
*.jsc
**/contents/images
**/contents/fonts
*kpluginindex.json
# Intellij IDE Artifacts
.idea/
*.imi
*.jar
*.tar
# KDE directory preferences
.directory
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*

17
macos/.mac_aliases Normal file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Directories and Directory listings
dir_size(){
local dir
if [[ -z "$1" ]]; then
dir="${PWD}"
else
dir="$1"
fi
du -ah "${dir}" -d 1 | sort -hr
}
# Update & Upgrades
alias up="brew upgrade --cask && brew upgrade --formula && rustup update && npm update -g"