From f8f6e1566e539b42d70380c02ea18a61fa4f41e9 Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Tue, 21 Mar 2023 21:43:34 +0100 Subject: Add light theme to neovim and tmux clipboard on --- .config/nvim/lua/filetree.lua | 6 +++- .config/nvim/lua/general.lua | 8 +++++ .config/nvim/lua/lsp.lua | 77 ++++++------------------------------------- .config/nvim/lua/plugins.lua | 15 +++++++++ .config/tmux/tmux.conf | 1 + 5 files changed, 39 insertions(+), 68 deletions(-) diff --git a/.config/nvim/lua/filetree.lua b/.config/nvim/lua/filetree.lua index d252bad..c47cbca 100644 --- a/.config/nvim/lua/filetree.lua +++ b/.config/nvim/lua/filetree.lua @@ -1,2 +1,6 @@ -require("nvim-tree").setup() +require("nvim-tree").setup({ + view = { + side = "right"; + } +}) diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua index 8864a2e..f50f538 100644 --- a/.config/nvim/lua/general.lua +++ b/.config/nvim/lua/general.lua @@ -55,5 +55,13 @@ if vim.fn.has("wsl") == 1 then group = vim.api.nvim_create_augroup("Yank", { clear = true }); callback = function() vim.fn.system("clip.exe", vim.fn.getreg("\"")) end; }) +else + vim.api.nvim_create_autocmd('TextYankPost', { + callback = function() + if vim.v.event.operator == 'y' and vim.v.event.regname == '+' then + require('osc52').copy_register('+') + end + end + }) end diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 5e8ddf8..4c8ab62 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -281,7 +281,9 @@ require("lspconfig").lua_ls.setup({ }; }) -require("lspconfig").jedi_language_server.setup({}) +require("lspconfig").jdtls.setup({}) + +require('lspconfig').jedi_language_server.setup({}) local null_ls = require("null-ls") @@ -311,75 +313,16 @@ null_ls.setup({ local dap, dapui = require("dap"), require("dapui") dapui.setup() -dap.listeners.after.event_initialized["dapui_config"] = - function() dapui.open() end -dap.listeners.before.event_terminated["dapui_config"] = - function() dapui.close() end -dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end - -dap.adapters.coreclr = { - type = "executable"; - command = "netcoredbg"; - args = { "--interpreter=vscode" }; -} - -vim.g.dotnet_build_project = function() - local default_path = vim.fn.getcwd() .. "/" - if vim.g["dotnet_last_proj_path"] ~= nil then - default_path = vim.g["dotnet_last_proj_path"] - end - local path = vim.fn.input("Path to your *proj file", default_path, "file") - vim.g["dotnet_last_proj_path"] = path - local cmd = "dotnet build -c Debug " .. path .. " > /dev/null" - print("") - print("Cmd to execute: " .. cmd) - local f = os.execute(cmd) - if f == 0 then - print("\nBuild: ✔️ ") - else - print("\nBuild: ❌ (code: " .. f .. ")") - end +dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() end - -vim.g.dotnet_get_dll_path = function() - local request = function() - return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file") - end - - if vim.g["dotnet_last_dll_path"] == nil then - vim.g["dotnet_last_dll_path"] = request() - else - if vim.fn.confirm("Do you want to change the path to dll?\n" .. - vim.g["dotnet_last_dll_path"], "&yes\n&no", 2) == 1 then - vim.g["dotnet_last_dll_path"] = request() - end - end - - return vim.g["dotnet_last_dll_path"] +dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() +end +dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() end -dap.configurations.cs = { - { - type = "coreclr"; - name = "launch - netcoredbg"; - request = "launch"; - program = function() - if vim.fn.confirm("Should I recompile first?", "&yes\n&no", 2) == 1 then - vim.g.dotnet_build_project() - end - return vim.g.dotnet_get_dll_path() - end; - }; - { - -- If you get an "Operation not permitted" error using this, try disabling YAMA: - -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope - name = "Attach to process"; - type = "cs"; - request = "attach"; - pid = require("dap.utils").pick_process; - args = {}; - }; -} vim.diagnostic.config({ virtual_text = false; diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index b34398c..101eaa5 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -4,6 +4,7 @@ local PKGS = { -- Common { url = "https://github.com/kyazdani42/nvim-web-devicons.git" }; + { url = "https://github.com/ojroques/nvim-osc52.git" }; { url = "https://github.com/kyazdani42/nvim-tree.lua.git" }; { url = "https://github.com/nvim-telescope/telescope.nvim.git" }; @@ -15,6 +16,7 @@ local PKGS = { { url = "https://github.com/tpope/vim-abolish.git" }; { url = "https://github.com/mg979/vim-visual-multi.git" }; { url = "https://github.com/echasnovski/mini.nvim.git" }; + { url = "https://github.com/catppuccin/nvim.git" }; -- Status line { url = "https://github.com/akinsho/bufferline.nvim.git" }; @@ -33,6 +35,7 @@ local PKGS = { { url = "https://github.com/sainnhe/sonokai.git" }; { url = "https://github.com/navarasu/onedark.nvim.git" }; { url = "https://github.com/Mofiqul/adwaita.nvim.git" }; + { url = "https://github.com/projekt0n/github-nvim-theme.git" }; -- LCOV Coverage { url = "https://github.com/google/vim-coverage.git" }; @@ -146,11 +149,23 @@ local function init_plugins() end; }); + require("catppuccin").setup({ + transparent_background = true, + show_end_of_line = true, + term_colors = true, + }) + vim.o.foldcolumn = "1" vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value vim.o.foldlevelstart = 99 vim.o.foldenable = true + require('osc52').setup { + max_length = 0, -- Maximum length of selection (0 for no limit) + silent = false, -- Disable message on successful copy + trim = false, -- Trim surrounding whitespaces before copy + } + require("devcontainer").setup({}) require("which-key").setup({}) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 7f5528e..e68c4d6 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -4,6 +4,7 @@ set-option -ga terminal-overrides ",xterm-256color:Tc" setw -g mode-keys vi set -g history-limit 10000 set -sg escape-time 50 +set -s set-clipboard on set -g status-interval 30 set -g status-style "bg=black,fg=white" -- cgit v1.2.3