diff --git a/functions/extract b/functions/extract new file mode 100644 index 0000000..b3f26ec --- /dev/null +++ b/functions/extract @@ -0,0 +1,22 @@ +extract() { + for archive in "$@"; do + if [ -f "$archive" ]; then + case "$archive" in + *.tar.bz2) tar xjf "$archive" ;; + *.tar.gz) tar xzf "$archive" ;; + *.bz2) bunzip2 "$archive" ;; + *.rar) unrar x "$archive" ;; + *.gz) gunzip "$archive" ;; + *.tar) tar xf "$archive" ;; + *.tbz2) tar xjf "$archive" ;; + *.tgz) tar xzf "$archive" ;; + *.zip) unzip "$archive" ;; + *.Z) uncompress "$archive" ;; + *.7z) 7z x "$archive" ;; + *) echo "'$archive' cannot be extracted via extract()" ;; + esac + else + echo "'$archive' is not a valid file" + fi + done +} diff --git a/functions/index b/functions/index new file mode 100644 index 0000000..0775731 --- /dev/null +++ b/functions/index @@ -0,0 +1,5 @@ + +baseDir=$XDG_CONFIG_HOME/functions + +source $baseDir/extract +source $baseDir/myip diff --git a/functions/myip b/functions/myip new file mode 100644 index 0000000..89e3d68 --- /dev/null +++ b/functions/myip @@ -0,0 +1,6 @@ +myip() { + publicip=$(curl -s https://ipecho.net/plain) + localip=$(ipconfig getifaddr en0) + echo "Public IP: $publicip" + echo "Local IP: $localip" +} diff --git a/nvim-deps/init.lua b/nvim-deps/init.lua new file mode 100644 index 0000000..2990cd1 --- /dev/null +++ b/nvim-deps/init.lua @@ -0,0 +1,59 @@ +-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps' +local path_package = vim.fn.stdpath('data') .. '/site/' +local mini_path = path_package .. 'pack/deps/start/mini.nvim' +if not vim.loop.fs_stat(mini_path) then + vim.cmd('echo "Installing `mini.nvim`" | redraw') + local clone_cmd = { 'git', 'clone', '--filter=blob:none', 'https://github.com/nvim-mini/mini.nvim', mini_path } + vim.fn.system(clone_cmd) + vim.cmd('packadd mini.nvim | helptags ALL') + vim.cmd('echo "Installed `mini.nvim`" | redraw') +end + +-- Set up 'mini.deps' (customize to your liking) +require('mini.deps').setup({ path = { package = path_package } }) + +-- Use 'mini.deps'. `now()` and `later()` are helpers for a safe two-stage +-- startup and are optional. +local add, now, later = MiniDeps.add, MiniDeps.now, MiniDeps.later + +-- Safely execute immediately +now(function() + vim.o.termguicolors = true + vim.cmd('colorscheme miniwinter') +end) +now(function() require('mini.notify').setup() end) +now(function() require('mini.icons').setup() end) +now(function() require('mini.tabline').setup() end) +now(function() require('mini.statusline').setup() end) + +-- Safely execute later +later(function() require('mini.ai').setup() end) +later(function() require('mini.comment').setup() end) +later(function() require('mini.pick').setup() end) +later(function() require('mini.surround').setup() end) + +now(function() + -- Use other plugins with `add()`. It ensures plugin is available in current + -- session (installs if absent) + add({ + source = 'neovim/nvim-lspconfig', + -- Supply dependencies near target plugin + depends = { 'williamboman/mason.nvim' }, + }) +end) + +later(function() + add({ + source = 'nvim-treesitter/nvim-treesitter', + -- Use 'master' while monitoring updates in 'main' + checkout = 'master', + monitor = 'main', + -- Perform action after every checkout + hooks = { post_checkout = function() vim.cmd('TSUpdate') end }, + }) + -- Possible to immediately execute code which depends on the added plugin + require('nvim-treesitter.configs').setup({ + ensure_installed = { 'lua', 'vimdoc' }, + highlight = { enable = true }, + }) +end) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 32e5a65..a02283a 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,35 +1,35 @@ { - "LazyVim": { "branch": "main", "commit": "92b7fcf7b156600b86952bf6f2c777adc68fd0b8" }, + "LazyVim": { "branch": "main", "commit": "0329bc0e508eb48f7cee7fe57975c364584f8738" }, "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "5af9374957a65be8770696da295dc9016b96f241" }, - "conform.nvim": { "branch": "master", "commit": "3bad87250ed85246fe8c5bc10005ab5a6289ae4c" }, - "flash.nvim": { "branch": "main", "commit": "b68bda044d68e4026c4e1ec6df3c5afd7eb8e341" }, + "catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" }, + "conform.nvim": { "branch": "master", "commit": "9fd3d5e0b689ec1bf400c53cbbec72c6fdf24081" }, + "flash.nvim": { "branch": "main", "commit": "3be9bf7e85550045ec576379a0c45aac144d0438" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, - "gitsigns.nvim": { "branch": "main", "commit": "23ae90a2a52fdc9b8c50dc61d6c30ebb18521343" }, - "grug-far.nvim": { "branch": "main", "commit": "50d9ee2b5a19634670441948e7e4afaa042f1059" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" }, - "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "f760507df8c49a4bf46a4d12e1fc616797508979" }, - "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, - "mini.ai": { "branch": "main", "commit": "e0d00c227112e942ed2789dd4c21d651002831c0" }, - "mini.icons": { "branch": "main", "commit": "e8fae66cb400744daeedf6e387347df50271c252" }, - "mini.pairs": { "branch": "main", "commit": "bada72fe4ec607f882a098d15aa4a3279bc6883d" }, - "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, + "grug-far.nvim": { "branch": "main", "commit": "3e72397465f774b01aa38e4fe8e6eecf23d766d9" }, + "lazy.nvim": { "branch": "main", "commit": "db067881fff0fd4be8c00e5bde7492e0e1c77a2f" }, + "lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" }, + "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" }, + "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" }, + "mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" }, + "noice.nvim": { "branch": "main", "commit": "c86aea584d98be7ee1167ce4d4ef946fbd7f3ae0" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-lint": { "branch": "master", "commit": "335a6044be16d7701001059cba9baa36fbeef422" }, - "nvim-lspconfig": { "branch": "master", "commit": "336b388c272555d2ae94627a50df4c2f89a5e257" }, - "nvim-treesitter": { "branch": "main", "commit": "5a70b1eb8cbdf6c7f0a59dfb7356ad198421b620" }, + "nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" }, + "nvim-lspconfig": { "branch": "master", "commit": "ececa531ecae813422697b5ef627a11cc964c2a7" }, + "nvim-treesitter": { "branch": "main", "commit": "8fecb462580ec0794a803b1d6ff9e2c4896c3e6f" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, - "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, + "persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "snacks.nvim": { "branch": "main", "commit": "5e0e8698526f350f1280ad1ef7a8670f857c9445" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "tokyonight.nvim": { "branch": "main", "commit": "ca56e536f565293b83a075971fb5880cfe41d6de" }, - "trouble.nvim": { "branch": "main", "commit": "f176232e7759c4f8abd923c21e3e5a5c76cd6837" }, - "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, - "which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" } + "snacks.nvim": { "branch": "main", "commit": "277ba028b3b764ee49c9be8fd4d1282aff86812a" }, + "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" }, + "tokyonight.nvim": { "branch": "main", "commit": "545d72cde6400835d895160ecb5853874fd5156d" }, + "trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" }, + "ts-comments.nvim": { "branch": "main", "commit": "217ab9cc137fceb6659b53790bd25e608219abe1" }, + "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" } } diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 2c134f7..c4c0325 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -1,3 +1,10 @@ -- 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 + +-- Grep search words from project root +vim.keymap.set("n", "fw", function() + require("telescope.builtin").live_grep({ + cwd = vim.fn.getcwd(), + }) +end, { desc = "Find Words (grep)" }) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index c0e0e80..a1a4380 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -30,11 +30,10 @@ require("lazy").setup({ 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, -- check for plugin updates periodically - notify = false, -- notify on update - }, -- automatically check for plugin updates + notify = true, -- notify on update + }, performance = { rtp = { -- disable some rtp plugins diff --git a/nvim/lua/plugins/colorscheme-github.lua b/nvim/lua/plugins/colorscheme-github.lua index b1a33a9..4119ecc 100644 --- a/nvim/lua/plugins/colorscheme-github.lua +++ b/nvim/lua/plugins/colorscheme-github.lua @@ -11,7 +11,7 @@ return { dim_inactive = true, styles = { -- Style to be applied to different syntax groups comments = "italic", -- Keep comments italic - this makes sense - functions = "bold", + functions = "bold,italic", keywords = "NONE", -- Remove italic from keywords variables = "NONE", conditionals = "bold", -- Keep conditionals bold for control flow @@ -42,9 +42,9 @@ return { }) vim.cmd("colorscheme github_dark_high_contrast") - + -- Apply custom function highlighting after colorscheme loads - vim.cmd [[ + vim.cmd([[ highlight Function guifg=#58a6ff gui=bold highlight! link @function Function highlight! link @function.call Function @@ -58,7 +58,7 @@ return { highlight Keyword gui=NONE highlight! link @keyword Keyword highlight! link @keyword.function Keyword - ]] + ]]) end, }, }