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('core.options')
require("config.lazy") 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 if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim -- bootstrap lazy.nvim
-- stylua: ignore -- 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 }) lazypath })
end end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath) vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
@ -46,6 +47,10 @@ require("lazy").setup({
}, },
}, },
icons = { icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
misc = { misc = {
dots = "󰇘", dots = "󰇘",
}, },
@ -63,9 +68,9 @@ require("lazy").setup({
Info = "", Info = "",
}, },
git = { git = {
added = "", added = "+",
modified = "", modified = "~",
removed = "", removed = "-",
}, },
kinds = { kinds = {
Array = "", Array = "",

View File

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

View File

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

@ -18,26 +18,59 @@ return {
'packer', 'packer',
'neogitstatus', 'neogitstatus',
-- 'NvimTree', -- 'NvimTree',
-- 'Trouble', 'Trouble',
'alpha', 'alpha',
'lir', 'lir',
-- 'Outline', 'Outline',
'neo-tree',
'spectre_panel', 'spectre_panel',
-- 'toggleterm', 'toggleterm',
'qf',
},
winbar = {
'help',
'startify',
'dashboard',
'packer',
'neogitstatus',
'NvimTree',
'neo-tree',
'Trouble',
'alpha',
'lir',
'Outline',
'spectre_panel',
'toggleterm',
'qf', 'qf',
} }
}, },
},
sections = { sections = {
lualine_a = { 'mode' }, lualine_a = { 'mode' },
lualine_b = { lualine_b = {
{
'branch', 'branch',
draw_empty = true, on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("LazyGit")
end, 100)
end
}
}, },
lualine_c = { lualine_c = {
{ {
'diff', 'diff',
symbols = { added = '+', modified = '~', removed = '-' }, symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed
},
colored = true, colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Gdiffsplit")
end, 100)
end
}, },
{ {
"diagnostics", "diagnostics",
@ -48,7 +81,10 @@ return {
info = icons.diagnostics.Info, info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint, hint = icons.diagnostics.Hint,
}, },
colored = true colored = true,
on_click = function(_, _)
require("trouble").toggle({ mode = "document_diagnostics" })
end
}, },
{ {
'filename', 'filename',
@ -59,7 +95,7 @@ return {
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly. readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
unnamed = '[No Name]', -- Text to show for unnamed buffers. unnamed = '[No Name]', -- Text to show for unnamed buffers.
newfile = '[New]', -- Text to show for newly created file before first write newfile = '[New]', -- Text to show for newly created file before first write
}, }
}, },
}, },
lualine_x = { lualine_x = {
@ -68,15 +104,42 @@ return {
{ {
'filetype', 'filetype',
colored = true, colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Telescope filetypes")
end, 100)
end
} }
}, },
lualine_y = { 'progress' }, lualine_y = { 'progress' },
lualine_z = { 'location' }, 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 = { dependencies = {
'nvim-tree/nvim-web-devicons' 'nvim-tree/nvim-web-devicons',
"SmiteshP/nvim-navic",
'kdheepak/lazygit.nvim'
} }
}, },
} }

View File

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

View File

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

View File

@ -9,17 +9,15 @@ return {
window = { window = {
completion = { completion = {
border = "rounded", border = "rounded",
scrollbar = false,
winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenu,Search:None"
}, },
documentation = { 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 = { snippet = {
expand = function(args) expand = function(args)
require("luasnip").lsp_expand(args.body) require("luasnip").lsp_expand(args.body)

View File

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

View File

@ -3,3 +3,4 @@ return {
'nvim-lua/plenary.nvim' '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', 'simrat39/symbols-outline.nvim',
opts = { opts = {
show_guides = true, show_guides = true,
fold_markers = { '', '' },
autofold_depth = 3, autofold_depth = 3,
show_symbol_details = false show_symbol_details = false,
show_numbers = false,
} }
} }
} }

View File

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