diff --git a/.gitignore b/.gitignore index 9f2ae21..98bdfa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,23 @@ +# ---- KDE Neon ---- +# 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 + # ---- macOS ---- # General .DS_Store @@ -26,57 +46,45 @@ Network Trash Folder Temporary Items .apdisk -# ---- KDE Neon ---- -# 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 - # ---- IDE ---- +# Vim Artifacts +**.swp +lazy-lock.json +.luarc.json + # VS Code Artifacts -.vscode +/.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 # Intellij IDE Artifacts -**.idea/ +.idea/ *.imi *.jar *.tar - -# Vim Artifacts -*.swp - -# NVIM Artifacts -*.luarc.json - resharper-host/ tasks/ # ---- Programming Languages ---- # Ignore all downloaded node modules node_modules/* -**lock.json - +dist +dist-ssr +*.local # Ignore all minified js files *.min.js +# Log files +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + # Other Files to ignore **app_stat_v2.db .ssh/*.pub @@ -89,3 +97,4 @@ node_modules/* **/contents/images **/contents/fonts *kpluginindex.json + diff --git a/LICENSE b/LICENSE index 4ed90b9..527a83a 100755 --- a/LICENSE +++ b/LICENSE @@ -7,17 +7,17 @@ AND DISTRIBUTION 1. Definitions. - + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. @@ -26,31 +26,31 @@ or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, @@ -59,7 +59,7 @@ original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative @@ -74,7 +74,7 @@ for the purpose of discussing and improving the Work, but excluding communicatio that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated diff --git a/README.md b/README.md index ed25b9a..a8d7fd9 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Place to keep my .dotfiles so I do not have to worry about migrating to another ## Usage ```bash -$ bash bootstrap.sh -h +$ bash bootstrap.sh -h Applies all settings stored in the script's directory to your home directory @@ -19,3 +19,6 @@ Example: bash ./bootstrap.sh -q --create-links ## Why `--create-links`? I have multiple Linux installations on my machine. Linking it from one place (this repository) keeps things tidy. Also, changes to dotfiles automatically get applied to all the distros. + + + diff --git a/bootstrap.sh b/bootstrap.sh index 7fcdb00..d4f496e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh usage() { if [ -n "$1" ]; then diff --git a/common/.aliases b/common/.aliases index c647b8d..3c50a12 100644 --- a/common/.aliases +++ b/common/.aliases @@ -5,8 +5,8 @@ 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 bashrc="${EDITOR:-vim} +116 ~/.bashrc" +alias zshrc="${EDITOR:-vim} ~/.zshrc" alias free="free -ht" alias type="type -a" alias grep='grep --color=auto' @@ -14,6 +14,8 @@ 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 ' +alias v=nvim +alias n=nvim url_encode(){ python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1" @@ -30,9 +32,10 @@ alias hsi="histsearch" 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 cd_root='cd $(git rev-parse --show-toplevel 2>/dev/null || echo ".")' +alias cd_git_root=cd_root +alias c=clear +alias cl=clear alias lsc='ls --color=auto' alias ll='lsc -alhF' alias la='lsc -Ah' diff --git a/common/.bashrc b/common/.bashrc index 07872bf..156092b 100644 --- a/common/.bashrc +++ b/common/.bashrc @@ -194,8 +194,8 @@ jazz_my_prompt() { # Aliases [[ ! -f ~/.aliases ]] || source ~/.aliases -[[ ! -f ~/.mac_aliases ]] || source ~/.mac_aliases -[[ ! -f ~/.neon_aliases ]] || source ~/.neon_aliases +[[ ! -f ~/.aliases_mac ]] || source ~/.aliases_mac +[[ ! -f ~/.aliases_neon ]] || source ~/.aliases_neon [[ ! -f ~/.aliases_personal ]] || source ~/.aliases_personal # nvm Setup diff --git a/common/.config/nvim/init.lua b/common/.config/nvim/init.lua index 30d9809..138fa47 100644 --- a/common/.config/nvim/init.lua +++ b/common/.config/nvim/init.lua @@ -1,8 +1,10 @@ --- TODO: Todo-Comments: Highlight TODOs --- TODO: Neo-Tree: reduce size, hidden visible by default, set vcs root at pwd+cwd --- TODO: Telescope: open in a new window -> vertial & horizontal --- TODO: LSPConfig: Standardize keymaps to d[x] --- TODO: Note what exactly Treesitter does??? +-- TODO: Git: Add a plugin +-- TODO: System install and setup lazygit +-- TODO: Setup auto complete +-- TODO: Provide description to each keymap +-- TODO: tpope/vim-obsession configure to work with tmux-resurrection +-- TODO: Check why Nvim can't find todos +-- TODO: Put all plugin configs inside /after/plugin directory -- Loads the system's Vim configs: keeps the VIM & NVim configs in sync local vimrc = vim.fn.stdpath("config") .. "/vim-sync.vim" @@ -23,9 +25,15 @@ if not vim.loop.fs_stat(lazypath) then }) end vim.opt.rtp:prepend(lazypath) + require("lazy").setup("plugins", { change_detection = { enabled = true, notify = false - } + }, }) + +require("configs.autocommands") +require("configs.configs") +require("configs.keymaps") + diff --git a/common/.config/nvim/lua/configs/autocommands.lua b/common/.config/nvim/lua/configs/autocommands.lua new file mode 100644 index 0000000..2a11c56 --- /dev/null +++ b/common/.config/nvim/lua/configs/autocommands.lua @@ -0,0 +1,10 @@ +-- [[ Highlight on yank ]] +local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) +vim.api.nvim_create_autocmd('TextYankPost', { + callback = function() + vim.highlight.on_yank() + end, + group = highlight_group, + pattern = '*', +}) + diff --git a/common/.config/nvim/lua/configs/configs.lua b/common/.config/nvim/lua/configs/configs.lua new file mode 100644 index 0000000..df23421 --- /dev/null +++ b/common/.config/nvim/lua/configs/configs.lua @@ -0,0 +1,2 @@ +-- Nvim Specific Configs that don't apply to VIM + diff --git a/common/.config/nvim/lua/configs/keymaps.lua b/common/.config/nvim/lua/configs/keymaps.lua new file mode 100644 index 0000000..01546c2 --- /dev/null +++ b/common/.config/nvim/lua/configs/keymaps.lua @@ -0,0 +1,9 @@ +-- -> to save all files +vim.keymap.set({ "n", "i", "v" }, "", "wa", {}) +-- -> Save all files and quit Nvim +vim.keymap.set({ "n", "i", "v" }, "", "wqa", {}) + +-- Remap for dealing with word wrap +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + diff --git a/common/.config/nvim/lua/plugins.lua b/common/.config/nvim/lua/plugins.lua index d85acf5..94c0ca1 100644 --- a/common/.config/nvim/lua/plugins.lua +++ b/common/.config/nvim/lua/plugins.lua @@ -1,15 +1,14 @@ -- Keeps the plugin list that Lazy uses at one place return { -- From VIM + { "tpope/vim-sensible" }, { "tpope/vim-fugitive" }, { "tpope/vim-surround" }, { "tpope/vim-repeat" }, { "tpope/vim-commentary" }, - { "tpope/vim-sensible" }, { "rstacruz/vim-closer" }, - { "machakann/vim-highlightedyank" }, { "airblade/vim-gitgutter" }, { "easymotion/vim-easymotion" }, - { "preservim/nerdtree" }, - -- { 'itchyny/lightline.vim' }, + { "tpope/vim-obsession" }, + { "mg979/vim-visual-multi" }, } diff --git a/common/.config/nvim/lua/plugins/bufferline.lua b/common/.config/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..58d164d --- /dev/null +++ b/common/.config/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,17 @@ +return { +-- TODO: Throws git pull issue when downloading through Lazy +-- "askinsho/bufferline.nvim", +-- dependencies = "nvim-tree/nvim-web-devicons", +-- config = function() +-- require("bufferline").setup({ +-- options = { +-- indicator = { style = "underline" }, +-- } +-- }) + +-- vim.keymap.set('n', '', ":BufferLineCycleNext") +-- vim.keymap.set('n', '', ":BufferLineCyclePrev") +-- vim.keymap.set('n', 'bo', ":BufferLineCloseOthers") +-- vim.keymap.set('n', 'bp', ":BufferLinePick") +-- end +} diff --git a/common/.config/nvim/lua/plugins/coding-highlighting.lua b/common/.config/nvim/lua/plugins/coding-highlighting.lua new file mode 100644 index 0000000..df88ea6 --- /dev/null +++ b/common/.config/nvim/lua/plugins/coding-highlighting.lua @@ -0,0 +1,40 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local tree_config = require("nvim-treesitter.configs") + tree_config.setup({ + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = "", + node_decremental = "", + } + } + }) + end + }, + { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + config = function() + require("ibl").setup({}) + end + }, + -- { "windwp/nvim-autopairs" }, + -- { + -- "akinsho/toggleterm.nvim", + -- version = "*", + -- config = function () + -- require("toggleterm").setup({}) + -- end + -- }, +} + + diff --git a/common/.config/nvim/lua/plugins/coding-lsp.lua b/common/.config/nvim/lua/plugins/coding-lsp.lua new file mode 100644 index 0000000..c8a0b1f --- /dev/null +++ b/common/.config/nvim/lua/plugins/coding-lsp.lua @@ -0,0 +1,116 @@ +return { + -- TODO: Configure following plugins in separate files + + -- LSP Configuration + { + -- Provides :Mason command which installs Language Servers + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end + }, + { + -- Helps to auto install Language Servers by specifying them + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", "bashls", "cssls", "dockerls", "emmet_ls", "jsonls", "tsserver", "marksman", + "pyre", "rust_analyzer", "sqlls", "taplo" + } + }) + end + }, + { + "neovim/nvim-lspconfig", + config = function() + -- Hook up NVIM with the above installed Language Servers + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({}) + lspconfig.bashls.setup({}) + lspconfig.cssls.setup({}) + lspconfig.dockerls.setup({}) + lspconfig.emmet_ls.setup({}) + lspconfig.jsonls.setup({}) + lspconfig.tsserver.setup({}) + lspconfig.marksman.setup({}) + lspconfig.pyre.setup({}) + lspconfig.rust_analyzer.setup({}) + lspconfig.sqlls.setup({}) + lspconfig.taplo.setup({}) + + -- LSP Keybindings + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) + vim.keymap.set('n', ']d', vim.diagnostic.goto_next) + vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, {}) + vim.keymap.set('n', 'q', vim.diagnostic.setloclist) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, {}) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {}) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {}) + -- vim.keymap.set('n', '', vim.lsp.buf.signature_help, {}) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, {}) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, {}) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, {}) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, {}) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, {}) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, {}) + vim.keymap.set('n', 'f', function() + vim.lsp.buf.format { async = true } + end, {}) + end + }, + + -- None-ls + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + -- TODO: Segement these by language & Install required ones through :Mason + -- null_ls.builtins.formatting.stylua, + -- null_ls.builtins.formatting.beautysh, + -- null_ls.builtins.formatting.csharpier, + -- null_ls.builtins.formatting.jq, + -- null_ls.builtins.formatting.markdownlint_toc, + -- null_ls.builtins.formatting.nginx_beautifier, + -- null_ls.builtins.formatting.pg_format, + -- null_ls.builtins.formatting.prettierd, + -- null_ls.builtins.formatting.protolint, + -- null_ls.builtins.formatting.rustfmt, + -- null_ls.builtins.formatting.shellharden, + -- null_ls.builtins.formatting.shfmt, + + -- null_ls.builtins.diagnostics.alex, + -- null_ls.builtins.diagnostics.codespell, + -- null_ls.builtins.diagnostics.eslint_d, + -- null_ls.builtins.diagnostics.jsonlint, + -- null_ls.builtins.diagnostics.luacheck, + -- null_ls.builtins.diagnostics.protolint, + -- null_ls.builtins.diagnostics.shellcheck, + -- null_ls.builtins.diagnostics.stylelint, + -- null_ls.builtins.diagnostics.tidy, + -- null_ls.builtins.diagnostics.tsc, + -- null_ls.builtins.diagnostics.vlint, + -- null_ls.builtins.diagnostics.yamllint, + + -- null_ls.builtins.code_actions.gitsigns, + -- null_ls.builtins.code_actions.eslint_d, + -- null_ls.builtins.code_actions.refactoring, + -- null_ls.builtins.code_actions.shellcheck, + + -- null_ls.builtins.completion.spell, + -- null_ls.builtins.completion.tags, + -- null_ls.builtins.completion.luasnip, + } + }) + + vim.keymap.set("n", "gf", vim.lsp.buf.format, {}) + end + }, + +} diff --git a/common/.config/nvim/lua/plugins/codinghelp.lua b/common/.config/nvim/lua/plugins/codinghelp.lua deleted file mode 100644 index e77ad0c..0000000 --- a/common/.config/nvim/lua/plugins/codinghelp.lua +++ /dev/null @@ -1,73 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local tree_config = require("nvim-treesitter.configs") - tree_config.setup({ - ensure_installed = { "lua", "vim", "vimdoc", "bash", "c_sharp", "css", "dockerfile", "git_config", "gitignore", "html", "http", "ini", "json", "proto", "python", "rust", "sql", "toml", "tsx", "typescript" , "javascript" }, - highlight = { enable = true }, - indent = { enable = true }, - }) - end - }, - - -- LSP Configuration - { - -- Provides :Mason command which installs Language Servers - "williamboman/mason.nvim", - config = function() - require("mason").setup() - end - }, - { - -- Helps to auto install Language Servers by specifying them - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "bashls", "cssls", "dockerls", "emmet_ls", "jsonls", "tsserver", "marksman", "pyre", "rust_analyzer", "sqlls", "taplo" } - }) - end - }, - { - "neovim/nvim-lspconfig", - config = function() - -- Hook up NVIM with the above installed Language Servers - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({}) - lspconfig.bashls.setup({}) - lspconfig.cssls.setup({}) - lspconfig.dockerls.setup({}) - lspconfig.emmet_ls.setup({}) - lspconfig.jsonls.setup({}) - lspconfig.tsserver.setup({}) - lspconfig.marksman.setup({}) - lspconfig.pyre.setup({}) - lspconfig.rust_analyzer.setup({}) - lspconfig.sqlls.setup({}) - lspconfig.taplo.setup({}) - - -- LSP Keybindings - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) - vim.keymap.set('n', ']d', vim.diagnostic.goto_next) - vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, {}) - vim.keymap.set('n', 'q', vim.diagnostic.setloclist) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, {}) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {}) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {}) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, {}) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, {}) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, {}) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, {}) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, {}) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, {}) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, {}) - vim.keymap.set('n', 'f', function() - vim.lsp.buf.format { async = true } - end, {}) - end - } -} diff --git a/common/.config/nvim/lua/plugins/colorthemes.lua b/common/.config/nvim/lua/plugins/colorthemes.lua index f5b440c..01313ae 100644 --- a/common/.config/nvim/lua/plugins/colorthemes.lua +++ b/common/.config/nvim/lua/plugins/colorthemes.lua @@ -12,19 +12,16 @@ return { "catppuccin/nvim", name = "catppuccin", priority = 1000, - -- config = function() - -- show_end_of_buffer = true, - -- integrations = { - -- cmp = true, - -- gitsigns = true, - -- nvimtree = true, - -- }, - -- vim.cmd.colorscheme "catppuccin-macchiato", - -- end - }, - { - "rose-pine/neovim", - name = "rose-pine", - priority = 1000, + config = function() + require("catppuccin").setup({ + show_end_of_buffer = true, + integrations = { + cmp = true, + gitsigns = true, + nvimtree = true, + }, + }) + -- vim.cmd.colorscheme "catppuccin-mocha" + end }, } diff --git a/common/.config/nvim/lua/plugins/lualine.lua b/common/.config/nvim/lua/plugins/lualine.lua index a4cf538..db590ed 100644 --- a/common/.config/nvim/lua/plugins/lualine.lua +++ b/common/.config/nvim/lua/plugins/lualine.lua @@ -1,9 +1,20 @@ return { "nvim-lualine/lualine.nvim", config = function() + local lazy_status = require("lazy.status") + require("lualine").setup({ options = { - theme = "powerline_dark" + -- theme = "horizon", + -- TODO: Following ain't taking effect. Why? + sections = { + lualine_a = {'mode','filename'}, + lualine_b = {'branch'}, + lualine_c = {'diff', 'diagnostics'}, + lualine_x = { { lazy_status.updates, cond = lazy_status.has_updates } }, + lualine_y = {'progress'}, + lualine_z = {'location', 'searchcount'} + }, } }) end diff --git a/common/.config/nvim/lua/plugins/neo-tree.lua b/common/.config/nvim/lua/plugins/neo-tree.lua index 9af12fe..5b5f4b8 100644 --- a/common/.config/nvim/lua/plugins/neo-tree.lua +++ b/common/.config/nvim/lua/plugins/neo-tree.lua @@ -1,13 +1,50 @@ return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", + { + "airblade/vim-rooter", + config = function() + vim.g.rooter_cd_cmd = "tcd" + end }, - config = function() - -- Keymaps for Neotree - vim.keymap.set("n", "n", ":lcd %:h :Neotree filesystem reveal left") - end + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + require("neo-tree").setup({ + filesystem = { + follow_current_file = { + enabled = true, -- Highlight the current buffer + leave_dirs_open = true, + }, + use_libuv_file_watcher = true, -- Sync file system changes + filtered_items = { + visible = true, + show_hidden_count = true, + hide_dotfile = false, + hide_gitignore = false + }, + }, + window = { + position = "left", + width = 25, -- Saner window size + mappings = { + ["s"] = "open_split", -- Default vim keymap for horizontal split + ["v"] = "open_vsplit" -- Default vim keymap for vertical split + } + }, + default_component_configs = { + indent = { + indent_size = 1, -- Compact tree display + padding = 0 -- Compact tree display + } + } + }) + -- Keymaps for Neotree + vim.keymap.set("n", "e", ":Neotree filesystem toggle") + end + } } diff --git a/common/.config/nvim/lua/plugins/telescope.lua b/common/.config/nvim/lua/plugins/telescope.lua index 632a4fd..290b71f 100644 --- a/common/.config/nvim/lua/plugins/telescope.lua +++ b/common/.config/nvim/lua/plugins/telescope.lua @@ -1,16 +1,51 @@ return { { - 'nvim-telescope/telescope.nvim', tag = '0.1.5', - dependencies = { 'nvim-lua/plenary.nvim' }, + "nvim-telescope/telescope.nvim", tag = "0.1.5", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "neovim/nvim-lspconfig", + "nvim-tree/nvim-web-devicons" + }, config = function() + local actions = require("telescope.actions") + + require("telescope").setup({ + pickers = { + find_files = { + mappings = { + i = { + -- Ctrl + s to open in horizontal split + [""] = actions.select_horizontal + } + } + } + } + }) + require("telescope").load_extension("fzf") + -- Keymaps for Telescope local builtin = require("telescope.builtin") - vim.keymap.set("n", "ff", builtin.find_files, {}) - vim.keymap.set("n", "fg", builtin.live_grep, {}) - vim.keymap.set("n", "fb", builtin.buffers, {}) + vim.keymap.set("n", "ff", "lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!{**/.git/*,**/node_modules/*,**/package-lock.json,**/yarn.lock}' }})", {}) + -- TODO: Live grep ain't working + -- vim.keymap.set("n", "fl", builtin.live_grep, {}) + vim.keymap.set("n", "fm", builtin.marks, {}) + vim.keymap.set("n", "fc", builtin.colorscheme, {}) + vim.keymap.set("n", "fr", builtin.registers, {}) + vim.keymap.set("n", "fs", builtin.lsp_document_symbols, {}) + vim.keymap.set("n", "fw", builtin.grep_string, {}) + vim.keymap.set("n", "fg", "AdvancedGitSearch", {}) + vim.keymap.set("n", "ft", builtin.treesitter, {}) + -- TODO: Find TODO ain't working either + vim.keymap.set("n", "fd", ":TodoTelescope", {}) end }, { + "nvim-telescope/telescope-fzf-native.nvim", + build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' + }, + { + -- For displaying LSP Code Actions "nvim-telescope/telescope-ui-select.nvim", config = function() require("telescope").setup({ @@ -23,5 +58,11 @@ return { }) require("telescope").load_extension("ui-select") end + }, + { + "aaronhallaert/advanced-git-search.nvim", + config = function() + require("telescope").load_extension("advanced_git_search") + end } } diff --git a/common/.config/nvim/lua/plugins/todo-comments.lua b/common/.config/nvim/lua/plugins/todo-comments.lua index c4e8a08..e6ed28f 100644 --- a/common/.config/nvim/lua/plugins/todo-comments.lua +++ b/common/.config/nvim/lua/plugins/todo-comments.lua @@ -2,19 +2,15 @@ return { "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" }, config = function() + require("todo-comments").setup({}) + vim.keymap.set("n", "]t", function() - require("todo-comments").jump_next( - { keywords = { "ERROR", "WARNING", "TODO" }} - ) - end, - { desc = "Next todo comment"} + require("todo-comments").jump_next() + end, { desc = "Next todo comment" } ) vim.keymap.set("n", "[t", function() - require("todo-comments").jump_prev( - { keywords = { "ERROR", "WARNING", "TODO" }} - ) - end, - { desc = "Previous todo comment"} + require("todo-comments").jump_prev() + end, { desc = "Previous todo comment" } ) end } diff --git a/common/.config/nvim/lua/plugins/undotree.lua b/common/.config/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..be6243b --- /dev/null +++ b/common/.config/nvim/lua/plugins/undotree.lua @@ -0,0 +1,6 @@ +return{ + "mbbill/undotree", + config = function() + vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + end +} diff --git a/common/.config/nvim/lua/plugins/vim-tmux-navigator.lua b/common/.config/nvim/lua/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..9caca98 --- /dev/null +++ b/common/.config/nvim/lua/plugins/vim-tmux-navigator.lua @@ -0,0 +1,7 @@ +return { + "christoomey/vim-tmux-navigator", + lazy = false, + config = function() + + end +} diff --git a/common/.config/tmux/tmux.conf b/common/.config/tmux/tmux.conf new file mode 100644 index 0000000..bd50809 --- /dev/null +++ b/common/.config/tmux/tmux.conf @@ -0,0 +1,123 @@ +# Keybinding Summary +#======================================================== +# Rename Session -> $ +# Rename Tab -> , +# Next/prev tab -> n/p +# H-split/V-split -> s/v +# Resize Pane -> leave alt -> h,j,k,l (repeat press) +# Switch Pane -> +# Enter copy mode -> [ +# Exit copy mode -> +# Reload tmux.conf -> r + +# More at: https://tmuxcheatsheet.com + +# TODO: Figure out how to save multiple sessions and resurrect them later + +#======================================================== +# KEY BINDINGS +#======================================================== +# Change Tmux leader key to -> +unbind C-b +set -g prefix M-a +bind-key M-a send-prefix + +# Kill current session with q +bind q confirm-before kill-session + +# Intuitive split bindings to | & - +unbind % +bind s split-window -h +unbind '"' +bind v split-window -v + +# Open panes in the current directory +bind - split-window -v -c "#{pane_current_path}" +bind | split-window -h -c "#{pane_current_path}" + +# Use repeated(h,j,k,l)s to resize current pane +bind -r h resize-pane -L +bind -r l resize-pane -R +bind -r k resize-pane -U +bind -r j resize-pane -D + +# Use Vim Navigations to copy text from the NON-vim panes +# Enable Tmux copy mode with [ -> Then use Vim navigations +bind-key -T copy-mode-vi "v" send -X begin-selection +bind-key -T copy-mode-vi "y" send -X copy-selection +unbind -T copy-mode-vi MouseDragEnd1Pane # Enable mouse selection as well + +# From Tmux-sensible Plugin +bind C-p previous-window +bind C-n next-window +bind C-a send-prefix +bind a last-window +bind r source-file ~/.config/tmux/tmux.conf \; display-message "Tmux config reloaded." + +# Change resurrect keys to (Save) & (Resurrect) +set -g @resurrect-save "M-s" +set -g @resurrect-restore "M-r" + +#======================================================== +# OPTIONS +#======================================================== +set -g set-clipboard on # Use system clipboard +setw -g mode-keys vi +set-window-option -g mode-keys vi + +# From tmux-sensible plugin +set -g display-time 1000 # Display message for 1s +set -g history-limit 50000 # Increase scrollback buffer +set -g mouse on # Mouse mode +set -s escape-time 0 # Address Vim switching delay +set -g status-interval 5 # Refresh status every 5s (default 15s) +set -g focus-events on # Enable focus event +setw -g aggressive-resize on # For grouped sessions + +# Resurrection Options +set -g @resurrect-capture-pane-contents "on" +set -g @resurrect-strategy-nvim "session" +set -g @resurrect-dir "$HOME/.config/tmux/resurrect" + +#======================================================== +# APPEARANCE +#======================================================== +# Start window numbers at 1 to match keyboard order with tmux window order +set -g base-index 1 +set -g pane-base-index 1 +set -g renumber-windows on +set-window-option -g pane-base-index 1 + +# Improve colors +set -g default-terminal "xterm-256color" +set-option -sa terminal-overrides ",xterm*:Tc" + +# Status at top +set -g status-position top + +#======================================================== +# PLUGINS +#======================================================== +run "~/.config/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager + +# TODO: Get into Tmux copy stuff when required +# set -g @plugin 'tmux-plugins/tmux-yank' +# set -g @plugin "tmux-plugins/tmux-copycat" + +set -g @plugin "christoomey/vim-tmux-navigator" # sync pane nav with Vim window nav +set -g @plugin "tmux-plugins/tmux-resurrect" # Persist sessions +set -g @plugin "tmux-plugins/tmux-continuum" # Auto save sessions every 15mins +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin "tmux-plugins/tmux-copycat" +set -g @plugin "fabioluciano/tmux-tokyo-night" + +#======================================================== +# PLUGINS Configurations +#======================================================== + +# Color schemes +set -g @theme_variation "night" +set -g @theme_disable_plugins 1 +set -g status-right "" + +set -g @plugin "tmux-plugins/tpm" diff --git a/common/.config/wezterm/wezterm.lua b/common/.config/wezterm/wezterm.lua new file mode 100644 index 0000000..2058275 --- /dev/null +++ b/common/.config/wezterm/wezterm.lua @@ -0,0 +1,61 @@ +local wezterm = require("wezterm") + +return { + color_scheme = "Catppuccin Mocha", + font_size = 14.0, + font = wezterm.font_with_fallback({ + -- "JetBrains Mono", + "JetBrainsMono Nerd Font", + { family = "Symbols Nerd Font Mono", scale = 0.75 } + }), + window_decorations = "RESIZE", + enable_tab_bar = true, + use_fancy_tab_bar = true, + hide_tab_bar_if_only_one_tab = true, + -- window_background_opacity = 0.99, + win32_system_backdrop = "Mica", + macos_window_background_blur = 80, + + window_padding = { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + + keys = { + { + key = "f", + mods = "ALT", + action = wezterm.action.ToggleFullScreen, + }, + }, + + mouse_bindings = { + { + event = { Up = { streak = 1, button = "Left" } }, + mods = "CTRL", + action = wezterm.action.OpenLinkAtMouseCursor, + } + }, + + force_reverse_video_cursor = true, + colors = { + foreground = "#dcd7ba", + background = "#1f1f28", + + cursor_bg = "#c8c093", + cursor_fg = "#c8c093", + cursor_border = "#c8c093", + + selection_fg = "#c8c093", + selection_bg = "#2d4f67", + + scrollbar_thumb = "#16161d", + split = "#16161d", + + ansi = { "#090618", "#c34043", "#76946a", "#c0a36e", "#7e9cd8", "#957fb8", "#6a9589", "#c8c093" }, + brights = { "#727169", "#e82424", "#98bb6c", "#e6c384", "#7fb4ca", "#938aa9", "#7aa89f", "#dcd7ba" }, + indexed = { [16] = "#ffa066", [17] = "#ff5d62" }, + }, +} diff --git a/common/.gitignore b/common/.gitignore index 04cf3b4..98bdfa3 100644 --- a/common/.gitignore +++ b/common/.gitignore @@ -1,3 +1,23 @@ +# ---- KDE Neon ---- +# 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 + # ---- macOS ---- # General .DS_Store @@ -26,32 +46,14 @@ Network Trash Folder Temporary Items .apdisk -# ---- KDE Neon ---- -# 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 - # ---- IDE ---- # Vim Artifacts -*.swp +**.swp +lazy-lock.json +.luarc.json # VS Code Artifacts -.vscode +/.vscode/ **state.vscdb **state.vscdb.backup .vscode/extensions/** # Ignore all Files under .vscode/extensions/ @@ -62,10 +64,6 @@ Temporary Items *.imi *.jar *.tar - -# Vim Artifacts -*.swp - resharper-host/ tasks/ diff --git a/common/.tmux.conf b/common/.tmux.conf deleted file mode 100644 index fc64739..0000000 --- a/common/.tmux.conf +++ /dev/null @@ -1,57 +0,0 @@ -######################## Key Bindings ######################## -# Change prefix to -> (Ctrl + a) -set-option -g prefix C-a -unbind-key C-a -bind-key C-a send-prefix - -# Use Shift-arrow keys to switch panes -bind -n S-Left select-pane -L -bind -n S-Right select-pane -R -bind -n S-Up select-pane -U -bind -n S-Down select-pane -D - -# Alt arrow to switch windows -bind -n M-Left previous-window -bind -n M-Right next-window - -# Set easier window split keys -bind-key v split-window -h -bind-key h split-window -v - -# Easy config reload -bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded." -######################## Key Bindings ######################## - - - -######################## Windows ######################## -# Start window numbers at 1 to match keyboard order with tmux window order -set -g base-index 1 -set-window-option -g pane-base-index 1 - -# Renumber windows sequentially after closing any of them -set -g renumber-windows on -######################## Windows ######################## - - - -######################## Colors ######################## -# improve colors -set -g default-terminal 'screen-256color' - -# Soften status bar color from harsh green to light gray -set -g status-style bg='#666666',fg='#aaaaaa' - -######################## Colors ######################## - - - -######################## Other Features ######################## -# Increase scrollback lines -set -g history-limit 10000 - -# Mouse mode -setw -g mouse on - -# Restore tmux-sessions -> https://github.com/tmux-plugins/tmux-resurrect -run-shell ~/downloads/softwares/tmux-resurrect/resurrect.tmux ######################## Other Features ######################## diff --git a/common/.vim/configs.vim b/common/.vim/configs.vim index 848514d..c82c01d 100644 --- a/common/.vim/configs.vim +++ b/common/.vim/configs.vim @@ -2,39 +2,62 @@ filetype plugin indent on set omnifunc=syntaxcomplete#Complete set complete+=kspell +set complete-=i +set completeopt="menuone,noselect" " Make sure tabs are 4 character wide -set shiftwidth=4 tabstop=4 softtabstop=4 expandtab -set autoindent smartindent +set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab +set autoindent smartindent breakindent syntax on " syntax highlighting. +syntax enable set cursorline " Hightlight cursor line set showmatch " Highlight matching braces set ls=2 " Show a status line set wrap " Wrap text set wildmenu " Makes the ex command mode autocomplete paths with Tab set number " Show line numbers +set ruler set relativenumber " Relative line numbers set shortmess+=I " Disable the default Vim startup message. set noerrorbells visualbell t_vb= " Disable audible bell because it's annoying. set mouse+=a " Enable mouse support set encoding=utf-8 " Encoding +set autoread +set nrformats-=octal +set formatoptions+=j +set display+=lastline +set display+=truncate +set history=1000 +set tabpagemax=50 +set viminfo^=! +set sessionoptions-=options +set viewoptions-=options +set nolangremap +set list +set signcolumn=yes +set scrolloff=5 +set isfname+={,},@-@ +set updatetime=50 + +" Enable undofile and save them in ~/.vim/undo +set undofile " Enable undofiles +set undodir=$HOME/.vim/undo// " Save in each project's root +set directory^=$HOME/.vim/swap// " All swap files at the one place please " Vim, by default, won't let you jump to a different file without saving the " current one. With the below, unsaved files are just hidden. set hidden -" Enable searching as you type, rather than waiting till you press enter. -" Highlight search pattern -" Intelligently handle cases in search +" Enable searching as you type, rather than waiting till you press enter. Highlight search pattern. Intelligently handle cases in search. set incsearch hlsearch ignorecase smartcase " Comments in Grey color and italic hi Comment guifg=#5C6370 ctermfg=50 cterm=italic " Highlight and remove trailing blank spaces on save -highlight ExtraWhitespace ctermbg=red guibg=red match ExtraWhitespace /\s\+$/ +highlight ExtraWhitespace ctermbg=red guibg=red autocmd BufWritePre * %s/\s\+$//e " Vim is based on Vi. Setting `nocompatible` switches from the default @@ -49,8 +72,7 @@ set nocompatible " Normally, backspace works only if you have made an edit. This fixes that. set backspace=indent,eol,start -" Sync vim clipboard with system clipboard -" Works across Linux, MacOS & Windows +" Sync vim clipboard with system clipboard. Works across Linux, MacOS & Windows. if has("mac") set clipboard+=unnamed else @@ -62,5 +84,6 @@ if !has('gui_running') set t_Co=256 set termguicolors hi LineNr ctermbg=NONE guibg=NONE + set termguicolors endif diff --git a/common/.vim/key_maps.vim b/common/.vim/key_maps.vim index 9893727..bb98715 100644 --- a/common/.vim/key_maps.vim +++ b/common/.vim/key_maps.vim @@ -13,6 +13,14 @@ inoremap :echoe "Use j" " Unbind some useless/annoying default key bindings. nmap Q +" Don't do anything on pressing space itself +nnoremap +vnoremap + +" Make space-bar the leader-key +let mapleader = " " +let maplocalleader = " " + " Center the cursor when moving through document nnoremap zz nnoremap zz @@ -24,6 +32,14 @@ nnoremap ]s ]szz nnoremap n nzzzv nnoremap N Nzzzv +" Move visually selected lines around with J & K +vnoremap J :m '>+1gv=gv +vnoremap K :m '<-2gv=gv + +" Keeps the cursor at the same place when doing J +" And not move to end of the line +nnoremap J mzJ`z:delmarks z + " Better window/split navigation map j map k @@ -31,10 +47,7 @@ map h map l " Clear searches -nnoremap / :call clearmatches():noh - -" Make space-bar the leader-key -let mapleader = " " +nnoremap / :call clearmatches():noh " Changes the pwd to the opened file's directory nnoremap cd :lcd %:h @@ -44,7 +57,10 @@ map j (easymotion-s) " Map nerdtree to e " Changes the pwd and opens the VCS root -nnoremap e :lcd %:h :NERDTreeToggleVCS +nnoremap e :tcd %:h :NERDTreeToggleVCS let g:NERDTreeShowHidden = 1 -let g:NERDTreeWinSize = 20 +let g:NERDTreeWinSize = 25 + +" to save everything and quit Neovim +nnoremap :wqa diff --git a/common/.vim/plugins.vim b/common/.vim/plugins.vim index d31fb74..6cc14ff 100644 --- a/common/.vim/plugins.vim +++ b/common/.vim/plugins.vim @@ -1,10 +1,3 @@ -"""""""""""""""""""""""""""""""" -" -" Plugins -" -""""""""""""""""""""""""""""""""" -" This being the 1st line in the config file, -" makes it possible to configure plugins any place in the file. call plug#begin('~/.vim/plugged') Plug 'tpope/vim-fugitive' "Fugitive Vim GitHub Wrapper Plug 'tpope/vim-surround' "Surround Plugin @@ -18,6 +11,8 @@ call plug#begin('~/.vim/plugged') Plug 'junegunn/rainbow_parentheses.vim' "Rainbow parenthesis Plug 'easymotion/vim-easymotion' "Easy Motion to quickly jump across the buffer Plug 'preservim/nerdtree' "Nerd Tree + Plug 'tpope/vim-obsession' "Obsessions -> saves sessions + Plug 'christoomey/vim-tmux-navigator' "Syncs with Tmux pane navigation keymaps "------------Style Plugins------------" " Status Styles Plug 'itchyny/lightline.vim' diff --git a/common/.vim/spell/en.utf-8.add b/common/.vim/spell/en.utf-8.add deleted file mode 100644 index 7c012d9..0000000 --- a/common/.vim/spell/en.utf-8.add +++ /dev/null @@ -1,9 +0,0 @@ -Bhubaneswar -Kolkata -Holi -Rakhi -Subrat -Ghosh -Tussar -Patra -Ctrl \ No newline at end of file diff --git a/common/.vim/spell/en.utf-8.add.spl b/common/.vim/spell/en.utf-8.add.spl deleted file mode 100644 index 42e77d3..0000000 Binary files a/common/.vim/spell/en.utf-8.add.spl and /dev/null differ diff --git a/common/.vim/vimrc b/common/.vim/vimrc index c81c056..9923f06 100644 --- a/common/.vim/vimrc +++ b/common/.vim/vimrc @@ -15,22 +15,15 @@ let g:session_dir="$VIMDIR/session" """""""""""""""""""""""""""""""" " -" LOOKS +" THEME " """""""""""""""""""""""""""""""" let g:lightline = { 'colorscheme': 'deepspace' } colorscheme deep-space -" Set color -if !has('gui_running') - set t_Co=256 - set termguicolors - hi LineNr ctermbg=NONE guibg=NONE -endif - """""""""""""""""""""""""""""""" " -" Quality of life improvements +" VIM SPECIFIC CONFIG " """""""""""""""""""""""""""""""" diff --git a/common/.zshrc b/common/.zshrc index 3c2299a..7e27a40 100644 --- a/common/.zshrc +++ b/common/.zshrc @@ -113,8 +113,8 @@ PATH=$(pyenv root)/shims:$PATH # Aliases [[ ! -f ~/.aliases ]] || source ~/.aliases -[[ ! -f ~/.mac_aliases ]] || source ~/.mac_aliases -[[ ! -f ~/.neon_aliases ]] || source ~/.neon_aliases +[[ ! -f ~/.aliases_mac ]] || source ~/.aliases_mac +[[ ! -f ~/.aliases_neon ]] || source ~/.aliases_neon [[ ! -f ~/.aliases_personal ]] || source ~/.aliases_personal # nvm Setup diff --git a/kde-neon/.neon_aliases b/kde-neon/.aliases_neon similarity index 100% rename from kde-neon/.neon_aliases rename to kde-neon/.aliases_neon diff --git a/macos/.mac_aliases b/macos/.aliases_mac similarity index 99% rename from macos/.mac_aliases rename to macos/.aliases_mac index f2c6dbd..e8bfb91 100644 --- a/macos/.mac_aliases +++ b/macos/.aliases_mac @@ -15,3 +15,4 @@ dir_size(){ # Update & Upgrades alias up="brew upgrade --cask && brew upgrade --formula && rustup update && npm update -g" +