updated config with cokeline

This commit is contained in:
Sven Vogel 2023-11-27 23:37:34 +01:00
parent 6d0613f442
commit 36147cfea3
18 changed files with 251 additions and 117 deletions

View File

@ -1,2 +1,4 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
require('core.options')
require('core.keymaps')
require('core.autocmds')
require("core.bootstrap")

View File

@ -2,7 +2,8 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable",
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
@ -46,6 +47,10 @@ require("lazy").setup({
},
},
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
misc = {
dots = "󰇘",
},
@ -63,9 +68,9 @@ require("lazy").setup({
Info = "",
},
git = {
added = "",
modified = "",
removed = "",
added = "+",
modified = "~",
removed = "-",
},
kinds = {
Array = "",

View File

@ -2,7 +2,7 @@ return {
lua_ls = {
mason = false
},
bash_ls = {
bashls = {
mason = false,
},
clangd = {
@ -14,4 +14,10 @@ return {
pyright = {
mason = false
},
html = {
mason = false
},
gopls = {
mason = false
}
}

View File

@ -1,5 +1,6 @@
local opt = vim.opt
opt.swapfile = false -- disable swapfiles because they are fucking garbage
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
@ -30,7 +31,7 @@ opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shi
opt.smartcase = false -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current
opt.splitbelow = false -- Put new windows below current
opt.splitkeep = "screen"
opt.splitright = true -- Put new windows right of current
opt.tabstop = 4 -- Number of spaces tabs count for

View File

@ -1,24 +0,0 @@
return {
{
"akinsho/bufferline.nvim",
dependencies = {
'nvim-tree/nvim-web-devicons'
},
opts = {
options = {
close_command = function(n) require("mini.bufremove").delete(n, false) end,
always_show_bufferline = true,
numbers = 'none',
separator_style = { "", "" },
offsets = {
{
filetype = 'neo-tree',
text = 'Explorer',
separator = true
}
},
},
}
}
}

80
lua/plugins/cokeline.lua Normal file
View File

@ -0,0 +1,80 @@
return {
{
"willothy/nvim-cokeline",
config = true,
opts = {
show_if_buffers_are_at_least = 1,
buffers = {
focus_on_delete = "next",
new_buffers_position = 'last',
},
mappings = {
disable_mouse = false,
},
default_hl = {
bg = function(buffer)
if buffer.is_focused then
return "Normal"
end
return "ColorColumn"
end,
fg = function(buffer)
if buffer.is_focused then
return "Normal"
end
return "TabLine"
end,
bold = function(buffer)
return buffer.is_focused
end
},
components = {
{
text = function(buffer) return ' ' .. buffer.devicon.icon end,
fg = function(buffer) return buffer.devicon.color end,
},
{
text = function(buffer) return ' ' .. buffer.filename .. ' ' end,
},
{
text = function(buffer)
if buffer.is_modified then
return ''
elseif buffer.is_readonly then
return ''
else
return ''
end
end
},
{
text = '󰅖',
on_click = function(_, _, _, _, buffer)
buffer:delete()
end
},
{
text = ' ',
}
},
tabs = {
placement = "right",
components = {
{
text = function(tabpage)
return '' .. tabpage.number
end
}
}
},
sidebar = {
filetype = { "NvimTree", "neo-tree", "SidebarNvim" },
components = {
{
text = "Explorer",
}
},
},
}
}
}

View File

@ -9,17 +9,17 @@ return {
},
scope = { enabled = false },
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},

View File

@ -18,65 +18,128 @@ return {
'packer',
'neogitstatus',
-- 'NvimTree',
-- 'Trouble',
'Trouble',
'alpha',
'lir',
-- 'Outline',
'Outline',
'neo-tree',
'spectre_panel',
-- 'toggleterm',
'toggleterm',
'qf',
},
winbar = {
'help',
'startify',
'dashboard',
'packer',
'neogitstatus',
'NvimTree',
'neo-tree',
'Trouble',
'alpha',
'lir',
'Outline',
'spectre_panel',
'toggleterm',
'qf',
}
},
sections = {
lualine_a = { 'mode' },
lualine_b = {
},
sections = {
lualine_a = { 'mode' },
lualine_b = {
{
'branch',
draw_empty = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("LazyGit")
end, 100)
end
}
},
lualine_c = {
{
'diff',
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed
},
colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Gdiffsplit")
end, 100)
end
},
lualine_c = {
{
'diff',
symbols = { added = '+', modified = '~', removed = '-' },
colored = true,
},
{
"diagnostics",
sources = { 'nvim_diagnostic' },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
colored = true
},
{
'filename',
file_status = true,
path = 0,
symbols = {
modified = '[+]', -- Text to show when the file is modified.
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
unnamed = '[No Name]', -- Text to show for unnamed buffers.
newfile = '[New]', -- Text to show for newly created file before first write
},
{
"diagnostics",
sources = { 'nvim_diagnostic' },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
colored = true,
on_click = function(_, _)
require("trouble").toggle({ mode = "document_diagnostics" })
end
},
lualine_x = {
'encoding',
'fileformat',
{
'filetype',
colored = true,
{
'filename',
file_status = true,
path = 0,
symbols = {
modified = '[+]', -- Text to show when the file is modified.
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
unnamed = '[No Name]', -- Text to show for unnamed buffers.
newfile = '[New]', -- Text to show for newly created file before first write
}
},
lualine_y = { 'progress' },
lualine_z = { 'location' },
},
lualine_x = {
'encoding',
'fileformat',
{
'filetype',
colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Telescope filetypes")
end, 100)
end
}
},
lualine_y = { 'progress' },
lualine_z = { 'location' },
},
winbar = {
lualine_c = {
{
"navic",
color_correction = nil,
navic_opts = {
click = true,
depth_limit = 4,
depth_limit_indicator = "",
separator = "",
icons = require("lazyvim.config").icons.kinds,
lazy_update_context = true,
}
}
}
},
inactive_winbar = {
lualine_c = {
'filename',
},
},
},
dependencies = {
'nvim-tree/nvim-web-devicons'
'nvim-tree/nvim-web-devicons',
"SmiteshP/nvim-navic",
'kdheepak/lazygit.nvim'
}
},
}

View File

@ -1,6 +1,7 @@
return {
{
"SmiteshP/nvim-navic",
lazy = true,
init = function()
vim.g.navic_silence = true
require("lazyvim.util").lsp.on_attach(function(client, buffer)
@ -9,11 +10,14 @@ return {
end
end)
end,
opts = {
highlight = true,
icons = require("lazyvim.config").icons.kinds,
separator = "",
depth_limit = 5,
}
opts = function()
return {
separator = " ",
highlight = true,
depth_limit = 5,
icons = require("lazyvim.config").icons.kinds,
lazy_update_context = true,
}
end,
}
}

View File

@ -31,15 +31,15 @@ return {
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
added = "+", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "M", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "D", -- this can only be used in the git_status source
renamed = "󰁕", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱 ",
staged = "",
unstaged = "U",
staged = "S",
conflict = "",
}
},
@ -47,6 +47,9 @@ return {
symbol = "+",
highlight = "NeoTreeModified",
},
},
filesystem = {
use_libuv_file_watcher = true
}
}
}

