nvim lazy.nvim cleanup. add some stuff to hypr config

This commit is contained in:
Seymur Bagirov 2024-03-17 06:52:42 +04:00
parent 23fca7ccf3
commit 91f852787c
12 changed files with 244 additions and 236 deletions

View File

@ -30,8 +30,8 @@ source = ~/.config/hypr/plugins.conf
source = ~/.config/hypr/wallpaper.conf source = ~/.config/hypr/wallpaper.conf
# env # env
env = XDG_SESSION_TYPE,wayland
env = WLR_DRM_NO_ATOMIC, 1 env = WLR_DRM_NO_ATOMIC, 1
env = DOTNET_CLI_TELEMETRY_OPTOUT, true env = DOTNET_CLI_TELEMETRY_OPTOUT, true
source = ~/.config/hypr/nvidia.conf
windowrulev2 = immediate, title:^(Overwatch)$ windowrulev2 = immediate, title:^(Overwatch)$
windowrulev2 = immediate, class:^(steam_app_1088710)$ windowrulev2 = immediate, class:^(steam_app_1088710)$

View File

@ -1,4 +1,4 @@
$lockCmd = pidof hyprlock || hyprlock $lockCmd = hyprlock
general { general {
lock_cmd = $lockCmd # dbus/sysd lock command (loginctl lock-session) lock_cmd = $lockCmd # dbus/sysd lock command (loginctl lock-session)
unlock_cmd = loginctl unlock-session # same as above, but unlock unlock_cmd = loginctl unlock-session # same as above, but unlock
@ -10,5 +10,4 @@ general {
listener { listener {
timeout = 500 # in seconds timeout = 500 # in seconds
on-timeout = loginctl lock-session # command to run when timeout has passed on-timeout = loginctl lock-session # command to run when timeout has passed
on-resume = notify-send "Hello!" # command to run when activity is detected after timeout has fired.
} }

5
hypr/nvidia.conf Normal file
View File

@ -0,0 +1,5 @@
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = WLR_NO_HARDWARE_CURSORS,1

View File

@ -1,8 +1,8 @@
exec-once = hyprpm reload -n # exec-once = hyprpm reload -n
# keymaps # keymaps
bind = $mainMod, W, hycov:toggleoverview # bind = $mainMod, W, hycov:toggleoverview

View File

@ -1,55 +1,55 @@
{ {
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"Ionide-vim": { "branch": "master", "commit": "8435bae84b26b602dbb68399661b3989915cc4d3" }, "Ionide-vim": { "branch": "master", "commit": "8435bae84b26b602dbb68399661b3989915cc4d3" },
"LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"cloak.nvim": { "branch": "main", "commit": "9abe4e986e924fc54a972c1b0ff52b65a0622624" }, "cloak.nvim": { "branch": "main", "commit": "462e84e1659d984196d09f7d16690b19b9aee804" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"codesnap.nvim": { "branch": "main", "commit": "bf50e508010d58757fa72d2c0b4e11c6b29dfc74" }, "codesnap.nvim": { "branch": "main", "commit": "53b3d2544a3219d9774c3234f1fb34949b7be6b3" },
"copilot.vim": { "branch": "release", "commit": "4d32b064fedbdbf8f3fa83afa1b19ebafd3a035c" }, "copilot.vim": { "branch": "release", "commit": "9484e35cf222e9360e05450622a884f95c662c4c" },
"csharpls-extended-lsp.nvim": { "branch": "master", "commit": "bde4aebe0dc74952188c2130c6831a1d8e4ce5c6" }, "csharpls-extended-lsp.nvim": { "branch": "master", "commit": "bde4aebe0dc74952188c2130c6831a1d8e4ce5c6" },
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" },
"harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, "harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" },
"image.nvim": { "branch": "master", "commit": "b0e24e6f4b2c8a7a5656e8418bbfd2200cabc9b9" }, "image.nvim": { "branch": "master", "commit": "0dd8bdbb8855bc98c534a902c91dc9eddb8155b1" },
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"kitty-scrollback.nvim": { "branch": "main", "commit": "93b4286c4e2c9d4a73ccbefb3adbc688d3ed5fe4" }, "kitty-scrollback.nvim": { "branch": "main", "commit": "af95c02d558216202639609a56123fed9d8fb193" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
"leap.nvim": { "branch": "main", "commit": "b41f48643b483bb0881c0f7804f6f0be7bb95155" }, "leap.nvim": { "branch": "main", "commit": "1f7c33f7c8fcad27c3da71a20c804931b8996f75" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "abac76482ec3012a2b359ba956a74e2ffd33d46f" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "14c9164413df4be17a5a0ca9e01a376691cbcaef" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "lualine.nvim": { "branch": "master", "commit": "af4c3cf17206810880d2a93562e0a4c0d901c684" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1bed24274d911bb3ed730c516ffce27e8fdeeac3" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "742db4e60c74e5fbcc596aaf9e7575e1342dfd09" },
"neodev.nvim": { "branch": "main", "commit": "3157f2e876fd6223d36cfa76bee4709247d62fa5" }, "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" }, "nui.nvim": { "branch": "main", "commit": "3dc46d725f7b94bee5117c0a699b57b1902b5d65" },
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" }, "nvim-dap": { "branch": "master", "commit": "c43c2473ecb482a9d91f32c1d4c0098fffad3c7d" },
"nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" }, "nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" },
"nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" },
"nvim-lspconfig": { "branch": "master", "commit": "ec7d51a619049c7c597f469f81ea199db6794651" }, "nvim-lspconfig": { "branch": "master", "commit": "4bdd3800b4148f670c6cf55ef65f490148eeb550" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
"nvim-treesitter": { "branch": "master", "commit": "6e2b56cbe75ddf18e6efecee44bc3936d70b0b3e" }, "nvim-treesitter": { "branch": "master", "commit": "f87882858438834d2fbb6379aa2be37de901751b" },
"nvim-treesitter-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" }, "nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" },
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"nvim-ufo": { "branch": "main", "commit": "553d8a9c611caa9f020556d4a26b760698e5b81b" }, "nvim-ufo": { "branch": "main", "commit": "7b14dd650b57291a49f037f1ede325d46e08b258" },
"nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" }, "nvim-web-devicons": { "branch": "master", "commit": "a851380fbea4c1312d11f13d5cdc86a7a19808dd" },
"onedarkpro.nvim": { "branch": "main", "commit": "3fbb6e8c35589e6373fcb8d49b6318f794740343" }, "onedarkpro.nvim": { "branch": "main", "commit": "e4fc3641aa3b52e30496bf34b87f70ef5506686e" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, "promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "64b7006a36cec099da7eaeb056c4a27dd5d73342" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "cfc3f53cfa0fbabd95bd33747288aea24fe45211" },
"rustaceanvim": { "branch": "master", "commit": "19f12173ccb7993f86ea26b0e21bbb883c3b86c7" }, "rustaceanvim": { "branch": "master", "commit": "69a22c2ec63ab375190006751562b62ebb318250" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "2e1e382df42467029b493c143c2e727028140214" }, "telescope.nvim": { "branch": "master", "commit": "e9e01d699843af530ef4ad2c8679a7e273bb3dd1" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"undotree": { "branch": "master", "commit": "9dbbf3b7d19dda0d22ceca461818e4739ad8154d" }, "undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" },
"vim-fugitive": { "branch": "master", "commit": "2e88f14a585c014691904ba8fe39e6ea851c9422" }, "vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" } "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }
} }

