1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-31 16:37:45 +02:00

nvim: adapted icons to fit with another

This commit is contained in:
tiyn 2023-08-08 18:10:08 +02:00
parent ec1e911712
commit 2a2dc266b0
2 changed files with 454 additions and 410 deletions

View File

@ -13,438 +13,448 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
return require("lazy").setup({ return require("lazy").setup({
-- display git status per line
{
'lewis6991/gitsigns.nvim',
config = function()
require('gitsigns').setup()
end
},
-- display git status per line -- show indentation lines
{ {
'lewis6991/gitsigns.nvim', 'lukas-reineke/indent-blankline.nvim',
config = function() config = function()
require('gitsigns').setup() require("indent_blankline").setup({
end show_current_context = true,
}, show_current_context_start = true
})
end,
},
-- show indentation lines -- statusline
{ {
'lukas-reineke/indent-blankline.nvim', 'nvim-lualine/lualine.nvim',
config = function() dependencies = { 'nvim-tree/nvim-web-devicons', },
require("indent_blankline").setup({ config = function()
show_current_context = true, require('lualine').setup({
show_current_context_start = true options = {
}) symbols = {
end, error = Error_sign,
}, warn = Warn_sign,
hint = Hint_sign,
-- statusline info = Info_sign
{ },
'nvim-lualine/lualine.nvim', theme = 'tccs',
dependencies = { 'nvim-tree/nvim-web-devicons', }, component_separators = { left = '', right = '' },
config = function() section_separators = { left = '', right = '' }
require('lualine').setup({
options = {
symbols = {
error = Error_sign,
warn = Warn_sign,
hint = Hint_sign,
info = Info_sign
}, },
theme = 'tccs', })
component_separators = { left = '', right = '' }, end
section_separators = { left = '', right = '' }
},
})
end
},
-- show function signature while typing
{
'ray-x/lsp_signature.nvim',
config = function()
require "lsp_signature".setup({
bind = true,
handler_opts = {
border = "none"
},
hint_prefix = Hint_sign,
hint_scheme = "DiagnosticSignHint"
})
end
},
-- preview for markdown filetypes
{
"iamcco/markdown-preview.nvim",
ft = { 'markdown' },
build = "cd app && yarn install"
},
-- latex asynchronous pdf rendering
{
'donRaphaco/neotex',
ft = { 'tex' },
config = function()
vim.g.neotex_enabled = 2
end
},
-- nim language support
{
'zah/nim.vim',
ft = { 'nim' }
},
-- automatic closing of brackets
{
'windwp/nvim-autopairs',
config = function()
require("nvim-autopairs").setup()
end
},
-- lang server installations
{
'williamboman/mason.nvim',
dependencies = {
{
'jose-elias-alvarez/null-ls.nvim',
config = function()
require("null-ls").setup({
sources = {
require("null-ls-embedded").nls_source.with({
filetypes = { "markdown" }
}),
require("null-ls").builtins.formatting.black,
require("null-ls").builtins.formatting.mdformat
}
})
end
},
{
'jay-babu/mason-null-ls.nvim',
config = function()
-- jay-babu/mason-null-ls.nvim
require("mason-null-ls").setup({
automatic_installation = true,
ensure_installed = { "black", "mdformat" }
})
end
},
'LostNeophyte/null-ls-embedded'
}, },
config = function()
require("mason").setup({
ui = {
icons = Install_icons
}
})
end
},
-- lang server management -- show function signature while typing
{ {
'williamboman/mason-lspconfig.nvim', 'ray-x/lsp_signature.nvim',
dependencies = { config = function()
'neovim/nvim-lspconfig', require "lsp_signature".setup({
{ bind = true,
'hrsh7th/cmp-nvim-lsp', handler_opts = {
config = function() border = "none"
Capabilities = require("cmp_nvim_lsp").default_capabilities() },
Capabilities.textDocument.foldingRange = { hint_prefix = Hint_sign,
dynamicRegistration = false, hint_scheme = "DiagnosticSignHint"
lineFoldingOnly = true })
} end
end },
},
-- navigation menu -- preview for markdown filetypes
{ {
'SmiteshP/nvim-navbuddy', "iamcco/markdown-preview.nvim",
config = function() ft = { 'markdown' },
local navbuddy = require("nvim-navbuddy") build = "cd app && yarn install"
Attach_func = function(client, bufnr) },
navbuddy.attach(client, bufnr)
-- latex asynchronous pdf rendering
{
'donRaphaco/neotex',
ft = { 'tex' },
config = function()
vim.g.neotex_enabled = 2
end
},
-- nim language support
{
'zah/nim.vim',
ft = { 'nim' }
},
-- automatic closing of brackets
{
'windwp/nvim-autopairs',
config = function()
require("nvim-autopairs").setup()
end
},
-- lang server installations
{
'williamboman/mason.nvim',
dependencies = {
{
'jose-elias-alvarez/null-ls.nvim',
config = function()
require("null-ls").setup({
sources = {
require("null-ls-embedded").nls_source.with({
filetypes = { "markdown" }
}),
require("null-ls").builtins.formatting.black,
require("null-ls").builtins.formatting.mdformat
}
})
end end
end, },
dependencies = { {
'SmiteshP/nvim-navic', 'jay-babu/mason-null-ls.nvim',
'MunifTanjim/nui.nvim' config = function()
} -- jay-babu/mason-null-ls.nvim
require("mason-null-ls").setup({
automatic_installation = true,
ensure_installed = { "black", "mdformat" }
})
end
},
'LostNeophyte/null-ls-embedded'
}, },
config = function()
require("mason").setup({
ui = {
icons = Install_signs
}
})
end
}, },
config = function()
require("mason-lspconfig").setup({ -- lang server management
automatic_setup = true, {
ensure_installed = { 'williamboman/mason-lspconfig.nvim',
"bashls", dependencies = {
"jdtls", 'neovim/nvim-lspconfig',
"lua_ls", {
"marksman", 'hrsh7th/cmp-nvim-lsp',
"nimls", config = function()
"pyright", Capabilities = require("cmp_nvim_lsp").default_capabilities()
"texlab" Capabilities.textDocument.foldingRange = {
} dynamicRegistration = false,
}) lineFoldingOnly = true
require("mason-lspconfig").setup_handlers({
function(server_name)
require('lspconfig')[server_name].setup({
on_attach = Attach_func,
capabilities = Capabilities,
flags = {
debounce_text_changes = 150
} }
}) end
end, },
["lua_ls"] = function() -- navigation menu
require 'lspconfig'.lua_ls.setup({ {
settings = { 'SmiteshP/nvim-navbuddy',
Lua = { config = function()
diagnostics = { local navbuddy = require("nvim-navbuddy")
globals = { 'vim' } Attach_func = function(client, bufnr)
navbuddy.attach(client, bufnr)
end
end,
dependencies = {
'SmiteshP/nvim-navic',
'MunifTanjim/nui.nvim'
}
},
},
config = function()
require("mason-lspconfig").setup({
automatic_setup = true,
ensure_installed = {
"bashls",
"jdtls",
"lua_ls",
"marksman",
"nimls",
"pyright",
"texlab"
}
})
require("mason-lspconfig").setup_handlers({
function(server_name)
require('lspconfig')[server_name].setup({
on_attach = Attach_func,
capabilities = Capabilities,
flags = {
debounce_text_changes = 150
}
})
end,
["lua_ls"] = function()
require 'lspconfig'.lua_ls.setup({
settings = {
Lua = {
diagnostics = {
globals = { 'vim' }
}
} }
} }
} })
})
end
})
end
},
-- autocompletion and its sources and snippets
{
'hrsh7th/nvim-cmp',
dependencies = {
'nvim-lua/plenary.nvim',
'onsails/lspkind-nvim',
-- cmp sources
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'lukas-reineke/cmp-under-comparator',
-- luasnip
{
'l3mon4d3/luasnip',
config = function()
require("luasnip.loaders.from_snipmate").lazy_load()
end,
dependencies = { 'saadparwaiz1/cmp_luasnip' }
},
},
config = function()
local cmp = require("cmp")
cmp.setup {
sorting = {
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
require "cmp-under-comparator".under,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order
},
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end end
})
end
},
-- autocompletion and its sources and snippets
{
'hrsh7th/nvim-cmp',
dependencies = {
'nvim-lua/plenary.nvim',
'onsails/lspkind-nvim',
-- cmp sources
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'lukas-reineke/cmp-under-comparator',
-- luasnip
{
'l3mon4d3/luasnip',
config = function()
require("luasnip.loaders.from_snipmate").lazy_load()
end,
dependencies = { 'saadparwaiz1/cmp_luasnip' }
}, },
mapping = { },
['<S-Tab>'] = cmp.mapping(function(fallback) config = function()
if cmp.visible() then local cmp = require("cmp")
cmp.select_prev_item() cmp.setup {
elseif require("luasnip").jumpable(-1) then sorting = {
require("luasnip").jump(-1) comparators = {
else cmp.config.compare.offset,
fallback() cmp.config.compare.exact,
cmp.config.compare.score,
require "cmp-under-comparator".under,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order
},
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end end
end, { "i", "s" }), },
['<Tab>'] = cmp.mapping(function(fallback) mapping = {
if cmp.visible() then ['<S-Tab>'] = cmp.mapping(function(fallback)
cmp.select_next_item() if cmp.visible() then
elseif require("luasnip").expand_or_jumpable() then cmp.select_prev_item()
require("luasnip").expand_or_jump() elseif require("luasnip").jumpable(-1) then
else require("luasnip").jump(-1)
fallback() else
end fallback()
end, { "i", "s" }), end
['<C-e>'] = cmp.mapping.close(), end, { "i", "s" }),
['<CR>'] = cmp.mapping.confirm { ['<Tab>'] = cmp.mapping(function(fallback)
behavior = cmp.ConfirmBehavior.Replace, if cmp.visible() then
select = true cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true
}
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'path' },
{ name = 'buffer' },
{ name = 'luasnip' }
},
formatting = {
format = require("lspkind").cmp_format({
mode = "symbol_text",
preset = "codicons",
maxwidth = 50,
menu = Menu_signs,
symbol_map = Lsp_signs
})
} }
}, }
sources = { end
{ name = 'nvim_lsp' }, },
{ name = 'path' },
{ name = 'buffer' }, -- fix for cursorhold function
{ name = 'luasnip' } 'antoinemadec/fixcursorhold.nvim',
},
formatting = { -- showing color of hex values, etc
format = require("lspkind").cmp_format({ {
mode = "symbol_text", 'norcalli/nvim-colorizer.lua',
preset = "codicons", config = function()
maxwidth = 50, require('colorizer').setup({
menu = Menu_signs, '*',
symbol_map = Symbol_map '!markdown'
})
end
},
-- fileexplorer on the side
{
"nvim-tree/nvim-tree.lua",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
width = 30,
},
filters = {
dotfiles = true,
},
renderer = {
group_empty = true,
icons = {
glyphs = {
git = Git_signs
},
},
}
})
end
},
-- better language highlighting by improved parsing
{
'nvim-treesitter/nvim-treesitter',
dependencies = {
-- automatically close html-tags
'windwp/nvim-ts-autotag',
},
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"c",
"cpp",
"css",
"html",
"java",
"markdown",
"latex",
"python",
},
autotag = { enable = true }
})
end
},
-- folding improvements
{
'kevinhwang91/nvim-ufo',
dependencies = { 'kevinhwang91/promise-async' },
config = function()
require('ufo').setup()
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { '*' },
command = 'lua require("ufo").closeAllFolds()'
}) })
} vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
} {
end pattern = { '*' },
}, command = 'lua require("ufo").openAllFolds()'
})
-- fix for cursorhold function end
'antoinemadec/fixcursorhold.nvim',
-- showing color of hex values, etc
{
'norcalli/nvim-colorizer.lua',
config = function()
require('colorizer').setup({
'*',
'!markdown'
})
end
},
-- fileexplorer on the side
{
"nvim-tree/nvim-tree.lua",
dependencies = {
"nvim-tree/nvim-web-devicons",
}, },
config = function()
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
}
})
end
},
-- better language highlighting by improved parsing -- fuzzy finder
{ {
'nvim-treesitter/nvim-treesitter', 'nvim-telescope/telescope.nvim',
dependencies = { version = '0.1.2',
-- automatically close html-tags dependencies = { 'nvim-lua/plenary.nvim' },
'windwp/nvim-ts-autotag', config = function()
require("telescope").setup()
end
}, },
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"c",
"cpp",
"css",
"html",
"java",
"markdown",
"latex",
"python",
},
autotag = { enable = true }
})
end
},
-- folding improvements -- clean up white spaces and empty lines before writing
{ {
'kevinhwang91/nvim-ufo', "mcauley-penney/tidy.nvim",
dependencies = { 'kevinhwang91/promise-async' }, event = "VeryLazy",
config = function() config = function()
require('ufo').setup() require("tidy").setup({
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, filetype_exclude = {}
{
pattern = { '*' },
command = 'lua require("ufo").closeAllFolds()'
}) })
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, end
{ },
pattern = { '*' },
command = 'lua require("ufo").openAllFolds()'
})
end
},
-- fuzzy finder -- todo symbols and highlighting
{ {
'nvim-telescope/telescope.nvim', 'folke/todo-comments.nvim',
version = '0.1.2', dependencies = { 'nvim-lua/plenary.nvim' },
dependencies = { 'nvim-lua/plenary.nvim' }, config = function()
config = function() require 'todo-comments'.setup {
require("telescope").setup() keywords = {
end ERRO = { icon = Error_sign, color = "error" },
}, WARN = { icon = Warn_sign, color = "warning" },
HACK = { icon = Hack_sign, color = "warning" },
-- clean up white spaces and empty lines before writing HINT = { icon = Hint_sign, color = "hint" },
{ TODO = { icon = Todo_sign, color = "info" },
"mcauley-penney/tidy.nvim", INFO = { icon = Info_sign, color = "hint", alt = { "NOTE" } },
event = "VeryLazy", PERF = { icon = Perfect_sign, color = "default" },
config = function() TEST = { icon = Test_sign, color = "test" }
require("tidy").setup({ }
filetype_exclude = {}
})
end
},
-- todo symbols and highlighting
{
'folke/todo-comments.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require 'todo-comments'.setup {
keywords = {
ERRO = { icon = Error_sign, color = "error" },
WARN = { icon = Warn_sign, color = "warning" },
HACK = { icon = Hack_sign, color = "warning" },
HINT = { icon = Hint_sign, color = "hint" },
TODO = { icon = Todo_sign, color = "info" },
INFO = { icon = Info_sign, color = "hint", alt = { "NOTE" } },
PERF = { icon = Perfect_sign, color = "default" },
TEST = { icon = Test_sign, color = "test" }
} }
} end
end },
},
-- git wrapper -- git wrapper
{ {
'tpope/vim-fugitive', 'tpope/vim-fugitive',
event = "VeryLazy" event = "VeryLazy"
}, },
-- markdown language support -- markdown language support
{ {
'preservim/vim-markdown', 'preservim/vim-markdown',
ft = { 'markdown' }, ft = { 'markdown' },
config = function() config = function()
vim.g.vim_markdown_folding_style_pythonic = 1 vim.g.vim_markdown_folding_style_pythonic = 1
end end
}, },
-- bulk renamer -- bulk renamer
{ {
'qpkorr/vim-renamer', 'qpkorr/vim-renamer',
event = "VeryLazy" event = "VeryLazy"
}, },
-- additional quote/parantheses funtions -- additional quote/parantheses funtions
{ {
"kylechui/nvim-surround", "kylechui/nvim-surround",
event = "VeryLazy", event = "VeryLazy",
config = function() config = function()
require("nvim-surround").setup() require("nvim-surround").setup()
end end
}, },
-- colorscheme -- colorscheme
{
'tiyn/vim-tccs',
config = function()
vim.cmd('colorscheme tccs')
end
},
},
{ {
'tiyn/vim-tccs', ui = {
config = function() icons = Lazy_signs
vim.cmd('colorscheme tccs') }
end
} }
}) )

