fix: Terminal popup

This commit is contained in:
Fabio Lenherr / DashieTM 2023-04-23 10:56:45 +02:00
parent 1e7350bd27
commit 090314c4e5
11 changed files with 122 additions and 20 deletions

12
nvim/ftplugin/rust.lua Normal file
View file

@ -0,0 +1,12 @@
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})

View file

@ -35,7 +35,6 @@
"neoconf.nvim": { "branch": "main", "commit": "6aaeb48336b369d7ed8ef243bfd0d76ec79362cd" },
"neodev.nvim": { "branch": "main", "commit": "864b35006d3de24c60e44b566de8018f919b13e6" },
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
"noice.nvim": { "branch": "main", "commit": "1da4edfba3e9278e98fc9723d7235d9ab3889744" },
"nui.nvim": { "branch": "main", "commit": "1f43b13d133eb4b4f53a4485379d9afa58808389" },
"null-ls.nvim": { "branch": "main", "commit": "5855128178fa78293acdfb5b4e41ef046779240b" },
"nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },
@ -54,6 +53,7 @@
"nvim-web-devicons": { "branch": "master", "commit": "0568104bf8d0c3ab16395433fcc5c1638efc25d4" },
"persistence.nvim": { "branch": "main", "commit": "c814fae5c37aa0aba9cd9da05df6e52b88d612c3" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "f044050da3ec6e1cdb31985beecec6810cc27f0b" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "e0fcb12702ad0d2873544a31730f9aaef04fd032" },
"telescope-project.nvim": { "branch": "master", "commit": "fa081e35ba7397e5147a51ece693aa3afda167fc" },

View file

@ -1,7 +1,3 @@
-- maps are automatically loaded on the VeryLazy event
-- Default maps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/maps.lua
-- Add any additional maps here
local Util = require("lazyvim.util")
local function map(mode, lhs, rhs, opts)
@ -17,10 +13,6 @@ end
local opts = { noremap = true, silent = true }
local term_opts = { silent = true }
-- map("n", "d", ':set relativenumber<CR>d', opts)
-- map("n", "y", ':set relativenumber<CR>y', opts)
-- map("n", "<ESC>", ':set norelativenumber<CR><ESC>', opts)
-- crimes against humanity, but I don't care
map("n", "j", "h", opts)
map("n", "l", "k", opts)
@ -43,7 +35,7 @@ map("n", "<F10>", ':lua require("dap").close()<CR> :lua require("dapui").toggle(
map("n", "f", ":lua require('nvim-tree.api').tree.toggle()<CR>", opts)
-- toggle terminal
map("n", "<C-d>", ":lua require('toggleterm').toggle(1)<CR>", opts)
map("n", "<C-t>", ":lua require('toggleterm').toggle(1)<CR>", opts)
-- tab switching
map("n", "<F1>", ":BufferLineCyclePrev<CR>", opts)
@ -72,8 +64,8 @@ function _G.set_terminal_maps()
vim.keymap.set("t", "jk", [[<C-\><C-n>]], opts)
vim.keymap.set("t", "<A-h>", [[<Cmd>wincmd h<CR>]], opts)
vim.keymap.set("t", "<A-j>", [[<Cmd>wincmd j<CR>]], opts)
-- vim.keymap.set("t", "<A-k>", [[<Cmd>wincmd k<CR>]], opts)
-- vim.keymap.set("t", "<A-l>", [[<Cmd>wincmd l<CR>]], opts)
vim.keymap.set("n", "<C-t>", ":lua require('toggleterm').toggle(1)<CR>", opts)
vim.keymap.set("i", "<C-t>", ":lua require('toggleterm').toggle(1)<CR>", opts)
end
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
@ -84,7 +76,6 @@ map("n", "<A-l>", ":wincmd k<CR>", opts)
map("n", "<A-;>", ":wincmd l<CR>", opts)
-- harpoon man
map("n", "<C-1>", ":lua require('harpoon.ui').nav_file(1)<CR>", opts)
map("n", "<C-2>", ":lua require('harpoon.ui').nav_file(2)<CR>", opts)
map("n", "<C-3>", ":lua require('harpoon.ui').nav_file(3)<CR>", opts)
@ -98,7 +89,6 @@ map("n", "fg", ":lua require('telescope.builtin').live_grep()<CR>", {})
map("n", "fh", ":lua require('telescope.builtin').help_tags()<CR>", {})
map("n", "fp", ":lua require'telescope'.extensions.project.project{}<CR>", { noremap = true, silent = true })
map("n", "fm", ":Telescope harpoon marks<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>z", ":lua require('telescope').extensions.zoxide.list{}<CR>")
-- trouble
@ -110,8 +100,9 @@ function Better_yank(opts)
vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "y")
end
vim.api.nvim_create_user_command("BetterYank", Better_yank, { count = 1 }) map("n", "gy", ":BetterYank<CR>", term_opts)
vim.api.nvim_create_user_command("BetterYank", Better_yank, { count = 1 })
map("n", "<leader>y", ":BetterYank<CR>", term_opts)
-- better delete
function Better_delete(opts)
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
@ -121,6 +112,17 @@ end
vim.api.nvim_create_user_command("BetterDelete", Better_delete, { count = 1 })
map("n", "<leader>d", ":BetterDelete<CR>", term_opts)
-- neovide zoom
local change_scale_factor = function(delta)
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
end
vim.keymap.set("n", "<C-=>", function()
change_scale_factor(1.25)
end)
vim.keymap.set("n", "<C-->", function()
change_scale_factor(1 / 1.25)
end)
-- gitui
map("n", "<leader>gg", function()
Util.float_term({ "gitui" }, { cwd = Util.get_root() })

View file

@ -50,7 +50,7 @@ return {
marksman = {},
asm_lsp = {},
csharp_ls = {
cmd = { "/home/dashie/.dotnet/tools/csharp-ls" },
cmd = { "/home/dashie/.local/share/nvim/mason/bin/csharp-ls" },
filetypes = { "cs" },
init_options = {
AutomaticWorkspaceInit = true,
@ -115,6 +115,9 @@ return {
jdtls = function()
return true
end,
rust_analyzer = function()
return true
end,
},
},
config = function(plugin, opts)
@ -148,7 +151,6 @@ return {
on_attach = on_attach,
vim.lsp.diagnostic.on_publish_diagnostics,
{
-- Disable virtual_text
virtual_text = true,
},
}, servers[server] or {})

View file

@ -158,4 +158,18 @@ return {
require("neoscroll.config").set_mappings(t)
end,
},
{
"simrat39/rust-tools.nvim",
lazy = true,
event = "FileType rust",
dependencies = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim", "mfussenegger/nvim-dap" },
opts = function()
local extension_path = vim.env.HOME .. "/.local/share/nvim/mason/packages/codelldb/extension/"
local codelldb_path = extension_path .. "adapter/codelldb"
local liblldb_path = extension_path .. "lldb/lib/liblldb.dylib"
return {
dap = { adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path) },
}
end,
},
}