Keybindings and smaller ui related improvements

Options:

- lualine shows path of files
- added breadcrumbs to programming buffers as winbar

Plugins:

- added mrcjkb/rustaceanvim for improved rust support
- added lewis6991/gitsigns.nvim to show changes in files
- dropped lspkind, it had no visible effect and could not easily be
  fixed
- added j-hui/fidget.nvim to make $/progress messages (e.g. from lsp)
  visible

Keybindings:

- dropped unused and commented out keybindings
- <leader>fr to resume last fzf search
- <C-W>0, 1, 2, 3 to mimic emacs <C-x>.... window keys
- <esc><esc> to clear last search
- added desc field to many keybindings in lsp
This commit is contained in:
2024-10-09 07:47:31 +02:00
parent de68c1e748
commit e82602334e
3 changed files with 105 additions and 51 deletions

View File

@@ -12,17 +12,10 @@ end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Vscode-like pictograms
{
"onsails/lspkind.nvim",
event = { "VimEnter" },
},
-- Auto-completion engine
{
"hrsh7th/nvim-cmp",
dependencies = {
"lspkind.nvim",
"hrsh7th/cmp-nvim-lsp", -- lsp auto-completion
"hrsh7th/cmp-buffer", -- buffer auto-completion
"hrsh7th/cmp-path", -- path auto-completion
@@ -49,6 +42,16 @@ require("lazy").setup({
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
-- Nice plugin to show what LSPs are doing in the background (and others
-- using $/progress and vim.notify())
{
"j-hui/fidget.nvim",
opts = {
-- options
},
},
-- show lsp signature while coding
{
"ray-x/lsp_signature.nvim",
@@ -94,6 +97,9 @@ require("lazy").setup({
end,
},
-- comfortable table editing, esp. used in orgmode
{ 'dhruvasagar/vim-table-mode' },
-- fzf-lua
{
"ibhagwan/fzf-lua",
@@ -107,7 +113,7 @@ require("lazy").setup({
end
},
-- whichkey
-- which-key
{
"folke/which-key.nvim",
event = "VeryLazy",
@@ -161,6 +167,34 @@ require("lazy").setup({
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
-- an alternative might be:
-- https://github.com/nvim-treesitter/nvim-treesitter-context
local function breadcrumb()
local result = require 'nvim-treesitter'.statusline(
{
type_patterns = {
"class",
"impl",
"function",
"method",
"import",
"for",
"if",
"while",
"variable",
"comment",
},
separator = ""
}
)
if result == "" then
result = ' '
elseif result == nil then
result = ''
end
return result
end
require("lualine").setup {
options = {
icons_enabled = false,
@@ -181,7 +215,7 @@ require("lazy").setup({
}
},
sections = {
lualine_a = { 'filename' },
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = {},
lualine_x = { 'encoding', 'fileformat', 'filetype' },
@@ -189,16 +223,25 @@ require("lazy").setup({
lualine_z = { 'progress', 'location' }
},
inactive_sections = {
lualine_a = {},
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {}
lualine_c = {},
-- lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_x = {},
lualine_y = { 'filesize' },
lualine_z = { 'location' }
},
tabline = {},
winbar = {},
inactive_winbar = {},
winbar = {
lualine_a = {
{ breadcrumb,
color = { bg = '#101010', fg = '#568200' },
},
},
},
inactive_winbar = {
lualine_a = { breadcrumb },
},
extensions = {}
}
end
@@ -247,9 +290,6 @@ require("lazy").setup({
"PhilRunninger/cmp-rpncalc",
},
-- comfortable table editing, esp. used in orgmode
{ 'dhruvasagar/vim-table-mode' },
-- TODO, WARN, HACK, PERF, NOTE, TEST and others highlighting and searching
{
"folke/todo-comments.nvim",
@@ -275,8 +315,8 @@ require("lazy").setup({
{ "cpkio/nvim-treesitter-asciidoc" },
-- Greeter to run on NeoVim startup
{
'goolord/alpha-nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
@@ -384,5 +424,18 @@ require("lazy").setup({
end,
},
-- improved Rust support
{
'mrcjkb/rustaceanvim',
version = '^5', -- Recommended
lazy = false, -- This plugin is already lazy
},
-- show git changes on the left
{
"lewis6991/gitsigns.nvim",
config = function()
require('gitsigns').setup()
end,
},
})