add rustaceanvim to neovim and change stuff in hypr

This commit is contained in:
Seymur Bagirov 2024-03-10 15:59:42 +04:00
parent 10d78efe47
commit 23fca7ccf3
5 changed files with 56 additions and 37 deletions

View File

@ -9,7 +9,7 @@ exec-once=[workspace 1 silent] steam
exec-once= xembedsniproxy & # for wine system tray exec-once= xembedsniproxy & # for wine system tray
exec-once=solaar --window=hide exec-once=solaar --window=hide
exec-once=blueman-applet exec-once=blueman-applet
exec-once=armcord --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --ozone-platform-hint=wayland & disown exec-once=gio launch ~/.local/share/applications/vesktop.desktop
exec-once=hypridle exec-once=hypridle
# exec-once=wallengine --screen-root HDMI-A-2 1383845959 # exec-once=wallengine --screen-root HDMI-A-2 1383845959
# exec-once=/home/themystery/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox # exec-once=/home/themystery/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox
@ -33,5 +33,5 @@ source = ~/.config/hypr/wallpaper.conf
env = XDG_SESSION_TYPE,wayland 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
windowrulev2 = immediate, class:^(overwatch.exe)$ windowrulev2 = immediate, title:^(Overwatch)$
windowrulev2 = immediate, class:^(steam_app_1088710)$ windowrulev2 = immediate, class:^(steam_app_1088710)$

View File

@ -45,6 +45,7 @@
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "64b7006a36cec099da7eaeb056c4a27dd5d73342" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "64b7006a36cec099da7eaeb056c4a27dd5d73342" },
"rustaceanvim": { "branch": "master", "commit": "19f12173ccb7993f86ea26b0e21bbb883c3b86c7" },
"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": "2e1e382df42467029b493c143c2e727028140214" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },

View File

@ -33,20 +33,19 @@ return {
} }
} }
dap.configurations.rust = { -- dap.configurations.rust = {
{ -- {
name = "Rust Debug", -- name = "Rust Debug",
type = "codelldb", -- type = "codelldb",
request = "launch", -- request = "launch",
program = function() -- program = function()
vim.fn.jobstart("cargo build"); -- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug", "file")
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug", "file") -- end,
end, -- cwd = "${workspaceFolder}",
cwd = "${workspaceFolder}", -- stopOnEntry = true,
stopOnEntry = true, -- showDisassembly = "never"
showDisassembly = "never" -- }
} -- }
}
end end

View File

@ -22,6 +22,9 @@ return {
-- extras -- extras
"SmiteshP/nvim-navic", "SmiteshP/nvim-navic",
"Decodetalkers/csharpls-extended-lsp.nvim", "Decodetalkers/csharpls-extended-lsp.nvim",
-- rust
'mrcjkb/rustaceanvim'
}, },
config = function() config = function()
local lsp = require("lsp-zero") local lsp = require("lsp-zero")
@ -50,17 +53,17 @@ return {
} }
} }
}) })
--
lsp.configure("rust_analyzer", { -- lsp.configure("rust_analyzer", {
settings = { -- settings = {
["rust-analyzer"] = { -- ["rust-analyzer"] = {
checkOnSave = true, -- checkOnSave = true,
check = { -- check = {
command = "clippy" -- command = "clippy"
} -- }
} -- }
} -- }
}) -- })
lsp.set_server_config({ lsp.set_server_config({
capabilities = { capabilities = {
@ -80,7 +83,7 @@ return {
require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
vim.opt.completeopt = {'menu', 'menuone', 'noselect'} vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
cmp.setup({ cmp.setup({
formatting = cmp_format, formatting = cmp_format,
@ -92,16 +95,16 @@ return {
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
sources = { sources = {
{name = 'path'}, { name = 'path' },
{name = 'nvim_lsp'}, { name = 'nvim_lsp' },
{name = 'nvim_lua'}, { name = 'nvim_lua' },
{name = 'buffer', keyword_length = 3}, { name = 'buffer', keyword_length = 3 },
{name = 'luasnip', keyword_length = 2}, { name = 'luasnip', keyword_length = 2 },
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
-- confirm completion item -- confirm completion item
['<CR>'] = cmp.mapping.confirm({select = false, behavior = cmp.ConfirmBehavior.Insert}), ['<CR>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Insert }),
['<Tab>'] = cmp.mapping.confirm({select = false, behavior = cmp.ConfirmBehavior.Replace}), ['<Tab>'] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
-- toggle completion menu -- toggle completion menu
['<C-e>'] = cmp_action.toggle_completion(), ['<C-e>'] = cmp_action.toggle_completion(),
@ -125,7 +128,7 @@ return {
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 end
@ -146,13 +149,14 @@ return {
require("mason").setup({}); require("mason").setup({});
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = {'tsserver','svelte', 'lua_ls', 'csharp_ls', "rust_analyzer"}, ensure_installed = { 'tsserver', 'svelte', 'lua_ls', 'csharp_ls', 'rust_analyzer' },
handlers = { handlers = {
lsp.default_setup, lsp.default_setup,
lua_ls = function() lua_ls = function()
local lua_opts = lsp.nvim_lua_ls() local lua_opts = lsp.nvim_lua_ls()
require('lspconfig').lua_ls.setup(lua_opts) require('lspconfig').lua_ls.setup(lua_opts)
end, end,
rust_analyzer = lsp.noop,
} }
}) })
@ -176,5 +180,15 @@ return {
}, },
}) })
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 end
} }

View File

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