Redo nvim packages with vim.pack

Plus some small changes here and there.
This commit is contained in:
Vladan Popovic 2025-11-14 15:39:20 +01:00
parent 1c9c72b1b8
commit 26683b6294
8 changed files with 223 additions and 124 deletions

View file

@ -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

View file

@ -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"

View file

@ -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", "<C-w>", "<cmd>let _s=@/<Bar>:%s/\\s\\+$//e<Bar>:let @/=_s<Bar><CR>")
@ -10,11 +14,10 @@ vim.keymap.set("n", "<leader>se", "<cmd>setlocal spell spelllang=en_us<cr>")
vim.keymap.set("n", "<leader>sq", "<cmd>setlocal nospell<cr>")
vim.keymap.set("n", "<F3>", "<cmd>set nonumber!<CR>")
vim.keymap.set("n", "<leader>fe", "<cmd>Oil<CR>")
vim.keymap.set("n", "<leader>e", "<cmd>Oil<CR>")
vim.keymap.set("n", ']d', "<cmd>lua vim.diagnostic.goto_next()<CR>")
vim.keymap.set("n", '[d', "<cmd>lua vim.diagnostic.goto_prev()<CR>")
vim.keymap.set("n", "<leader>aa", require("actions-preview").code_actions)
-- Outline!!
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>")
@ -26,3 +29,25 @@ vim.keymap.set("n", "<M-r>", "<cmd>lua vim.lsp.buf.rename()()<CR>")
vim.keymap.set("n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>")
vim.keymap.set("n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
vim.keymap.set("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>")
-- Snippets can be useful.
vim.keymap.set('n', '<leader>ss', telescope.extensions.luasnip.luasnip, {})
-- Fuzzy * files, symbols, buffers, help, etc.
vim.keymap.set("n", "<leader>a", codeactions.code_actions)
vim.keymap.set('n', '<leader>F', builtin.find_files) -- f[ind]a[ll]
vim.keymap.set('n', '<leader>b', builtin.buffers)
vim.keymap.set('n', '<leader>d', builtin.diagnostics)
vim.keymap.set('n', '<leader>f', builtin.git_files)
vim.keymap.set('n', '<leader>h', builtin.help_tags)
vim.keymap.set('n', '<leader>ws', builtin.lsp_dynamic_workspace_symbols)
-- Grep (the only one).
vim.keymap.set('n', '<leader>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', '<leader>ci', builtin.lsp_incoming_calls)
vim.keymap.set('n', '<leader>co', builtin.lsp_outgoing_calls)

View file

@ -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')

View file

@ -16,11 +16,9 @@ local files_config = {
cache_picker = false,
layout_strategy = "vertical",
layout_config = {
vertical = {
prompt_position = "top",
mirror = true,
width = 0.5,
},
width = 0.8,
},
}
@ -55,6 +53,12 @@ telescope.setup {
i = { ["<c-f>"] = actions.to_fuzzy_refine },
n = { ["<c-f>"] = 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', '<leader>ss', telescope.extensions.luasnip.luasnip, {})
-- Fuzzy * files, symbols, buffers, help, etc.
vim.keymap.set('n', '<leader>fa', builtin.find_files) -- f[ind]a[ll]
vim.keymap.set('n', '<leader>fb', builtin.buffers)
vim.keymap.set('n', '<leader>fd', builtin.diagnostics)
vim.keymap.set('n', '<leader>ff', builtin.git_files)
vim.keymap.set('n', '<leader>fh', builtin.help_tags)
vim.keymap.set('n', '<leader>fs', builtin.lsp_dynamic_workspace_symbols)
-- Grep (the only one).
vim.keymap.set('n', '<leader>rg', builtin.live_grep)
-- LSP navigation.
vim.keymap.set('n', '<leader>gd', builtin.lsp_definitions)
vim.keymap.set('n', '<leader>gr', builtin.lsp_references)
vim.keymap.set('n', '<leader>gi', builtin.lsp_implementations)
vim.keymap.set('n', '<leader>ci', builtin.lsp_incoming_calls)
vim.keymap.set('n', '<leader>co', builtin.lsp_outgoing_calls)

View file

@ -0,0 +1,7 @@
local theme = require("everforest")
theme.setup({
background = "hard",
ui_contrast = "high",
})
theme.load()

View file

@ -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

View file

@ -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"
}
}
}