From 20d36577c46b2b3fc7ed2ddb0bfae61f4338a37b Mon Sep 17 00:00:00 2001 From: subcrip Date: Tue, 2 Jul 2024 14:53:19 +0800 Subject: [PATCH] backup --- hypr/hyprland.conf | 9 +-- nvim/lazy-lock.json | 40 ++++++------- nvim/lua/config.lua | 135 +++++++++++++++++++++++--------------------- 3 files changed, 96 insertions(+), 88 deletions(-) diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 9b244ef..b32c0e5 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -75,8 +75,8 @@ env = XDG_SESSION_DESKTOP,wayland env = EDITOR,vim env = MOZ_ENABLE_WAYLAND,1 # env = GDK_BACKEND,"wayland,x11" -# env = QT_QPA_PLATFORM,wayland;xcb -env = QT_QPA_PLATFORM,"wayland;xcb" +env = QT_QPA_PLATFORM,wayland;xcb +# env = QT_QPA_PLATFORM,"wayland;xcb" env = QT_QPA_PLATFORMTHEME,qt5ct env = QT_AUTO_SCREEN_SCALE_FACTOR,1 # env = QT_SCALE_FACTOR,1.2 @@ -162,7 +162,7 @@ dwindle { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { - new_is_master = true + new_status = master } # https://wiki.hyprland.org/Configuring/Variables/#misc @@ -295,7 +295,7 @@ bind = , PRINT, exec, hyprshot -m output bind = $mainMod SHIFT, S, exec, hyprshot -m region # Session Lock -bindr= $mainMod, L, exec, swaylock -c 000000 +bindr= $mainMod, L, exec, swaylock -c 00000000 ############################## ### WINDOWS AND WORKSPACES ### @@ -327,3 +327,4 @@ device { transform=0 output=HDMI-A-1 } + diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 1134789..2940f27 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,9 +1,9 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" }, + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "NeoColumn.nvim": { "branch": "main", "commit": "db7695c7c70fcacd290712deef659bca464634ee" }, "actions-preview.nvim": { "branch": "master", "commit": "9f52a01c374318e91337697ebed51c6fae57f8a4" }, - "arshamiser.nvim": { "branch": "dev", "commit": "53a73d60d426cb17860d4de169bce00ec3996c16" }, + "arshamiser.nvim": { "branch": "dev", "commit": "b6e08be110536725121e782535365dfc7f3ae246" }, "arshlib.nvim": { "branch": "master", "commit": "111fd439268adda206a24b133096893869a50764" }, "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, "barbar.nvim": { "branch": "master", "commit": "79f7d16578a167bdf5355725551ef7d90613a601" }, @@ -23,21 +23,21 @@ "eslint.nvim": { "branch": "main", "commit": "158f2289907d377018752fcfe0d61b746dc11767" }, "feline.nvim": { "branch": "master", "commit": "3587f57480b88e8009df7b36dc84e9c7ff8f2c49" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "fzf-lua": { "branch": "main", "commit": "1ec6eeda11c3a3dcd544e1c61ad4b8c9b49903c4" }, + "fzf-lua": { "branch": "main", "commit": "41ea49cfc1b3f0586753bbeb7850474f28dc22cf" }, "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, - "gitsigns.nvim": { "branch": "main", "commit": "8df63f2ddc615feb71fd4aee45a4cee022876df1" }, - "goto-preview": { "branch": "main", "commit": "3552fad4a0244ffd9ac86508e29ccc5166f19eb8" }, + "gitsigns.nvim": { "branch": "main", "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, + "goto-preview": { "branch": "main", "commit": "1519ea3512828c944eed5b2bbb66a8f8deb92447" }, "haskell-vim": { "branch": "master", "commit": "f35d02204b4813d1dbe8b0e98cc39701a4b8e15e" }, "heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" }, - "hlargs.nvim": { "branch": "main", "commit": "30fe1b3de2b7614f061be4fc9c71984a2b87e50a" }, + "hlargs.nvim": { "branch": "main", "commit": "cc0d9ee75e5ffba730393049119361b9e3a5b1b6" }, "hop.nvim": { "branch": "master", "commit": "036462a345792279c58f2f6445756efab706f04a" }, - "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, - "lazy.nvim": { "branch": "main", "commit": "4ea9fe060042f345960ad0c01aa7bca91405e10a" }, - "lazydev.nvim": { "branch": "main", "commit": "6184ebbbc8045d70077659b7d30c705a588dc62f" }, - "legendary.nvim": { "branch": "master", "commit": "89e0d00c5aed623c1f29cf2a963fd1737358e92a" }, + "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, + "lazy.nvim": { "branch": "main", "commit": "a9d7ade203b3f3ee3058c082c62afdf8e4bcb416" }, + "lazydev.nvim": { "branch": "main", "commit": "78d8a11fbd02ad4eafa07dd8a43a959a69fb3bf8" }, + "legendary.nvim": { "branch": "master", "commit": "847af406e688e172934ec91ba12088ffcd497e1f" }, "listish.nvim": { "branch": "master", "commit": "3bc4bb02036f3802c6428c6232633d3192ac3604" }, "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, - "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, + "lspkind.nvim": { "branch": "master", "commit": "67ec67c68f05ca41dab0d426c9e7c94ad86085f9" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown-toc.nvim": { "branch": "main", "commit": "fc95e8e305273d4a864abab05fc63885bb1a336f" }, @@ -46,20 +46,20 @@ "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "melange-nvim": { "branch": "master", "commit": "800490ee87ce3e1b4afe751ff81f2864cb01937d" }, "modicator.nvim": { "branch": "main", "commit": "d1d327fd4bdfc3af4cfdf83b85c2eaefa71de7a8" }, - "neogit": { "branch": "master", "commit": "11dea1b67bb153cd5b4a2de348ceefa69508dfce" }, + "neogit": { "branch": "master", "commit": "1838cd1e9641903815cdc4a35f6ccb5bd4cf886e" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-lspconfig": { "branch": "master", "commit": "0630abde4d99740773b6f7da70937268c20854a4" }, + "nvim-lspconfig": { "branch": "master", "commit": "7edfd6692ba17f8d4fe08d84142781898ab0a672" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-neoclip.lua": { "branch": "main", "commit": "709c97fabec9da7d04f7d2f5e207423af8c02871" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-numbertoggle": { "branch": "main", "commit": "c5827153f8a955886f1b38eaea6998c067d2992f" }, "nvim-origami": { "branch": "main", "commit": "c824f470e0c177707822c37b13087ab1dd7ddf91" }, - "nvim-surround": { "branch": "main", "commit": "687ea2f33955df0042bf228853a82696265e7e2d" }, - "nvim-treesitter": { "branch": "master", "commit": "122b4d3db1616c1f1305b847c5ed2217c4c329f1" }, - "nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" }, + "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "nvim-treesitter": { "branch": "master", "commit": "7ff0b8d3d21b15eb7231fcbd2acfded8987f5efd" }, + "nvim-treesitter-context": { "branch": "master", "commit": "1b9c756c0cad415f0a2661c858448189dd120c15" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, @@ -78,18 +78,18 @@ "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, "telescope-git-file-history.nvim": { "branch": "master", "commit": "f94fab1d5a51fa28dd95b1a6bd377505dc1a8e82" }, - "telescope-undo.nvim": { "branch": "main", "commit": "95b61c01ea3a4c9e8747731148e905bbcf0ccaee" }, + "telescope-undo.nvim": { "branch": "main", "commit": "51be9ae7c42fc27c0b05505e3a0162e0f05fbb6a" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" }, "todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" }, - "trouble.nvim": { "branch": "main", "commit": "57761ba7148164f0315ed203e714ac242329abd4" }, + "trouble.nvim": { "branch": "main", "commit": "e5d0e04121c662ce29190a57dd03655d43c59d44" }, "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" }, "vim-cursorword": { "branch": "master", "commit": "34852083276c1fd9ff4cccaf052111e7d5a2472e" }, - "vim-fugitive": { "branch": "master", "commit": "64d6cafb9dcbacce18c26d7daf617ebb96b273f3" }, + "vim-fugitive": { "branch": "master", "commit": "d0c1a437536778bcc8174b7cb2ffdf98f611e6fe" }, "vim-markdown": { "branch": "master", "commit": "a657e697376909c41475a686eeef7fc7a4972d94" }, "vim-obsession": { "branch": "master", "commit": "fe9d3e1a9a50171e7d316a52e1e56d868e4c1fe5" }, "vim-prosession": { "branch": "master", "commit": "4b8323d4e9b74afe9132a34b2d7ea6cfa9461550" }, - "vim-visual-multi": { "branch": "master", "commit": "b84a6d42c1c10678928b0bf8327f378c8bc8af5a" }, + "vim-visual-multi": { "branch": "master", "commit": "525521677deb8401b62054bbbbc9b17f8486de3d" }, "vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" }, "vim-wakatime": { "branch": "master", "commit": "3cb40867cb5a3120f9bef76eff88edc7f1dc1a23" }, "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } diff --git a/nvim/lua/config.lua b/nvim/lua/config.lua index 12aacbb..926f456 100644 --- a/nvim/lua/config.lua +++ b/nvim/lua/config.lua @@ -36,7 +36,6 @@ vim.diagnostic.config({ }) vim.cmd([[au CursorHold * lua vim.diagnostic.open_float(0,{scope = "cursor"})]]) vim.g.mapleader = " "; -vim.g['cph#dir'] = '/home/user/RustIsBestLang/'; vim.filetype.add({ extension = { ct = 'cpp', @@ -44,7 +43,7 @@ vim.filetype.add({ }) local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then +if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ "git", "clone", @@ -203,7 +202,8 @@ local plugins = { lazy = false, }, { - 'onsails/lspkind.nvim' -- icon in completion menu + -- dir = "/home/user/lspkind.nvim/", + 'arielherself/lspkind.nvim' -- icon in completion menu }, { 'MunifTanjim/eslint.nvim', @@ -344,7 +344,7 @@ local plugins = { ft = "lua", -- only load on lua files opts = { library = { - -- vim.env.LAZY .. "/luvit-meta/library", -- see below + -- lazypath .. "/luvit-meta/library", -- see below -- You can also add plugins you always want to have loaded. -- Useful if the plugin has globals or types you want to use -- vim.env.LAZY .. "/LazyVim", -- see below @@ -458,7 +458,7 @@ require('search').setup { append_tabs = { { 'Symbols', - builtin.lsp_workspace_symbols, + builtin.lsp_dynamic_workspace_symbols, }, { 'Commits', @@ -541,54 +541,58 @@ local feedkey = function(key, mode) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end -cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.confirm({ select = true }) - elseif luasnip_status and luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), +local ELLIPSIS_CHAR = '…' +local MAX_LABEL_WIDTH = 20 +local MIN_LABEL_WIDTH = 20 - [""] = cmp.mapping(function() - if cmp.visible() then - cmp.select_prev_item() - elseif vim.fn["vsnip#jumpable"](-1) == 1 then - feedkey("(vsnip-jump-prev)", "") - end - end, { "i", "s" }), +cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.confirm({ select = true }) + elseif luasnip_status and luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.abort(), - }, - -- sources for autocompletion - sources = cmp.config.sources({ - { name = "cody" }, - { - name = "nvim_lsp", - option = { - markdown_oxide = { keyword_pattern = [[\(\k\| \|\/\|#\)\+]] } - } - }, -- LSP - { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within the current buffer - { name = "path" }, -- file system paths - { name = "emoji" }, - { name = "nerdfont" }, - { name = "calc" }, - }), -}) + [""] = cmp.mapping(function() + if cmp.visible() then + cmp.select_prev_item() + elseif vim.fn["vsnip#jumpable"](-1) == 1 then + feedkey("(vsnip-jump-prev)", "") + end + end, { "i", "s" }), + + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.abort(), + }, + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "cody" }, + { + name = "nvim_lsp", + option = { + markdown_oxide = { keyword_pattern = [[\(\k\| \|\/\|#\)\+]] } + } + }, -- LSP + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within the current buffer + { name = "path" }, -- file system paths + { name = "emoji" }, + { name = "nerdfont" }, + { name = "calc" }, + }), +} -- Setup language servers. local lspconfig = require('lspconfig') @@ -883,27 +887,28 @@ local types = require("cmp.types") local lspkind = require('lspkind') cmp.setup { formatting = { + fields = { cmp.ItemField.Abbr, cmp.ItemField.Kind, cmp.ItemField.Menu }, format = lspkind.cmp_format({ - mode = 'symbol', -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + mode = 'symbol_text', -- show only symbol annotations + maxwidth = 30, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) -- can also be a function to dynamically calculate max width such as -- maxwidth = function() return math.floor(0.45 * vim.o.columns) end, - ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) show_labelDetails = true, -- show labelDetails in menu. Disabled by default -- The function below will be called before any actual modifications from lspkind -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) before = function (entry, vim_item) - local word = entry:get_insert_text() - if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then - word = word - -- word = vim.lsp.util.parse_snippet(word) - end - word = str.oneline(word) - if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet and string.sub(vim_item.abbr, -1, -1) == "~" then - word = word .. "~" - end - vim_item.abbr = word + -- local word = entry:get_insert_text() + -- if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then + -- word = word + -- -- word = vim.lsp.util.parse_snippet(word) + -- end + -- word = str.oneline(word) + -- if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet and string.sub(vim_item.abbr, -1, -1) == "~" then + -- word = word .. "~" + -- end + -- vim_item.abbr = word return vim_item end }) @@ -1099,3 +1104,5 @@ vim.env.SRC_ENDPOINT = 'https://sourcegraph.com/' vim.env.SRC_ACCESS_TOKEN = '' -- TODO: fill in the token before using it require('sg').setup {} + +-- vim.diagnostic.config({ virtual_text = false })