View File

@ -1,4 +1,4 @@
-- set diagnostic signs -- set signs for various uses
Error_sign = "" Error_sign = ""
Warn_sign = "" Warn_sign = ""
Info_sign = "" Info_sign = ""
@ -15,7 +15,7 @@ Menu_signs = {
luasnip = "", luasnip = "",
} }
Symbol_map = { Lsp_signs = {
Text = "", Text = "",
Method = "", Method = "",
Function = "φ", Function = "φ",
@ -43,12 +43,46 @@ Symbol_map = {
TypeParameter = "" TypeParameter = ""
} }
Install_icons = { Install_signs = {
package_installed = "", package_installed = "",
package_pending = "", package_pending = "",
package_uninstalled = "" package_uninstalled = ""
} }
Git_signs = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
deleted = "",
untracked = "",
ignored = "",
}
Lazy_signs = {
cmd = "",
config = "",
event = "",
ft = "",
init = "",
import = "",
keys = "",
lazy = "󰒲 ",
loaded = "",
not_loaded = "",
plugin = "",
runtime = "",
source = "",
start = "",
task = "",
list = {
"",
"",
"",
"",
}
}
vim.fn.sign_define( vim.fn.sign_define(
"DiagnosticSignError", "DiagnosticSignError",
{ texthl = "DiagnosticSignError", text = Error_sign, numhl = "DiagnosticSignError" } { texthl = "DiagnosticSignError", text = Error_sign, numhl = "DiagnosticSignError" }