From c5d0e48e20be63146c5aac729da4d231ca3629f8 Mon Sep 17 00:00:00 2001 From: Seymur Bagirov Date: Sun, 14 Apr 2024 21:29:28 +0400 Subject: [PATCH] add sql support to neovim and add misc changes to other stuff sql supported by these plugins: vim-dadbod vim-dadbod-ui vim-dadbod-completions --- hypr/autostart.conf | 2 + hypr/hyprland.conf | 4 +- hypr/plugins.conf | 17 +++--- hypr/wallpaper.conf | 2 +- kitty/kitty.conf | 2 +- nvim/lazy-lock.json | 64 ++++++++++++----------- nvim/lua/themystery/plugins/dap.lua | 2 +- nvim/lua/themystery/plugins/init.lua | 5 ++ nvim/lua/themystery/plugins/sql.lua | 62 ++++++++++++++++++++++ nvim/lua/themystery/plugins/telescope.lua | 1 + waybar/config.jsonc | 6 +-- zsh/.profile | 1 + zsh/.zshrc | 2 +- 13 files changed, 120 insertions(+), 50 deletions(-) create mode 100644 nvim/lua/themystery/plugins/sql.lua diff --git a/hypr/autostart.conf b/hypr/autostart.conf index 9bc3e3d..d6cc2e4 100755 --- a/hypr/autostart.conf +++ b/hypr/autostart.conf @@ -11,6 +11,7 @@ exec-once=solaar --window=hide exec-once=blueman-applet exec-once=gio launch ~/.local/share/applications/vesktop.desktop exec-once=hypridle +exec-once=qbittorrent-nox # exec-once=wallengine --screen-root HDMI-A-2 1383845959 # exec-once=/home/themystery/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox @@ -34,4 +35,5 @@ env = WLR_DRM_NO_ATOMIC, 1 env = DOTNET_CLI_TELEMETRY_OPTOUT, true source = ~/.config/hypr/nvidia.conf windowrulev2 = immediate, title:^(Overwatch)$ +windowrulev2 = immediate, class:^(cs2)$ windowrulev2 = immediate, class:^(steam_app_1088710)$ diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 7a74a79..6341d8f 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -12,9 +12,9 @@ monitor=,preferred,auto,auto # xwaylandvideobridge hiding windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ windowrulev2 = noanim,class:^(xwaylandvideobridge)$ -windowrulev2 = nofocus,class:^(xwaylandvideobridge)$ windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ - +windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ +windowrulev2 = noblur,class:^(xwaylandvideobridge)$ diff --git a/hypr/plugins.conf b/hypr/plugins.conf index 6bd03e5..8ce9a7b 100644 --- a/hypr/plugins.conf +++ b/hypr/plugins.conf @@ -1,4 +1,4 @@ -# exec-once = hyprpm reload -n +exec-once = hyprpm reload -n # keymaps @@ -9,15 +9,10 @@ # plugin config plugin { - hycov { - enable_hotarea = 0 - } + csgo-vulkan-fix { + res_w = 1920, + res_h = 1080, - hyev { - open_window = play -v 0.4 ~/hyev-sound/add.wav - close_window = play -v 0.4 ~/hyev-sound/remove.wav - change_workspace = play -v 0.3 ~/hyev-sound/change_workspace.wav - fullscreen_on = play -v 0.4 ~/hyev-sound/fullscreen.wav - fullscreen_off = play -v 0.4 ~/hyev-sound/tile.wav - } + class = cs2 + } } diff --git a/hypr/wallpaper.conf b/hypr/wallpaper.conf index 0101c80..82a00b4 100644 --- a/hypr/wallpaper.conf +++ b/hypr/wallpaper.conf @@ -5,7 +5,7 @@ # exec-once = mpvpaper -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers.com-ADDED-Mercy-Overwatch.mp4 # exec-once = mpvpaper -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers-com-Rainy-Train-Station-4K.mp4 # exec-once = mpvpaper -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers-com-Night-Italian-Cafe-4K.mp4 -# exec = mpvpaper -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers-com-Winter-City-4K.mp4 +# exec = mpvpaper -p -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers-com-Rainy-Train-Station-4K.mp4 exec-once = swww init diff --git a/kitty/kitty.conf b/kitty/kitty.conf index ac66256..0afcd7c 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -2032,7 +2032,7 @@ map ctrl+v paste_from_clipboard #: New tab map kitty_mod+t new_tab_with_cwd -# map cmd+t new_tab +map ctrl+alt+t new_tab #: Close tab diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 0d256b2..c5e843d 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,55 +1,59 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "Ionide-vim": { "branch": "master", "commit": "8435bae84b26b602dbb68399661b3989915cc4d3" }, "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, - "cloak.nvim": { "branch": "main", "commit": "462e84e1659d984196d09f7d16690b19b9aee804" }, + "cloak.nvim": { "branch": "main", "commit": "6e5bcd50bebc5cdb7cd3a00eb3d97ab7c4cc3b94" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "codesnap.nvim": { "branch": "main", "commit": "53b3d2544a3219d9774c3234f1fb34949b7be6b3" }, + "codesnap.nvim": { "branch": "main", "commit": "70f1ff882c28fb5b86c56146cb0c1f00597451ba" }, "copilot.vim": { "branch": "release", "commit": "9484e35cf222e9360e05450622a884f95c662c4c" }, "csharpls-extended-lsp.nvim": { "branch": "master", "commit": "bde4aebe0dc74952188c2130c6831a1d8e4ce5c6" }, "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, - "gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" }, + "gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" }, "harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, + "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, "image.nvim": { "branch": "master", "commit": "0dd8bdbb8855bc98c534a902c91dc9eddb8155b1" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "kitty-scrollback.nvim": { "branch": "main", "commit": "af95c02d558216202639609a56123fed9d8fb193" }, - "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" }, - "leap.nvim": { "branch": "main", "commit": "1f7c33f7c8fcad27c3da71a20c804931b8996f75" }, - "lsp-zero.nvim": { "branch": "v3.x", "commit": "14c9164413df4be17a5a0ca9e01a376691cbcaef" }, - "lualine.nvim": { "branch": "master", "commit": "af4c3cf17206810880d2a93562e0a4c0d901c684" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1bed24274d911bb3ed730c516ffce27e8fdeeac3" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "742db4e60c74e5fbcc596aaf9e7575e1342dfd09" }, - "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, - "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, - "nui.nvim": { "branch": "main", "commit": "3dc46d725f7b94bee5117c0a699b57b1902b5d65" }, - "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-dap": { "branch": "master", "commit": "c43c2473ecb482a9d91f32c1d4c0098fffad3c7d" }, - "nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" }, + "kitty-scrollback.nvim": { "branch": "main", "commit": "74d46367f91ebb0ed4591435095972489ec6bb5b" }, + "lazy.nvim": { "branch": "main", "commit": "08954f723bf2d442ea020551e3acc956f4dc6dc7" }, + "leap.nvim": { "branch": "main", "commit": "25753d8a16b69fbbce5d392702c21dbc79d86bd1" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "2b5e9a39b3bf60bfb0cc7c35d5f2e879d4cd72ea" }, + "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "8afbb06081ce1e4beb5b18945d14a608b10babeb" }, + "neodev.nvim": { "branch": "main", "commit": "6a533ed9d3435dcaa456380d833ea04da37ea2ed" }, + "noice.nvim": { "branch": "main", "commit": "d29b26c329558ee4bb2e7f3cc25078929ef89b2f" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, + "nvim-cmp": { "branch": "main", "commit": "97dc716fc914c46577a4f254035ebef1aa72558a" }, + "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, + "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, - "nvim-lspconfig": { "branch": "master", "commit": "4bdd3800b4148f670c6cf55ef65f490148eeb550" }, + "nvim-lspconfig": { "branch": "master", "commit": "6e5c78ebc9936ca74add66bda22c566f951b6ee5" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, + "nvim-nio": { "branch": "master", "commit": "33c62b3eadd8154169e42144de16ba4db6784bec" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-treesitter": { "branch": "master", "commit": "f87882858438834d2fbb6379aa2be37de901751b" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" }, + "nvim-treesitter": { "branch": "master", "commit": "aa31b8d4ccaa05e1ab30120e103f72adbd2837bc" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ufo": { "branch": "main", "commit": "7b14dd650b57291a49f037f1ede325d46e08b258" }, - "nvim-web-devicons": { "branch": "master", "commit": "a851380fbea4c1312d11f13d5cdc86a7a19808dd" }, - "onedarkpro.nvim": { "branch": "main", "commit": "e4fc3641aa3b52e30496bf34b87f70ef5506686e" }, - "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, + "nvim-ufo": { "branch": "main", "commit": "458aa4451b98614cfab6b3d7beddc8caff5e3052" }, + "nvim-web-devicons": { "branch": "master", "commit": "6662f059bf78e6092ba90cd1929599625f448f55" }, + "onedarkpro.nvim": { "branch": "main", "commit": "9cb77d936fd42c2c98becceb0f132df170d4eba0" }, + "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "cfc3f53cfa0fbabd95bd33747288aea24fe45211" }, - "rustaceanvim": { "branch": "master", "commit": "69a22c2ec63ab375190006751562b62ebb318250" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "580bc045c7ab3ab3ebd267774038c0d8cc19c789" }, + "rustaceanvim": { "branch": "master", "commit": "ff658ba1da85498135e02300797466a447754ff0" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "e9e01d699843af530ef4ad2c8679a7e273bb3dd1" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" }, - "vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" }, + "vim-dadbod": { "branch": "master", "commit": "960bbb7de11b7282a68d579a64e838b487934493" }, + "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, + "vim-dadbod-ui": { "branch": "master", "commit": "066922699bdf1c6e14d517b844454b12b93ce25a" }, + "vim-fugitive": { "branch": "master", "commit": "193ba9b393931bad768c1d2eed688b0bcc240858" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" } } \ No newline at end of file diff --git a/nvim/lua/themystery/plugins/dap.lua b/nvim/lua/themystery/plugins/dap.lua index 663d505..54b28ee 100644 --- a/nvim/lua/themystery/plugins/dap.lua +++ b/nvim/lua/themystery/plugins/dap.lua @@ -1,6 +1,6 @@ return { "rcarriga/nvim-dap-ui", - dependencies = { "mfussenegger/nvim-dap" }, + dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, config = function() -- dap keymaps vim.keymap.set("n", "", "lua require'dap'.continue()") diff --git a/nvim/lua/themystery/plugins/init.lua b/nvim/lua/themystery/plugins/init.lua index a22e68e..341e839 100644 --- a/nvim/lua/themystery/plugins/init.lua +++ b/nvim/lua/themystery/plugins/init.lua @@ -55,4 +55,9 @@ return { }, "SmiteshP/nvim-navic", "Decodetalkers/csharpls-extended-lsp.nvim", + { + "lukas-reineke/headlines.nvim", + dependencies = "nvim-treesitter/nvim-treesitter", + config = true, -- or `opts = {}` + } } diff --git a/nvim/lua/themystery/plugins/sql.lua b/nvim/lua/themystery/plugins/sql.lua new file mode 100644 index 0000000..321509e --- /dev/null +++ b/nvim/lua/themystery/plugins/sql.lua @@ -0,0 +1,62 @@ +local sql_ft = { "sql", "mysql", "plsql" } +return { + { + 'kristijanhusak/vim-dadbod-completion', + ft = sql_ft, + requires = { 'kristijanhusak/vim-dadbod', lazy = true}, + lazy = true, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "sql", + }, + command = [[setlocal omnifunc=vim_dadbod_completion#omni]], + }) + local autocomplete_group = vim.api.nvim_create_augroup("vimrc_autocompletion", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + pattern = sql_ft, + callback = function() + local cmp = require("cmp") + local global_sources = cmp.get_config().sources + local buffer_sources = {} + + -- add globally defined sources (see separate nvim-cmp config) + -- this makes e.g. luasnip snippets available since luasnip is configured globally + if global_sources then + for _, source in ipairs(global_sources) do + table.insert(buffer_sources, { name = source.name }) + end + end + + -- add vim-dadbod-completion source + table.insert(buffer_sources, { name = "vim-dadbod-completion" }) + + -- update sources for the current buffer + cmp.setup.buffer({ sources = buffer_sources }) + end, + group = autocomplete_group, + }) + end + }, + { + 'kristijanhusak/vim-dadbod-ui', + dependencies = + { + { 'tpope/vim-dadbod', lazy = true }, + -- { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, + -- {'hrsh7th/nvim-cmp'} + {'kristijanhusak/vim-dadbod-completion'}, + }, + cmd = { + 'DBUI', + 'DBUIToggle', + 'DBUIAddConnection', + 'DBUIFindBuffer', + }, + init = function() + -- Your DBUI configuration + vim.g.db_ui_use_nerd_fonts = 1 + vim.g.db_ui_save_location = vim.fn.stdpath("data") .. "/db_ui" + end, + } +} diff --git a/nvim/lua/themystery/plugins/telescope.lua b/nvim/lua/themystery/plugins/telescope.lua index 8502487..b6cc526 100644 --- a/nvim/lua/themystery/plugins/telescope.lua +++ b/nvim/lua/themystery/plugins/telescope.lua @@ -1,5 +1,6 @@ return { "nvim-telescope/telescope.nvim", + branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim" diff --git a/waybar/config.jsonc b/waybar/config.jsonc index 8a04af9..76b22ae 100755 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -219,11 +219,11 @@ "interval": 10 }, "cpu": { - "format": "{usage}% ", + "format": " {usage}%", "tooltip": true }, "memory": { - "format": "{}% " + "format": " {}%" }, "tray": { // "icon-size": 21, @@ -289,7 +289,7 @@ }, "custom/gpu-usage": { "exec": "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits", - "format": "{}% G", + "format": "G {}%", "return-type": "", "interval": 3 }, diff --git a/zsh/.profile b/zsh/.profile index 02713b5..c2e9b5f 100644 --- a/zsh/.profile +++ b/zsh/.profile @@ -167,3 +167,4 @@ alias tgwaybar="killall -SIGUSR1 waybar" alias rwaybar="killall -SIGUSR2 waybar" alias ls="lsd" alias sl="sl -e -d" +alias s="kitten ssh" diff --git a/zsh/.zshrc b/zsh/.zshrc index bfdba05..ff055be 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -72,6 +72,6 @@ export PATH="$HOME/go/bin:$PATH" # bun export BUN_INSTALL="$HOME/.bun" export PATH="$BUN_INSTALL/bin:$PATH" - +export FP='fzf --preview "bat --style=numbers --color=always --line-range :500 {}"'