feat: add bufferline

This commit is contained in:
Maciej Jur 2023-07-29 21:15:17 +02:00
parent 08d972a587
commit 8f4406002f
Signed by: kamov
GPG key ID: 191CBFF5F72ECAFD
7 changed files with 60 additions and 29 deletions

4
nvim/README.md Normal file
View file

@ -0,0 +1,4 @@
| Key | Action |
| ------------- | ------------------------- |
| `<leader>pm` | open package manager |

View file

@ -1,23 +1,34 @@
-- Setup global config
require("global")
-- Load lazy.nvim package manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
-- Setup Neovide config
-- Only run this if inside Neovide
if vim.g.neovide then
require("neovide")
end
vim.opt.rtp:prepend(lazypath)
-- Set up plugins
plugins = require("plugins")
lazy = require("lazy")
-- Bootstrap package manager
do
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
end
lazy.setup(plugins)
-- Load lazy
local lazy_ok, lazy = pcall(require, "lazy")
if lazy_ok then
lazy.setup(require("plugins"))
vim.keymap.set('n', '<leader>pm', lazy.home, { desc = "Package manager: open" })
else
print("(init) Couldn't load Lazy")
end

View file

@ -1,26 +1,27 @@
{
"LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" },
"bufferline.nvim": { "branch": "main", "commit": "d24378edc14a675c820a303b4512af3bbc5761e9" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"diffview.nvim": { "branch": "main", "commit": "e91110d2a7f8e2f667666aba6ea089ff823f8748" },
"gitsigns.nvim": { "branch": "main", "commit": "11b80e7eea249affc8776483272bcfc627b5552a" },
"gitsigns.nvim": { "branch": "main", "commit": "5d73da785a3c05fd63ac31769079db05169a6ec7" },
"haskell-tools.nvim": { "branch": "1.x.x", "commit": "43ec3b2f068c8163476dbb0c35bcb8ad7d588fa4" },
"kanagawa.nvim": { "branch": "master", "commit": "1749cea392acb7d1548a946fcee1e6f1304cd3cb" },
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" },
"mason.nvim": { "branch": "main", "commit": "5e58cdbcde0469d487873e531c71ef97df821adb" },
"mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "981a43adcca25e7ccc3c589902d49f25e4d48ebc" },
"nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" },
"nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" },
"nvim-dap": { "branch": "master", "commit": "d17d1bba23ec72a157bd183c57840c39e323f515" },
"nvim-dap": { "branch": "master", "commit": "2f28ea843bcdb378b171a66ddcd568516e431d55" },
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
"nvim-lspconfig": { "branch": "master", "commit": "6f426c34c8e21af2f934e56be9d1198a507ecc9f" },
"nvim-treesitter": { "branch": "master", "commit": "74a7da4e4be5ee71e9efb6d7bdffa16ad620cc57" },
"nvim-lspconfig": { "branch": "master", "commit": "b6091272422bb0fbd729f7f5d17a56d37499c54f" },
"nvim-treesitter": { "branch": "master", "commit": "ee107fc759647293a84ad42b867f518331364fbe" },
"nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" },
"plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },

View file

@ -12,7 +12,7 @@ return function()
standalone = true,
-- capabilities = capabilities,
on_attach = function(client, bufnr)
local buf_opts = { noremap = true, silent = true, buffer = buf_number }
local buf_opts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', "<C-b>", rt.hover_actions.hover_actions, buf_opts)
vim.keymap.set('n', "<Leader>a", rt.code_action_group.code_action_group, buf_opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, buf_opts)
@ -24,7 +24,7 @@ return function()
command = "clippy",
allFeatures = true,
}
}
}
},
dap = {
adapter = require("rust-tools.dap").get_codelldb_adapter(lsp_path, lib_path),

View file

@ -13,21 +13,19 @@ opt.expandtab = true
-- Line numbers
opt.number = true
opt.relativenumber = true
-- Clipboard
opt.clipboard = "unnamedplus"
-- Helper punctuation
vim.opt.list = true
vim.opt.listchars = {
opt.list = true
opt.listchars = {
trail = '·',
nbsp = '',
tab = '→→',
}
-- Neovide
g.neovide_scale_factor = 0.75
-- Trailing whitespace
-- vim.fn.matchadd("errorMsg", [[\s\+$]])
vim.api.nvim_create_autocmd("BufWritePre", { command = [[%s/\s\+$//e]] })

2
nvim/lua/neovide.lua Normal file
View file

@ -0,0 +1,2 @@
vim.g.neovide_scale_factor = 0.75

View file

@ -49,6 +49,19 @@ return {
end,
},
-- Bufferline
{
'akinsho/bufferline.nvim',
version = "*",
dependencies = {
'nvim-tree/nvim-web-devicons'
},
config = function()
local config = require("bufferline")
config.setup({})
end
},
-- Git diffviewer
{
"sindrets/diffview.nvim",
@ -92,7 +105,9 @@ return {
-- nvim
"vim", "vimdoc", "lua",
-- misc
"comment", "gitignore", "diff", "dockerfile", "json", "yaml", "toml", "regex",
"comment", "dockerfile", "json", "yaml", "toml", "regex",
-- git
"gitcommit", "gitignore", "diff",
-- shell
"bash", -- "fish", "nu",
-- markdown