View File

@ -9,17 +9,15 @@ return {
window = {
completion = {
border = "rounded",
scrollbar = false,
winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenu,Search:None"
},
documentation = {
border = "rounded"
border = "rounded",
scrollbar = false,
winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenu,Search:None"
},
},
completion = {
completeopt = "menu,menuone,noinsert",
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
col_offset = -3,
side_padding = 0,
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)

View File

@ -39,7 +39,7 @@ return {
formatting_options = nil,
timeout_ms = nil,
},
servers = require("config.language-server"),
servers = require("core.language-server"),
setup = {
}
},

View File

@ -2,4 +2,5 @@ return {
{
'nvim-lua/plenary.nvim'
}
}
}

View File

@ -1,5 +0,0 @@
return {
{
"karb94/neoscroll.nvim"
}
}

View File

@ -3,9 +3,9 @@ return {
'simrat39/symbols-outline.nvim',
opts = {
show_guides = true,
fold_markers = { '', '' },
autofold_depth = 3,
show_symbol_details = false
show_symbol_details = false,
show_numbers = false,
}
}
}

View File

@ -5,12 +5,12 @@ return {
priority = 1000,
opts = {
style = "night",
transparent = true,
transparent = false,
styles = {
sidebars = "transparent",
floats = "transparent",
sidebars = "dark",
floats = "normal",
},
sidebars = { "qf", "NvimTree", "help" },
sidebars = { "qf", "help", "neo-tree", "Outline" },
},
},
-- Configure LazyVim to load gruvbox