From 988fd01ab7e272918625e37fd6fe77b34c9224a2 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Wed, 2 Oct 2024 09:57:37 +0200 Subject: [PATCH 01/20] bash: update work profile (merge ubuntu with main) --- dotfiles/.bashrc | 24 +++++++++++++++++++++--- dotfiles/.environ | 2 ++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 52dc78b..21f7765 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -15,13 +15,31 @@ shopt -s histappend [[ -f $HOME/.bash_colors ]] && source "$HOME/.bash_colors" [[ -f $HOME/.bash_functions ]] && source "$HOME/.bash_functions" +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi +while read -r completion ; do source "$completion" ; done < <(find $HOME/.bash_completion/*) + # Save working dir on every prompt. export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"; pwd > $HOME/.cwd' -export PS1="${Yellow}\d \A ${Off}${Green}\u@\h: ${Off}\w ${Red}\$(parse_branch git)${BRed}\$(parse_branch fossil)${Off}\n-$ " +export PS1="${Red}\d \A ${Blue}\u@\h: ${Off}\w ${BGreen}\$(parse_branch git)${BPurple}\$(parse_branch fossil)${Off}\n-$ " + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize # Use fzf if installed. -hash fzf 2>/dev/null && eval "$(fzf --bash)" -export FZF_DEFAULT_OPTS='--border=horizontal --info=inline --no-reverse --height=50%' +export FZF_DEFAULT_OPTS='--border=horizontal --info=inline --no-reverse --height=30%' [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" diff --git a/dotfiles/.environ b/dotfiles/.environ index 24ba281..bd645bc 100644 --- a/dotfiles/.environ +++ b/dotfiles/.environ @@ -20,3 +20,5 @@ add_path() case :$PATH: in *:$1:*) ;; *) PATH=$1:$PATH;; esac add_path $HOME/.local/bin add_path $PYTHONUSERBASE/bin add_path $HOME/.cargo/bin +add_path $HOME/.kubectl-plugins:$PATH +add_path $PATH:/opt/gradle/gradle-8.8/bin From 0c5298af845a4f8721cfc5fecd7d55ea4700c9cb Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Wed, 2 Oct 2024 11:12:15 +0200 Subject: [PATCH 02/20] change paths and config values for work host - sway: use wlp* for waybar wifi interfaces - containers: set home path - gpg: use pinentry-gnome3 - git: change global user.email --- dotfiles/.config/containers/storage.conf | 2 +- dotfiles/.config/git/config | 2 +- dotfiles/.config/waybar/config | 2 +- dotfiles/.gnupg/gpg-agent.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dotfiles/.config/containers/storage.conf b/dotfiles/.config/containers/storage.conf index 3fc7f79..fbed9d1 100644 --- a/dotfiles/.config/containers/storage.conf +++ b/dotfiles/.config/containers/storage.conf @@ -1,4 +1,4 @@ [storage] driver = "overlay" runroot = "/run/user/1000" - graphroot = "/home/vladan/.local/share/containers/storage" + graphroot = "/home/vladanpopovic/.local/share/containers/storage" diff --git a/dotfiles/.config/git/config b/dotfiles/.config/git/config index c5a5d27..217cdd7 100644 --- a/dotfiles/.config/git/config +++ b/dotfiles/.config/git/config @@ -1,5 +1,5 @@ [user] - email = vladanovic@gmail.com + email = vladan.popovic@hm.com name = Vladan Popovic [core] excludesfile = /home/vladan/.config/git/ignore diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config index 207aefd..b0cdc8d 100644 --- a/dotfiles/.config/waybar/config +++ b/dotfiles/.config/waybar/config @@ -21,7 +21,7 @@ }, "network": { "tooltip": false, - "interface": "wlp3s0*", + "interface": "wlp*", "format-wifi": " {essid} ({signalStrength}%)", "format-ethernet": "{ifname}: {ipaddr}/{cidr}", "format-linked": "{ifname} (No IP)", diff --git a/dotfiles/.gnupg/gpg-agent.conf b/dotfiles/.gnupg/gpg-agent.conf index 4277e89..bba5ea9 100644 --- a/dotfiles/.gnupg/gpg-agent.conf +++ b/dotfiles/.gnupg/gpg-agent.conf @@ -1,5 +1,5 @@ default-cache-ttl 3600 -pinentry-program /usr/bin/pinentry-qt5 +pinentry-program /usr/bin/pinentry-gnome3 max-cache-ttl 72000 default-cache-ttl 72000 max-cache-ttl-ssh 72000 From 8c71d70a46cd410b21d4b4ae7d62b14095788474 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 14 Oct 2024 08:57:01 +0200 Subject: [PATCH 03/20] alacritty: decrease font on big screen --- dotfiles/.config/alacritty/alacritty.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/.config/alacritty/alacritty.toml b/dotfiles/.config/alacritty/alacritty.toml index 2f95351..857e36e 100644 --- a/dotfiles/.config/alacritty/alacritty.toml +++ b/dotfiles/.config/alacritty/alacritty.toml @@ -13,7 +13,7 @@ style = "Block" TERM = "alacritty" [font] -size = 11 +size = 10 [font.bold] family = "monospace" From 2844c29a9c645b59d199b6a0f55f34edcb0f05cf Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Tue, 22 Oct 2024 20:37:15 +0200 Subject: [PATCH 04/20] sway: fix screenshot capture --- dotfiles/.config/sway/config.d/90-bindings.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotfiles/.config/sway/config.d/90-bindings.conf b/dotfiles/.config/sway/config.d/90-bindings.conf index 2f16926..a38c706 100644 --- a/dotfiles/.config/sway/config.d/90-bindings.conf +++ b/dotfiles/.config/sway/config.d/90-bindings.conf @@ -122,9 +122,9 @@ bindsym $mod+z exec swaylock -c 000000 # Take full screen screenshot with PrtScr -bindsym Print exec grim -t png "~/screenshot-$(date +%Y-%m-%d-%H%M%S).png" +bindsym Print exec grim -t png ~/screenshot-$(date +%Y-%m-%d-%H%M%S).png # Take area screenshot with Shift+PrtScr -bindsym Shift+Print exec grim -g "$(slurp)" "~/screenshot-$(date +%Y-%m-%d-%H%M%S).png" +bindsym Shift+Print exec grim -g "$(slurp)" ~/screenshot-$(date +%Y-%m-%d-%H%M%S).png # # Resizing containers: From 9259e7b2ba2425e22aa0882b97a32696d07eedc9 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sat, 2 Nov 2024 12:37:30 +0100 Subject: [PATCH 05/20] Update alacritty - config format --- dotfiles/.config/alacritty/alacritty.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dotfiles/.config/alacritty/alacritty.toml b/dotfiles/.config/alacritty/alacritty.toml index 2f95351..acf2d4c 100644 --- a/dotfiles/.config/alacritty/alacritty.toml +++ b/dotfiles/.config/alacritty/alacritty.toml @@ -1,9 +1,9 @@ -live_config_reload = true -working_directory = "None" - +[general] import = [ "~/.config/alacritty/light.toml" ] +live_config_reload = true +working_directory = "None" [cursor] thickness = 0.2 @@ -414,7 +414,7 @@ history = 100000 save_to_clipboard = true semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" -[shell] +[terminal.shell] program = "/bin/bash" [window] From b48b531d3d535ba1b2ef564d12df350f0e2cc0ef Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 3 Nov 2024 16:00:31 +0100 Subject: [PATCH 06/20] Swith to rustaceanvim and set up Rust debugging --- dotfiles/.config/nvim/lua/lsp.lua | 86 ++++++++++++--------- dotfiles/.config/nvim/lua/plugins/dap.lua | 87 ++++++++++++++++++++++ dotfiles/.config/nvim/lua/plugins/init.lua | 22 +++++- 3 files changed, 155 insertions(+), 40 deletions(-) create mode 100644 dotfiles/.config/nvim/lua/plugins/dap.lua diff --git a/dotfiles/.config/nvim/lua/lsp.lua b/dotfiles/.config/nvim/lua/lsp.lua index 5f337ea..2dde945 100644 --- a/dotfiles/.config/nvim/lua/lsp.lua +++ b/dotfiles/.config/nvim/lua/lsp.lua @@ -19,7 +19,6 @@ local common_on_attach = function(client, bufnr) end, }) end - -- Use vim's default coloring. client.server_capabilities.semanticTokensProvider = nil for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do @@ -27,13 +26,61 @@ local common_on_attach = function(client, bufnr) end end +-- LSP diagnostics. +vim.lsp.handlers["textDocument/publishDiagnostics"] = + vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = false, + underline = true, + signs = true, + update_in_insert = false + }) + +-- Setup rust outside of lspconfig. +vim.g.rustaceanvim = function() + return { + -- Plugin configuration. + tools = { + }, + -- LSP configuration. + server = { + on_attach = function(client, bufnr) + common_on_attach(client, bufnr) + end, + default_settings = { + -- rust-analyzer language server configuration + ['rust-analyzer'] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true + }, + checkOnSave = { + command = "clippy", + }, + }, + }, + -- DAP configuration. + dap = { + }, + } + } +end + local nvim_lsp = require('lspconfig') local capabilities = vim.lsp.protocol.make_client_capabilities() -- LSPs local servers = { "clangd", - "gleam", "lua_ls", "ocamllsp", "pyright", @@ -45,32 +92,6 @@ for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach } end -nvim_lsp.rust_analyzer.setup({ - on_attach = common_on_attach, - capabilities = capabilities, - settings = { - ["rust-analyzer"] = { - imports = { - granularity = { - group = "module", - }, - prefix = "self", - }, - cargo = { - buildScripts = { - enable = true, - }, - }, - procMacro = { - enable = true - }, - checkOnSave = { - command = "clippy", - }, - } - } -}) - nvim_lsp.ruff.setup({ on_attach = function (client) common_on_attach(client) @@ -84,12 +105,3 @@ nvim_lsp.ruff.setup({ } }, }) - --- LSP diagnostics. -vim.lsp.handlers["textDocument/publishDiagnostics"] = - vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - underline = true, - signs = true, - update_in_insert = false - }) diff --git a/dotfiles/.config/nvim/lua/plugins/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..de6ae2f --- /dev/null +++ b/dotfiles/.config/nvim/lua/plugins/dap.lua @@ -0,0 +1,87 @@ +local dap, dapui = require('dap'), require('dapui') + +-- Open dapui once dap starts. +dapui.setup() +dap.listeners.before.attach.dapui_config = function() + dapui.open() +end +dap.listeners.before.launch.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 + +-- Keybindings used in probably all editors/IDEs. +vim.keymap.set('n', '', dap.continue) +vim.keymap.set('n', '', dap.step_over) +vim.keymap.set('n', '', dap.step_into) +vim.keymap.set('n', '', dap.step_out) +-- Breakpoints. +vim.keymap.set('n', 'b', dap.toggle_breakpoint) +vim.keymap.set('n', 'B', dap.set_breakpoint) +vim.keymap.set('n', 'lp', function() dap.set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end) +-- Repl, run and dap-ui bindings. +vim.keymap.set('n', 'dr', dap.repl.open) +vim.keymap.set('n', 'dl', dap.run_last) +vim.keymap.set({'n', 'v'}, 'dh', function() require('dap.ui.widgets').hover() end) +vim.keymap.set({'n', 'v'}, 'dp', function() require('dap.ui.widgets').preview() end) +vim.keymap.set('n', 'df', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.frames) end) +vim.keymap.set('n', 'ds', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.scopes) end) + +-- Set up lldb (LLVM debugger) +-- Install archlinux: sudo pacman -S lldb +-- Install ubuntu: sudo apt +dap.adapters.lldb = { + type = 'server', + port = "${port}", + executable = { + command = '/usr/bin/lldb-dap', + args = { "--port", "${port}" }, + }, +} + +-- Custom debuggable build runs (on top of rust-analyzer debuggables). +local ExecTypes = { + TEST = "cargo build --tests -q --message-format=json", + BIN = "cargo build -q --message-format=json" +} +local function runBuild(type) + local lines = vim.fn.systemlist(type) + local output = table.concat(lines, "\n") + local filename = output:match('^.*"executable":"(.*)",.*\n.*,"success":true}$') + + if filename == nil then + return error("failed to build cargo project") + end + + return filename +end +-- Custom debuggable configurations. +dap.configurations.rust = { + { + name = "Debug Test", + type = "lldb", + request = "launch", + program = function () + return runBuild(ExecTypes.TEST) + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + showDisassembly = "never" + }, + { + name = "Debug Bin", + type = "lldb", + request = "launch", + program = function () + return runBuild(ExecTypes.BIN) + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + showDisassembly = "never" + } +} diff --git a/dotfiles/.config/nvim/lua/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index 61e0a61..94e4584 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -38,14 +38,29 @@ require('packer').startup(function() -- LSP and related use { 'neovim/nvim-lspconfig' } use { 'aznhe21/actions-preview.nvim' } - use { 'folke/trouble.nvim' } -- lsp diagnostics + use { 'folke/trouble.nvim' } -- diagnostics - -- Plugins to extend builtin language support + -- Plugins to extend builtin lsp use { 'cespare/vim-toml' } use { 'gleam-lang/gleam.vim' } - use { 'rust-lang/rust.vim' } use { 'folke/neodev.nvim' } use { 'hashivim/vim-terraform' } + use { + 'mrcjkb/rustaceanvim', + requires = { + 'mfussenegger/nvim-dap' + } + } + + -- Debugging + use { 'mfussenegger/nvim-dap' } + use { + "rcarriga/nvim-dap-ui", + requires = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio", + } + } -- Git use { @@ -70,6 +85,7 @@ end) require('plugins.catppuccin') require('plugins.cmp') +require('plugins.dap') require('plugins.gitsigns') require('plugins.luasnip_config') require('plugins.neogit') From 7dfe2ca68b7f055ea7fba839fda779b8e81b4a15 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 3 Nov 2024 19:53:47 +0100 Subject: [PATCH 07/20] change breakpoint icon --- dotfiles/.config/nvim/lua/plugins/dap.lua | 2 ++ dotfiles/.config/nvim/lua/plugins/init.lua | 1 + 2 files changed, 3 insertions(+) diff --git a/dotfiles/.config/nvim/lua/plugins/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua index de6ae2f..4414638 100644 --- a/dotfiles/.config/nvim/lua/plugins/dap.lua +++ b/dotfiles/.config/nvim/lua/plugins/dap.lua @@ -32,6 +32,8 @@ vim.keymap.set({'n', 'v'}, 'dp', function() require('dap.ui.widgets').pr vim.keymap.set('n', 'df', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.frames) end) vim.keymap.set('n', 'ds', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.scopes) end) +vim.fn.sign_define('DapBreakpoint', {text='󰬪', texthl='', linehl='', numhl=''}) + -- Set up lldb (LLVM debugger) -- Install archlinux: sudo pacman -S lldb -- Install ubuntu: sudo apt diff --git a/dotfiles/.config/nvim/lua/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index 94e4584..cb6ca9d 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -3,6 +3,7 @@ require('plugins.packer_setup') require('packer').startup(function() -- Packer can manage itself as an optional plugin use { 'wbthomason/packer.nvim', opt = true } + use { 'glepnir/nerdicons.nvim', cmd = 'NerdIcons', config = function() require('nerdicons').setup({}) end } -- Fuzzy finder use { From a06e856332587a34c27e7a0d5198ba91c856ab5a Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 17 Nov 2024 00:07:23 +0100 Subject: [PATCH 08/20] nvim: python dap wip --- dotfiles/.config/nvim/lua/plugins/dap.lua | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dotfiles/.config/nvim/lua/plugins/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua index 4414638..cf4f022 100644 --- a/dotfiles/.config/nvim/lua/plugins/dap.lua +++ b/dotfiles/.config/nvim/lua/plugins/dap.lua @@ -87,3 +87,34 @@ dap.configurations.rust = { showDisassembly = "never" } } + +-- Set up debugpy via uv +dap.adapters.python = { + type = 'server', + port = "${port}", + host = "127.0.0.1", + executable = { + command = "uvx", + args = { + "debugpy", + "--listen", + "127.0.0.1:${port}", + "--wait-for-client", + }, + }, + options = { + source_filetype = 'python', + }, +} + +dap.configurations.python = { + { + type = 'python'; + request = 'launch'; + name = "Launch file"; + program = "${file}"; + pythonPath = function() + return "${workspaceFolder}/.venv/bin/python" + end; + }, +} From 92781385aebb005871409dfa89ca2d6fb686216b Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Tue, 3 Dec 2024 01:47:00 +0100 Subject: [PATCH 09/20] Reconfigure mako, colors and timeouts --- dotfiles/.config/mako/config | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dotfiles/.config/mako/config b/dotfiles/.config/mako/config index a32fc19..a19fc01 100644 --- a/dotfiles/.config/mako/config +++ b/dotfiles/.config/mako/config @@ -1,6 +1,6 @@ sort=-time -default-timeout=0 -ignore-timeout=0 +default-timeout=5000 +ignore-timeout=1 height=200 width=400 @@ -17,16 +17,14 @@ border-radius=10 background-color=#eff1f5E0 text-color=#4c4f69 -border-color=#40a02b progress-color=over #ccd0da [urgency=low] border-color=#c1ca8c -[urgency=high] -border-color=#fe040b -background-color=#ffe1e5 +[urgency=normal] +border-color=#a1bacc [urgency=critical] border-color=#fe040b -background-color=#ffe1e5 +default-timeout=0 From 104665a90a78034f46216d6b1c5afc233352bbbf Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 4 Nov 2024 08:52:15 +0100 Subject: [PATCH 10/20] ignore more folders in telescope --- dotfiles/.config/nvim/lua/plugins/telescope.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotfiles/.config/nvim/lua/plugins/telescope.lua b/dotfiles/.config/nvim/lua/plugins/telescope.lua index 08388d6..eb347c0 100644 --- a/dotfiles/.config/nvim/lua/plugins/telescope.lua +++ b/dotfiles/.config/nvim/lua/plugins/telescope.lua @@ -45,6 +45,8 @@ telescope.setup { file_ignore_patterns = { '.git/', '.venv/', + '.pytest_cache/', + 'target/', }, }, pickers = { From 61aa9ba7ce5376a3a7cebb2289175a6cd912ad9f Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Fri, 26 Sep 2025 16:41:34 +0200 Subject: [PATCH 11/20] Update nvim lsp and plugins --- dotfiles/.config/nvim/after/lsp/ty.lua | 6 +++ dotfiles/.config/nvim/lua/keymappings.lua | 6 ++- dotfiles/.config/nvim/lua/lsp.lua | 37 ++++--------------- .../.config/nvim/lua/plugins/catppuccin.lua | 5 ++- dotfiles/.config/nvim/lua/plugins/neogit.lua | 8 ++-- dotfiles/.config/nvim/lua/plugins/oil.lua | 2 +- 6 files changed, 29 insertions(+), 35 deletions(-) create mode 100644 dotfiles/.config/nvim/after/lsp/ty.lua diff --git a/dotfiles/.config/nvim/after/lsp/ty.lua b/dotfiles/.config/nvim/after/lsp/ty.lua new file mode 100644 index 0000000..4f1df79 --- /dev/null +++ b/dotfiles/.config/nvim/after/lsp/ty.lua @@ -0,0 +1,6 @@ +-- ~/.config/nvim/after/lsp/ty.lua +return { + cmd = { "ty", "server" }, + filetypes = { "python" }, + root_dir = vim.fs.root(0, { ".git/", "pyproject.toml" }), +} diff --git a/dotfiles/.config/nvim/lua/keymappings.lua b/dotfiles/.config/nvim/lua/keymappings.lua index 58f4ca9..ab520fd 100644 --- a/dotfiles/.config/nvim/lua/keymappings.lua +++ b/dotfiles/.config/nvim/lua/keymappings.lua @@ -19,6 +19,10 @@ vim.keymap.set("n", "aa", require("actions-preview").code_actions) -- Outline!! vim.keymap.set("n", "o", "Outline") - -- Close all buffers vim.keymap.set("n", '', "bufdo bd") + +vim.keymap.set("n", "", "lua vim.lsp.buf.rename()()") +vim.keymap.set("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))") +vim.keymap.set("n", "wa", "lua vim.lsp.buf.add_workspace_folder()") +vim.keymap.set("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()") diff --git a/dotfiles/.config/nvim/lua/lsp.lua b/dotfiles/.config/nvim/lua/lsp.lua index 2dde945..40b14dc 100644 --- a/dotfiles/.config/nvim/lua/lsp.lua +++ b/dotfiles/.config/nvim/lua/lsp.lua @@ -1,15 +1,6 @@ local autoformat_files = '*.py,*.rs,*.tf' local common_on_attach = function(client, bufnr) - -- Mappings. - vim.keymap.set("n", "K", "lua vim.lsp.buf.hover()") - vim.keymap.set("n", "", "lua vim.lsp.buf.signature_help()") - vim.keymap.set("n", "", "lua vim.lsp.buf.type_definition()") - vim.keymap.set("n", "", "lua vim.lsp.buf.rename()()") - vim.keymap.set("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))") - vim.keymap.set("n", "wa", "lua vim.lsp.buf.add_workspace_folder()") - vim.keymap.set("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()") - -- Autoformat on save. if client.supports_method("textDocument/formatting") then vim.api.nvim_create_autocmd("BufWritePre", { @@ -19,6 +10,7 @@ local common_on_attach = function(client, bufnr) end, }) end + -- Use vim's default coloring. client.server_capabilities.semanticTokensProvider = nil for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do @@ -63,9 +55,7 @@ vim.g.rustaceanvim = function() procMacro = { enable = true }, - checkOnSave = { - command = "clippy", - }, + checkOnSave = true, }, }, -- DAP configuration. @@ -75,33 +65,22 @@ vim.g.rustaceanvim = function() } end -local nvim_lsp = require('lspconfig') local capabilities = vim.lsp.protocol.make_client_capabilities() +vim.lsp.enable('ty') + -- LSPs local servers = { "clangd", "lua_ls", "ocamllsp", - "pyright", "rnix", "terraformls", "vimls", } for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach } + vim.lsp.config(lsp, { + capabilities = capabilities, + on_attach = common_on_attach, + }) end - -nvim_lsp.ruff.setup({ - on_attach = function (client) - common_on_attach(client) - client.server_capabilities.renameProvider = false - client.server_capabilities.hoverProvider = false - end, - init_options = { - settings = { - -- Any extra CLI arguments for `ruff` go here. - args = {} - } - }, -}) diff --git a/dotfiles/.config/nvim/lua/plugins/catppuccin.lua b/dotfiles/.config/nvim/lua/plugins/catppuccin.lua index e29ea46..3cbb45c 100644 --- a/dotfiles/.config/nvim/lua/plugins/catppuccin.lua +++ b/dotfiles/.config/nvim/lua/plugins/catppuccin.lua @@ -16,7 +16,7 @@ require("catppuccin").setup({ TelescopeNormal = { bg = "#fafafa" }, TelescopePromptNormal = { bg = colors.surface1 }, TelescopePromptBorder = { bg = colors.surface1, fg = colors.surface1 }, - CursorLine = { bg = colors.text }, + CursorLine = { bg = colors.surface2 }, NvimTreeWinSeparator = { fg = colors.text }, NvimTreeGitNew = { fg = colors.green }, NvimTreeGitDirty = { fg = colors.yellow }, @@ -100,6 +100,9 @@ require("catppuccin").setup({ DiagnosticUnnecessary = { link = "" }, + Pmenu = { fg = colors.text }, + PmenuSel = { bg = colors.overlay0 }, + --["@conceal.checked"] = { fg = colors.teal }, --["@none"] = { link = "Normal" }, --["@field"] = { fg = colors.blue }, diff --git a/dotfiles/.config/nvim/lua/plugins/neogit.lua b/dotfiles/.config/nvim/lua/plugins/neogit.lua index 771a0e6..57b7d83 100644 --- a/dotfiles/.config/nvim/lua/plugins/neogit.lua +++ b/dotfiles/.config/nvim/lua/plugins/neogit.lua @@ -24,9 +24,11 @@ neogit.setup { graph_style = "ascii", -- Used to generate URL's for branch popup action "pull request". git_services = { - ["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", - ["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1", - ["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", + ["github.com"] = { + pull_request = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", + commit = "https://github.com/${owner}/${repository}/commit/${oid}", + tree = "https://${host}/${owner}/${repository}/tree/${branch_name}", + }, }, -- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf -- sorter instead. By default, this function returns `nil`. diff --git a/dotfiles/.config/nvim/lua/plugins/oil.lua b/dotfiles/.config/nvim/lua/plugins/oil.lua index 884e296..16e9fbb 100644 --- a/dotfiles/.config/nvim/lua/plugins/oil.lua +++ b/dotfiles/.config/nvim/lua/plugins/oil.lua @@ -53,7 +53,7 @@ require('oil').setup({ -- Skip the confirmation popup for simple operations skip_confirm_for_simple_edits = false, -- Change this to customize the command used when deleting to trash - trash_command = "trash-put", + -- trash_command = "trash-put", -- Selecting a new/moved/renamed file or directory will prompt you to save changes first prompt_save_on_select_new_entry = true, -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap From a697524c74652d5a66d0a3205a7bf7dbde0861a7 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Tue, 22 Oct 2024 20:37:15 +0200 Subject: [PATCH 12/20] sway: fix screenshot capture --- dotfiles/.config/sway/config.d/90-bindings.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotfiles/.config/sway/config.d/90-bindings.conf b/dotfiles/.config/sway/config.d/90-bindings.conf index 2f16926..a38c706 100644 --- a/dotfiles/.config/sway/config.d/90-bindings.conf +++ b/dotfiles/.config/sway/config.d/90-bindings.conf @@ -122,9 +122,9 @@ bindsym $mod+z exec swaylock -c 000000 # Take full screen screenshot with PrtScr -bindsym Print exec grim -t png "~/screenshot-$(date +%Y-%m-%d-%H%M%S).png" +bindsym Print exec grim -t png ~/screenshot-$(date +%Y-%m-%d-%H%M%S).png # Take area screenshot with Shift+PrtScr -bindsym Shift+Print exec grim -g "$(slurp)" "~/screenshot-$(date +%Y-%m-%d-%H%M%S).png" +bindsym Shift+Print exec grim -g "$(slurp)" ~/screenshot-$(date +%Y-%m-%d-%H%M%S).png # # Resizing containers: From d68bd10bd1152437f2a74ac243e252c62b5a7112 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sat, 2 Nov 2024 12:37:30 +0100 Subject: [PATCH 13/20] Update alacritty - config format --- dotfiles/.config/alacritty/alacritty.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dotfiles/.config/alacritty/alacritty.toml b/dotfiles/.config/alacritty/alacritty.toml index 857e36e..2d6de2f 100644 --- a/dotfiles/.config/alacritty/alacritty.toml +++ b/dotfiles/.config/alacritty/alacritty.toml @@ -1,9 +1,9 @@ -live_config_reload = true -working_directory = "None" - +[general] import = [ "~/.config/alacritty/light.toml" ] +live_config_reload = true +working_directory = "None" [cursor] thickness = 0.2 @@ -414,7 +414,7 @@ history = 100000 save_to_clipboard = true semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" -[shell] +[terminal.shell] program = "/bin/bash" [window] From 82ce9b2891a121f939d09e69577b2a0953cb7838 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 3 Nov 2024 16:00:31 +0100 Subject: [PATCH 14/20] Swith to rustaceanvim and set up Rust debugging --- dotfiles/.config/nvim/lua/lsp.lua | 86 ++++++++++++--------- dotfiles/.config/nvim/lua/plugins/dap.lua | 87 ++++++++++++++++++++++ dotfiles/.config/nvim/lua/plugins/init.lua | 22 +++++- 3 files changed, 155 insertions(+), 40 deletions(-) create mode 100644 dotfiles/.config/nvim/lua/plugins/dap.lua diff --git a/dotfiles/.config/nvim/lua/lsp.lua b/dotfiles/.config/nvim/lua/lsp.lua index 5f337ea..2dde945 100644 --- a/dotfiles/.config/nvim/lua/lsp.lua +++ b/dotfiles/.config/nvim/lua/lsp.lua @@ -19,7 +19,6 @@ local common_on_attach = function(client, bufnr) end, }) end - -- Use vim's default coloring. client.server_capabilities.semanticTokensProvider = nil for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do @@ -27,13 +26,61 @@ local common_on_attach = function(client, bufnr) end end +-- LSP diagnostics. +vim.lsp.handlers["textDocument/publishDiagnostics"] = + vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = false, + underline = true, + signs = true, + update_in_insert = false + }) + +-- Setup rust outside of lspconfig. +vim.g.rustaceanvim = function() + return { + -- Plugin configuration. + tools = { + }, + -- LSP configuration. + server = { + on_attach = function(client, bufnr) + common_on_attach(client, bufnr) + end, + default_settings = { + -- rust-analyzer language server configuration + ['rust-analyzer'] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true + }, + checkOnSave = { + command = "clippy", + }, + }, + }, + -- DAP configuration. + dap = { + }, + } + } +end + local nvim_lsp = require('lspconfig') local capabilities = vim.lsp.protocol.make_client_capabilities() -- LSPs local servers = { "clangd", - "gleam", "lua_ls", "ocamllsp", "pyright", @@ -45,32 +92,6 @@ for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach } end -nvim_lsp.rust_analyzer.setup({ - on_attach = common_on_attach, - capabilities = capabilities, - settings = { - ["rust-analyzer"] = { - imports = { - granularity = { - group = "module", - }, - prefix = "self", - }, - cargo = { - buildScripts = { - enable = true, - }, - }, - procMacro = { - enable = true - }, - checkOnSave = { - command = "clippy", - }, - } - } -}) - nvim_lsp.ruff.setup({ on_attach = function (client) common_on_attach(client) @@ -84,12 +105,3 @@ nvim_lsp.ruff.setup({ } }, }) - --- LSP diagnostics. -vim.lsp.handlers["textDocument/publishDiagnostics"] = - vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - underline = true, - signs = true, - update_in_insert = false - }) diff --git a/dotfiles/.config/nvim/lua/plugins/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..de6ae2f --- /dev/null +++ b/dotfiles/.config/nvim/lua/plugins/dap.lua @@ -0,0 +1,87 @@ +local dap, dapui = require('dap'), require('dapui') + +-- Open dapui once dap starts. +dapui.setup() +dap.listeners.before.attach.dapui_config = function() + dapui.open() +end +dap.listeners.before.launch.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 + +-- Keybindings used in probably all editors/IDEs. +vim.keymap.set('n', '', dap.continue) +vim.keymap.set('n', '', dap.step_over) +vim.keymap.set('n', '', dap.step_into) +vim.keymap.set('n', '', dap.step_out) +-- Breakpoints. +vim.keymap.set('n', 'b', dap.toggle_breakpoint) +vim.keymap.set('n', 'B', dap.set_breakpoint) +vim.keymap.set('n', 'lp', function() dap.set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end) +-- Repl, run and dap-ui bindings. +vim.keymap.set('n', 'dr', dap.repl.open) +vim.keymap.set('n', 'dl', dap.run_last) +vim.keymap.set({'n', 'v'}, 'dh', function() require('dap.ui.widgets').hover() end) +vim.keymap.set({'n', 'v'}, 'dp', function() require('dap.ui.widgets').preview() end) +vim.keymap.set('n', 'df', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.frames) end) +vim.keymap.set('n', 'ds', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.scopes) end) + +-- Set up lldb (LLVM debugger) +-- Install archlinux: sudo pacman -S lldb +-- Install ubuntu: sudo apt +dap.adapters.lldb = { + type = 'server', + port = "${port}", + executable = { + command = '/usr/bin/lldb-dap', + args = { "--port", "${port}" }, + }, +} + +-- Custom debuggable build runs (on top of rust-analyzer debuggables). +local ExecTypes = { + TEST = "cargo build --tests -q --message-format=json", + BIN = "cargo build -q --message-format=json" +} +local function runBuild(type) + local lines = vim.fn.systemlist(type) + local output = table.concat(lines, "\n") + local filename = output:match('^.*"executable":"(.*)",.*\n.*,"success":true}$') + + if filename == nil then + return error("failed to build cargo project") + end + + return filename +end +-- Custom debuggable configurations. +dap.configurations.rust = { + { + name = "Debug Test", + type = "lldb", + request = "launch", + program = function () + return runBuild(ExecTypes.TEST) + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + showDisassembly = "never" + }, + { + name = "Debug Bin", + type = "lldb", + request = "launch", + program = function () + return runBuild(ExecTypes.BIN) + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + showDisassembly = "never" + } +} diff --git a/dotfiles/.config/nvim/lua/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index 61e0a61..94e4584 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -38,14 +38,29 @@ require('packer').startup(function() -- LSP and related use { 'neovim/nvim-lspconfig' } use { 'aznhe21/actions-preview.nvim' } - use { 'folke/trouble.nvim' } -- lsp diagnostics + use { 'folke/trouble.nvim' } -- diagnostics - -- Plugins to extend builtin language support + -- Plugins to extend builtin lsp use { 'cespare/vim-toml' } use { 'gleam-lang/gleam.vim' } - use { 'rust-lang/rust.vim' } use { 'folke/neodev.nvim' } use { 'hashivim/vim-terraform' } + use { + 'mrcjkb/rustaceanvim', + requires = { + 'mfussenegger/nvim-dap' + } + } + + -- Debugging + use { 'mfussenegger/nvim-dap' } + use { + "rcarriga/nvim-dap-ui", + requires = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio", + } + } -- Git use { @@ -70,6 +85,7 @@ end) require('plugins.catppuccin') require('plugins.cmp') +require('plugins.dap') require('plugins.gitsigns') require('plugins.luasnip_config') require('plugins.neogit') From 9a094971862648baebc33f661106f2285ee3c6e3 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 3 Nov 2024 19:53:47 +0100 Subject: [PATCH 15/20] change breakpoint icon --- dotfiles/.config/nvim/lua/plugins/dap.lua | 2 ++ dotfiles/.config/nvim/lua/plugins/init.lua | 1 + 2 files changed, 3 insertions(+) diff --git a/dotfiles/.config/nvim/lua/plugins/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua index de6ae2f..4414638 100644 --- a/dotfiles/.config/nvim/lua/plugins/dap.lua +++ b/dotfiles/.config/nvim/lua/plugins/dap.lua @@ -32,6 +32,8 @@ vim.keymap.set({'n', 'v'}, 'dp', function() require('dap.ui.widgets').pr vim.keymap.set('n', 'df', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.frames) end) vim.keymap.set('n', 'ds', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.scopes) end) +vim.fn.sign_define('DapBreakpoint', {text='󰬪', texthl='', linehl='', numhl=''}) + -- Set up lldb (LLVM debugger) -- Install archlinux: sudo pacman -S lldb -- Install ubuntu: sudo apt diff --git a/dotfiles/.config/nvim/lua/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index 94e4584..cb6ca9d 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -3,6 +3,7 @@ require('plugins.packer_setup') require('packer').startup(function() -- Packer can manage itself as an optional plugin use { 'wbthomason/packer.nvim', opt = true } + use { 'glepnir/nerdicons.nvim', cmd = 'NerdIcons', config = function() require('nerdicons').setup({}) end } -- Fuzzy finder use { From 514deb38a536d7d9f3cadfc0d41852bc573b2240 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 4 Nov 2024 08:52:15 +0100 Subject: [PATCH 16/20] ignore more folders in telescope --- dotfiles/.config/nvim/lua/plugins/telescope.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotfiles/.config/nvim/lua/plugins/telescope.lua b/dotfiles/.config/nvim/lua/plugins/telescope.lua index 08388d6..eb347c0 100644 --- a/dotfiles/.config/nvim/lua/plugins/telescope.lua +++ b/dotfiles/.config/nvim/lua/plugins/telescope.lua @@ -45,6 +45,8 @@ telescope.setup { file_ignore_patterns = { '.git/', '.venv/', + '.pytest_cache/', + 'target/', }, }, pickers = { From 292bfd640452ed3ef6533a9939f42132d10ceaa2 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 4 Nov 2024 08:53:45 +0100 Subject: [PATCH 17/20] Revert "Update alacritty - config format" This reverts commit 9259e7b2ba2425e22aa0882b97a32696d07eedc9. --- dotfiles/.config/alacritty/alacritty.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dotfiles/.config/alacritty/alacritty.toml b/dotfiles/.config/alacritty/alacritty.toml index 2d6de2f..857e36e 100644 --- a/dotfiles/.config/alacritty/alacritty.toml +++ b/dotfiles/.config/alacritty/alacritty.toml @@ -1,9 +1,9 @@ -[general] +live_config_reload = true +working_directory = "None" + import = [ "~/.config/alacritty/light.toml" ] -live_config_reload = true -working_directory = "None" [cursor] thickness = 0.2 @@ -414,7 +414,7 @@ history = 100000 save_to_clipboard = true semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" -[terminal.shell] +[shell] program = "/bin/bash" [window] From 5cf479221358db78bde2a310ce61205a2c6fb9b8 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 16 Dec 2024 08:49:03 +0100 Subject: [PATCH 18/20] Rofi reconfig --- dotfiles/.config/nvim/lua/plugins/dap.lua | 2 +- dotfiles/.config/rofi/config.rasi | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dotfiles/.config/nvim/lua/plugins/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua index 4414638..c7f2604 100644 --- a/dotfiles/.config/nvim/lua/plugins/dap.lua +++ b/dotfiles/.config/nvim/lua/plugins/dap.lua @@ -41,7 +41,7 @@ dap.adapters.lldb = { type = 'server', port = "${port}", executable = { - command = '/usr/bin/lldb-dap', + command = '/usr/bin/lldb-dap-18', args = { "--port", "${port}" }, }, } diff --git a/dotfiles/.config/rofi/config.rasi b/dotfiles/.config/rofi/config.rasi index 163853f..94c72e2 100644 --- a/dotfiles/.config/rofi/config.rasi +++ b/dotfiles/.config/rofi/config.rasi @@ -3,11 +3,11 @@ @theme "sidebar" configuration { -/* modes: "combi,drun,run,ssh,filebrowser";*/ + modes: "combi,drun,run,ssh,filebrowser"; font: "mono 12"; location: 0; - yoffset: -150; - xoffset: 1920; + yoffset: 0; + xoffset: 0; fixed-num-lines: true; show-icons: true; terminal: "alacritty"; @@ -21,7 +21,7 @@ configuration { icon-theme: "Papyrus"; /* drun-match-fields: "name,generic,exec,categories,keywords";*/ /* drun-categories: ;*/ -/* drun-show-actions: false;*/ + drun-show-actions: true; /* drun-display-format: "{name} [({generic})]";*/ /* drun-url-launcher: "xdg-open";*/ /* disable-history: false;*/ @@ -38,7 +38,6 @@ configuration { /* parse-known-hosts: true;*/ combi-modes: "drun,run,ssh,filebrowser"; matching: "fuzzy"; - /* tokenize: true;*/ /* m: "-5";*/ /* filter: ;*/ @@ -77,3 +76,7 @@ configuration { sorting-method: "name"; } } +window { + transparency: "real"; + width: 1000px; +} From 87c31ee64505796049948cd887874b7d43a43431 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Fri, 26 Sep 2025 16:41:34 +0200 Subject: [PATCH 19/20] Update nvim lsp and plugins --- dotfiles/.config/nvim/after/lsp/ty.lua | 6 +++ dotfiles/.config/nvim/lua/keymappings.lua | 6 ++- dotfiles/.config/nvim/lua/lsp.lua | 37 ++++--------------- .../.config/nvim/lua/plugins/catppuccin.lua | 5 ++- dotfiles/.config/nvim/lua/plugins/neogit.lua | 8 ++-- dotfiles/.config/nvim/lua/plugins/oil.lua | 2 +- 6 files changed, 29 insertions(+), 35 deletions(-) create mode 100644 dotfiles/.config/nvim/after/lsp/ty.lua diff --git a/dotfiles/.config/nvim/after/lsp/ty.lua b/dotfiles/.config/nvim/after/lsp/ty.lua new file mode 100644 index 0000000..4f1df79 --- /dev/null +++ b/dotfiles/.config/nvim/after/lsp/ty.lua @@ -0,0 +1,6 @@ +-- ~/.config/nvim/after/lsp/ty.lua +return { + cmd = { "ty", "server" }, + filetypes = { "python" }, + root_dir = vim.fs.root(0, { ".git/", "pyproject.toml" }), +} diff --git a/dotfiles/.config/nvim/lua/keymappings.lua b/dotfiles/.config/nvim/lua/keymappings.lua index 58f4ca9..ab520fd 100644 --- a/dotfiles/.config/nvim/lua/keymappings.lua +++ b/dotfiles/.config/nvim/lua/keymappings.lua @@ -19,6 +19,10 @@ vim.keymap.set("n", "aa", require("actions-preview").code_actions) -- Outline!! vim.keymap.set("n", "o", "Outline") - -- Close all buffers vim.keymap.set("n", '', "bufdo bd") + +vim.keymap.set("n", "", "lua vim.lsp.buf.rename()()") +vim.keymap.set("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))") +vim.keymap.set("n", "wa", "lua vim.lsp.buf.add_workspace_folder()") +vim.keymap.set("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()") diff --git a/dotfiles/.config/nvim/lua/lsp.lua b/dotfiles/.config/nvim/lua/lsp.lua index 2dde945..40b14dc 100644 --- a/dotfiles/.config/nvim/lua/lsp.lua +++ b/dotfiles/.config/nvim/lua/lsp.lua @@ -1,15 +1,6 @@ local autoformat_files = '*.py,*.rs,*.tf' local common_on_attach = function(client, bufnr) - -- Mappings. - vim.keymap.set("n", "K", "lua vim.lsp.buf.hover()") - vim.keymap.set("n", "", "lua vim.lsp.buf.signature_help()") - vim.keymap.set("n", "", "lua vim.lsp.buf.type_definition()") - vim.keymap.set("n", "", "lua vim.lsp.buf.rename()()") - vim.keymap.set("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))") - vim.keymap.set("n", "wa", "lua vim.lsp.buf.add_workspace_folder()") - vim.keymap.set("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()") - -- Autoformat on save. if client.supports_method("textDocument/formatting") then vim.api.nvim_create_autocmd("BufWritePre", { @@ -19,6 +10,7 @@ local common_on_attach = function(client, bufnr) end, }) end + -- Use vim's default coloring. client.server_capabilities.semanticTokensProvider = nil for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do @@ -63,9 +55,7 @@ vim.g.rustaceanvim = function() procMacro = { enable = true }, - checkOnSave = { - command = "clippy", - }, + checkOnSave = true, }, }, -- DAP configuration. @@ -75,33 +65,22 @@ vim.g.rustaceanvim = function() } end -local nvim_lsp = require('lspconfig') local capabilities = vim.lsp.protocol.make_client_capabilities() +vim.lsp.enable('ty') + -- LSPs local servers = { "clangd", "lua_ls", "ocamllsp", - "pyright", "rnix", "terraformls", "vimls", } for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach } + vim.lsp.config(lsp, { + capabilities = capabilities, + on_attach = common_on_attach, + }) end - -nvim_lsp.ruff.setup({ - on_attach = function (client) - common_on_attach(client) - client.server_capabilities.renameProvider = false - client.server_capabilities.hoverProvider = false - end, - init_options = { - settings = { - -- Any extra CLI arguments for `ruff` go here. - args = {} - } - }, -}) diff --git a/dotfiles/.config/nvim/lua/plugins/catppuccin.lua b/dotfiles/.config/nvim/lua/plugins/catppuccin.lua index e29ea46..3cbb45c 100644 --- a/dotfiles/.config/nvim/lua/plugins/catppuccin.lua +++ b/dotfiles/.config/nvim/lua/plugins/catppuccin.lua @@ -16,7 +16,7 @@ require("catppuccin").setup({ TelescopeNormal = { bg = "#fafafa" }, TelescopePromptNormal = { bg = colors.surface1 }, TelescopePromptBorder = { bg = colors.surface1, fg = colors.surface1 }, - CursorLine = { bg = colors.text }, + CursorLine = { bg = colors.surface2 }, NvimTreeWinSeparator = { fg = colors.text }, NvimTreeGitNew = { fg = colors.green }, NvimTreeGitDirty = { fg = colors.yellow }, @@ -100,6 +100,9 @@ require("catppuccin").setup({ DiagnosticUnnecessary = { link = "" }, + Pmenu = { fg = colors.text }, + PmenuSel = { bg = colors.overlay0 }, + --["@conceal.checked"] = { fg = colors.teal }, --["@none"] = { link = "Normal" }, --["@field"] = { fg = colors.blue }, diff --git a/dotfiles/.config/nvim/lua/plugins/neogit.lua b/dotfiles/.config/nvim/lua/plugins/neogit.lua index 771a0e6..57b7d83 100644 --- a/dotfiles/.config/nvim/lua/plugins/neogit.lua +++ b/dotfiles/.config/nvim/lua/plugins/neogit.lua @@ -24,9 +24,11 @@ neogit.setup { graph_style = "ascii", -- Used to generate URL's for branch popup action "pull request". git_services = { - ["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", - ["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1", - ["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", + ["github.com"] = { + pull_request = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", + commit = "https://github.com/${owner}/${repository}/commit/${oid}", + tree = "https://${host}/${owner}/${repository}/tree/${branch_name}", + }, }, -- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf -- sorter instead. By default, this function returns `nil`. diff --git a/dotfiles/.config/nvim/lua/plugins/oil.lua b/dotfiles/.config/nvim/lua/plugins/oil.lua index 884e296..16e9fbb 100644 --- a/dotfiles/.config/nvim/lua/plugins/oil.lua +++ b/dotfiles/.config/nvim/lua/plugins/oil.lua @@ -53,7 +53,7 @@ require('oil').setup({ -- Skip the confirmation popup for simple operations skip_confirm_for_simple_edits = false, -- Change this to customize the command used when deleting to trash - trash_command = "trash-put", + -- trash_command = "trash-put", -- Selecting a new/moved/renamed file or directory will prompt you to save changes first prompt_save_on_select_new_entry = true, -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap From 913fa4c2cc0f80657b77fe2ff4759ff6e029cbea Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Fri, 26 Sep 2025 16:43:24 +0200 Subject: [PATCH 20/20] Add entity operator completion and tiup, remove cal alias --- dotfiles/.bash_aliases | 1 - dotfiles/.bashrc | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dotfiles/.bash_aliases b/dotfiles/.bash_aliases index a602010..339d660 100644 --- a/dotfiles/.bash_aliases +++ b/dotfiles/.bash_aliases @@ -4,7 +4,6 @@ alias myip="curl http://ip.ie.mk/get" alias ls="ls --color" alias grep="grep --color" alias virsh="virsh --connect qemu:///system" -alias cal="cal -m" alias genpasswd="strings /dev/urandom | tr -cd '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c 32; echo" alias du="dust -r" alias jsonpp="python -m json.tool" diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 21f7765..7fbcf42 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -55,3 +55,7 @@ if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then fi export GPG_TTY=$(tty) gpg-connect-agent updatestartuptty /bye >/dev/null + +source '/home/vladanpopovic/.bash_completions/entity-operator.sh' + +export PATH=/home/vladanpopovic/.tiup/bin:$PATH