diff --git a/.config/X11/profile b/.config/X11/profile index 0df47f1..c4ffab2 100644 --- a/.config/X11/profile +++ b/.config/X11/profile @@ -33,15 +33,16 @@ if [ "$XDG_SESSION_TYPE" = "wayland" ]; then export _JAVA_AWT_WM_NONREPARENTING=1 export XCURSOR_SIZE=24 fi -export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0" +export GTK_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-1.0/gtkrc +export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc":"${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc.mine" export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default" export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" # export WINEESYNC=1 export MOZ_USE_XINPUT2="1" -export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME}/asdf/asdfrc" -export ASDF_DATA_DIR="${XDG_DATA_HOME}/asdf" +export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/asdfrc" +export ASDF_DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/asdf" # export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" # export ADB_VENDOR_KEY="$XDG_CONFIG_HOME"/android # export ANDROID_EMULATOR_HOME="$XDG_DATA_HOME"/android/ @@ -53,37 +54,35 @@ export ASDF_DATA_DIR="${XDG_DATA_HOME}/asdf" # export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin export ANDROID_HOME="$HOME/Android/Sdk" export PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/cmdline-tools/latest:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH" -export MYSQL_HISTFILE="$XDG_DATA_HOME"/mysql_history +export MYSQL_HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/mysql_history" export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc" export PSQL_HISTORY="$XDG_STATE_HOME/psql_history" export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass" export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf" -export RLWRAP_HOME="$XDG_DATA_HOME"/rlwrap +export RLWRAP_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/rlwrap" export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv -# export ANDROID_AVD_HOME="$XDG_DATA_HOME"/android/ +# export ANDROID_AVD_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/android/" export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" -export RUSTUP_HOME="$XDG_DATA_HOME"/rustup -export OPAMROOT="$XDG_DATA_HOME/opam" +export RUSTUP_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/rustup" +export OPAMROOT="${XDG_DATA_HOME:-$HOME/.local/share}/opam" [ -x "$CARGO_HOME/env" ] && . "$CARGO_HOME/env" -export GOPATH="$XDG_DATA_HOME"/golib +export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/golib" export GOPATH="$GOPATH:$HOME/Documents/Programming/GoLang" export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/npm/npmrc" -export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history -# export NVM_DIR="$HOME/.config/nvm" -# [ -s "${NVM_DIR:-$HOME/.config/nvm}/nvm.sh" ] && . "${NVM_DIR:-$HOME/.config/nvm}/nvm.sh" +export NODE_REPL_HISTORY="${XDG_DATA_HOME:-$HOME/.local/share}/node_repl_history" export ICEAUTHORITY="${XDG_CACHE_HOME:-$HOME/.cache}/ICEauthority" export RXVT_SOCKET="$XDG_RUNTIME_DIR"/urxvtd export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc -export WORKON_HOME="$XDG_DATA_HOME/virtualenvs" +export WORKON_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/virtualenvs" export PYLINTHOME="$XDG_CACHE_HOME/pylint" export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter" -export JUPYTERLAB_DIR="$XDG_DATA_HOME/jupyter/lab" +export JUPYTERLAB_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/jupyter/lab" export IPYTHONDIR="$XDG_CONFIG_HOME/jupyter" export PYTHON_HISTORY=$XDG_STATE_HOME/python/history export PYTHON_EGG_CACHE="$XDG_CACHE_HOME/python-eggs" export PYTHONPYCACHEPREFIX=$XDG_CACHE_HOME/python -export PYTHONUSERBASE=$XDG_DATA_HOME/python -export REDISCLI_HISTFILE="$XDG_DATA_HOME"/redis/rediscli_history +export PYTHONUSERBASE=${XDG_DATA_HOME:-$HOME/.local/share}/python +export REDISCLI_HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}"/redis/rediscli_history export REDISCLI_RCFILE="$XDG_CONFIG_HOME"/redis/redisclirc export MYPY_CACHE_DIR="$XDG_CACHE_HOME"/mypy export CONDARC="$XDG_CONFIG_HOME/conda/condarc" @@ -93,21 +92,21 @@ export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc export XCOMPOSEFILE="$XDG_CONFIG_HOME/X11/xcompose" export XCOMPOSECACHE="$XDG_CACHE_HOME/X11/xcompose" -export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" +export GRADLE_USER_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/gradle" export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" -export MACHINE_STORAGE_PATH="$XDG_DATA_HOME"/docker-machine -export LEIN_HOME="$XDG_DATA_HOME/lein" +export MACHINE_STORAGE_PATH="${XDG_DATA_HOME:-$HOME/.local/share}"/docker-machine +export LEIN_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/lein" export LESSHISTFILE=- export DENO_INSTALL="/home/shubham/.config/deno" [ -s "$DENO_INSTALL" ] && export PATH="$PATH:$DENO_INSTALL/bin" -export BUN_INSTALL="$XDG_DATA_HOME/bun" +export BUN_INSTALL="${XDG_DATA_HOME:-$HOME/.local/share}/bun" [ -s "$BUN_INSTALL" ] && export PATH="$BUN_INSTALL/bin:$PATH" # export LESSOPEN="| /usr/bin/highlight -O xterm256 --style=leo %s 2>/dev/null" # export LESS='-q -F -i -J -M -W -x4 -z-4 -R --use-color' export LESS='-R --use-color -Dd+r$Du+b' # export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java export _JAVA_AWT_WM_NONREPARENTING=1 -# export GNUPGHOME="$XDG_DATA_HOME"/gnupg +# export GNUPGHOME="${XDG_DATA_HOME:-$HOME/.local/share}"/gnupg export _ZL_DATA="$XDG_CACHE_HOME/zlua" export _ZL_DATA_DIR="$XDG_CACHE_HOME/zlua" export RANGER_ZLUA="$HOME/Downloads/GitClones/z.lua/z.lua" @@ -122,7 +121,7 @@ export FZF_DEFAULT_OPTS="--cycle --marker='+' --keep-right" # eval $(dircolors "$XDG_CONFIG_HOME"/dir_colors) export XCURSOR_PATH=${XCURSOR_PATH}:~/.local/share/icons export GHCUP_USE_XDG_DIRS="$HOME"/.config -export STACK_ROOT="$XDG_DATA_HOME"/stack +export STACK_ROOT="${XDG_DATA_HOME:-$HOME/.local/share}/stack" export CABAL_CONFIG="$XDG_CONFIG_HOME"/cabal/config export CABAL_DIR="$XDG_CACHE_HOME"/cabal # export PYENV_ROOT="$HOME/.config/pyenv" diff --git a/.config/kmonad/mkmonad.kbd b/.config/kmonad/mkmonad.kbd index b8cef1c..93477e7 100644 --- a/.config/kmonad/mkmonad.kbd +++ b/.config/kmonad/mkmonad.kbd @@ -1,6 +1,6 @@ (defcfg ;; For Linux - input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd") + input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:2:1.0-event-kbd") ;; input (device-file "/dev/input/by-id/usb-Compx_2.4G_Receiver-event-kbd") output (uinput-sink "My KMonad output: Desktop") diff --git a/.config/lazygit/state.yml b/.config/lazygit/state.yml index ad88150..9c8ed83 100644 --- a/.config/lazygit/state.yml +++ b/.config/lazygit/state.yml @@ -1,9 +1,7 @@ lastupdatecheck: 0 recentrepos: -- /home/shubham/Documents/Programming/WebDev/page-form - /home/shubham/Documents/dotfiles -- /home/shubham/Documents/Programming/Php/twitter-clone -- /home/shubham/Documents/Programming/Php/job-boarding-2 +- /home/shubham/Documents/Programming/WebDev/page-form - /home/shubham/Documents/Programming/WebDev/discord-clone - /home/shubham/Downloads/GitClones/lfimg startuppopupversion: 5 diff --git a/.config/nvim-lazy/lazy-lock.json b/.config/nvim-lazy/lazy-lock.json index e8b068d..78bfe48 100644 --- a/.config/nvim-lazy/lazy-lock.json +++ b/.config/nvim-lazy/lazy-lock.json @@ -2,13 +2,12 @@ "LazyVim": { "branch": "main", "commit": "7c7c196a78e936a1bc4cf28e7908e9bd96d75607" }, "LuaSnip": { "branch": "master", "commit": "8d7aa7a7b7c0875e4878d1d2590924bc1c229305" }, "NeoTerm.lua": { "branch": "main", "commit": "f71a4a9663c52673a677a09894d945983c8da303" }, - "SchemaStore.nvim": { "branch": "main", "commit": "ed65feb5b8026d7c6b1981cfe9d97402342d344d" }, + "SchemaStore.nvim": { "branch": "main", "commit": "a5f6e784d2000f9570791d5f43040ab29e13f9e3" }, "blink.cmp": { "branch": "main", "commit": "917026450f5fa051cda9c538b517f0cf28ceec6f" }, "bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" }, "bullets.vim": { "branch": "master", "commit": "2253f970e54320dbd76fd6bb4f5a0bf2436ce232" }, "catppuccin": { "branch": "main", "commit": "65bf0b16f57a3db70d6a93ac68882dd9a31d0565" }, "clangd_extensions.nvim": { "branch": "main", "commit": "8f7b72100883e0e34400d9518d40a03f21e4d0a6" }, - "cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-git": { "branch": "main", "commit": "ec049036e354ed8ed0215f2427112882e1ea7051" }, "cmp-look": { "branch": "master", "commit": "971e65a6be0e75c3438fe7b176d4fc020cb89d7b" }, @@ -16,7 +15,7 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-rg": { "branch": "master", "commit": "d6cea15ad504369ec98f3de73b9631dfdd23a671" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "6a28c90082a67f62a323ab90d988e000a718a8c7" }, + "conform.nvim": { "branch": "master", "commit": "4dd429fe3f47077f4e50cdaf03f7877ce9b213e0" }, "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, "crates.nvim": { "branch": "main", "commit": "8bf8358ee326d5d8c11dcd7ac0bcc9ff97dbc785" }, "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, @@ -33,8 +32,8 @@ "indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" }, "kanagawa.nvim": { "branch": "master", "commit": "e5f7b8a804360f0a48e40d0083a97193ee4fcc87" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, - "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" }, + "lualine.nvim": { "branch": "master", "commit": "640260d7c2d98779cab89b1e7088ab14ea354a02" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, @@ -56,7 +55,7 @@ "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, "neotest-vitest": { "branch": "main", "commit": "9e30dca989a2287cf3fde86b3e138ea7fa4de935" }, "neovim-session-manager": { "branch": "master", "commit": "35c154a4b904cbe2aa7acce00a8c1c54a8831780" }, - "noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" }, + "noice.nvim": { "branch": "main", "commit": "3cd84d402e0b5a56cf06b6c7f644a3cc9a3956a6" }, "nordic.nvim": { "branch": "main", "commit": "1ee4044077059b34eacd18d93613495a602c131f" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, @@ -64,7 +63,7 @@ "nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" }, "nvim-dap-python": { "branch": "master", "commit": "3e3dd98d4d83715c9e0e429b4a5da7bd706e6ceb" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, "nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" }, "nvim-lint": { "branch": "master", "commit": "16b21a7d04d06661f92f273a0744fd81fb19e09e" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, @@ -85,7 +84,7 @@ "refactoring.nvim": { "branch": "master", "commit": "53ed6854e0bba64d467c58e87084dcf8b1c22d36" }, "render-markdown.nvim": { "branch": "main", "commit": "fc05fb7c56795f191b6800799a2ec6ea325ba715" }, "resession.nvim": { "branch": "master", "commit": "c4d92a57b3936a2d6e1c087dbd6b670da2b1b082" }, - "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" }, + "rustaceanvim": { "branch": "master", "commit": "7405d2d84ce96e460d548cf7e8def332ac6e19f0" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, diff --git a/.config/nvim-lazy/lua/plugins/conform.lua b/.config/nvim-lazy/lua/plugins/conform.lua index 09638b7..6bd6e49 100644 --- a/.config/nvim-lazy/lua/plugins/conform.lua +++ b/.config/nvim-lazy/lua/plugins/conform.lua @@ -73,6 +73,7 @@ return { go = function(bufnr) return { "goimports", first(bufnr, "gofumpt", "gofmt") } end, + python = { "ruff_format", "ruff_fix", "ruff_organize_imports" }, }, }, }, diff --git a/.config/nvim/after/plugin/keymaps.lua b/.config/nvim/after/plugin/keymaps.lua index 90c98c9..f8ce199 100644 --- a/.config/nvim/after/plugin/keymaps.lua +++ b/.config/nvim/after/plugin/keymaps.lua @@ -51,7 +51,7 @@ vim.keymap.set( { silent = false, desc = 'Edit in same dir(Split)' } ) -vim.keymap.set('n', 'x', function() +vim.keymap.set('n', 'R', function() vim.cmd 'source %' local file = vim.fn.substitute(vim.fn.expand '%:r', 'lua/', '', '') local ok, mod = pcall(require, file) diff --git a/.config/nvim/lua/plugins/avante.lua b/.config/nvim/lua/plugins/avante.lua index 186e87a..670ef82 100644 --- a/.config/nvim/lua/plugins/avante.lua +++ b/.config/nvim/lua/plugins/avante.lua @@ -1,102 +1,151 @@ ---@type LazySpec return { - 'yetone/avante.nvim', - event = 'VeryLazy', - version = false, -- set this if you want to always pull the latest change - opts = function() - local identity = vim.fn.expand '$HOME/.config/age/identity.txt' - local secret = vim.fn.expand '$HOME/.config/age/gemini_api.age' - vim.env.GEMINI_API_KEY = require('age').get(secret, identity) -- Get secret - local ollama_setup = { - -- add any opts here - ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string - provider = 'gemini', - vendors = { - ---@type AvanteProvider - ollama = { - ['local'] = true, - endpoint = '127.0.0.1:11434/v1', - model = 'llama3.2', - parse_curl_args = function(opts, code_opts) - return { - url = opts.endpoint .. '/chat/completions', - headers = { - ['Accept'] = 'application/json', - ['Content-Type'] = 'application/json', - }, - body = { - model = opts.model, - messages = require('avante.providers').copilot.parse_message(code_opts), -- you can make your own message, but this is very advanced - max_tokens = 2048, - stream = true, + { + 'yetone/avante.nvim', + event = 'VeryLazy', + version = false, -- set this if you want to always pull the latest change + -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + build = 'make', + opts = function() + local identity = vim.fn.expand '$HOME/.config/age/identity.txt' + local secret = vim.fn.expand '$HOME/.config/age/gemini_api.age' + vim.env.GEMINI_API_KEY = require('age').get(secret, identity) -- Get secret + local ollama_setup = { + -- add any opts here + ---@type Provider + provider = 'gemini', + vendors = { + ---@type AvanteProvider + ollama = { + ['local'] = true, + endpoint = '127.0.0.1:11434/v1', + model = 'llama3.2', + parse_curl_args = function(opts, code_opts) + return { + url = opts.endpoint .. '/chat/completions', + headers = { + ['Accept'] = 'application/json', + ['Content-Type'] = 'application/json', + }, + body = { + model = opts.model, + messages = require('avante.providers').copilot.parse_message(code_opts), -- you can make your own message, but this is very advanced + max_tokens = 2048, + stream = true, + }, + } + end, + parse_response_data = function(data_stream, event_state, opts) + require('avante.providers').openai.parse_response(data_stream, event_state, opts) + end, + }, + }, + } + if not vim.env.GEMINI_API_KEY then + return ollama_setup + end + return { + ---@type Provider + provider = 'gemini', + } + end, + dependencies = { + 'KingMichaelPark/age.nvim', -- Add age dependency + 'nvim-treesitter/nvim-treesitter', + { + 'stevearc/dressing.nvim', + opts = { + select = { + -- Priority list of preferred vim.select implementations + backend = { 'fzf_lua', 'telescope', 'fzf', 'builtin', 'nui' }, + -- Options for fzf-lua + fzf_lua = { + winopts = { + height = 0.5, + width = 0.8, }, - } - end, - parse_response_data = function(data_stream, event_state, opts) - require('avante.providers').openai.parse_response(data_stream, event_state, opts) - end, + }, + }, }, }, - } - if not vim.env.GEMINI_API_KEY then - return ollama_setup - end - return { - ---@type "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string - provider = 'gemini', - } - end, - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - build = 'make', - -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows - dependencies = { - 'KingMichaelPark/age.nvim', -- Add age dependency - 'nvim-treesitter/nvim-treesitter', - { - 'stevearc/dressing.nvim', - opts = { - select = { - -- Priority list of preferred vim.select implementations - backend = { 'fzf_lua', 'telescope', 'fzf', 'builtin', 'nui' }, - -- Options for fzf-lua - fzf_lua = { - winopts = { - height = 0.5, - width = 0.8, + 'nvim-lua/plenary.nvim', + 'MunifTanjim/nui.nvim', + --- The below dependencies are optional, + 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons + 'zbirenbaum/copilot.lua', -- for providers='copilot' + { + -- support for image pasting + 'HakonHarnes/img-clip.nvim', + event = 'VeryLazy', + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, }, + -- required for Windows users + use_absolute_path = true, }, }, }, - }, - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - --- The below dependencies are optional, - 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons - 'zbirenbaum/copilot.lua', -- for providers='copilot' - { - -- support for image pasting - 'HakonHarnes/img-clip.nvim', - event = 'VeryLazy', - opts = { - -- recommended settings - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { - insert_mode = true, - }, - -- required for Windows users - use_absolute_path = true, + { + -- Make sure to set this up properly if you have lazy=true + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { 'markdown', 'Avante' }, }, + ft = { 'markdown', 'Avante' }, }, }, - { - -- Make sure to set this up properly if you have lazy=true - 'MeanderingProgrammer/render-markdown.nvim', - opts = { - file_types = { 'markdown', 'Avante' }, + }, + { + 'olimorris/codecompanion.nvim', + cmd = { + 'CodeCompanion', + 'CodeCompanionChat', + 'CodeCompanionCmd', + 'CodeCompanionActions', + }, + keys = { + { 'cc', 'CodeCompanionChat toggle', desc = 'Chat Toggle', mode = { 'n', 'x' } }, + { 'cA', 'CodeCompanionChat add', desc = 'Chat Add Selection', mode = 'x' }, + { 'ca', 'CodeCompanionActions', desc = 'Chat Actions', mode = { 'n', 'x' } }, + { 'cd', 'CodeCompanionCmd/', desc = 'Chat Cmd' }, + }, + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-treesitter/nvim-treesitter', + 'KingMichaelPark/age.nvim', + { + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { 'markdown', 'Avante', 'codecompanion' }, + }, + ft = { 'markdown', 'Avante', 'codecompanion' }, }, - ft = { 'markdown', 'Avante' }, }, + config = function() + local identity = vim.fn.expand '$HOME/.config/age/identity.txt' + local secret = vim.fn.expand '$HOME/.config/age/glhf.age' + require('codecompanion').setup({ + display = { + chat = { render_headers = false }, + }, + adapters = { + ollama = function() + return require('codecompanion.adapters').extend('openai_compatible', { + env = { + url = 'https://glhf.chat/api/openai/v1', + api_key = require('age').get(secret, identity), -- Get secret -- optional: if your endpoint is authenticated + chat_url = '/chat/completions', + model = 'hf:Qwen/Qwen2.5-Coder-32B-Instruct', + }, + }) + end, + }, + }) + end, }, } diff --git a/.config/nvim/lua/plugins/config/astrolsp.lua b/.config/nvim/lua/plugins/config/astrolsp.lua index bcd6b39..5a53665 100644 --- a/.config/nvim/lua/plugins/config/astrolsp.lua +++ b/.config/nvim/lua/plugins/config/astrolsp.lua @@ -28,7 +28,6 @@ M.opts = { }, }, }, - -- Configure buffer local user commands to add when attaching a language server commands = { Format = { function() @@ -38,35 +37,32 @@ M.opts = { desc = 'Format file with LSP', }, }, - -- Configure default capabilities for language servers (`:h vim.lsp.protocol.make_client.capabilities()`) capabilities = { textDocument = { foldingRange = { dynamicRegistration = false, lineFoldingOnly = true } }, workspace = { didChangeWatchedFiles = vim.fn.has 'nvim-0.10' == 0 and { dynamicRegistration = true }, }, }, - -- Configure language servers for `lspconfig` (`:h lspconfig-setup`) config = { bashls = { settings = { bashIde = { highlightParsingErrors = true } }, }, }, - -- Configuration of mappings added when attaching a language server during the core `on_attach` function - -- The first key into the table is the vim map mode (`:h map-modes`), and the value is a table of entries to be passed to `vim.keymap.set` (`:h vim.keymap.set`): - -- - The key is the first parameter or the vim mode (only a single mode supported) and the value is a table of keymaps within that mode: - -- - The first element with no key in the table is the action (the 2nd parameter) and the rest of the keys/value pairs are options for the third parameter. - -- There is also a special `cond` key which can either be a string of a language server capability or a function with `client` and `bufnr` parameters that returns a boolean of whether or not the mapping is added. mappings = { - -- map mode (:h map-modes) n = { K = { vim.lsp.buf.hover, desc = 'Hover', cond = 'textDocument/hover' }, - gl = { vim.diagnostic.open_float, desc = 'Hover diagnostics' }, + ['le'] = { vim.diagnostic.open_float, desc = 'Hover diagnostics' }, + ['ld'] = { + vim.lsp.buf.definition, + desc = 'Goto definition', + cond = 'textDocument/definition', + }, gd = { vim.lsp.buf.definition, desc = 'Goto definition', cond = 'textDocument/definition', }, - gs = { + ['lo'] = { function() vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, @@ -77,19 +73,19 @@ M.opts = { desc = 'Oraganize imports', cond = 'textDocument/codeAction', }, - gi = { + ['li'] = { vim.lsp.buf.implementation, desc = 'Goto implementation', cond = 'textDocument/implementation', }, -- condition for only server with declaration capabilities - gD = { vim.lsp.buf.declaration, desc = 'Goto Declaration', cond = 'textDocument/declaration' }, - gt = { + ['lD'] = { vim.lsp.buf.declaration, desc = 'Goto Declaration', cond = 'textDocument/declaration' }, + ['lt'] = { vim.lsp.buf.type_definition, desc = 'Type definition', cond = 'textDocument/typeDefinition', }, - ['g='] = { + ['F'] = { function() vim.cmd [[EslintFixAll]] end, @@ -102,6 +98,11 @@ M.opts = { desc = 'Goto references', cond = 'textDocument/references', }, + ['lR'] = { + vim.lsp.buf.references, + desc = 'Goto references', + cond = 'textDocument/references', + }, [']e'] = { function() vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) @@ -122,12 +123,12 @@ M.opts = { vim.diagnostic.goto_prev, desc = 'Goto Next diagnostic', }, - gw = { + ['lw'] = { vim.lsp.buf.document_symbol, desc = 'Document symbols', cond = 'textDocument/documentSymbol', }, - gW = { + ['lW'] = { vim.lsp.buf.workspace_symbol, desc = 'Workspace symbols', cond = 'workspace/symbol', @@ -188,7 +189,6 @@ M.opts = { }, }, }, - handlers = { function(server, opts) local ok, cmp_nvim_lsp = pcall(require, 'cmp_nvim_lsp') diff --git a/.config/nvim/lua/plugins/config/conform.lua b/.config/nvim/lua/plugins/config/conform.lua index e21da5e..19ff5fa 100644 --- a/.config/nvim/lua/plugins/config/conform.lua +++ b/.config/nvim/lua/plugins/config/conform.lua @@ -57,7 +57,7 @@ require('conform').setup({ -- You can use a function here to determine the formatters dynamically python = function(bufnr) if require('conform').get_formatter_info('ruff_format', bufnr).available then - return { 'ruff_format' } + return { 'ruff_format', 'ruff_fix', 'ruff_organize_imports' } else return { 'isort', 'black' } end diff --git a/.config/nvim/lua/plugins/config/dial.lua b/.config/nvim/lua/plugins/config/dial.lua index 2ef068f..b7438a3 100644 --- a/.config/nvim/lua/plugins/config/dial.lua +++ b/.config/nvim/lua/plugins/config/dial.lua @@ -127,15 +127,17 @@ function M.config() local opts = { dials_by_ft = { - css = 'css', - javascript = 'typescript', - javascriptreact = 'typescript', - json = 'json', lua = 'lua', + json = 'json', + jsonc = 'json', + json5 = 'json', markdown = 'markdown', python = 'python', + css = 'css', sass = 'css', scss = 'css', + javascript = 'typescript', + javascriptreact = 'typescript', typescript = 'typescript', typescriptreact = 'typescript', }, @@ -171,6 +173,7 @@ function M.config() }, json = { augend.integer.alias.decimal, -- nonnegative and negative decimal number + augend.constant.alias.bool, -- boolean value (true <-> false) augend.semver.alias.semver, -- versioning (v1.1.2) }, lua = { diff --git a/.config/nvim/lua/plugins/config/tree-sitter.lua b/.config/nvim/lua/plugins/config/tree-sitter.lua index d6d23cc..97e232b 100644 --- a/.config/nvim/lua/plugins/config/tree-sitter.lua +++ b/.config/nvim/lua/plugins/config/tree-sitter.lua @@ -57,6 +57,8 @@ configs.setup({ ['ac'] = '@class.outer', ['ic'] = { query = '@class.inner', desc = 'Select inner part of a class region' }, ['al'] = { query = '@scope', query_group = 'locals', desc = 'Select language scope' }, + ['a/'] = { query = '@comment.outer', desc = 'Select outer comment' }, + ['i/'] = { query = '@comment.inner', desc = 'Select inner comment' }, }, selection_modes = { ['@parameter.outer'] = 'v', -- charwise @@ -70,7 +72,7 @@ configs.setup({ set_jumps = true, -- whether to set jumps in the jumplist goto_next_start = { [']m'] = '@function.outer', - [']]'] = { query = '@class.outer', desc = 'Next class start' }, + [']C'] = { query = '@class.outer', desc = 'Next class start' }, [']l'] = '@loop.*', -- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } [']s'] = { query = '@scope', query_group = 'locals', desc = 'Next scope' }, @@ -82,7 +84,7 @@ configs.setup({ }, goto_previous_start = { ['[m'] = '@function.outer', - ['[['] = '@class.outer', + ['[C'] = '@class.outer', }, goto_previous_end = { ['[M'] = '@function.outer', @@ -98,14 +100,14 @@ configs.setup({ swap = { enable = true, swap_next = { - ['>K'] = { query = '@block.outer', desc = 'Swap next block' }, - ['>F'] = { query = '@function.outer', desc = 'Swap next function' }, - ['>A'] = { query = '@parameter.inner', desc = 'Swap next argument' }, + ['k'] = { query = '@block.outer', desc = 'Swap next block' }, + ['f'] = { query = '@function.outer', desc = 'Swap next function' }, + ['a'] = { query = '@parameter.inner', desc = 'Swap next argument' }, }, swap_previous = { - ['K'] = { query = '@block.outer', desc = 'Swap previous block' }, + ['F'] = { query = '@function.outer', desc = 'Swap previous function' }, + ['A'] = { query = '@parameter.inner', desc = 'Swap previous argument' }, }, }, }, diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua index fc90fc0..373194e 100644 --- a/.config/nvim/lua/plugins/flash.lua +++ b/.config/nvim/lua/plugins/flash.lua @@ -7,8 +7,8 @@ return { }, -- stylua: ignore keys = { - { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - { "S", mode = { "n", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, diff --git a/.config/nvim/lua/plugins/lsp/htmlcss.lua b/.config/nvim/lua/plugins/lsp/htmlcss.lua index c04e7f1..b103334 100644 --- a/.config/nvim/lua/plugins/lsp/htmlcss.lua +++ b/.config/nvim/lua/plugins/lsp/htmlcss.lua @@ -68,15 +68,18 @@ return { emmet_language_server = { filetypes = { 'css', + 'less', + 'sass', + 'scss', 'eruby', 'html', 'htmldjango', - 'less', 'pug', - 'sass', - 'scss', 'heex', 'blade', + 'vue', + 'svelte', + 'astro', 'javascriptreact', 'typescriptreact', }, diff --git a/.config/nvim/lua/plugins/mini/ai.lua b/.config/nvim/lua/plugins/mini/ai.lua new file mode 100644 index 0000000..4c32bad --- /dev/null +++ b/.config/nvim/lua/plugins/mini/ai.lua @@ -0,0 +1,39 @@ +---@type LazySpec +return { + 'echasnovski/mini.ai', + version = '*', + event = { 'BufReadPost', 'BufNewFile' }, + enabled = false, + dependencies = { + { + 'echasnovski/mini.extra', + version = '*', + opts = {}, + config = function() + require('mini.extra').setup() + end, + }, + }, + opts = function() + local ai = require 'mini.ai' + local gen_ai_spec = require('mini.extra').gen_ai_spec + return { + search_method = 'cover_or_prev', + n_lines = 100, + o = ai.gen_spec.treesitter({ -- code block + a = { '@block.outer', '@conditional.outer', '@loop.outer' }, + i = { '@block.inner', '@conditional.inner', '@loop.inner' }, + }), + f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }), -- function + c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }), -- class + t = { '<([%p%w]-)%f[^<%w][^<>]->.-', '^<.->().*()$' }, -- tags + B = gen_ai_spec.buffer(), + D = gen_ai_spec.diagnostic(), + L = gen_ai_spec.line(), + } + end, + config = function(_, opts) + vim.print(opts) + require('mini.ai').setup(opts) + end, +} diff --git a/.config/nvim/lua/plugins/mini/operators.lua b/.config/nvim/lua/plugins/mini/operators.lua new file mode 100644 index 0000000..93e178e --- /dev/null +++ b/.config/nvim/lua/plugins/mini/operators.lua @@ -0,0 +1,21 @@ +---@type LazySpec +return { + 'echasnovski/mini.operators', + version = '*', + enabled = true, + keys = { + { 'g=', mode = { 'n', 'x' }, desc = 'Evalute' }, + { 'ge', mode = { 'n', 'x' }, desc = 'Exchange' }, + { 'gm', mode = { 'n', 'x' }, desc = 'Duplicate' }, + { 'gR', mode = { 'n', 'x' }, desc = 'Replace with register' }, + { 'gs', mode = { 'n', 'x' }, desc = 'Sort' }, + }, + opts = { + -- Exchange text regions + exchange = { prefix = 'ge' }, + replace = { prefix = 'gR' }, + }, + config = function(_, opts) + require('mini.operators').setup(opts) + end, +} diff --git a/.config/nvim/lua/plugins/mini/surround.lua b/.config/nvim/lua/plugins/mini/surround.lua new file mode 100644 index 0000000..f6564e5 --- /dev/null +++ b/.config/nvim/lua/plugins/mini/surround.lua @@ -0,0 +1,20 @@ +---@type LazySpec +return { + 'echasnovski/mini.surround', + version = '*', + enabled = false, + keys = { + { 'sa', mode = { 'n', 'v' }, desc = 'Surround add' }, + { 'sd', mode = { 'n' }, desc = 'Surround delete' }, + { 'sr', mode = { 'n' }, desc = 'Surround replace' }, + { 'sf', mode = { 'n' }, desc = 'Surround find' }, + { 'sh', mode = { 'n' }, desc = 'Surround highlight' }, + }, + opts = { + search_method = 'cover_or_prev', + n_lines = 200, + }, + config = function(_, opts) + require('mini.surround').setup(opts) + end, +} diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua index 73997b2..9d433e4 100644 --- a/.config/nvim/lua/plugins/neogit.lua +++ b/.config/nvim/lua/plugins/neogit.lua @@ -3,12 +3,11 @@ return { cmd = 'Neogit', keys = { { 'og', 'Neogit', desc = 'Neogit' }, + { 'gn', 'Neogit', desc = 'Neogit' }, }, dependencies = { 'nvim-lua/plenary.nvim', -- required { 'sindrets/diffview.nvim', cmd = 'DiffviewOpen', opts = {} }, -- optional - Diff integration - -- Only one of these is needed, not both. - 'nvim-telescope/telescope.nvim', -- optional }, opts = { telescope_sorter = function() diff --git a/.config/nvim/lua/plugins/surround.lua b/.config/nvim/lua/plugins/surround.lua index 18a6407..b07cbb7 100644 --- a/.config/nvim/lua/plugins/surround.lua +++ b/.config/nvim/lua/plugins/surround.lua @@ -1,5 +1,7 @@ +---@type LazySpec return { 'kylechui/nvim-surround', + enabled = true, config = true, -- config = function() -- require("nvim-surround").setup() diff --git a/.config/nvim/lua/plugins/tree-sitter.lua b/.config/nvim/lua/plugins/tree-sitter.lua index 57e4080..1d5011d 100644 --- a/.config/nvim/lua/plugins/tree-sitter.lua +++ b/.config/nvim/lua/plugins/tree-sitter.lua @@ -1,42 +1,26 @@ return { - { - 'nvim-treesitter/nvim-treesitter', - event = { 'BufReadPre', 'BufNewFile' }, - lazy = vim.fn.argc(-1) == 0, - version = false, -- last release is way too old and doesn't work on Windows - build = ':TSUpdate', - init = function() - require 'nvim-treesitter.query_predicates' - end, - cmd = { 'TSUpdateSync', 'TSUpdate', 'TSInstall' }, - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - 'andymass/vim-matchup', - 'windwp/nvim-ts-autotag', - { - 'nvim-treesitter/nvim-treesitter-context', - opts = { - mode = 'cursor', - max_lines = 3, - }, + 'nvim-treesitter/nvim-treesitter', + event = { 'BufReadPre', 'BufNewFile' }, + lazy = vim.fn.argc(-1) == 0, + version = false, -- last release is way too old and doesn't work on Windows + build = ':TSUpdate', + init = function() + require 'nvim-treesitter.query_predicates' + end, + cmd = { 'TSUpdateSync', 'TSUpdate', 'TSInstall' }, + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + 'andymass/vim-matchup', + 'windwp/nvim-ts-autotag', + { + 'nvim-treesitter/nvim-treesitter-context', + opts = { + mode = 'cursor', + max_lines = 3, }, }, - config = function() - require 'plugins.config.tree-sitter' - end, }, - -- { - -- 'windwp/nvim-ts-autotag', - -- event = { 'BufReadPre', 'BufNewFile' }, - -- config = function() - -- require('nvim-ts-autotag').setup({ - -- -- Defaults - -- opts = { - -- enable_close = true, -- Auto close tags - -- enable_rename = true, -- Auto rename pairs of tags - -- enable_close_on_slash = false, -- Auto close on trailing ", lazy.spawn("flameshot gui"), desc="Take screenshot(FULL)"), Key("S-", lazy.spawn("flameshot full"), desc="Take screenshot(FOCUS)"), diff --git a/.config/ripgreprc b/.config/ripgreprc index 784a15b..50328e8 100644 --- a/.config/ripgreprc +++ b/.config/ripgreprc @@ -9,7 +9,7 @@ test:*.spec.ts,*.spec.js,*.jest.ts,*.jest.js,*.spec.tsx,*.spec.jsx,*.jest.tsx,*. vue:*.vue --type-add -svelte:*.svelte +svelte:*.svelte,*.svelte.ts --type-add prisma:*.prisma diff --git a/.config/sxhkd/dwm_sxhkdrc b/.config/sxhkd/dwm_sxhkdrc index 78698e7..992e57c 100755 --- a/.config/sxhkd/dwm_sxhkdrc +++ b/.config/sxhkd/dwm_sxhkdrc @@ -24,7 +24,7 @@ super + alt + {c,g} {open-rcs,open-games} control + alt + {p,c,v,e} - {get-class-name,xcolor -s,pavucontrol || pavucontrol-qt,rofie} + {get-class-name,sh -c 'xcolor -s && notify-send "Color Copied" "Hex: $(xclip -o -sel clip) copied to clipboard"',pavucontrol || pavucontrol-qt,rofie} super + control + {s,l,m} {logout_prompt,betterlockscreen -l,load_monitors} diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 609a6b1..1e1780d 100755 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -38,7 +38,7 @@ super + alt + {c,g} flameshot {gui,full,launcher} || notify-send "Failed" "Flameshot is not installed." -u critical control + alt + {p,c,v,e} - {get-class-name,xcolor -s,pavucontrol || pavucontrol-qt,rofie} + {get-class-name,sh -c 'xcolor -s && notify-send "Color Copied" "Hex: $(xclip -o -sel clip) copied to clipboard"',pavucontrol || pavucontrol-qt,rofie} super +{_,shift + } Escape {pkill -USR1 -x sxhkd && notify-send -t 1000 "BSPWM" "SXHKD Restarted",xkill}