diff --git a/README.md b/README.md index becabea..28513bf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Save this service config to `$XDG_CONFIG_HOME/systemd/user/dotfiles.service`: [Unit] Description=Stow dotfiles linker Documentation=man:stow(1) -Before=basic.target +Before=wayland-session.target +Conflicts=wayland-session.target [Service] Type=oneshot @@ -19,7 +20,7 @@ ExecStop=/usr/bin/stow --target=%h --delete dotfiles/ WantedBy=default.target ``` -Update `WorkingDirectory=%h/dev/dotfiles` and enable the service: +(and enable it:) ```sh systemctl --user enable --now dotfiles.service diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 35e7d85..6f086b2 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -15,9 +15,18 @@ 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/ -maxdepth 1 -not -type d) + # Save working dir on every prompt. -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-$ " +export PROMPT_COMMAND='pwd > $HOME/.cwd' +export PS1="${Yellow}\d \A ${Off}${Green}\u@\h: ${Off}\w ${Red}\$(parse_branch git)${BRed}\$(parse_branch fossil)${Off}\n-$ " # Use fzf if installed. hash fzf 2>/dev/null && eval "$(fzf --bash)" diff --git a/dotfiles/.config/alacritty/alacritty.toml b/dotfiles/.config/alacritty/alacritty.toml index db0e1a0..2f95351 100644 --- a/dotfiles/.config/alacritty/alacritty.toml +++ b/dotfiles/.config/alacritty/alacritty.toml @@ -1,10 +1,10 @@ -[general] -import = [ - "~/.config/alacritty/dark.toml" -] live_config_reload = true working_directory = "None" +import = [ + "~/.config/alacritty/light.toml" +] + [cursor] thickness = 0.2 style = "Block" @@ -414,7 +414,7 @@ history = 100000 save_to_clipboard = true semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" -[terminal.shell] +[shell] program = "/bin/bash" [window] diff --git a/dotfiles/.config/alacritty/dark.toml b/dotfiles/.config/alacritty/dark.toml index af3714c..957863b 100644 --- a/dotfiles/.config/alacritty/dark.toml +++ b/dotfiles/.config/alacritty/dark.toml @@ -2,7 +2,7 @@ # Default colors [colors.primary] -background = '#1d2329' +background = '#1d1f21' foreground = '#c5c8c6' [colors.cursor] diff --git a/dotfiles/.config/helix/config.toml b/dotfiles/.config/helix/config.toml deleted file mode 100644 index 4c6e918..0000000 --- a/dotfiles/.config/helix/config.toml +++ /dev/null @@ -1,13 +0,0 @@ -theme = "everforest_dark_hc" - -[editor] -auto-pairs = false - -[editor.file-picker] -hidden = true - -[keys.normal] -D = "kill_to_line_end" -V = "extend_line_below" -x = "delete_selection" -G = "goto_last_line" diff --git a/dotfiles/.config/helix/themes/everforest_dark_hc.toml b/dotfiles/.config/helix/themes/everforest_dark_hc.toml deleted file mode 100644 index 89b6353..0000000 --- a/dotfiles/.config/helix/themes/everforest_dark_hc.toml +++ /dev/null @@ -1,111 +0,0 @@ -"type" = "yellow" -"constant" = "purple" -"constant.numeric" = "purple" -"constant.character.escape" = "orange" -"string" = "green" -"string.regexp" = "blue" -"comment" = "grey0" -"variable" = "fg" -"variable.builtin" = "blue" -"variable.parameter" = "fg" -"variable.other.member" = "fg" -"label" = "aqua" -"punctuation" = "grey2" -"punctuation.delimiter" = "grey2" -"punctuation.bracket" = "fg" -"keyword" = "red" -"keyword.directive" = "aqua" -"operator" = "orange" -"function" = "green" -"function.builtin" = "blue" -"function.macro" = "aqua" -"tag" = "yellow" -"namespace" = "aqua" -"attribute" = "aqua" -"constructor" = "yellow" -"module" = "blue" -"special" = "orange" - -"markup.heading.marker" = "grey2" -"markup.heading.1" = { fg = "red", modifiers = ["bold"] } -"markup.heading.2" = { fg = "orange", modifiers = ["bold"] } -"markup.heading.3" = { fg = "yellow", modifiers = ["bold"] } -"markup.heading.4" = { fg = "green", modifiers = ["bold"] } -"markup.heading.5" = { fg = "blue", modifiers = ["bold"] } -"markup.heading.6" = { fg = "fg", modifiers = ["bold"] } -"markup.list" = "red" -"markup.bold" = { modifiers = ["bold"] } -"markup.italic" = { modifiers = ["italic"] } -"markup.link.url" = { fg = "blue", modifiers = ["underlined"] } -"markup.link.text" = "purple" -"markup.quote" = "grey2" -"markup.raw" = "green" - -"diff.plus" = "green" -"diff.delta" = "orange" -"diff.minus" = "red" - -"ui.background" = { bg = "bg0" } -"ui.background.separator" = "grey0" -"ui.cursor" = { fg = "bg0", bg = "fg" } -"ui.cursor.match" = { fg = "orange", bg = "bg_yellow" } -"ui.cursor.insert" = { fg = "bg0", bg = "grey1" } -"ui.cursor.select" = { fg = "bg0", bg = "blue" } -"ui.cursorline.primary" = { bg = "bg1" } -"ui.cursorline.secondary" = { bg = "bg1" } -"ui.selection" = { bg = "bg3" } -"ui.linenr" = "grey0" -"ui.linenr.selected" = "fg" -"ui.statusline" = { fg = "grey2", bg = "bg3" } -"ui.statusline.inactive" = { fg = "grey0", bg = "bg1" } -"ui.statusline.normal" = { fg = "bg0", bg = "grey2", modifiers = ["bold"] } -"ui.statusline.insert" = { fg = "bg0", bg = "yellow", modifiers = ["bold"] } -"ui.statusline.select" = { fg = "bg0", bg = "blue", modifiers = ["bold"] } -"ui.bufferline" = { fg = "grey0", bg = "bg1" } -"ui.bufferline.active" = { fg = "fg", bg = "bg3", modifiers = ["bold"] } -"ui.popup" = { fg = "grey2", bg = "bg2" } -"ui.window" = { fg = "grey0", bg = "bg0" } -"ui.help" = { fg = "fg", bg = "bg2" } -"ui.text" = "fg" -"ui.text.focus" = "fg" -"ui.menu" = { fg = "fg", bg = "bg3" } -"ui.menu.selected" = { fg = "bg0", bg = "green" } -"ui.virtual.whitespace" = { fg = "bg4" } -"ui.virtual.indent-guide" = { fg = "bg4" } -"ui.virtual.ruler" = { bg = "bg3" } - -"hint" = "blue" -"info" = "aqua" -"warning" = "yellow" -"error" = "red" -"diagnostic" = { underline = { style = "curl" } } -"diagnostic.hint" = { underline = { color = "blue", style = "dotted" } } -"diagnostic.info" = { underline = { color = "aqua", style = "dotted" } } -"diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } -"diagnostic.error" = { underline = { color = "red", style = "curl" } } - -[palette] - -bg0 = "#1d2329" -bg1 = "#232b30" -bg2 = "#2b353a" -bg3 = "#323e44" -bg4 = "#3a474b" -bg5 = "#435150" -bg_visual = "#3f2935" -bg_red = "#3d2d32" -bg_green = "#2f3c33" -bg_blue = "#293e4b" -bg_yellow = "#39382f" - -fg = "#dbcdac" -red = "#ec7678" -orange = "#ec966a" -yellow = "#e3c277" -green = "#a9c678" -aqua = "#7cc68e" -blue = "#77c1b7" -purple = "#de97bb" -grey0 = "#6b7974" -grey1 = "#849489" -grey2 = "#9caba0" diff --git a/dotfiles/.config/mako/config b/dotfiles/.config/mako/config index a19fc01..a70e683 100644 --- a/dotfiles/.config/mako/config +++ b/dotfiles/.config/mako/config @@ -1,6 +1,6 @@ sort=-time -default-timeout=5000 -ignore-timeout=1 +default-timeout=0 +ignore-timeout=0 height=200 width=400 @@ -17,14 +17,15 @@ border-radius=10 background-color=#eff1f5E0 text-color=#4c4f69 +border-color=#fe640b progress-color=over #ccd0da -[urgency=low] -border-color=#c1ca8c - -[urgency=normal] -border-color=#a1bacc +[urgency=high] +border-color=#fe040b +background-color=#ffe1e5 +border-size=5 [urgency=critical] border-color=#fe040b -default-timeout=0 +background-color=#ffe1e5 +border-size=5 diff --git a/dotfiles/.config/nvim/after/lsp/ty.lua b/dotfiles/.config/nvim/after/lsp/ty.lua deleted file mode 100644 index 4f1df79..0000000 --- a/dotfiles/.config/nvim/after/lsp/ty.lua +++ /dev/null @@ -1,6 +0,0 @@ --- ~/.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 9bfcc04..58f4ca9 100644 --- a/dotfiles/.config/nvim/lua/keymappings.lua +++ b/dotfiles/.config/nvim/lua/keymappings.lua @@ -1,7 +1,3 @@ -local builtin = require('telescope.builtin') -local codeactions = require("actions-preview") -local telescope = require('telescope') - -- Clear trailing whitespace vim.keymap.set("n", "", "let _s=@/:%s/\\s\\+$//e:let @/=_s") @@ -14,40 +10,15 @@ vim.keymap.set("n", "se", "setlocal spell spelllang=en_us") vim.keymap.set("n", "sq", "setlocal nospell") vim.keymap.set("n", "", "set nonumber!") -vim.keymap.set("n", "e", "Oil") +vim.keymap.set("n", "fe", "Oil") vim.keymap.set("n", ']d', "lua vim.diagnostic.goto_next()") vim.keymap.set("n", '[d', "lua vim.diagnostic.goto_prev()") +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()") - --- Snippets can be useful. -vim.keymap.set('n', 'ss', telescope.extensions.luasnip.luasnip, {}) - --- Fuzzy * files, symbols, buffers, help, etc. -vim.keymap.set("n", "a", codeactions.code_actions) -vim.keymap.set('n', 'F', builtin.find_files) -- f[ind]a[ll] -vim.keymap.set('n', 'b', builtin.buffers) -vim.keymap.set('n', 'd', builtin.diagnostics) -vim.keymap.set('n', 'f', builtin.git_files) -vim.keymap.set('n', 'h', builtin.help_tags) -vim.keymap.set('n', 'ws', builtin.lsp_dynamic_workspace_symbols) - --- Grep (the only one). -vim.keymap.set('n', 'rg', builtin.live_grep) - --- LSP navigation. -vim.keymap.set('n', 'gd', builtin.lsp_definitions) -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) diff --git a/dotfiles/.config/nvim/lua/lsp.lua b/dotfiles/.config/nvim/lua/lsp.lua index 40b14dc..85f9e8f 100644 --- a/dotfiles/.config/nvim/lua/lsp.lua +++ b/dotfiles/.config/nvim/lua/lsp.lua @@ -1,10 +1,18 @@ -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()") + vim.keymap.set("n", "r", "lua vim.lsp.buf.rename()") + -- Autoformat on save. if client.supports_method("textDocument/formatting") then vim.api.nvim_create_autocmd("BufWritePre", { - pattern = autoformat_files, + pattern = '*.py,*.rs', callback = function() vim.lsp.buf.format() end, @@ -18,6 +26,65 @@ local common_on_attach = function(client, bufnr) end end +local nvim_lsp = require('lspconfig') +local capabilities = vim.lsp.protocol.make_client_capabilities() + +-- LSPs +local servers = { + "clangd", + "dartls", + "gleam", + "lua_ls", + "ocamllsp", + "pyright", + "rnix", + "terraformls", + "vimls", +} +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) + client.server_capabilities.renameProvider = false + client.server_capabilities.hoverProvider = false + end, + init_options = { + settings = { + -- Any extra CLI arguments for `ruff` go here. + args = {} + } + }, +}) + -- LSP diagnostics. vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { @@ -26,61 +93,3 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = 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 = true, - }, - }, - -- DAP configuration. - dap = { - }, - } - } -end - -local capabilities = vim.lsp.protocol.make_client_capabilities() - -vim.lsp.enable('ty') - --- LSPs -local servers = { - "clangd", - "lua_ls", - "ocamllsp", - "rnix", - "terraformls", - "vimls", -} -for _, lsp in ipairs(servers) do - vim.lsp.config(lsp, { - capabilities = capabilities, - on_attach = common_on_attach, - }) -end diff --git a/dotfiles/.config/nvim/lua/plugins/catppuccin.lua b/dotfiles/.config/nvim/lua/plugins/catppuccin.lua index 3cbb45c..e29ea46 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.surface2 }, + CursorLine = { bg = colors.text }, NvimTreeWinSeparator = { fg = colors.text }, NvimTreeGitNew = { fg = colors.green }, NvimTreeGitDirty = { fg = colors.yellow }, @@ -100,9 +100,6 @@ 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/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua deleted file mode 100644 index cf4f022..0000000 --- a/dotfiles/.config/nvim/lua/plugins/dap.lua +++ /dev/null @@ -1,120 +0,0 @@ -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) - -vim.fn.sign_define('DapBreakpoint', {text='󰬪', texthl='', linehl='', numhl=''}) - --- 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" - } -} - --- 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; - }, -} diff --git a/dotfiles/.config/nvim/lua/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index 33babb8..61e0a61 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -1,45 +1,79 @@ -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/hedyhli/outline.nvim', - 'https://github.com/stevearc/oil.nvim', -}) +require('plugins.packer_setup') +require('packer').startup(function() + -- Packer can manage itself as an optional plugin + use { 'wbthomason/packer.nvim', opt = true } + + -- Fuzzy finder + use { + 'nvim-telescope/telescope.nvim', + requires = { + { 'nvim-lua/popup.nvim' }, + { 'nvim-lua/plenary.nvim' }, + } + } + + -- Autocomplete and snippets + use { + 'hrsh7th/nvim-cmp', + requires = { + { 'hrsh7th/cmp-nvim-lsp' }, + { 'hrsh7th/cmp-buffer' }, + { 'hrsh7th/cmp-path' }, + { 'hrsh7th/cmp-cmdline' }, + } + } + use { 'L3MON4D3/LuaSnip', + requires = { + { "rafamadriz/friendly-snippets" }, + { 'saadparwaiz1/cmp_luasnip' }, + { "benfowler/telescope-luasnip.nvim" }, + }, + } + + -- Statusbar, colors and syntax + use { 'vim-airline/vim-airline' } + use { 'vim-airline/vim-airline-themes' } + + -- LSP and related + use { 'neovim/nvim-lspconfig' } + use { 'aznhe21/actions-preview.nvim' } + use { 'folke/trouble.nvim' } -- lsp diagnostics + + -- Plugins to extend builtin language support + use { 'cespare/vim-toml' } + use { 'gleam-lang/gleam.vim' } + use { 'rust-lang/rust.vim' } + use { 'folke/neodev.nvim' } + use { 'hashivim/vim-terraform' } + + -- Git + use { + 'NeogitOrg/neogit', + requires = { + { "nvim-lua/plenary.nvim" }, + { "sindrets/diffview.nvim" }, + }, + } + use { "lewis6991/gitsigns.nvim" } + + -- Filesystem browser + use { 'stevearc/oil.nvim' } + + -- Misc + use { 'jbyuki/venn.nvim' } -- ascii diagrams + + use { 'hedyhli/outline.nvim' } + + use { "catppuccin/nvim", as = "catppuccin" } +end) + +require('plugins.catppuccin') require('plugins.cmp') -require('plugins.dap') require('plugins.gitsigns') require('plugins.luasnip_config') -require('plugins.outline') require('plugins.neogit') -require('plugins.telescope') -require('plugins.theme') require('plugins.oil') +require('plugins.outline') +require('plugins.telescope') +require('plugins.venn') diff --git a/dotfiles/.config/nvim/lua/plugins/neogit.lua b/dotfiles/.config/nvim/lua/plugins/neogit.lua index 57b7d83..771a0e6 100644 --- a/dotfiles/.config/nvim/lua/plugins/neogit.lua +++ b/dotfiles/.config/nvim/lua/plugins/neogit.lua @@ -24,11 +24,9 @@ neogit.setup { graph_style = "ascii", -- Used to generate URL's for branch popup action "pull request". git_services = { - ["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}", - }, + ["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}", }, -- 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 16e9fbb..884e296 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 diff --git a/dotfiles/.config/nvim/lua/plugins/telescope.lua b/dotfiles/.config/nvim/lua/plugins/telescope.lua index 905bd09..3accc4a 100644 --- a/dotfiles/.config/nvim/lua/plugins/telescope.lua +++ b/dotfiles/.config/nvim/lua/plugins/telescope.lua @@ -16,9 +16,11 @@ local files_config = { cache_picker = false, layout_strategy = "vertical", layout_config = { - prompt_position = "top", - mirror = true, - width = 0.8, + vertical = { + prompt_position = "top", + mirror = true, + width = 0.5, + }, }, } @@ -41,10 +43,7 @@ telescope.setup { treesitter = false }, file_ignore_patterns = { - '.git/', - '.venv/', - '.pytest_cache/', - 'target/', + '.git', }, }, pickers = { @@ -53,12 +52,6 @@ telescope.setup { i = { [""] = actions.to_fuzzy_refine }, n = { [""] = telescope_resume }, }, - layout_strategy = 'vertical', - layout_config = { - prompt_position = "top", - mirror = true, - width = 0.8, - }, }, find_files = vim.tbl_extend("force", files_config, { hidden = true, @@ -66,3 +59,24 @@ telescope.setup { git_files = files_config, }, } + +-- Snippets can be useful. +vim.keymap.set('n', 'ss', telescope.extensions.luasnip.luasnip, {}) + +-- Fuzzy * files, symbols, buffers, help, etc. +vim.keymap.set('n', 'fa', builtin.find_files) -- f[ind]a[ll] +vim.keymap.set('n', 'fb', builtin.buffers) +vim.keymap.set('n', 'fd', builtin.diagnostics) +vim.keymap.set('n', 'ff', builtin.git_files) +vim.keymap.set('n', 'fh', builtin.help_tags) +vim.keymap.set('n', 'fs', builtin.lsp_dynamic_workspace_symbols) + +-- Grep (the only one). +vim.keymap.set('n', 'gg', builtin.live_grep) + +-- LSP navigation. +vim.keymap.set('n', 'gd', builtin.lsp_definitions) +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) diff --git a/dotfiles/.config/nvim/lua/plugins/theme.lua b/dotfiles/.config/nvim/lua/plugins/theme.lua deleted file mode 100644 index 34b2d66..0000000 --- a/dotfiles/.config/nvim/lua/plugins/theme.lua +++ /dev/null @@ -1,7 +0,0 @@ -local theme = require("everforest") - -theme.setup({ - background = "hard", - ui_contrast = "high", -}) -theme.load() diff --git a/dotfiles/.config/nvim/lua/settings.lua b/dotfiles/.config/nvim/lua/settings.lua index 026315f..7447ed9 100644 --- a/dotfiles/.config/nvim/lua/settings.lua +++ b/dotfiles/.config/nvim/lua/settings.lua @@ -22,7 +22,7 @@ vim.opt.errorformat:prepend('%f|%l col %c|%m') vim.opt.fileformat = 'unix' vim.opt.undofile = true -vim.opt.background = 'dark' +vim.opt.background = 'light' -- Enable vimrc files per project and disable unsafe commands in project vimrc vim.opt.exrc = true @@ -42,7 +42,6 @@ vim.api.nvim_create_autocmd({'InsertLeave', 'BufEnter'}, { }) vim.cmd([[ - set title set noautoread autocmd CursorHold * checktime autocmd TextYankPost * lua vim.highlight.on_yank {on_visual = false} diff --git a/dotfiles/.config/nvim/nvim-pack-lock.json b/dotfiles/.config/nvim/nvim-pack-lock.json deleted file mode 100644 index d611882..0000000 --- a/dotfiles/.config/nvim/nvim-pack-lock.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "plugins": { - "LuaSnip": { - "rev": "3732756842a2f7e0e76a7b0487e9692072857277", - "src": "https://github.com/L3MON4D3/LuaSnip" - }, - "actions-preview.nvim": { - "rev": "cb938c25edaac38d362555f19244a9cb85d561e8", - "src": "https://github.com/aznhe21/actions-preview.nvim" - }, - "cmp-buffer": { - "rev": "b74fab3656eea9de20a9b8116afa3cfc4ec09657", - "src": "https://github.com/hrsh7th/cmp-buffer" - }, - "cmp-cmdline": { - "rev": "d126061b624e0af6c3a556428712dd4d4194ec6d", - "src": "https://github.com/hrsh7th/cmp-cmdline" - }, - "cmp-nvim-lsp": { - "rev": "cbc7b02bb99fae35cb42f514762b89b5126651ef", - "src": "https://github.com/hrsh7th/cmp-nvim-lsp" - }, - "cmp-path": { - "rev": "c642487086dbd9a93160e1679a1327be111cbc25", - "src": "https://github.com/hrsh7th/cmp-path" - }, - "cmp_luasnip": { - "rev": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90", - "src": "https://github.com/saadparwaiz1/cmp_luasnip" - }, - "diffview.nvim": { - "rev": "4516612fe98ff56ae0415a259ff6361a89419b0a", - "src": "https://github.com/sindrets/diffview.nvim" - }, - "everforest-nvim": { - "rev": "557bce922401e247a596583679bc181d4d688554", - "src": "https://github.com/neanias/everforest-nvim" - }, - "friendly-snippets": { - "rev": "572f5660cf05f8cd8834e096d7b4c921ba18e175", - "src": "https://github.com/rafamadriz/friendly-snippets" - }, - "gitsigns.nvim": { - "rev": "20ad4419564d6e22b189f6738116b38871082332", - "src": "https://github.com/lewis6991/gitsigns.nvim" - }, - "gleam.vim": { - "rev": "7174886f4974629a4427b0c703d6ce77f39422c5", - "src": "https://github.com/gleam-lang/gleam.vim" - }, - "neogit": { - "rev": "614a63489be5734b14f314c3449535566b8352d4", - "src": "https://github.com/NeogitOrg/neogit" - }, - "nerdicons.nvim": { - "rev": "2d257ff9b00b7d1510704e0a565a6a7ede76b79a", - "src": "https://github.com/glepnir/nerdicons.nvim" - }, - "nvim-cmp": { - "rev": "d78fb3b64eedb701c9939f97361c06483af575e0", - "src": "https://github.com/hrsh7th/nvim-cmp" - }, - "nvim-dap": { - "rev": "b38f7d30366d9169d0a623c4c85fbcf99d8d58bb", - "src": "https://github.com/mfussenegger/nvim-dap" - }, - "nvim-dap-ui": { - "rev": "cf91d5e2d07c72903d052f5207511bf7ecdb7122", - "src": "https://github.com/rcarriga/nvim-dap-ui" - }, - "nvim-lspconfig": { - "rev": "95fe3c170753238d3ca4f760e79a991400677abc", - "src": "https://github.com/neovim/nvim-lspconfig" - }, - "nvim-nio": { - "rev": "21f5324bfac14e22ba26553caf69ec76ae8a7662", - "src": "https://github.com/nvim-neotest/nvim-nio" - }, - "oil.nvim": { - "rev": "7e1cd7703ff2924d7038476dcbc04b950203b902", - "src": "https://github.com/stevearc/oil.nvim" - }, - "outline.nvim": { - "rev": "6b62f73a6bf317531d15a7ae1b724e85485d8148", - "src": "https://github.com/hedyhli/outline.nvim" - }, - "packer.nvim": { - "rev": "ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3", - "src": "https://github.com/wbthomason/packer.nvim" - }, - "plenary.nvim": { - "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", - "src": "https://github.com/nvim-lua/plenary.nvim" - }, - "popup.nvim": { - "rev": "b7404d35d5d3548a82149238289fa71f7f6de4ac", - "src": "https://github.com/nvim-lua/popup.nvim" - }, - "rustaceanvim": { - "rev": "6bd02e97a1f3102f06a72726764f24d3b3a33a85", - "src": "https://github.com/mrcjkb/rustaceanvim" - }, - "telescope-luasnip.nvim": { - "rev": "07a2a2936a7557404c782dba021ac0a03165b343", - "src": "https://github.com/benfowler/telescope-luasnip.nvim" - }, - "telescope.nvim": { - "rev": "3a12a853ebf21ec1cce9a92290e3013f8ae75f02", - "src": "https://github.com/nvim-telescope/telescope.nvim" - }, - "trouble.nvim": { - "rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a", - "src": "https://github.com/folke/trouble.nvim" - }, - "vim-airline": { - "rev": "6b51799f26c5fe262ebb04742ce7cdb011082ed7", - "src": "https://github.com/vim-airline/vim-airline" - }, - "vim-airline-themes": { - "rev": "77aab8c6cf7179ddb8a05741da7e358a86b2c3ab", - "src": "https://github.com/vim-airline/vim-airline-themes" - }, - "vim-terraform": { - "rev": "520498fab16a3a11f2ae1b8cb65e0a1684bc317a", - "src": "https://github.com/hashivim/vim-terraform" - }, - "vim-toml": { - "rev": "1b63257680eeb65677eb1ca5077809a982756d58", - "src": "https://github.com/cespare/vim-toml" - } - } -} \ No newline at end of file diff --git a/dotfiles/.config/sway/config.d/50-style.conf b/dotfiles/.config/sway/config.d/50-style.conf index 7fb3e9d..a2c938c 100644 --- a/dotfiles/.config/sway/config.d/50-style.conf +++ b/dotfiles/.config/sway/config.d/50-style.conf @@ -1,6 +1,6 @@ # Remove title from windows -default_border pixel 2 +default_border pixel 1 default_floating_border normal bindsym $mod+t border toggle @@ -15,14 +15,14 @@ set $bi #3f3f3f # Foreground active set $fa #eff1f5 # Foreground inactive -set $fi #8a8a8a +set $fi #646464 # Border active -set $bra #327ba8 +set $bra #9a9a9a # Border inactive set $bri #000000 # class border backgr. text indicator child_border -client.focused $bra $bra $fa $bg $bra +client.focused $bra $bra $bg $bg $bra client.focused_inactive $bra $ba $fa $bg $bri client.unfocused $bri $bi $fi $bg $bri #client.urgent $br $br $fg $bg $br #currently not implemented diff --git a/dotfiles/.config/sway/config.d/90-bindings.conf b/dotfiles/.config/sway/config.d/90-bindings.conf index a38c706..395d805 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 /tmp/screen.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)" /tmp/screen.png # # Resizing containers: diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config index 207aefd..4312297 100644 --- a/dotfiles/.config/waybar/config +++ b/dotfiles/.config/waybar/config @@ -4,7 +4,7 @@ "height": 30, "modules-left": ["sway/workspaces", "sway/mode", "sway/window"], "modules-center": [], - "modules-right": ["temperature", "network", "battery", "pulseaudio", "backlight", "cpu", "memory", "clock", "sway/language", "tray"], + "modules-right": ["temperature", "network", "battery", "pulseaudio", "backlight", "cpu", "memory", "custom/layout", "clock", "tray"], // Module config "sway/mode": { "tooltip": true, @@ -73,8 +73,10 @@ "memory": { "format": " {}%" }, - "sway/language": { - "format": "| {short} {variant}", + "custom/layout": { + "exec": "~/.config/waybar/keyboard-layout.py", + "return-type": "json", + "format": "| {}" }, "clock": { "tooltip": false, diff --git a/dotfiles/.config/waybar/style.css b/dotfiles/.config/waybar/style.css index d02758f..1bd9166 100644 --- a/dotfiles/.config/waybar/style.css +++ b/dotfiles/.config/waybar/style.css @@ -44,14 +44,14 @@ window#waybar.solo { #workspaces button { padding: 0 5px; background-color: transparent; - border-bottom: 2px solid #327ba8; + border-bottom: 2px solid rgba(180, 14, 25, 0.5); color: #999999; } #workspaces button.focused { color: #ffffff; background-color: #333333; - border-bottom: 2px solid #aa9600; + border-bottom: 2px solid #ff9600; } #workspaces button.urgent { diff --git a/dotfiles/.environ b/dotfiles/.environ index 94fd713..ebe8a3a 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 @@ -11,12 +11,9 @@ export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc export SYSTEMD_EDITOR=$EDITOR export TERM=alacritty 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 diff --git a/dotfiles/.profile b/dotfiles/.profile index 52e7f30..c7cffbd 100644 --- a/dotfiles/.profile +++ b/dotfiles/.profile @@ -1,7 +1,7 @@ # vim: set ft=sh: [ -f $HOME/.environ ] && source $HOME/.environ -[ -n "$BASH_VERSION" ] && source $HOME/.bashrc +[ $BASH == "/usr/bin/bash" ] && source $HOME/.bashrc MOZ_ENABLE_WAYLAND=1 XDG_CURRENT_DESKTOP=sway diff --git a/dotfiles/.ripgreprc b/dotfiles/.ripgreprc deleted file mode 100644 index 6516a24..0000000 --- a/dotfiles/.ripgreprc +++ /dev/null @@ -1,21 +0,0 @@ -# Don't let ripgrep vomit really long lines to my terminal, and show a preview. ---max-columns=150 ---max-columns-preview - -# Add my 'web' type. ---type-add -web:*.{html,css,js}* - -# Search hidden files / directories (e.g. dotfiles) by default ---hidden - -# Using glob patterns to include/exclude files or folders ---glob -!.git/* - -# Set the colors. ---colors=line:none ---colors=line:style:bold - -# Because who cares about case!? ---smart-case