This commit is contained in:
subcrip 2024-05-31 00:05:21 +08:00
parent 98a9b2ebf4
commit c59412977a
Signed by: subcrip
SSH Key Fingerprint: SHA256:dFPFi68d8C87YkFkEBU4TkcrYRySWpekRR1hbnDWUCw
8 changed files with 97 additions and 47 deletions

View File

@ -107,7 +107,7 @@ general {
col.inactive_border = rgba(595959aa) col.inactive_border = rgba(595959aa)
# Set to true enable resizing windows by clicking and dragging on borders and gaps # Set to true enable resizing windows by clicking and dragging on borders and gaps
resize_on_border = false resize_on_border = true
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false allow_tearing = false
@ -140,7 +140,7 @@ decoration {
# https://wiki.hyprland.org/Configuring/Variables/#animations # https://wiki.hyprland.org/Configuring/Variables/#animations
animations { animations {
enabled = true enabled = false
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
@ -218,12 +218,13 @@ $mainMod = SUPER # Sets "Windows" key as main modifier
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, T, exec, $terminal bind = $mainMod, T, exec, $terminal
bind = $mainMod, C, killactive, bind = $mainMod, C, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating, bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu bind = $mainMod, R, exec, $menu
bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, M, fullscreen, 1
bind = $mainMod, F, fullscreen, 0
# Move focus with mainMod + arrow keys # Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l bind = $mainMod, left, movefocus, l

View File

@ -1,7 +1,12 @@
shell /home/linuxbrew/.linuxbrew/bin/zsh
font_family FiraCode Nerd Font Reg font_family FiraCode Nerd Font Reg
# install from AUR
# yay -S ttf-victor-mono-nerd
italic_font VictorMono NF Medium Italic
font_features FiraCodeNF-Reg +ss09 +ss10 +cv06
font_size 13 font_size 13
disable_ligatures cursor disable_ligatures cursor
modify_font cell_width 90% # modify_font cell_width 90%
cursor_shape beam cursor_shape beam
cursor_blink_interval 0 cursor_blink_interval 0
scrollback_lines 10000 scrollback_lines 10000

View File

@ -8,7 +8,7 @@
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" }, "barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"better-escape.vim": { "branch": "master", "commit": "6b16a45a839727977277f6ab11bded63e9ed86bb" }, "better-escape.vim": { "branch": "master", "commit": "6b16a45a839727977277f6ab11bded63e9ed86bb" },
"cmake-tools.nvim": { "branch": "master", "commit": "d84e9ec2b71f18a39e8d8c4301796c77d64b80ef" }, "cmake-tools.nvim": { "branch": "master", "commit": "131540d8015a63511904570e7205eefa49aa74a7" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
@ -19,47 +19,48 @@
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"codesnap.nvim": { "branch": "main", "commit": "a223fd882953e56ae1a8747fdc44b8d6a2ff7a9b" }, "codesnap.nvim": { "branch": "main", "commit": "a223fd882953e56ae1a8747fdc44b8d6a2ff7a9b" },
"cphelper.nvim": { "branch": "main", "commit": "ab259315496514d58b2021048ef40437ad0f5814" }, "cphelper.nvim": { "branch": "main", "commit": "ab259315496514d58b2021048ef40437ad0f5814" },
"diffview.nvim": { "branch": "main", "commit": "1ec7b56b959dab18f7030f541c33ae60e18a6f88" }, "diffview.nvim": { "branch": "main", "commit": "3afa6a053f680e9f1329c4a151db988a482306cd" },
"dressing.nvim": { "branch": "master", "commit": "3c38ac861e1b8d4077ff46a779cde17330b29f3a" },
"eslint.nvim": { "branch": "main", "commit": "158f2289907d377018752fcfe0d61b746dc11767" }, "eslint.nvim": { "branch": "main", "commit": "158f2289907d377018752fcfe0d61b746dc11767" },
"feline.nvim": { "branch": "master", "commit": "3587f57480b88e8009df7b36dc84e9c7ff8f2c49" }, "feline.nvim": { "branch": "master", "commit": "3587f57480b88e8009df7b36dc84e9c7ff8f2c49" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"fzf-lua": { "branch": "main", "commit": "0c4458b0f0d12970e54c8cd7c5ad60676edcf764" }, "fzf-lua": { "branch": "main", "commit": "b92220ec838c195eb1c711daa69c905b1d7b8d8c" },
"git-conflict.nvim": { "branch": "main", "commit": "4c8e252b87d54d944c1e56bfb477f78b6fdaf661" }, "git-conflict.nvim": { "branch": "main", "commit": "4c8e252b87d54d944c1e56bfb477f78b6fdaf661" },
"gitsigns.nvim": { "branch": "main", "commit": "cdfcd9d39d23c46ae9a040de2c6a8b8bf868746e" }, "gitsigns.nvim": { "branch": "main", "commit": "75dc649106827183547d3bedd4602442340d2f7f" },
"goto-preview": { "branch": "main", "commit": "3552fad4a0244ffd9ac86508e29ccc5166f19eb8" }, "goto-preview": { "branch": "main", "commit": "3552fad4a0244ffd9ac86508e29ccc5166f19eb8" },
"heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" }, "heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" },
"hlargs.nvim": { "branch": "main", "commit": "30fe1b3de2b7614f061be4fc9c71984a2b87e50a" }, "hlargs.nvim": { "branch": "main", "commit": "30fe1b3de2b7614f061be4fc9c71984a2b87e50a" },
"hop.nvim": { "branch": "master", "commit": "059e88e9dcaad3280ea1fd5c757f6904f274aed5" }, "hop.nvim": { "branch": "master", "commit": "036462a345792279c58f2f6445756efab706f04a" },
"image.nvim": { "branch": "master", "commit": "2a618c86d9f8fd9f7895d12b55ec2f31fd14fa05" }, "image.nvim": { "branch": "master", "commit": "645f997d171ea3d2505986a0519755600a26f02f" },
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
"lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, "lazy.nvim": { "branch": "main", "commit": "24fa2a97085ca8a7220b5b078916f81e316036fd" },
"legendary.nvim": { "branch": "master", "commit": "c1345db98e4c6e6e80d528384f3b5acbcb90bc40" }, "legendary.nvim": { "branch": "master", "commit": "c1345db98e4c6e6e80d528384f3b5acbcb90bc40" },
"listish.nvim": { "branch": "master", "commit": "3bc4bb02036f3802c6428c6232633d3192ac3604" }, "listish.nvim": { "branch": "master", "commit": "3bc4bb02036f3802c6428c6232633d3192ac3604" },
"lsp_signature.nvim": { "branch": "master", "commit": "43729353dec224fa620a877639b8b0744112b286" }, "lsp_signature.nvim": { "branch": "master", "commit": "529e8861d0410389f0163a5e5c2199d4a4ef5bf6" },
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"marks.nvim": { "branch": "master", "commit": "74e8d01b2a2131b6e46354cffc553aa7f81bcf5b" }, "marks.nvim": { "branch": "master", "commit": "74e8d01b2a2131b6e46354cffc553aa7f81bcf5b" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" },
"mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" },
"melange-nvim": { "branch": "master", "commit": "3d787ca41e98be6bdc95e71ac5ad425082d37406" }, "melange-nvim": { "branch": "master", "commit": "800490ee87ce3e1b4afe751ff81f2864cb01937d" },
"modicator.nvim": { "branch": "main", "commit": "780ea1e98c9bee8f3816685213b0aac42b34cd75" }, "modicator.nvim": { "branch": "main", "commit": "780ea1e98c9bee8f3816685213b0aac42b34cd75" },
"monokai": { "branch": "master", "commit": "aafde73a622435891d36b411d8623e705ead6293" }, "monokai": { "branch": "master", "commit": "2bad2a92fe0ff6c8581d33a853a1b17592b83239" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
"neodev.nvim": { "branch": "main", "commit": "56268d602feaf4fb5131f7d49c0334b4863b0470" }, "neodev.nvim": { "branch": "main", "commit": "56268d602feaf4fb5131f7d49c0334b4863b0470" },
"neogit": { "branch": "master", "commit": "69e0f1264f583dbe85a6bcd63c5ec9cb29f94571" }, "neogit": { "branch": "master", "commit": "9da48298a1c1e1ea52b4b9b9a4c2c4ded6ac422a" },
"nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" }, "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-lspconfig": { "branch": "master", "commit": "b972e7154bc94ab4ecdbb38c8edbccac36f83996" }, "nvim-lspconfig": { "branch": "master", "commit": "38de86f82efd9ba0881203767d6a8e1815abca28" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-neoclip.lua": { "branch": "main", "commit": "9b02a625dfa22499089458554be86171a1dfe8b1" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-numbertoggle": { "branch": "main", "commit": "c5827153f8a955886f1b38eaea6998c067d2992f" }, "nvim-numbertoggle": { "branch": "main", "commit": "c5827153f8a955886f1b38eaea6998c067d2992f" },
"nvim-surround": { "branch": "main", "commit": "79aaa42da1f698ed31bcbe7f83081f69dca7ba17" }, "nvim-surround": { "branch": "main", "commit": "03d3972f15ee4acbc997873202cbd6cb7e50b230" },
"nvim-treesitter": { "branch": "master", "commit": "6d56c5f404d3b116bab167bc03993cfb0a83f8aa" }, "nvim-treesitter": { "branch": "master", "commit": "b91ae14fc3bb801c7ea69bc283fe860b32b5163d" },
"nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" }, "nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" },
"nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
"outline.nvim": { "branch": "main", "commit": "139e363dd5a44f66a51041264aabe3884df4dd98" }, "outline.nvim": { "branch": "main", "commit": "6a91568110684ac056e62e3b2d7409d7c8b2e5e1" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"prettier.nvim": { "branch": "main", "commit": "d98e732cb73690b07c00c839c924be1d1d9ac5c2" }, "prettier.nvim": { "branch": "main", "commit": "d98e732cb73690b07c00c839c924be1d1d9ac5c2" },
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" }, "search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },

View File

@ -60,11 +60,12 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
local plugins = { local plugins = {
{ 'nvim-lua/plenary.nvim' },
{ 'rcarriga/nvim-notify' },
{"loctvl842/monokai-pro.nvim", name="monokai", priority=1000}, {"loctvl842/monokai-pro.nvim", name="monokai", priority=1000},
{ {
'nvim-telescope/telescope.nvim', tag = '0.1.5', 'nvim-telescope/telescope.nvim', tag = '0.1.5',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim',
{ {
"isak102/telescope-git-file-history.nvim", "isak102/telescope-git-file-history.nvim",
dependencies = { "tpope/vim-fugitive" } dependencies = { "tpope/vim-fugitive" }
@ -76,7 +77,6 @@ local plugins = {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
branch = "v3.x", branch = "v3.x",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
"3rd/image.nvim" "3rd/image.nvim"
@ -127,7 +127,7 @@ local plugins = {
init = function() vim.g.barbar_auto_setup = false end, init = function() vim.g.barbar_auto_setup = false end,
opts = { opts = {
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
-- animation = true, animation = false,
-- insert_at_start = true, -- insert_at_start = true,
-- …etc. -- …etc.
}, },
@ -178,9 +178,9 @@ local plugins = {
"famiu/feline.nvim", "famiu/feline.nvim",
"rebelot/heirline.nvim", "rebelot/heirline.nvim",
"kyazdani42/nvim-web-devicons", "kyazdani42/nvim-web-devicons",
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
"nanotee/sqls.nvim", "nanotee/sqls.nvim",
"arsham/listish.nvim", "arsham/listish.nvim",
}, },
config = function() config = function()
require('gitsigns').setup() require('gitsigns').setup()
@ -220,7 +220,6 @@ local plugins = {
{ 'hedyhli/outline.nvim' }, { 'hedyhli/outline.nvim' },
{ {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { opts = {
-- your configuration comes here -- your configuration comes here
-- or leave it empty to use the default settings -- or leave it empty to use the default settings
@ -258,10 +257,10 @@ local plugins = {
-- sqlite is only needed if you want to use frecency sorting -- sqlite is only needed if you want to use frecency sorting
-- dependencies = { 'kkharji/sqlite.lua' } -- dependencies = { 'kkharji/sqlite.lua' }
}, },
{ -- {
'stevearc/dressing.nvim', -- 'stevearc/dressing.nvim',
opts = {}, -- opts = {},
}, -- },
{ {
"folke/twilight.nvim", "folke/twilight.nvim",
opts = { opts = {
@ -302,12 +301,12 @@ local plugins = {
}, },
{ 'Civitasv/cmake-tools.nvim' }, { 'Civitasv/cmake-tools.nvim' },
{ 'p00f/cphelper.nvim' }, { 'p00f/cphelper.nvim' },
{ "arielherself/melange-nvim", commit = "3d787ca" }, -- { dir = '/home/user/Documents/melange-nvim' },
{ "arielherself/melange-nvim" },
{ 'hrsh7th/vim-vsnip' }, { 'hrsh7th/vim-vsnip' },
{ {
"NeogitOrg/neogit", "NeogitOrg/neogit",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration "sindrets/diffview.nvim", -- optional - Diff integration
-- Only one of these is needed, not both. -- Only one of these is needed, not both.
@ -323,15 +322,16 @@ local plugins = {
"FabianWirth/search.nvim", "FabianWirth/search.nvim",
dependencies = { "nvim-telescope/telescope.nvim" } dependencies = { "nvim-telescope/telescope.nvim" }
}, },
{ 'stevearc/dressing.nvim' },
{ 'NvChad/nvim-colorizer.lua' }, { 'NvChad/nvim-colorizer.lua' },
{ 'debugloop/telescope-undo.nvim' }, { 'debugloop/telescope-undo.nvim' },
{ "arielherself/neodev.nvim", opts = {} }, { "arielherself/neodev.nvim", opts = {} },
{
"AckslD/nvim-neoclip.lua",
},
} }
local opts = { require("lazy").setup(plugins, {})
}
require("lazy").setup(plugins, opts) vim.notify = require("notify")
require("monokai-pro").setup({ require("monokai-pro").setup({
transparent_background = true, transparent_background = true,
@ -339,13 +339,13 @@ require("monokai-pro").setup({
devicons = true, -- highlight the icons of `nvim-web-devicons` devicons = true, -- highlight the icons of `nvim-web-devicons`
styles = { styles = {
comment = { italic = true }, comment = { italic = true },
keyword = { italic = true }, -- any other keyword keyword = { italic = false }, -- any other keyword
type = { italic = false }, -- (preferred) int, long, char, etc type = { italic = false }, -- (preferred) int, long, char, etc
storageclass = { italic = true }, -- static, register, volatile, etc storageclass = { italic = false }, -- static, register, volatile, etc
structure = { italic = true }, -- struct, union, enum, etc structure = { italic = false }, -- struct, union, enum, etc
parameter = { italic = true }, -- parameter pass in function parameter = { italic = false }, -- parameter pass in function
annotation = { italic = true }, annotation = { italic = false },
tag_attribute = { italic = true }, -- attribute of tag in reactjs tag_attribute = { italic = false }, -- attribute of tag in reactjs
}, },
filter = "spectrum", -- classic | octagon | pro | machine | ristretto | spectrum filter = "spectrum", -- classic | octagon | pro | machine | ristretto | spectrum
-- Enable this will disable filter option -- Enable this will disable filter option
@ -421,9 +421,9 @@ require('search').setup {
}, },
} }
} }
vim.keymap.set('n', '<leader>p', builtin.find_files, {}) vim.keymap.set('n', '<leader>gp', builtin.find_files, {})
-- vim.keymap.set('n', '<leader>g', builtin.live_grep, {}) -- vim.keymap.set('n', '<leader>g', builtin.live_grep, {})
vim.keymap.set('n', '<leader>g', '<Cmd>lua require("search").open({ tab_name = "Grep" })<CR>') vim.keymap.set('n', '<leader>gg', '<Cmd>lua require("search").open({ tab_name = "Grep" })<CR>')
local config = require("nvim-treesitter.configs") local config = require("nvim-treesitter.configs")
config.setup({ config.setup({
@ -616,6 +616,7 @@ vim.keymap.set('n', '<C-CR>', 'i{<ESC>A}<ESC>%li<CR><ESC>$i<CR><ESC>k^', {norema
vim.keymap.set('n', '<C-BS>', 'd0i<BS><ESC>l', {noremap=true}) vim.keymap.set('n', '<C-BS>', 'd0i<BS><ESC>l', {noremap=true})
vim.keymap.set('i', '<C-BS>', '<C-u><BS>', {noremap=true}) vim.keymap.set('i', '<C-BS>', '<C-u><BS>', {noremap=true})
vim.keymap.set('n', '<leader><leader>', '<Cmd>Telescope help_tags<CR>', {noremap=true}) vim.keymap.set('n', '<leader><leader>', '<Cmd>Telescope help_tags<CR>', {noremap=true})
vim.keymap.set('n', '<leader>p', '<Cmd>Telescope neoclip a extra=plus,unnamedplus<CR>', {noremap=true})
vim.api.nvim_create_user_command('PopupSaveas', function() vim.api.nvim_create_user_command('PopupSaveas', function()
vim.ui.input({ prompt = 'Save As: ' }, function(input) vim.ui.input({ prompt = 'Save As: ' }, function(input)
@ -965,3 +966,4 @@ vim.api.nvim_create_autocmd("LspAttach", {
end, end,
}) })
require('neoclip').setup {}

View File

@ -0,0 +1,28 @@
return [=[
pair<vector<int>, vector<int>> factcount(int n) {
vector<bool> not_prime(n + 1);
vector<int> res(n + 1), num(n + 1);
vector<int> primes;
res[1] = 1;
for (int i = 2; i <= n; ++i) {
if (not not_prime[i]) {
res[i] = 2;
num[i] = 1;
primes.emplace_back(i);
}
for (auto&& x : primes) {
if (i * x > n) break;
not_prime[i * x] = 1;
if (i % x == 0) {
num[i * x] = num[i] + 1;
res[i * x] = res[i] / num[i * x] * (num[i * x] + 1);
break;
}
num[i * x] = 1;
res[i * x] = res[i] * 2;
}
}
return {primes, res};
}
]=]

View File

@ -262,3 +262,16 @@ ls.add_snippets(nil, {
}) })
} }
}) })
local factcount = require('snippets.factcount')
ls.add_snippets(nil, {
cpp = {
snip({
trig = 'factcount',
namr = 'factcount',
dscr = 'Get primes and the count of factors of each number',
},{
text(lines(factcount))
})
}
})

View File

@ -28,7 +28,7 @@ private:
if (s != t) push(p, m - s + 1, t - m); if (s != t) push(p, m - s + 1, t - m);
if (x <= m) set(s, m, p * 2, x, c); if (x <= m) set(s, m, p * 2, x, c);
else set(m + 1, t, p * 2 + 1, x, c); else set(m + 1, t, p * 2 + 1, x, c);
d[p] = d[p * 2] + d[p * 2 + 1]; pull(p);
} }
void range_apply(size_type s, size_type t, size_type p, size_type l, size_type r, const tag_type& c) { void range_apply(size_type s, size_type t, size_type p, size_type l, size_type r, const tag_type& c) {

File diff suppressed because one or more lines are too long