From 86fbe4ac5624824e1df81e3f39524f3295bc8922 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 7 Dec 2025 13:04:02 +0100 Subject: [PATCH] merge with work setup --- dotfiles/.bashrc | 13 ++++- dotfiles/.config/alacritty/alacritty.toml | 17 +++--- dotfiles/.config/alacritty/dark.toml | 34 ++---------- dotfiles/.config/nvim/lua/keymappings.lua | 9 ++++ dotfiles/.config/nvim/lua/lsp.lua | 12 ++--- dotfiles/.config/nvim/lua/plugins/init.lua | 54 +++++++++---------- dotfiles/.config/nvim/nvim-pack-lock.json | 2 +- .../.config/sway/config.d/90-bindings.conf | 1 - dotfiles/.environ | 8 +-- 9 files changed, 66 insertions(+), 84 deletions(-) diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 35e7d85..1266427 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -7,6 +7,14 @@ [[ -f /etc/bashrc ]] && source /etc/bashrc [[ -f $HOME/.environ ]] && . $HOME/.environ +# Local user bins +add_path() case :$PATH: in *:$1:*) ;; *) PATH=$1:$PATH;; esac +add_path $HOME/.local/bin +add_path $HOME/.cargo/bin +add_path $HOME/.kubectl-plugins:$PATH +add_path $HOME/.tiup/bin +add_path $PYTHONUSERBASE/bin + # Append to history, don't overwrite. shopt -s histappend @@ -16,9 +24,12 @@ shopt -s histappend [[ -f $HOME/.bash_functions ]] && source "$HOME/.bash_functions" # Save working dir on every prompt. -export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"; pwd > $HOME/.cwd' +# export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"; pwd > $HOME/.cwd' export PS1="${Blue}\d \A ${Off}${Yellow}\u@\h: ${Off}\w ${Green}\$(parse_branch git)${BRed}\$(parse_branch fossil)${Off}\n-$ " +# more is less +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + # Use fzf if installed. hash fzf 2>/dev/null && eval "$(fzf --bash)" export FZF_DEFAULT_OPTS='--border=horizontal --info=inline --no-reverse --height=50%' diff --git a/dotfiles/.config/alacritty/alacritty.toml b/dotfiles/.config/alacritty/alacritty.toml index db0e1a0..9a5f65f 100644 --- a/dotfiles/.config/alacritty/alacritty.toml +++ b/dotfiles/.config/alacritty/alacritty.toml @@ -1,10 +1,3 @@ -[general] -import = [ - "~/.config/alacritty/dark.toml" -] -live_config_reload = true -working_directory = "None" - [cursor] thickness = 0.2 style = "Block" @@ -422,3 +415,13 @@ decorations = "full" dynamic_padding = false dynamic_title = true opacity = 1 + +[general] +live_config_reload = true +working_directory = "None" + +import = [ + "~/.config/alacritty/themes/themes/everforest_dark.toml" +] + +[terminal] diff --git a/dotfiles/.config/alacritty/dark.toml b/dotfiles/.config/alacritty/dark.toml index af3714c..ab9cf6e 100644 --- a/dotfiles/.config/alacritty/dark.toml +++ b/dotfiles/.config/alacritty/dark.toml @@ -1,32 +1,4 @@ # Colors (Tomorrow Night) - -# Default colors -[colors.primary] -background = '#1d2329' -foreground = '#c5c8c6' - -[colors.cursor] -text = '#1d1f21' -cursor = '#ffffff' - -# Normal colors -[colors.normal] -black = '#1d1f21' -red = '#cc6666' -green = '#7ea400' -yellow = '#e6c547' -blue = '#81a2be' -magenta = '#b294bb' -cyan = '#000000' -white = '#373b41' - -# Bright colors -[colors.bright] -black = '#666666' -red = '#ff3334' -green = '#7ea400' -yellow = '#f0c674' -blue = '#81a2be' -magenta = '#b77ee0' -cyan = '#54ced6' -white = '#282a2e' +import = [ + "~/.config/alacritty/themes/themes/everforest_dark.toml" +] diff --git a/dotfiles/.config/nvim/lua/keymappings.lua b/dotfiles/.config/nvim/lua/keymappings.lua index 9bfcc04..2bfa926 100644 --- a/dotfiles/.config/nvim/lua/keymappings.lua +++ b/dotfiles/.config/nvim/lua/keymappings.lua @@ -51,3 +51,12 @@ vim.keymap.set('n', 'gr', builtin.lsp_references) vim.keymap.set('n', 'gi', builtin.lsp_implementations) vim.keymap.set('n', 'ci', builtin.lsp_incoming_calls) vim.keymap.set('n', 'co', builtin.lsp_outgoing_calls) + +vim.keymap.set('n', 'x', function() + -- Check if diagnostics are currently enabled for the current buffer + if vim.diagnostic.is_enabled() then + vim.diagnostic.enable(false) + else + vim.diagnostic.enable() + end +end, { noremap = true, silent = true, desc = "Toggle diagnostics" }) diff --git a/dotfiles/.config/nvim/lua/lsp.lua b/dotfiles/.config/nvim/lua/lsp.lua index 40b14dc..4c7851f 100644 --- a/dotfiles/.config/nvim/lua/lsp.lua +++ b/dotfiles/.config/nvim/lua/lsp.lua @@ -2,7 +2,7 @@ local autoformat_files = '*.py,*.rs,*.tf' local common_on_attach = function(client, bufnr) -- Autoformat on save. - if client.supports_method("textDocument/formatting") then + if client:supports_method("textDocument/formatting") then vim.api.nvim_create_autocmd("BufWritePre", { pattern = autoformat_files, callback = function() @@ -12,10 +12,10 @@ local common_on_attach = function(client, bufnr) end -- Use vim's default coloring. - client.server_capabilities.semanticTokensProvider = nil - for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do - vim.api.nvim_set_hl(0, group, {}) - end + --client.server_capabilities.semanticTokensProvider = nil + --for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do + -- vim.api.nvim_set_hl(0, group, {}) + --end end -- LSP diagnostics. @@ -27,7 +27,6 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = update_in_insert = false }) --- Setup rust outside of lspconfig. vim.g.rustaceanvim = function() return { -- Plugin configuration. @@ -69,7 +68,6 @@ local capabilities = vim.lsp.protocol.make_client_capabilities() vim.lsp.enable('ty') --- LSPs local servers = { "clangd", "lua_ls", diff --git a/dotfiles/.config/nvim/lua/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index 33babb8..8cd5fd4 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -1,37 +1,33 @@ vim.pack.add({ - 'https://github.com/wbthomason/packer.nvim', - 'https://github.com/glepnir/nerdicons.nvim', - 'https://github.com/nvim-telescope/telescope.nvim', - 'https://github.com/nvim-lua/popup.nvim', - 'https://github.com/nvim-lua/plenary.nvim', - 'https://github.com/hrsh7th/nvim-cmp', - 'https://github.com/hrsh7th/cmp-nvim-lsp', - 'https://github.com/hrsh7th/cmp-buffer', - 'https://github.com/hrsh7th/cmp-path', - 'https://github.com/hrsh7th/cmp-cmdline', 'https://github.com/L3MON4D3/LuaSnip', - 'https://github.com/rafamadriz/friendly-snippets', - 'https://github.com/saadparwaiz1/cmp_luasnip', - 'https://github.com/benfowler/telescope-luasnip.nvim', - "https://github.com/neanias/everforest-nvim", - 'https://github.com/neovim/nvim-lspconfig', - 'https://github.com/aznhe21/actions-preview.nvim', - 'https://github.com/folke/trouble.nvim', - 'https://github.com/cespare/vim-toml', - 'https://github.com/gleam-lang/gleam.vim', - 'https://github.com/hashivim/vim-terraform', - 'https://github.com/mrcjkb/rustaceanvim', - 'https://github.com/mfussenegger/nvim-dap', - 'https://github.com/mfussenegger/nvim-dap', - 'https://github.com/rcarriga/nvim-dap-ui', - 'https://github.com/mfussenegger/nvim-dap', - 'https://github.com/nvim-neotest/nvim-nio', 'https://github.com/NeogitOrg/neogit', - 'https://github.com/nvim-lua/plenary.nvim', - 'https://github.com/sindrets/diffview.nvim', - 'https://github.com/lewis6991/gitsigns.nvim', + 'https://github.com/aznhe21/actions-preview.nvim', + 'https://github.com/benfowler/telescope-luasnip.nvim', + 'https://github.com/cespare/vim-toml', + 'https://github.com/folke/trouble.nvim', + 'https://github.com/gleam-lang/gleam.vim', + 'https://github.com/glepnir/nerdicons.nvim', + 'https://github.com/hashivim/vim-terraform', 'https://github.com/hedyhli/outline.nvim', + 'https://github.com/hrsh7th/cmp-buffer', + 'https://github.com/hrsh7th/cmp-cmdline', + 'https://github.com/hrsh7th/cmp-nvim-lsp', + 'https://github.com/hrsh7th/cmp-path', + 'https://github.com/hrsh7th/nvim-cmp', + 'https://github.com/lewis6991/gitsigns.nvim', + 'https://github.com/mfussenegger/nvim-dap', + 'https://github.com/mrcjkb/rustaceanvim', + 'https://github.com/neanias/everforest-nvim', + 'https://github.com/nvim-lua/plenary.nvim', + 'https://github.com/nvim-lua/popup.nvim', + 'https://github.com/nvim-neotest/nvim-nio', + 'https://github.com/nvim-telescope/telescope.nvim', + 'https://github.com/rafamadriz/friendly-snippets', + 'https://github.com/rcarriga/nvim-dap-ui', + 'https://github.com/saadparwaiz1/cmp_luasnip', + 'https://github.com/sindrets/diffview.nvim', 'https://github.com/stevearc/oil.nvim', + 'https://github.com/wbthomason/packer.nvim', }) require('plugins.cmp') diff --git a/dotfiles/.config/nvim/nvim-pack-lock.json b/dotfiles/.config/nvim/nvim-pack-lock.json index 65763ba..5a968cb 100644 --- a/dotfiles/.config/nvim/nvim-pack-lock.json +++ b/dotfiles/.config/nvim/nvim-pack-lock.json @@ -121,4 +121,4 @@ "src": "https://github.com/cespare/vim-toml" } } -} \ No newline at end of file +} diff --git a/dotfiles/.config/sway/config.d/90-bindings.conf b/dotfiles/.config/sway/config.d/90-bindings.conf index a38c706..424f277 100644 --- a/dotfiles/.config/sway/config.d/90-bindings.conf +++ b/dotfiles/.config/sway/config.d/90-bindings.conf @@ -25,7 +25,6 @@ # exit sway (logs you out of your Wayland session) bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' - bindsym ctrl+Space exec makoctl dismiss bindsym ctrl+Shift+Space exec makoctl dismiss --all # # Moving around: diff --git a/dotfiles/.environ b/dotfiles/.environ index 94fd713..342b53d 100644 --- a/dotfiles/.environ +++ b/dotfiles/.environ @@ -1,6 +1,6 @@ # vim: set ft=sh: -export EDITOR=hx +export EDITOR=nvim export GIT_EDITOR=$EDITOR export HISTCONTROL=ignoredups:erasedups # Avoid duplicates export HISTFILESIZE=100000000 # big big history @@ -14,9 +14,3 @@ export PYTHONDONTWRITEBYTECODE=1 export PYTHONUSERBASE=$HOME/.env/python export TZ="Europe/Belgrade" export FZF_DEFAULT_OPTS='--border=horizontal --info=inline --no-reverse --height=50%' - -# Local user bins -add_path() case :$PATH: in *:$1:*) ;; *) PATH=$1:$PATH;; esac -add_path $HOME/.local/bin -add_path $PYTHONUSERBASE/bin -add_path $HOME/.cargo/bin