View File

@ -1,13 +1,5 @@
return { return {
"mistricky/codesnap.nvim", "mistricky/codesnap.nvim",
-- config = function()
-- vim.keymap.set("n", "<leader>cs", "<cmd>CodeSnapPreviewOn<CR>"
-- require("codesnap").setup({
-- mac_window_bar = true,
-- opacity = true,
-- watermark = "TheMystery"
-- })
-- end,
config = function() config = function()
vim.keymap.set("n", "<leader>csv", "<cmd>CodeSnapPreviewOn<CR>") vim.keymap.set("n", "<leader>csv", "<cmd>CodeSnapPreviewOn<CR>")
require("codesnap").setup({ require("codesnap").setup({

View File

@ -0,0 +1,8 @@
return {
"lewis6991/gitsigns.nvim",
config = function()
-- TODOS: Add keybindings
require("gitsigns").setup()
end
}

View File

@ -7,28 +7,16 @@ return {
vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true }) vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
end end
}, },
{
"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"
},
{ {
"mbbill/undotree", "mbbill/undotree",
config = function() config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end end
}, },
{
"lewis6991/gitsigns.nvim",
opts = {}
},
{
"windwp/nvim-ts-autotag",
event = "InsertEnter",
opts = {}
},
{ {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
event = "InsertEnter", event = "InsertEnter",
opts = {} config = true
}, },
{ {
"kosayoda/nvim-lightbulb", "kosayoda/nvim-lightbulb",
@ -55,7 +43,8 @@ return {
}, },
{ {
"ionide/Ionide-vim", "ionide/Ionide-vim",
event = "VimEnter" event = "VimEnter",
enabled = false
}, },
{ {
'ggandor/leap.nvim', 'ggandor/leap.nvim',
@ -66,5 +55,4 @@ return {
}, },
"SmiteshP/nvim-navic", "SmiteshP/nvim-navic",
"Decodetalkers/csharpls-extended-lsp.nvim", "Decodetalkers/csharpls-extended-lsp.nvim",
"HiPhish/rainbow-delimiters.nvim"
} }

View File

@ -1,194 +1,192 @@
return { return {
'VonHeikemen/lsp-zero.nvim', {
branch = 'v3.x', 'mrcjkb/rustaceanvim',
dependencies = { version = '^4', -- Recommended
-- LSP Support ft = { 'rust' },
'neovim/nvim-lspconfig',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
-- Autocompletion
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
-- Snippets
'L3MON4D3/LuaSnip',
'rafamadriz/friendly-snippets',
-- extras
"SmiteshP/nvim-navic",
"Decodetalkers/csharpls-extended-lsp.nvim",
-- rust
'mrcjkb/rustaceanvim'
}, },
config = function() {
local lsp = require("lsp-zero") 'VonHeikemen/lsp-zero.nvim',
branch = 'v3.x',
dependencies = {
-- LSP Support
'neovim/nvim-lspconfig',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
lsp.configure('csharp_ls', { -- Autocompletion
handlers = { 'hrsh7th/nvim-cmp',
["textDocument/definition"] = require("csharpls_extended").handler, 'hrsh7th/cmp-buffer',
["textDocument/typeDefinition"] = require("csharpls_extended").handler 'hrsh7th/cmp-path',
} 'saadparwaiz1/cmp_luasnip',
}) 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
lsp.configure('clangd', { -- Snippets
cmd = { 'clangd', '--offset-encoding=utf-16' }, 'L3MON4D3/LuaSnip',
}) 'rafamadriz/friendly-snippets',
-- this code makes it so that the css language server doesn't complain about tailwindcss classes
lsp.configure("cssls", { -- extras
settings = { "SmiteshP/nvim-navic",
css = { "Decodetalkers/csharpls-extended-lsp.nvim",
lint = { unknownAtRules = "ignore" }
}, -- rust
scss = { 'mrcjkb/rustaceanvim'
lint = { unknownAtRules = "ignore" } },
}, config = function()
less = { local lsp = require("lsp-zero")
lint = { unknownAtRules = "ignore" }
lsp.configure('csharp_ls', {
handlers = {
["textDocument/definition"] = require("csharpls_extended").handler,
["textDocument/typeDefinition"] = require("csharpls_extended").handler
} }
} })
})
--
-- lsp.configure("rust_analyzer", {
-- settings = {
-- ["rust-analyzer"] = {
-- checkOnSave = true,
-- check = {
-- command = "clippy"
-- }
-- }
-- }
-- })
lsp.set_server_config({ lsp.configure('clangd', {
capabilities = { cmd = { 'clangd', '--offset-encoding=utf-16' },
textDocument = { })
foldingRange = { -- this code makes it so that the css language server doesn't complain about tailwindcss classes
dynamicRegistration = false, lsp.configure("cssls", {
lineFoldingOnly = true settings = {
css = {
lint = { unknownAtRules = "ignore" }
},
scss = {
lint = { unknownAtRules = "ignore" }
},
less = {
lint = { unknownAtRules = "ignore" }
} }
} }
} })
}) --
-- lsp.configure("rust_analyzer", {
-- settings = {
-- ["rust-analyzer"] = {
-- checkOnSave = true,
-- check = {
-- command = "clippy"
-- }
-- }
-- }
-- })
local cmp = require('cmp')
local cmp_action = lsp.cmp_action()
local cmp_format = lsp.cmp_format()
require('luasnip.loaders.from_vscode').lazy_load() local cmp = require('cmp')
local cmp_action = lsp.cmp_action()
local cmp_format = lsp.cmp_format()
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } require('luasnip.loaders.from_vscode').lazy_load()
cmp.setup({ vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
formatting = cmp_format,
preselect = 'item',
completion = {
completeopt = 'menu,menuone,noinsert'
},
window = {
documentation = cmp.config.window.bordered(),
},
sources = {
{ name = 'path' },
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'buffer', keyword_length = 3 },
{ name = 'luasnip', keyword_length = 2 },
},
mapping = cmp.mapping.preset.insert({
-- confirm completion item
['<CR>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Insert }),
['<Tab>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
-- toggle completion menu cmp.setup({
['<C-e>'] = cmp_action.toggle_completion(), formatting = cmp_format,
preselect = 'item',
completion = {
completeopt = 'menu,menuone,noinsert'
},
window = {
documentation = cmp.config.window.bordered(),
},
sources = {
{ name = 'path' },
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'buffer', keyword_length = 3 },
{ name = 'luasnip', keyword_length = 2 },
},
mapping = cmp.mapping.preset.insert({
-- confirm completion item
['<CR>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Insert }),
['<Tab>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
-- tab complete -- toggle completion menu
-- ['<Tab>'] = cmp_action.tab_complete(), ['<C-e>'] = cmp_action.toggle_completion(),
['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- navigate between snippet placeholder -- tab complete
['<C-d>'] = cmp_action.luasnip_jump_forward(), -- ['<Tab>'] = cmp_action.tab_complete(),
['<C-b>'] = cmp_action.luasnip_jump_backward(), ['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- scroll documentation window -- navigate between snippet placeholder
['<C-f>'] = cmp.mapping.scroll_docs(5), ['<C-d>'] = cmp_action.luasnip_jump_forward(),
['<C-u>'] = cmp.mapping.scroll_docs(-5), ['<C-b>'] = cmp_action.luasnip_jump_backward(),
}),
}) -- scroll documentation window
['<C-f>'] = cmp.mapping.scroll_docs(5),
['<C-u>'] = cmp.mapping.scroll_docs(-5),
}),
})
local navic = require("nvim-navic") local navic = require("nvim-navic")
lsp.on_attach(function(client, bufnr) lsp.on_attach(function(client, bufnr)
local opts = { buffer = bufnr, remap = false } local opts = { buffer = bufnr, remap = false }
lsp.default_keymaps({ buffer = bufnr }) lsp.default_keymaps({ buffer = bufnr })
if client.server_capabilities.documentSymbolProvider then if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr) navic.attach(client, bufnr)
end
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "<leader>dc", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>ed", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
-- for the code action key map to work you need to change key binding('.' symbol) of your terminal, otherwise it won't work
vim.keymap.set("n", "<C-.>", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
-- sometimes lsp fails, we can restart it with this keymap
vim.keymap.set('n', "<leader>lr", vim.cmd.LspRestart, opts)
end)
require("mason").setup({});
require("mason-lspconfig").setup({
ensure_installed = { 'tsserver', 'svelte', 'lua_ls', 'csharp_ls', 'rust_analyzer' },
handlers = {
lsp.default_setup,
lua_ls = function()
local lua_opts = lsp.nvim_lua_ls()
require('lspconfig').lua_ls.setup(lua_opts)
end,
rust_analyzer = lsp.noop,
}
})
lsp.set_sign_icons({
error = '',
warn = '',
hint = '',
info = ''
})
vim.diagnostic.config({
virtual_text = false,
severity_sort = true,
float = {
style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})
vim.g.rustaceanvim = {
server = {
capabilities = lsp.get_capabilities(),
on_attach = function()
local bufnr = vim.api.nvim_get_current_buf()
vim.keymap.set("n", "<C-.>", function() vim.cmd.RustLsp('codeAction') end, {silent = true, buffer = bufnr, remap = true})
end end
}, vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "<leader>dc", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>ed", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
-- for the code action key map to work you need to change key binding('.' symbol) of your terminal, otherwise it won't work
vim.keymap.set("n", "<C-.>", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
-- sometimes lsp fails, we can restart it with this keymap
vim.keymap.set('n', "<leader>lr", vim.cmd.LspRestart, opts)
end)
} require("mason").setup({});
end require("mason-lspconfig").setup({
ensure_installed = { 'tsserver', 'svelte', 'lua_ls', 'csharp_ls' },
handlers = {
lsp.default_setup,
lua_ls = function()
local lua_opts = lsp.nvim_lua_ls()
require('lspconfig').lua_ls.setup(lua_opts)
end,
rust_analyzer = lsp.noop,
}
})
lsp.set_sign_icons({
error = '',
warn = '',
hint = '',
info = ''
})
vim.diagnostic.config({
virtual_text = false,
severity_sort = true,
float = {
style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})
vim.g.rustaceanvim = {
server = {
-- capabilities = lsp.get_capabilities(),
on_attach = function()
local bufnr = vim.api.nvim_get_current_buf()
vim.keymap.set("n", "<C-.>", function() vim.cmd.RustLsp('codeAction') end,
{ silent = true, buffer = bufnr, remap = true })
end
},
}
end
}
} }

View File

@ -1,5 +0,0 @@
return {
'mrcjkb/rustaceanvim',
version = '^4', -- Recommended
ft = { 'rust' },
}

View File

@ -1,7 +1,11 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { "HiPhish/rainbow-delimiters.nvim" }, build = ":TSUpdate",
dependencies = {
"HiPhish/rainbow-delimiters.nvim",
"windwp/nvim-ts-autotag"
},
config = function() config = function()
require 'nvim-treesitter.configs'.setup { require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" -- A list of parser names, or "all"
@ -29,6 +33,11 @@ return {
} }
} }
require('rainbow-delimiters.setup').setup() require('rainbow-delimiters.setup').setup()
vim.filetype.add {
pattern = {
['.*/hypr/.*%.conf'] = 'hyprlang'
}
}
end end
}, },
"nvim-treesitter/nvim-treesitter-context" "nvim-treesitter/nvim-treesitter-context"

View File

@ -1,7 +1,8 @@
return { return {
"kevinhwang91/nvim-ufo", "kevinhwang91/nvim-ufo",
dependencies = { dependencies = {
"kevinhwang91/promise-async" "kevinhwang91/promise-async",
'VonHeikemen/lsp-zero.nvim'
}, },
config = function() config = function()
vim.o.foldcolumn = '1' -- '0' is not bad vim.o.foldcolumn = '1' -- '0' is not bad
@ -15,5 +16,18 @@ return {
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds) vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds)
vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith) -- closeAllFolds == closeFoldsWith(0) vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith) -- closeAllFolds == closeFoldsWith(0)
local lsp = require('lsp-zero')
lsp.set_server_config({
capabilities = {
textDocument = {
foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
}
}
})
end end
} }