From 26683b6294d29b5ab5e59ebf3bf44438cb08ca37 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Fri, 14 Nov 2025 15:39:20 +0100 Subject: [PATCH] Redo nvim packages with vim.pack Plus some small changes here and there. --- dotfiles/.bashrc | 6 - dotfiles/.config/helix/config.toml | 9 ++ dotfiles/.config/nvim/lua/keymappings.lua | 29 +++- dotfiles/.config/nvim/lua/plugins/init.lua | 127 +++++------------ .../.config/nvim/lua/plugins/telescope.lua | 35 ++--- dotfiles/.config/nvim/lua/plugins/theme.lua | 7 + dotfiles/.config/nvim/lua/settings.lua | 2 +- dotfiles/.config/nvim/nvim-pack-lock.json | 132 ++++++++++++++++++ 8 files changed, 223 insertions(+), 124 deletions(-) create mode 100644 dotfiles/.config/nvim/lua/plugins/theme.lua create mode 100644 dotfiles/.config/nvim/nvim-pack-lock.json diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 78a82de..35e7d85 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -23,12 +23,6 @@ export PS1="${Blue}\d \A ${Off}${Yellow}\u@\h: ${Off}\w ${Green}\$(parse_branch hash fzf 2>/dev/null && eval "$(fzf --bash)" export FZF_DEFAULT_OPTS='--border=horizontal --info=inline --no-reverse --height=50%' -[ -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 gpg-agent as ssh agent (and get a nice graphical prompt). unset SSH_AGENT_PID if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then diff --git a/dotfiles/.config/helix/config.toml b/dotfiles/.config/helix/config.toml index 8c1ce9f..4c6e918 100644 --- a/dotfiles/.config/helix/config.toml +++ b/dotfiles/.config/helix/config.toml @@ -1,4 +1,13 @@ 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/nvim/lua/keymappings.lua b/dotfiles/.config/nvim/lua/keymappings.lua index ab520fd..9bfcc04 100644 --- a/dotfiles/.config/nvim/lua/keymappings.lua +++ b/dotfiles/.config/nvim/lua/keymappings.lua @@ -1,3 +1,7 @@ +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") @@ -10,11 +14,10 @@ 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", "fe", "Oil") +vim.keymap.set("n", "e", "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") @@ -26,3 +29,25 @@ 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/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index cb6ca9d..33babb8 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -1,96 +1,45 @@ -require('plugins.packer_setup') +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('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 { - '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' } -- diagnostics - - -- Plugins to extend builtin lsp - use { 'cespare/vim-toml' } - use { 'gleam-lang/gleam.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 { - '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.neogit') -require('plugins.oil') require('plugins.outline') +require('plugins.neogit') require('plugins.telescope') -require('plugins.venn') +require('plugins.theme') +require('plugins.oil') diff --git a/dotfiles/.config/nvim/lua/plugins/telescope.lua b/dotfiles/.config/nvim/lua/plugins/telescope.lua index eb347c0..905bd09 100644 --- a/dotfiles/.config/nvim/lua/plugins/telescope.lua +++ b/dotfiles/.config/nvim/lua/plugins/telescope.lua @@ -16,11 +16,9 @@ local files_config = { cache_picker = false, layout_strategy = "vertical", layout_config = { - vertical = { - prompt_position = "top", - mirror = true, - width = 0.5, - }, + prompt_position = "top", + mirror = true, + width = 0.8, }, } @@ -55,6 +53,12 @@ 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, @@ -62,24 +66,3 @@ 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', '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/plugins/theme.lua b/dotfiles/.config/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..34b2d66 --- /dev/null +++ b/dotfiles/.config/nvim/lua/plugins/theme.lua @@ -0,0 +1,7 @@ +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 684ff54..026315f 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 = 'light' +vim.opt.background = 'dark' -- Enable vimrc files per project and disable unsafe commands in project vimrc vim.opt.exrc = true diff --git a/dotfiles/.config/nvim/nvim-pack-lock.json b/dotfiles/.config/nvim/nvim-pack-lock.json new file mode 100644 index 0000000..d611882 --- /dev/null +++ b/dotfiles/.config/nvim/nvim-pack-lock.json @@ -0,0 +1,132 @@ +{ + "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