From 76bd4806edf2d213ea8cf9fa4eef204ba98583a5 Mon Sep 17 00:00:00 2001 From: Pratik Tripathy Date: Fri, 17 Nov 2023 16:01:23 +0530 Subject: [PATCH] - .gitignore updated to add more JS specific things and log files - Ideavim config: organized, added more VIM options, more keymaps - .profile updated to map the caps-lock key to escape on system login - .zshrc updated to enable VIM mode on zsh shell - Removed LazyVim config - would reconfigure it from scratch --- common/.config/Code/User/settings.json | 97 ++----- common/.config/nvim/.neoconf.json | 15 - common/.config/nvim/custom.nvim/init.lua | 2 - .../.config/nvim/custom.nvim/lazy-lock.json | 40 --- .../nvim/custom.nvim/lua/pratik/core/init.lua | 2 - .../custom.nvim/lua/pratik/core/keymaps.lua | 48 ---- .../custom.nvim/lua/pratik/core/options.lua | 51 ---- .../nvim/custom.nvim/lua/pratik/lazy.lua | 15 - .../lua/pratik/plugins/dressing.lua | 4 - .../lua/pratik/plugins/ide/auto-pairs.lua | 24 -- .../lua/pratik/plugins/ide/gitsigns.lua | 5 - .../lua/pratik/plugins/ide/lspconfig.lua | 134 --------- .../lua/pratik/plugins/ide/mason.lua | 53 ---- .../lua/pratik/plugins/ide/nvim-cmp.lua | 67 ----- .../lua/pratik/plugins/ide/rust-tools.lua | 3 - .../pratik/plugins/ide/symbols-outline.lua | 8 - .../custom.nvim/lua/pratik/plugins/init.lua | 11 - .../lua/pratik/plugins/looks/colorizer.lua | 5 - .../lua/pratik/plugins/looks/lualine.lua | 71 ----- .../plugins/looks/nightfly-colorscheme.lua | 8 - .../lua/pratik/plugins/looks/web-devicons.lua | 3 - .../lua/pratik/plugins/maximizer.lua | 3 - .../lua/pratik/plugins/nvim-tree.lua | 53 ---- .../lua/pratik/plugins/telescope.lua | 31 -- .../plugins/treesitter-text-objects.lua | 110 -------- .../lua/pratik/plugins/treesitter.lua | 64 ----- .../lua/pratik/plugins/which-key.lua | 36 --- common/.config/nvim/init.lua | 2 - common/.config/nvim/lazyvim.json | 9 - common/.config/nvim/lua/config/autocmds.lua | 3 - common/.config/nvim/lua/config/keymaps.lua | 3 - common/.config/nvim/lua/config/lazy.lua | 46 --- common/.config/nvim/lua/config/options.lua | 3 - common/.config/nvim/lua/plugins/example.lua | 265 ------------------ common/.config/nvim/stylua.toml | 3 - common/.gitignore | 15 +- common/.ideavimrc | 112 +++++--- common/.profile | 3 + common/.zshrc | 7 +- 39 files changed, 117 insertions(+), 1317 deletions(-) delete mode 100644 common/.config/nvim/.neoconf.json delete mode 100644 common/.config/nvim/custom.nvim/init.lua delete mode 100644 common/.config/nvim/custom.nvim/lazy-lock.json delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/core/init.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/core/keymaps.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/core/options.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/lazy.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/dressing.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/auto-pairs.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/gitsigns.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/lspconfig.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/mason.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/nvim-cmp.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/rust-tools.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/symbols-outline.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/init.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/colorizer.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/lualine.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/nightfly-colorscheme.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/web-devicons.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/maximizer.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/nvim-tree.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/telescope.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter-text-objects.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter.lua delete mode 100644 common/.config/nvim/custom.nvim/lua/pratik/plugins/which-key.lua delete mode 100644 common/.config/nvim/init.lua delete mode 100644 common/.config/nvim/lazyvim.json delete mode 100644 common/.config/nvim/lua/config/autocmds.lua delete mode 100644 common/.config/nvim/lua/config/keymaps.lua delete mode 100644 common/.config/nvim/lua/config/lazy.lua delete mode 100644 common/.config/nvim/lua/config/options.lua delete mode 100644 common/.config/nvim/lua/plugins/example.lua delete mode 100644 common/.config/nvim/stylua.toml diff --git a/common/.config/Code/User/settings.json b/common/.config/Code/User/settings.json index 34980f1..8e29190 100644 --- a/common/.config/Code/User/settings.json +++ b/common/.config/Code/User/settings.json @@ -2,11 +2,11 @@ // Global "update.mode": "manual", "workbench.settings.editor": "json", - // + // Privacy "telemetry.telemetryLevel": "off", "extensions.ignoreRecommendations": true, - // + // Editor "editor.fontSize": 21, // Increase the Editor's font to offset "window.zoomLevel": -1, // Reduces the Activity Bar size @@ -28,13 +28,13 @@ "files.autoSaveDelay": 1000, "diffEditor.renderSideBySide": true, "diffEditor.ignoreTrimWhitespace": false, - // + // Editor Font "editor.fontFamily": "FuraCode Nerd Font", "editor.fontLigatures": true, "terminal.integrated.fontFamily": "FuraCode Nerd Font", "terminal.integrated.fontSize": 20, - // + // Workbench - Everything that surrounds the editor "workbench.startupEditor": "newUntitledFile", "workbench.sideBar.location": "left", @@ -45,14 +45,10 @@ "bookmarks.navigateThroughAllFiles": true, "window.menuBarVisibility": "compact", "explorer.confirmDragAndDrop": false, - // - // Screencast Options - "screencastMode.verticalOffset": 5, - "screencastMode.fontSize": 45, - // + // Debugging "debug.toolBarLocation": "docked", - // + // Prettier Plugin "prettier.tabWidth": 4, "editor.defaultFormatter": "esbenp.prettier-vscode", @@ -64,7 +60,7 @@ "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - // + // Code Spell Checker Plugin "cSpell.diagnosticLevel": "Hint", "cSpell.allowCompoundWords": true, @@ -115,12 +111,12 @@ "umount", "unmount" ], - // + // Shell check plugin "shellcheck.run": "onSave", "shellcheck.exclude": ["2181", "2039"], "security.workspace.trust.untrustedFiles": "open", - // + // Better Comments "better-comments.tags": [ { @@ -169,30 +165,15 @@ "italic": false } ], - // ES Lint - "eslint.alwaysShowStatus": true, - "eslint.run": "onSave", - // + // JavaScript "typescript.suggest.paths": false, - // + // Git "git.enableSmartCommit": true, "git.autofetch": true, "git.confirmSync": false, - // GetLens - "gitlens.hovers.currentLine.over": "line", - "gitlens.advanced.telemetry.enabled": false, - "gitlens.statusBar.reduceFlicker": true, - "gitlens.blame.avatars": false, - "gitlens.currentLine.uncommittedChangesFormat": "✏️ ${ago}", - "gitlens.codeLens.enabled": false, - "gitlens.currentLine.enabled": false, - "gitlens.views.branches.branches.layout": "list", - // - // Golang - "go.useLanguageServer": true, - "go.formatTool": "gofmt", + // Markdown "markdownlint.run": "onType", "markdown.extension.print.imgToBase64": true, @@ -213,53 +194,22 @@ "no-hard-tabs": false, "line-length": false }, - // LaTex - // https://nevalsar.hashnode.dev/compiling-latex-with-ubuntu-and-visual-studio-code#heading-issues-with-modules-setting-additional-compiler-flags - "latex-workshop.latex.tools": [ - { - "name": "latexmk", - "command": "latexmk", - "args": [ - "--shell-escape", - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "-pdf", - "-outdir=%OUTDIR%", - "%DOC%" - ], - "env": {} - }, - { - "name": "pdflatex", - "command": "pdflatex", - "args": [ - "--shell-escape", - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "%DOC%" - ], - "env": {} - }, - { - "name": "bibtex", - "command": "bibtex", - "args": ["--shell-escape", "%DOCFILE%"], - "env": {} - } - ], - // + // Vim Plugin + "vim.foldfix": true, + "vim.highlightedyank.enable": true, + "vim.hlsearch": true, + "vim.leader": " ", + "vim.showMarksInGutter": true, + "vim.smartRelativeLine": true, + "vim.vimrc.enable": true, + "vim.useSystemClipboard": true, + // Python "python.jediEnabled": false, "python.languageServer": "Pylance", "workbench.iconTheme": "material-icon-theme", "workbench.colorTheme": "GitHub Dark", - // "theme-by-language.themes": { - // "*": "GitHub Dark", - // "markdown": "Community Material Theme Darker High Contrast" - // }, // Rust // "rust.build_on_save": true, @@ -276,6 +226,7 @@ // "terminal.integrated.shell.linux": "/bin/zsh", "debug.javascript.autoAttachFilter": "disabled", - "debug.onTaskErrors": "debugAnyway" + "debug.onTaskErrors": "debugAnyway", + "vim.disableExtension": true // } diff --git a/common/.config/nvim/.neoconf.json b/common/.config/nvim/.neoconf.json deleted file mode 100644 index 7c48087..0000000 --- a/common/.config/nvim/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/common/.config/nvim/custom.nvim/init.lua b/common/.config/nvim/custom.nvim/init.lua deleted file mode 100644 index 8a37d10..0000000 --- a/common/.config/nvim/custom.nvim/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -require("pratik.core") -require("pratik.lazy") diff --git a/common/.config/nvim/custom.nvim/lazy-lock.json b/common/.config/nvim/custom.nvim/lazy-lock.json deleted file mode 100644 index ef9f320..0000000 --- a/common/.config/nvim/custom.nvim/lazy-lock.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, - "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" }, - "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" }, - "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, - "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, - "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" }, - "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "e4f34741daa9cf95de68a603d3e7a6844a69fdf0" }, - "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, - "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, - "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-lsp-file-operations": { "branch": "master", "commit": "0ae13ac58136c6175638b6e1ba04cb487dd22272" }, - "nvim-lspconfig": { "branch": "master", "commit": "cb49a4cd622d7ed775c31561bb8aa6a50712d6b9" }, - "nvim-tree.lua": { "branch": "master", "commit": "78a9ca5ed6557f29cd0ce203df44213e54bfabb9" }, - "nvim-treesitter": { "branch": "master", "commit": "bf0a96568a54618138ac42c84758945cdafef86b" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" }, - "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, - "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, - "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, - "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, - "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, - "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, - "vim-gitgutter": { "branch": "main", "commit": "f7b97666ae36c7b3f262f3190dbcd7033845d985" }, - "vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" }, - "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, - "vim-nightfly-guicolors": { "branch": "master", "commit": "9053e99131731f268258ab4d35d4841c3126ff9a" }, - "vim-paragraph-motion": { "branch": "master", "commit": "2f6b36670327952b0bcc6915f4947feb85977af3" }, - "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, - "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "vim-trailing-whitespace": { "branch": "master", "commit": "5540b3faa2288b226a8d9a4e8244558b12c598aa" } -} \ No newline at end of file diff --git a/common/.config/nvim/custom.nvim/lua/pratik/core/init.lua b/common/.config/nvim/custom.nvim/lua/pratik/core/init.lua deleted file mode 100644 index 1e45909..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/core/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -require("pratik.core.keymaps") -require("pratik.core.options") diff --git a/common/.config/nvim/custom.nvim/lua/pratik/core/keymaps.lua b/common/.config/nvim/custom.nvim/lua/pratik/core/keymaps.lua deleted file mode 100644 index defc95c..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/core/keymaps.lua +++ /dev/null @@ -1,48 +0,0 @@ --- set leader key to space -vim.g.mapleader = " " - -local keymap = vim.keymap - --- General Keymaps ------------------- - --- clear search highlights -keymap.set("n", "hx", ":nohl", { desc = "Clear search highlights" }) - --- delete single character without copying into register -keymap.set("n", "x", '"_x') - --- increment/decrement numbers -keymap.set("n", "+", "", { desc = "Increment number" }) -keymap.set("n", "-", "", { desc = "Decrement number" }) - --- window management -keymap.set("n", "sv", "v", { desc = "Split window vertically" }) -keymap.set("n", "sh", "s", { desc = "Split window horizontally" }) -keymap.set("n", "se", "=", { desc = "Make splits equal size" }) -keymap.set("n", "sx", "close", { desc = "Close current split" }) - -keymap.set("n", "ta", "tabnew", { desc = "Open new tab" }) -keymap.set("n", "tx", "tabclose", { desc = "Close current tab" }) -keymap.set("n", "tn", "tabn", { desc = "Go to next tab" }) -keymap.set("n", "tp", "tabp", { desc = "Go to previous tab" }) --- keymap.set("n", "tf", "tabnew %", { desc = "Open current buffer in new tab" }) - --- Center cursor after scrolling -keymap.set("n", "", "zz") -keymap.set("n", "", "zz") - --- Plugin Keymaps ------------------- - --- vim-maximizer -keymap.set("n", "sm", ":MaximizerToggle", { desc = "Maximize Split" }) - --- nvim-tree -keymap.set("n", "ee", ":NvimTreeToggle", { desc = "Open/Close file explorer" }) -keymap.set("n", "ef", ":NvimTreeFocus", { desc = "Bring focus back to file explorer" }) -keymap.set("n", "er", "NvimTreeRefresh", { desc = "Refresh file explorer" }) - --- telescope -keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd" }) -keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files" }) -keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd" }) -keymap.set("n", "fc", "Telescope grep_string", { desc = "Find string under cursor in cwd" }) diff --git a/common/.config/nvim/custom.nvim/lua/pratik/core/options.lua b/common/.config/nvim/custom.nvim/lua/pratik/core/options.lua deleted file mode 100644 index 84d7e30..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/core/options.lua +++ /dev/null @@ -1,51 +0,0 @@ -local opt = vim.opt -- for conciseness - --- line numbers -opt.relativenumber = true -- show relative line numbers -opt.number = true -- shows absolute line number on cursor line (when relative number is on) - --- tabs & indentation -opt.tabstop = 2 -- 2 spaces for tabs (prettier default) -opt.shiftwidth = 2 -- 2 spaces for indent width -opt.expandtab = true -- expand tab to spaces -opt.autoindent = true -- copy indent from current line when starting new one - --- line wrapping -opt.wrap = true -- disable line wrapping - -opt.encoding = "utf-8" - -opt.syntax = "on" -opt.showmatch = true -opt.shortmess:append("I") -opt.mouse:append("a") - --- search settings -opt.ignorecase = true -- ignore case when searching -opt.smartcase = true -- if you include mixed case in your search, assumes you want case-sensitive -opt.incsearch = true - --- cursor line -opt.cursorline = true -- highlight the current cursor line - --- appearance - --- turn on termguicolors for nightfly colorscheme to work --- (have to use iterm2 or any other true color terminal) -opt.termguicolors = true -opt.background = "dark" -- colorschemes that can be light or dark will be made dark -opt.signcolumn = "yes" -- show sign column so that text doesn't shift - --- backspace -opt.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position - --- clipboard -opt.clipboard:append("unnamedplus") -- use system clipboard as default register -opt.clipboard:append("unnamed") - --- split windows -opt.splitright = true -- split vertical window to the right -opt.splitbelow = true -- split horizontal window to the bottom - --- turn off swapfile -opt.swapfile = false diff --git a/common/.config/nvim/custom.nvim/lua/pratik/lazy.lua b/common/.config/nvim/custom.nvim/lua/pratik/lazy.lua deleted file mode 100644 index ea3f0d8..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/lazy.lua +++ /dev/null @@ -1,15 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - 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({ - { import = "pratik.plugins" }, - { import = "pratik.plugins.ide" }, - { import = "pratik.plugins.looks" }, -}, { - change_detection = { - notify = false, - } -}) diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/dressing.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/dressing.lua deleted file mode 100644 index 105f7e5..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/dressing.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "stevearc/dressing.nvim", - event = "VeryLazy", -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/auto-pairs.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/auto-pairs.lua deleted file mode 100644 index 5661655..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/auto-pairs.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - "windwp/nvim-autopairs", - event = { "InsertEnter" }, - dependencies = { - "hrsh7th/nvim-cmp", - }, - config = function() - -- configure autopairs - require("nvim-autopairs").setup({ - check_ts = true, -- enable treesitter - ts_config = { - lua = { "string" }, -- don't add pairs in lua string treesitter nodes - javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes - java = false, -- don't check treesitter on java - }, - }) - - -- import nvim-autopairs completion functionality - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - - -- make autopairs and completion work together - require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/gitsigns.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/gitsigns.lua deleted file mode 100644 index eaf7ae7..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/gitsigns.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "lewis6991/gitsigns.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = true, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/lspconfig.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/lspconfig.lua deleted file mode 100644 index a6828e2..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/lspconfig.lua +++ /dev/null @@ -1,134 +0,0 @@ -return { - "neovim/nvim-lspconfig", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - { "antosha417/nvim-lsp-file-operations", config = true }, - }, - config = function() - -- Change the Diagnostic symbols in the sign column (gutter) - local signs = { Error = " ", Warn = " ", Hint = "󰠠 ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end - - -- import lspconfig plugin - local lspconfig = require("lspconfig") - - -- used to enable autocompletion (assign to every lsp server config) - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - -- configure html server - lspconfig["html"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure typescript server with plugin - lspconfig["tsserver"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure css server - lspconfig["cssls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure tailwindcss server - lspconfig["tailwindcss"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure graphql language server - lspconfig["graphql"].setup({ - capabilities = capabilities, - on_attach = on_attach, - filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" }, - }) - - -- configure emmet language server - lspconfig["emmet_ls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" }, - }) - - -- configure python server - lspconfig["pyright"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure lua server (with special settings) - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - settings = { -- custom settings for lua - Lua = { - -- make the language server recognize "vim" global - diagnostics = { - globals = { "vim" }, - }, - workspace = { - -- make language server aware of runtime files - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, - }) - - -- Setup keymaps - local keymap = vim.keymap -- for conciseness - local opts = { noremap = true, silent = true } - local on_attach = function(client, bufnr) - opts.buffer = bufnr - - opts.desc = "Show LSP references" - keymap.set("n", "gR", "Telescope lsp_references", opts) -- show definition, references - - opts.desc = "Go to declaration" - keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration - - opts.desc = "Show LSP definitions" - keymap.set("n", "gd", "Telescope lsp_definitions", opts) -- show lsp definitions - - opts.desc = "Show LSP implementations" - keymap.set("n", "gi", "Telescope lsp_implementations", opts) -- show lsp implementations - - opts.desc = "Show LSP type definitions" - keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) -- show lsp type definitions - - opts.desc = "See available code actions" - keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection - - opts.desc = "Smart rename" - keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename - - opts.desc = "Show buffer diagnostics" - keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file - - opts.desc = "Show line diagnostics" - keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line - - opts.desc = "Go to previous diagnostic" - keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer - - opts.desc = "Go to next diagnostic" - keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer - - opts.desc = "Show documentation for what is under cursor" - keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor - - opts.desc = "Restart LSP" - keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary - end - - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/mason.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/mason.lua deleted file mode 100644 index 2d32587..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/mason.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - "williamboman/mason.nvim", - dependencies = { - "williamboman/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - config = function() - -- enable mason and configure icons - require("mason").setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, - }) - - require("mason-lspconfig").setup({ - -- list of servers for mason to install - ensure_installed = { - "tsserver", - "html", - "cssls", - "lua_ls", - "graphql", - "emmet_ls", - "pyright", - "rust_analyzer", - "dockerls", - "bashls", - "yamlls", - "jsonls" - }, - -- auto-install configured servers (with lspconfig) - automatic_installation = true, -- not the same as ensure_installed - }) - - require("mason-tool-installer").setup({ - ensure_installed = { - "prettier", -- prettier formatter - "stylua", -- lua formatter - "isort", -- python formatter - "black", -- python formatter - "pylint", -- python linter - "eslint_d", -- js linter - "jsonlint", - "markdownlint", - "shellcheck", - }, - }) - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/nvim-cmp.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/nvim-cmp.lua deleted file mode 100644 index 8cabb54..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/nvim-cmp.lua +++ /dev/null @@ -1,67 +0,0 @@ -return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", -- source for text in buffer - "hrsh7th/cmp-path", -- source for file system paths - "L3MON4D3/LuaSnip", -- snippet engine - "saadparwaiz1/cmp_luasnip", -- for autocompletion - "rafamadriz/friendly-snippets", -- useful snippets - "onsails/lspkind.nvim", -- vs-code like pictograms - -- Rust Cargo - dependencies = { - { - "Saecki/crates.nvim", - event = { "BufRead Cargo.toml" }, - opts = { - src = { - cmp = { enabled = true }, - }, - }, - }, - }, - }, - config = function() - local cmp = require("cmp") - local luasnip = require("luasnip") - local lspkind = require("lspkind") - - -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - completion = { - completeopt = "menu,menuone,preview,noselect", - }, - snippet = { -- configure how nvim-cmp interacts with snippet engine - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), -- previous suggestion - [""] = cmp.mapping.select_next_item(), -- next suggestion - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), -- show completion suggestions - [""] = cmp.mapping.abort(), -- close completion window - [""] = cmp.mapping.confirm({ select = false }), - }), - -- sources for autocompletion - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "crates" }, -- Rust crates - { name = "nvim_lsp" }, - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths - }), - -- configure lspkind for vs-code like pictograms in completion menu - formatting = { - format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = "...", - }), - }, - }) - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/rust-tools.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/rust-tools.lua deleted file mode 100644 index 48d1d9e..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/rust-tools.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "neovim/nvim-lspconfig", -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/symbols-outline.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/symbols-outline.lua deleted file mode 100644 index dbc4605..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/ide/symbols-outline.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - config = true, - }, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/init.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/init.lua deleted file mode 100644 index 0d8eacd..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/init.lua +++ /dev/null @@ -1,11 +0,0 @@ -return{ - -- My Favorite vanilla Vim plugins - 'tpope/vim-fugitive', - 'tpope/vim-surround', - 'tpope/vim-repeat', - 'machakann/vim-highlightedyank', - 'dbakker/vim-paragraph-motion', - 'airblade/vim-gitgutter', - 'bronson/vim-trailing-whitespace', - 'tpope/vim-commentary', -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/colorizer.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/colorizer.lua deleted file mode 100644 index a65b5cc..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/colorizer.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "NvChad/nvim-colorizer.lua", - event = { "BufReadPre", "BufNewFile" }, - config = true, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/lualine.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/lualine.lua deleted file mode 100644 index 3698644..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/lualine.lua +++ /dev/null @@ -1,71 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local lualine = require("lualine") - local lazy_status = require("lazy.status") -- to configure lazy pending updates count - - local colors = { - blue = "#65D1FF", - green = "#3EFFDC", - violet = "#FF61EF", - yellow = "#FFDA7B", - red = "#FF4A4A", - fg = "#c3ccdc", - bg = "#112638", - inactive_bg = "#2c3043", - } - - local my_lualine_theme = { - normal = { - a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - insert = { - a = { bg = colors.green, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - visual = { - a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - command = { - a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - replace = { - a = { bg = colors.red, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - inactive = { - a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, - b = { bg = colors.inactive_bg, fg = colors.semilightgray }, - c = { bg = colors.inactive_bg, fg = colors.semilightgray }, - }, - } - - -- configure lualine with modified theme - lualine.setup({ - options = { - theme = my_lualine_theme, - }, - sections = { - lualine_x = { - { - lazy_status.updates, - cond = lazy_status.has_updates, - color = { fg = "#ff9e64" }, - }, - { "encoding" }, - { "fileformat" }, - { "filetype" }, - }, - }, - }) - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/nightfly-colorscheme.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/nightfly-colorscheme.lua deleted file mode 100644 index 661885b..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/nightfly-colorscheme.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - 'bluz71/vim-nightfly-guicolors', - priority = 1000, -- Makes sure this loads before all other plugins - config = function() - -- load the colorscheme here - vim.cmd([[colorscheme nightfly]]) - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/web-devicons.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/web-devicons.lua deleted file mode 100644 index 89aa773..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/looks/web-devicons.lua +++ /dev/null @@ -1,3 +0,0 @@ -return{ - 'nvim-tree/nvim-web-devicons', -} \ No newline at end of file diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/maximizer.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/maximizer.lua deleted file mode 100644 index b93cffb..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/maximizer.lua +++ /dev/null @@ -1,3 +0,0 @@ -return{ - 'szw/vim-maximizer', -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/nvim-tree.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/nvim-tree.lua deleted file mode 100644 index 9aab4b9..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/nvim-tree.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - "nvim-tree/nvim-tree.lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local nvimtree = require("nvim-tree") - - -- recommended settings from nvim-tree documentation - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - - -- change color for arrows in tree to light blue - vim.cmd([[ highlight NvimTreeFolderArrowClosed guifg=#3FC5FF ]]) - vim.cmd([[ highlight NvimTreeFolderArrowOpen guifg=#3FC5FF ]]) - - -- configure nvim-tree - nvimtree.setup({ - view = { - width = 28, - relativenumber = true, - }, - -- change folder arrow icons - renderer = { - indent_markers = { - enable = true, - }, - icons = { - glyphs = { - folder = { - arrow_closed = "", -- arrow when folder is closed - arrow_open = "", -- arrow when folder is open - }, - }, - }, - }, - -- disable window_picker for - -- explorer to work well with - -- window splits - actions = { - open_file = { - window_picker = { - enable = false, - }, - }, - }, - filters = { - custom = { ".DS_Store" }, - }, - git = { - ignore = false, - }, - }) - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/telescope.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/telescope.lua deleted file mode 100644 index 03bdfc2..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/telescope.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-tree/nvim-web-devicons", - }, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") - - telescope.setup({ - defaults = { - path_display = { "truncate " }, - mappings = { - i = { - [""] = actions.move_selection_previous, -- move to prev result - [""] = actions.move_selection_next, -- move to next result - [""] = actions.send_selected_to_qflist + actions.open_qflist, - }, - }, - }, - }) - - telescope.load_extension("fzf") - - -- set keymaps - local keymap = vim.keymap -- for conciseness - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter-text-objects.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter-text-objects.lua deleted file mode 100644 index 68d5164..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter-text-objects.lua +++ /dev/null @@ -1,110 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter-textobjects", - lazy = true, - config = function() - require("nvim-treesitter.configs").setup({ - textobjects = { - select = { - enable = true, - - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, - ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, - ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, - ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, - - -- works for javascript/typescript files (custom capture I created in after/queries/ecma/textobjects.scm) - ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, - ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, - ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, - ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, - - ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, - ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, - - ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, - ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, - - ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, - ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, - - ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, - ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, - - ["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" }, - ["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" }, - - ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, - ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, - }, - }, - swap = { - enable = true, - swap_next = { - ["na"] = "@parameter.inner", -- swap parameters/argument with next - ["n:"] = "@property.outer", -- swap object property with next - ["nm"] = "@function.outer", -- swap function with next - }, - swap_previous = { - ["pa"] = "@parameter.inner", -- swap parameters/argument with prev - ["p:"] = "@property.outer", -- swap object property with prev - ["pm"] = "@function.outer", -- swap function with previous - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]f"] = { query = "@call.outer", desc = "Next function call start" }, - ["]m"] = { query = "@function.outer", desc = "Next method/function def start" }, - ["]c"] = { query = "@class.outer", desc = "Next class start" }, - ["]i"] = { query = "@conditional.outer", desc = "Next conditional start" }, - ["]l"] = { query = "@loop.outer", desc = "Next loop start" }, - - -- You can pass a query group to use query from `queries//.scm file in your runtime path. - -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. - ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, - ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, - }, - goto_next_end = { - ["]F"] = { query = "@call.outer", desc = "Next function call end" }, - ["]M"] = { query = "@function.outer", desc = "Next method/function def end" }, - ["]C"] = { query = "@class.outer", desc = "Next class end" }, - ["]I"] = { query = "@conditional.outer", desc = "Next conditional end" }, - ["]L"] = { query = "@loop.outer", desc = "Next loop end" }, - }, - goto_previous_start = { - ["[f"] = { query = "@call.outer", desc = "Prev function call start" }, - ["[m"] = { query = "@function.outer", desc = "Prev method/function def start" }, - ["[c"] = { query = "@class.outer", desc = "Prev class start" }, - ["[i"] = { query = "@conditional.outer", desc = "Prev conditional start" }, - ["[l"] = { query = "@loop.outer", desc = "Prev loop start" }, - }, - goto_previous_end = { - ["[F"] = { query = "@call.outer", desc = "Prev function call end" }, - ["[M"] = { query = "@function.outer", desc = "Prev method/function def end" }, - ["[C"] = { query = "@class.outer", desc = "Prev class end" }, - ["[I"] = { query = "@conditional.outer", desc = "Prev conditional end" }, - ["[L"] = { query = "@loop.outer", desc = "Prev loop end" }, - }, - }, - }, - }) - - local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move") - - -- vim way: ; goes to the direction you were moving. - vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) - vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) - - -- Optionally, make builtin f, F, t, T also repeatable with ; and , - vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f) - vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F) - vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t) - vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T) - end, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter.lua deleted file mode 100644 index bbd9922..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/treesitter.lua +++ /dev/null @@ -1,64 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - build = ":TSUpdate", - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - "windwp/nvim-ts-autotag", - }, - config = function() - -- import nvim-treesitter plugin - local treesitter = require("nvim-treesitter.configs") - - -- configure treesitter - treesitter.setup({ -- enable syntax highlighting - highlight = { - enable = true, - }, - -- enable indentation - indent = { enable = true }, - -- enable autotagging (w/ nvim-ts-autotag plugin) - autotag = { - enable = true, - }, - -- ensure these language parsers are installed - ensure_installed = { - "json", - "javascript", - "typescript", - "tsx", - "yaml", - "html", - "css", - "markdown", - "markdown_inline", - "graphql", - "bash", - "lua", - "vim", - "dockerfile", - "gitignore", - "query", - "rust", - "toml", - "ron", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - -- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - }) - end, - }, -} diff --git a/common/.config/nvim/custom.nvim/lua/pratik/plugins/which-key.lua b/common/.config/nvim/custom.nvim/lua/pratik/plugins/which-key.lua deleted file mode 100644 index c96b272..0000000 --- a/common/.config/nvim/custom.nvim/lua/pratik/plugins/which-key.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-tree/nvim-web-devicons", - }, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") - - telescope.setup({ - defaults = { - path_display = { "truncate " }, - mappings = { - i = { - [""] = actions.move_selection_previous, -- move to prev result - [""] = actions.move_selection_next, -- move to next result - [""] = actions.send_selected_to_qflist + actions.open_qflist, - }, - }, - }, - }) - - telescope.load_extension("fzf") - - -- set keymaps - local keymap = vim.keymap -- for conciseness - - keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd" }) - keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files" }) - keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd" }) - keymap.set("n", "fc", "Telescope grep_string", { desc = "Find string under cursor in cwd" }) - end, -} diff --git a/common/.config/nvim/init.lua b/common/.config/nvim/init.lua deleted file mode 100644 index 2514f9e..0000000 --- a/common/.config/nvim/init.lua +++ /dev/null @@ -1,2 +0,0 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") diff --git a/common/.config/nvim/lazyvim.json b/common/.config/nvim/lazyvim.json deleted file mode 100644 index ff6a139..0000000 --- a/common/.config/nvim/lazyvim.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extras": [ - - ], - "news": { - "NEWS.md": "2123" - }, - "version": 2 -} \ No newline at end of file diff --git a/common/.config/nvim/lua/config/autocmds.lua b/common/.config/nvim/lua/config/autocmds.lua deleted file mode 100644 index 27e9e06..0000000 --- a/common/.config/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,3 +0,0 @@ --- 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 diff --git a/common/.config/nvim/lua/config/keymaps.lua b/common/.config/nvim/lua/config/keymaps.lua deleted file mode 100644 index 2c134f7..0000000 --- a/common/.config/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,3 +0,0 @@ --- 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 diff --git a/common/.config/nvim/lua/config/lazy.lua b/common/.config/nvim/lua/config/lazy.lua deleted file mode 100644 index 891b190..0000000 --- a/common/.config/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,46 +0,0 @@ -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", - }, - }, - }, -}) diff --git a/common/.config/nvim/lua/config/options.lua b/common/.config/nvim/lua/config/options.lua deleted file mode 100644 index 3ea1454..0000000 --- a/common/.config/nvim/lua/config/options.lua +++ /dev/null @@ -1,3 +0,0 @@ --- 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 diff --git a/common/.config/nvim/lua/plugins/example.lua b/common/.config/nvim/lua/plugins/example.lua deleted file mode 100644 index f84ebdc..0000000 --- a/common/.config/nvim/lua/plugins/example.lua +++ /dev/null @@ -1,265 +0,0 @@ --- 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 = { { "cs", "SymbolsOutline", 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 - { - "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", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "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 - 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 for completion and snippets (supertab) - -- first: disable default and 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, { - [""] = 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" }), - [""] = 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, - }, -} diff --git a/common/.config/nvim/stylua.toml b/common/.config/nvim/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/common/.config/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file diff --git a/common/.gitignore b/common/.gitignore index 6565b55..75f039c 100644 --- a/common/.gitignore +++ b/common/.gitignore @@ -69,10 +69,21 @@ tasks/ # ---- Programming Languages ---- # Ignore all downloaded node modules node_modules/* - +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 @@ -84,4 +95,4 @@ node_modules/* *.jsc **/contents/images **/contents/fonts -*kpluginindex.json \ No newline at end of file +*kpluginindex.json diff --git a/common/.ideavimrc b/common/.ideavimrc index b5feb99..1008917 100644 --- a/common/.ideavimrc +++ b/common/.ideavimrc @@ -1,54 +1,86 @@ -" .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 +" Examples to map IDE actions to IdeaVim -- https://jb.gg/abva4t +" Enable IdeaVim plugins https://jb.gg/ideavim-plugins -" Source your .vimrc -source ~/.vimrc +" Source .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 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Searches +set hlsearch " highlight search occurrences +set ignorecase " ignore case in search patterns +set smartcase " no ignore case when pattern is uppercase +set incsearch " show search results while typing +set wrapscan " searches wrap around the end of the file -" Quick scope for motions with f, t, F & T -" https://plugins.jetbrains.com/plugin/19417-ideavim-quickscope -" set quickscope +" common settings +set gdefault " substitute all occurrences in line +set history=10000 " command line history +set scrolloff=5 sidescrolloff=10 " Keep some line before and after the cursor visible +set clipboard^=unnamed,unnamedplus,ideaput " Copy to and from system clipboard -" Do incremental searching. -set incsearch +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"keymaps +let mapleader = " " -" Don't use Ex mode, use Q for formatting. +" Don't use Ex mode, use Q for formatting map Q gq -" Copy to and from system clipboard -set clipboard^=unnamed,unnamedplus - -" --- 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' -" Repeat for Surround -Plug 'tpope/vim-repeat' -" Paragraph Motion -Plug 'dbakker/vim-paragraph-motion' -" Git gutter icons -Plug 'airblade/vim-gitgutter', - -"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t -"" Map \r to the Reformat Code action -map \r (ReformatCode) - -"" Map d to start debug +" Map d to start debug "map d (Debug) - -"" Map \b to toggle the breakpoint on the current line +" Map \b to toggle breakpoint "map \b (ToggleLineBreakpoint) " Center the cursor when doing 1/2 page down and page up nnoremap zz -nnoremap zz \ No newline at end of file +nnoremap zz + +" clear search highlighting +nnoremap / :nohls + +" code navigations +nmap e :action GotoFile +nmap a :action FindInPath +nmap gr :action ShowUsages +nmap gi :action GotoImplementation +nmap gs :action GotoSuperMethod +nmap tn :action NextTab +nmap tp :action PreviousTab + +nmap :action ParameterInfo +imap :action ParameterInfo +nmap n :action GotoNextError +map gh (ShowErrorDescription) + +" code refactoring +nmap ri :action Inline +nmap rr :action RenameElement +nmap rev :action IntroduceVariable +vmap rev :action IntroduceVariable +nmap rem :action ExtractMethod +vmap rem :action ExtractMethod +nmap rm :action Move +nmap ro :action OptimizeImports +nmap rG :action Generate +nmap rf :action ReformatCode + +" Easy motion +map J (easymotion-s) +map j (easymotion-f) + +nmap gr :action Vcs.RollbackChangedLines + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Enabled plugins +set ideajoin +Plug 'easymotion/vim-easymotion' +Plug 'preservim/NERDTree' +Plug 'tpope/surround' +Plug 'tpope/commentary' +Plug 'machakann/highlightedyank' +Plug 'dbakker/vim-paragraph-motion' +Plug 'chrisbra/matchit' +Plug 'tpope/vim-repeat' " Repeat for Surround +Plug 'airblade/vim-gitgutter' " Git gutter icons +Plug 'mg979/vim-visual-multi' " Multi Line Editing diff --git a/common/.profile b/common/.profile index d89ea5a..474bc9b 100644 --- a/common/.profile +++ b/common/.profile @@ -25,3 +25,6 @@ fi if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi + +# Remap caps lock to escape +setxkbmap -option caps:escape \ No newline at end of file diff --git a/common/.zshrc b/common/.zshrc index 7148e39..3c2299a 100644 --- a/common/.zshrc +++ b/common/.zshrc @@ -60,6 +60,7 @@ plugins=( systemd zsh-syntax-highlighting zsh-autosuggestions + vi-mode # exercism ) @@ -71,7 +72,6 @@ source $ZSH/oh-my-zsh.sh POWERLEVEL9K_INSTANT_PROMPT=off POWERLEVEL9K_SHORTEN_DIR_LENGTH=4 -# POWERLEVEL9K_SHORTEN_STRATEGY="None" POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S %a}" POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0 POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=6 @@ -99,6 +99,9 @@ setopt HIST_IGNORE_SPACE # Don't add commands that start with whitespac # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# enable vi-mode +bindkey -v + # Setup path and export variables [[ ! -f ~/.env ]] || source ~/.env [[ ! -f ~/.set_path ]] || source ~/.set_path @@ -122,4 +125,4 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr [[ ! -f ~/.config/exercism/exercism_completion.bash ]] || source ~/.config/exercism/exercism_completion.bash eval "$(ssh-agent -s)" > /dev/null -ulimit -n 10240 \ No newline at end of file +ulimit -n 10240