full config rewrite
This commit is contained in:
parent
6647ae475a
commit
e48c346134
|
|
@ -0,0 +1,6 @@
|
||||||
|
column_width = 160
|
||||||
|
line_endings = "Unix"
|
||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
quote_style = "AutoPreferSingle"
|
||||||
|
call_parentheses = "Always"
|
||||||
152
init.lua
152
init.lua
|
|
@ -1,4 +1,148 @@
|
||||||
vim.g.skip_ts_context_commentstring_module = true
|
vim.g.mapleader = ' '
|
||||||
require "basics"
|
vim.g.maplocalleader = ' '
|
||||||
require "plugins"
|
vim.g.have_nerd_font = true
|
||||||
require "keys"
|
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.mouse = 'a'
|
||||||
|
vim.opt.showmode = false
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.opt.clipboard = 'unnamedplus'
|
||||||
|
vim.g.clipboard = {
|
||||||
|
name = 'xclip',
|
||||||
|
copy = {
|
||||||
|
['+'] = 'xclip -selection clipboard',
|
||||||
|
['*'] = 'xclip -selection primary',
|
||||||
|
},
|
||||||
|
paste = {
|
||||||
|
['+'] = { 'xclip', '-selection', 'clipboard', '-o' },
|
||||||
|
['*'] = { 'xclip', '-selection', 'primary', '-o' },
|
||||||
|
},
|
||||||
|
cache_enabled = true,
|
||||||
|
}
|
||||||
|
end)
|
||||||
|
vim.opt.breakindent = true
|
||||||
|
vim.opt.undofile = true
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.updatetime = 250
|
||||||
|
vim.opt.timeoutlen = 300
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.list = true
|
||||||
|
vim.opt.inccommand = 'split'
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.scrolloff = 10
|
||||||
|
vim.opt.confirm = true
|
||||||
|
|
||||||
|
-- Convert Tab to spaces
|
||||||
|
vim.cmd([[filetype plugin indent on]])
|
||||||
|
vim.o.tabstop = 2
|
||||||
|
vim.o.shiftwidth = 2
|
||||||
|
vim.o.expandtab = true
|
||||||
|
|
||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
zsh = 'zsh',
|
||||||
|
sh = 'sh',
|
||||||
|
},
|
||||||
|
filename = {
|
||||||
|
['.zshrc'] = 'zsh',
|
||||||
|
['.zshenv'] = 'zsh',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require('diagnostic')
|
||||||
|
require('keybinds')
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
|
desc = 'Highlight when yanking (copying) text',
|
||||||
|
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Setup Lazy
|
||||||
|
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||||
|
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
error('Error cloning lazy.nvim:\n' .. out)
|
||||||
|
end
|
||||||
|
end ---@diagnostic disable-next-line: undefined-field
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require('lazy').setup({
|
||||||
|
require('plugins/web-devicons'),
|
||||||
|
require('plugins/neo-tree'),
|
||||||
|
require('plugins/conform'),
|
||||||
|
require('plugins/treesitter'),
|
||||||
|
require('plugins/lsp'),
|
||||||
|
require('plugins/telescope'),
|
||||||
|
{
|
||||||
|
'folke/tokyonight.nvim',
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
require('tokyonight').setup({
|
||||||
|
transparent = true,
|
||||||
|
terminal_colors = false,
|
||||||
|
---@param highlights tokyonight.Highlights
|
||||||
|
---@param colors ColorScheme
|
||||||
|
on_highlights = function(highlights, colors)
|
||||||
|
highlights.TabLineSel = { bg = '#252d37' }
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.cmd([[colorscheme tokyonight-night]])
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
require('plugins/none-ls'),
|
||||||
|
require('plugins/blink'),
|
||||||
|
require('plugins/pairs'),
|
||||||
|
require('plugins/ccc'),
|
||||||
|
require('plugins/heirline'),
|
||||||
|
require('plugins/lspsaga'),
|
||||||
|
{ 'folke/ts-comments.nvim', opts = {}, event = 'VeryLazy' },
|
||||||
|
{
|
||||||
|
'folke/todo-comments.nvim',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'MagicDuck/grug-far.nvim',
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'windwp/nvim-ts-autotag',
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'axelvc/template-string.nvim',
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
'jghauser/mkdir.nvim',
|
||||||
|
{
|
||||||
|
'supermaven-inc/supermaven-nvim',
|
||||||
|
config = function()
|
||||||
|
if not (vim.fn.has_key(vim.fn.environ(), 'LOAD_SUPERMAVEN') == 0) then
|
||||||
|
require('supermaven-nvim').setup({})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'folke/todo-comments.nvim',
|
||||||
|
dependencies = 'nvim-lua/plenary.nvim',
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# linux_display_server x11
|
# linux_display_server x11
|
||||||
# Font
|
# Font
|
||||||
|
# font_family family='Berkeley Mono Trial' postscript_name=BerkeleyMonoTrial-Regular
|
||||||
font_family Input Mono Narrow
|
font_family Input Mono Narrow
|
||||||
# font_family CaskaydiaCove Nerd Font Mono
|
# font_family CaskaydiaCove Nerd Font Mono
|
||||||
font_size 11
|
font_size 11
|
||||||
|
|
|
||||||
286
lazy-lock.json
286
lazy-lock.json
|
|
@ -1,254 +1,36 @@
|
||||||
{
|
{
|
||||||
"Comment.nvim": {
|
"blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" },
|
||||||
"branch": "master",
|
"ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" },
|
||||||
"commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb"
|
"conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" },
|
||||||
},
|
"cspell.nvim": { "branch": "main", "commit": "fb104ec1e06e984baefcad6a0559381f5d933442" },
|
||||||
"FixCursorHold.nvim": {
|
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||||
"branch": "master",
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"commit": "1900f89dc17c603eec29960f57c00bd9ae696495"
|
"gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" },
|
||||||
},
|
"grug-far.nvim": { "branch": "main", "commit": "b3f9412b1ed76f14cfc68e1ee899873544330c80" },
|
||||||
"LuaSnip": {
|
"heirline.nvim": { "branch": "master", "commit": "fae936abb5e0345b85c3a03ecf38525b0828b992" },
|
||||||
"branch": "master",
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"commit": "03c8e67eb7293c404845b3982db895d59c0d1538"
|
"lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" },
|
||||||
},
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" },
|
||||||
"blink.cmp": {
|
"mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" },
|
||||||
"branch": "main",
|
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||||
"commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3"
|
"mini.pairs": { "branch": "main", "commit": "42407ccb80ec59c84e7c91d815f42ed90a8cc093" },
|
||||||
},
|
"mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
|
||||||
"ccc.nvim": {
|
"neo-tree.nvim": { "branch": "main", "commit": "7bc06b5efc5554d10f73a8aa508e02c03a83c2a0" },
|
||||||
"branch": "main",
|
"none-ls.nvim": { "branch": "main", "commit": "db2a48b79cfcdab8baa5d3f37f21c78b6705c62e" },
|
||||||
"commit": "b57cbaf8db3ac43c56c9e2c7f3812944638260ed"
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
},
|
"nvim-lspconfig": { "branch": "master", "commit": "6bba673aa8993eceec233be17b42ddfb9540794b" },
|
||||||
"cmp-npm": {
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"branch": "main",
|
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
|
||||||
"commit": "2337f109f51a09297596dd6b538b70ccba92b4e4"
|
"nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" },
|
||||||
},
|
"nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" },
|
||||||
"crates.nvim": {
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
"branch": "main",
|
"schemastore.nvim": { "branch": "main", "commit": "6af106298a8fd50af775d5281ee39a102556e352" },
|
||||||
"commit": "1d92a7f449a2a76d8f4c3459bd98f450e76d2ea3"
|
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||||
},
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||||
"cspell.nvim": {
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"branch": "main",
|
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||||
"commit": "fb104ec1e06e984baefcad6a0559381f5d933442"
|
"template-string.nvim": { "branch": "main", "commit": "da5f326b65fb74fd068aa1d8b55461b64c8fb23b" },
|
||||||
},
|
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||||
"editorconfig-vim": {
|
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||||
"branch": "master",
|
"ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }
|
||||||
"commit": "91bd0b0a2c6a72a110ab9feae335e1224480c233"
|
|
||||||
},
|
|
||||||
"fidget.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "d9ba6b7bfe29b3119a610892af67602641da778e"
|
|
||||||
},
|
|
||||||
"formatter.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "eb89a1f3e079f1b9680bc7293b75fffccb5e1598"
|
|
||||||
},
|
|
||||||
"friendly-snippets": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "efff286dd74c22f731cdec26a70b46e5b203c619"
|
|
||||||
},
|
|
||||||
"gitsigns.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "8b00147519d6f8353867d5d0b55f587306b0cfb6"
|
|
||||||
},
|
|
||||||
"heirline.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "af3f441ea10f96105e1af14cd37bf213533812d2"
|
|
||||||
},
|
|
||||||
"lazy.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "ac21a639c7ecfc8b822dcc9455deceea3778f839"
|
|
||||||
},
|
|
||||||
"lightspeed.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "fcc72d8a4d5f4ebba62d8a3a0660f88f1b5c3b05"
|
|
||||||
},
|
|
||||||
"lsp_signature.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "5b64964ed02098c85613ee3d20f96bed1dfb64cc"
|
|
||||||
},
|
|
||||||
"lspkind-nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6"
|
|
||||||
},
|
|
||||||
"markview.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "f1e2a57388b61fff8e9d7519ce05cee27a59a57e"
|
|
||||||
},
|
|
||||||
"mason-lspconfig.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "a8e6efcf623b86bae6d2223eede7c43883329f80"
|
|
||||||
},
|
|
||||||
"mason-null-ls.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "de19726de7260c68d94691afb057fa73d3cc53e7"
|
|
||||||
},
|
|
||||||
"mason.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "5664dd5deb3ac9527da90691543eb28df51c1ef8"
|
|
||||||
},
|
|
||||||
"mkdir.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "c55d1dee4f099528a1853b28bb28caa802eba217"
|
|
||||||
},
|
|
||||||
"monokai.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "c295909d53c7577af7eece5ae83855384dd900a6"
|
|
||||||
},
|
|
||||||
"neo-tree.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "e96fd85bf18bc345dab332b345098fa5460dffac"
|
|
||||||
},
|
|
||||||
"neotest": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72"
|
|
||||||
},
|
|
||||||
"neotest-jest": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "514fd4eae7da15fd409133086bb8e029b65ac43f"
|
|
||||||
},
|
|
||||||
"neotest-zig": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "c7a1a39626fa90e639fb640b6322739060a2acf3"
|
|
||||||
},
|
|
||||||
"none-ls.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "02f5275d8a5546092f01306f162c00c71d6e0281"
|
|
||||||
},
|
|
||||||
"nui.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46"
|
|
||||||
},
|
|
||||||
"nvim-autopairs": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "68f0e5c3dab23261a945272032ee6700af86227a"
|
|
||||||
},
|
|
||||||
"nvim-dap": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "52302f02fea3a490e55475de52fa4deb8af2eb11"
|
|
||||||
},
|
|
||||||
"nvim-dap-ui": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "bc81f8d3440aede116f821114547a476b082b319"
|
|
||||||
},
|
|
||||||
"nvim-lspconfig": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "7af2c37192deae28d1305ae9e68544f7fb5408e1"
|
|
||||||
},
|
|
||||||
"nvim-nio": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662"
|
|
||||||
},
|
|
||||||
"nvim-treesitter": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "00a513f87ee3c339c2024b08db3eb63ba7736ed6"
|
|
||||||
},
|
|
||||||
"nvim-ts-autotag": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "4c00b86bd1246ba9c4cd50a823d8296cd2eb9663"
|
|
||||||
},
|
|
||||||
"nvim-ts-context-commentstring": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f"
|
|
||||||
},
|
|
||||||
"nvim-vtsls": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "45c6dfea9f83a126e9bfc5dd63430562b3f8af16"
|
|
||||||
},
|
|
||||||
"nvim-web-devicons": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "1020869742ecb191f260818234517f4a1515cfe8"
|
|
||||||
},
|
|
||||||
"nvim-window-picker": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "0dfef64eaf063e1cd27983ab11a30e7bc5b74fac"
|
|
||||||
},
|
|
||||||
"omnisharp-vim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "cdbf65bc4385d7026428d2f392b40a317725cc9c"
|
|
||||||
},
|
|
||||||
"outline.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "f01eae624e6170656b6fadd6d7b8717636078bd6"
|
|
||||||
},
|
|
||||||
"packer.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3"
|
|
||||||
},
|
|
||||||
"plantuml-syntax": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "9d4900aa16674bf5bb8296a72b975317d573b547"
|
|
||||||
},
|
|
||||||
"playground": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749"
|
|
||||||
},
|
|
||||||
"plenary.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "857c5ac632080dba10aae49dba902ce3abf91b35"
|
|
||||||
},
|
|
||||||
"popfix": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "bf3cc436df63cd535350d5ef1b951c91554d4b01"
|
|
||||||
},
|
|
||||||
"popui.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "4d903e46fdb5eef25fa79ef1b598f5340a2674b0"
|
|
||||||
},
|
|
||||||
"popup.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac"
|
|
||||||
},
|
|
||||||
"presence.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "87c857a56b7703f976d3a5ef15967d80508df6e6"
|
|
||||||
},
|
|
||||||
"roslyn.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "3f86e52047f1697117c73d4597729b25bc06839e"
|
|
||||||
},
|
|
||||||
"snacks.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "57445057395fd1f5b315defa367c57651ea2e5f2"
|
|
||||||
},
|
|
||||||
"statuscol.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "a2a0e3ed55ba0f636ce0b2ccf61bca4050edd288"
|
|
||||||
},
|
|
||||||
"supermaven-nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50"
|
|
||||||
},
|
|
||||||
"tailwind-tools.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "abe7368392345c53174979c2cf033e832de80ef8"
|
|
||||||
},
|
|
||||||
"telescope-ui-select.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2"
|
|
||||||
},
|
|
||||||
"telescope.nvim": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "78857db9e8d819d3cc1a9a7bdc1d39d127a36495"
|
|
||||||
},
|
|
||||||
"template-string.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "da5f326b65fb74fd068aa1d8b55461b64c8fb23b"
|
|
||||||
},
|
|
||||||
"todo-comments.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5"
|
|
||||||
},
|
|
||||||
"typescript.nvim": {
|
|
||||||
"branch": "main",
|
|
||||||
"commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467"
|
|
||||||
},
|
|
||||||
"vim-caddyfile": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0"
|
|
||||||
},
|
|
||||||
"vim-repeat": {
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "65846025c15494983dafe5e3b46c8f88ab2e9635"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
local set = vim.o
|
|
||||||
|
|
||||||
set.number = true
|
|
||||||
set.relativenumber = true
|
|
||||||
set.clipboard = "unnamedplus"
|
|
||||||
set.mouse = "a"
|
|
||||||
set.termguicolors = true
|
|
||||||
set.swapfile = false
|
|
||||||
set.cursorline = true
|
|
||||||
set.cursorlineopt = "number"
|
|
||||||
set.scrolloff = 5
|
|
||||||
|
|
||||||
vim.cmd [[filetype plugin indent on]]
|
|
||||||
set.tabstop = 2
|
|
||||||
set.shiftwidth = 2
|
|
||||||
set.expandtab = true
|
|
||||||
|
|
||||||
-- vim.cmd [[autocmd FileType markdown setlocal spell spelllang=de,en]]
|
|
||||||
-- vim.cmd [[autocmd FileType tex setlocal spell spelllang=de,en]]
|
|
||||||
vim.cmd [[autocmd bufnewfile,bufread *.tsx set filetype=typescriptreact]]
|
|
||||||
vim.cmd [[autocmd bufnewfile,bufread *.jsx set filetype=javascriptreact]]
|
|
||||||
vim.cmd [[autocmd bufnewfile,bufread Jenkinsfile set filetype=groovy]]
|
|
||||||
|
|
||||||
set.splitright = true
|
|
||||||
set.splitbelow = true
|
|
||||||
|
|
||||||
set.signcolumn = "auto:2"
|
|
||||||
|
|
||||||
-- set leader
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
vim.filetype.add(
|
|
||||||
{
|
|
||||||
extension = {
|
|
||||||
zsh = "sh",
|
|
||||||
sh = "sh"
|
|
||||||
},
|
|
||||||
filename = {
|
|
||||||
[".zshrc"] = "sh",
|
|
||||||
[".zshenv"] = "sh"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
vim.diagnostic.config({
|
||||||
|
severity_sort = true,
|
||||||
|
float = { border = 'rounded', source = 'if_many' },
|
||||||
|
underline = true,
|
||||||
|
signs = {
|
||||||
|
text = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = ' ',
|
||||||
|
[vim.diagnostic.severity.WARN] = ' ',
|
||||||
|
[vim.diagnostic.severity.INFO] = ' ',
|
||||||
|
[vim.diagnostic.severity.HINT] = ' ',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
virtual_text = {
|
||||||
|
source = 'if_many',
|
||||||
|
spacing = 2,
|
||||||
|
format = function(diagnostic)
|
||||||
|
local diagnostic_message = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||||
|
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||||
|
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||||
|
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||||
|
}
|
||||||
|
return diagnostic_message[diagnostic.severity]
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
2657
lua/json-schema.lua
2657
lua/json-schema.lua
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,30 @@
|
||||||
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||||
|
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||||
|
|
||||||
|
-- Navigate buffers with ALT
|
||||||
|
vim.api.nvim_set_keymap('', '<A-Left>', '<C-w><Left>', { silent = true })
|
||||||
|
vim.api.nvim_set_keymap('', '<A-Up>', '<C-w><Up>', { silent = true })
|
||||||
|
vim.api.nvim_set_keymap('', '<A-Down>', '<C-w><Down>', { silent = true })
|
||||||
|
vim.api.nvim_set_keymap('', '<A-Right>', '<C-w><Right>', { silent = true })
|
||||||
|
vim.api.nvim_set_keymap('', '<C-p>', '<C-i>', { silent = true, noremap = true })
|
||||||
|
|
||||||
|
local print_namespace = function()
|
||||||
|
local cmd = 'bash -c "xq *.csproj -q RootNamespace"'
|
||||||
|
-- insert namespace NAMESPACE.PATH.TO.FILE; at the start of the file
|
||||||
|
local output = vim.fn.system(cmd):gsub('\n', '')
|
||||||
|
local relative_path = vim.fn.expand('%:h')
|
||||||
|
local short_path = relative_path:gsub('/', '.')
|
||||||
|
local namespace = output .. '.' .. short_path
|
||||||
|
if relative_path == '.' then
|
||||||
|
namespace = output
|
||||||
|
end
|
||||||
|
vim.cmd([[normal! gg]])
|
||||||
|
vim.cmd([[normal! }]])
|
||||||
|
vim.cmd([[normal! o]])
|
||||||
|
vim.api.nvim_put({ 'namespace ' .. namespace .. ';' }, 'c', true, true)
|
||||||
|
vim.cmd([[normal! o]])
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>n', print_namespace, { silent = true })
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader><cr>', '<cmd>terminal<cr>i', { silent = true })
|
||||||
78
lua/keys.lua
78
lua/keys.lua
|
|
@ -1,78 +0,0 @@
|
||||||
vim.api.nvim_set_keymap(
|
|
||||||
"n",
|
|
||||||
"<leader>ff",
|
|
||||||
"<cmd>lua require('telescope.builtin').find_files({hidden = true})<cr>",
|
|
||||||
{silent = true}
|
|
||||||
)
|
|
||||||
vim.api.nvim_set_keymap(
|
|
||||||
"n",
|
|
||||||
"<leader>fF",
|
|
||||||
"<cmd>lua require('telescope.builtin').find_files({no_ignore=true, no_ignore_parent = true, hidden = true})<cr>",
|
|
||||||
{silent = true}
|
|
||||||
)
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<cr>", {silent = true})
|
|
||||||
-- vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<cr>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<cr>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fB", "<cmd>lua require('telescope.builtin').git_branches()<cr>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>ft", "<CMD>TodoTelescope<CR>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fj", "<CMD>Telescope jsonfly<CR>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fb", "<CMD>Telescope buffers<CR>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "gr", "<cmd>lua require('telescope.builtin').lsp_references()<cr>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua require('telescope.builtin').lsp_definitions()<cr>", {silent = true})
|
|
||||||
local opts = {noremap = true, silent = true}
|
|
||||||
vim.api.nvim_set_keymap(
|
|
||||||
"n",
|
|
||||||
"<C-LeftMouse>",
|
|
||||||
"<LeftMouse><cmd>lua require('telescope.builtin').lsp_definitions()<cr>",
|
|
||||||
opts
|
|
||||||
)
|
|
||||||
vim.api.nvim_set_keymap(
|
|
||||||
"n",
|
|
||||||
"<C-RightMouse>",
|
|
||||||
"<LeftMouse><cmd>lua require('telescope.builtin').lsp_references()<cr>",
|
|
||||||
opts
|
|
||||||
)
|
|
||||||
vim.api.nvim_set_keymap("n", "gi", "<cmd>lua require('telescope.builtin').lsp_implementations()<cr>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>D", "<cmd>lua vim.diagnostic.goto_next { wrap = false }<cr>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>b", "<cmd>Gitsigns blame_line<cr>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("", "q:", "<Nop>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>h", "<Plug>RestNvim", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader><cr>", ":terminal<cr>i", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("t", "<Esc>", "<C-\\><C-n>", {silent = true, noremap = true})
|
|
||||||
vim.api.nvim_set_keymap("", "<A-Left>", "<C-w><Left>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("", "<A-Up>", "<C-w><Up>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("", "<A-Down>", "<C-w><Down>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("", "<A-Right>", "<C-w><Right>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("", "<C-p>", "<C-i>", {silent = true, noremap = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>i", "<cmd>!ocamlc -i -c %>%i<CR>", {silent = true})
|
|
||||||
|
|
||||||
local insert_random_uuid = function()
|
|
||||||
local id, _ = vim.fn.system("uuidgen"):gsub("\n", ""):gsub("-", ""):upper()
|
|
||||||
vim.api.nvim_put({id}, "c", true, true)
|
|
||||||
end
|
|
||||||
local insert_random_uuid_dashed = function()
|
|
||||||
local id, _ = vim.fn.system("uuidgen"):gsub("\n", ""):upper()
|
|
||||||
vim.api.nvim_put({id}, "c", true, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>u", insert_random_uuid, {noremap = true, silent = true})
|
|
||||||
vim.keymap.set("n", "<leader>U", insert_random_uuid_dashed, {noremap = true, silent = true})
|
|
||||||
|
|
||||||
local print_namespace = function()
|
|
||||||
local cmd = 'bash -c "xq *.csproj -q RootNamespace"'
|
|
||||||
-- insert namespace NAMESPACE.PATH.TO.FILE; at the start of the file
|
|
||||||
local output = vim.fn.system(cmd):gsub("\n", "")
|
|
||||||
local relative_path = vim.fn.expand("%:h")
|
|
||||||
local short_path = relative_path:gsub("/", ".")
|
|
||||||
local namespace = output .. "." .. short_path
|
|
||||||
if relative_path == "." then
|
|
||||||
namespace = output
|
|
||||||
end
|
|
||||||
vim.cmd [[normal! gg]]
|
|
||||||
vim.cmd [[normal! }]]
|
|
||||||
vim.cmd [[normal! o]]
|
|
||||||
vim.api.nvim_put({"namespace " .. namespace .. ";"}, "c", true, true)
|
|
||||||
vim.cmd [[normal! o]]
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>n", print_namespace, {silent = true})
|
|
||||||
372
lua/plugins.lua
372
lua/plugins.lua
|
|
@ -1,372 +0,0 @@
|
||||||
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)
|
|
||||||
|
|
||||||
require("lazy").setup(
|
|
||||||
{
|
|
||||||
"wbthomason/packer.nvim",
|
|
||||||
{
|
|
||||||
"MasterGordon/monokai.nvim",
|
|
||||||
-- dir = "$HOME/git/monokai.nvim",
|
|
||||||
config = function()
|
|
||||||
require("monokai").setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kyazdani42/nvim-web-devicons",
|
|
||||||
config = function()
|
|
||||||
require("plugins/icons")
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-treesitter/playground",
|
|
||||||
dependencies = {"nvim-treesitter/nvim-treesitter"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
config = function()
|
|
||||||
require "plugins/treesitter"
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
|
||||||
"windwp/nvim-ts-autotag",
|
|
||||||
"windwp/nvim-autopairs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"numToStr/Comment.nvim",
|
|
||||||
after = "nvim-ts-context-commentstring",
|
|
||||||
config = function()
|
|
||||||
require("Comment").setup {
|
|
||||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
|
||||||
mappings = {
|
|
||||||
basic = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"folke/snacks.nvim",
|
|
||||||
priority = 1000,
|
|
||||||
lazy = false,
|
|
||||||
---@type snacks.Config
|
|
||||||
opts = {
|
|
||||||
bigfile = {enabled = true}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"mhartington/formatter.nvim",
|
|
||||||
config = function()
|
|
||||||
require "plugins/formatter"
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
require "plugins/lsp"
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
"nvimtools/none-ls.nvim",
|
|
||||||
"davidmh/cspell.nvim",
|
|
||||||
"RishabhRD/popfix",
|
|
||||||
"onsails/lspkind-nvim",
|
|
||||||
"ray-x/lsp_signature.nvim",
|
|
||||||
"jose-elias-alvarez/typescript.nvim",
|
|
||||||
"hood/popui.nvim",
|
|
||||||
"OmniSharp/omnisharp-vim",
|
|
||||||
"yioneko/nvim-vtsls",
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
"jay-babu/mason-null-ls.nvim",
|
|
||||||
"seblj/roslyn.nvim",
|
|
||||||
"blink.cmp"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"luckasRanarison/tailwind-tools.nvim",
|
|
||||||
dependencies = {"nvim-treesitter/nvim-treesitter"},
|
|
||||||
opts = {
|
|
||||||
server = {
|
|
||||||
override = false
|
|
||||||
},
|
|
||||||
document_color = {
|
|
||||||
enabled = true, -- can be toggled by commands
|
|
||||||
kind = "inline", -- "inline" | "foreground" | "background"
|
|
||||||
inline_symbol = " ", -- only used in inline mode
|
|
||||||
debounce = 200 -- in milliseconds, only applied in insert mode
|
|
||||||
},
|
|
||||||
conceal = {
|
|
||||||
enabled = false, -- can be toggled by commands
|
|
||||||
min_length = nil, -- only conceal classes exceeding the provided length
|
|
||||||
symbol = "", -- only a single character is allowed
|
|
||||||
highlight = {
|
|
||||||
-- extmark highlight options, see :h 'highlight'
|
|
||||||
fg = "#38BDF8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
custom_filetypes = {} -- see the extension section to learn how it works
|
|
||||||
} -- your configuration
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"OXY2DEV/markview.nvim",
|
|
||||||
lazy = false, -- Recommended
|
|
||||||
-- ft = "markdown" -- If you decide to lazy-load anyway
|
|
||||||
|
|
||||||
dependencies = {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"nvim-tree/nvim-web-devicons"
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("markview").setup(
|
|
||||||
{
|
|
||||||
hybrid_modes = {"n"}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
config = function()
|
|
||||||
require("plugins/telescope")
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/popup.nvim",
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-telescope/telescope-ui-select.nvim"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"uga-rosa/ccc.nvim",
|
|
||||||
config = function()
|
|
||||||
require("ccc").setup(
|
|
||||||
{
|
|
||||||
highlighter = {
|
|
||||||
auto_enable = true,
|
|
||||||
lsp = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
dependencies = "nvim-lua/plenary.nvim",
|
|
||||||
config = function()
|
|
||||||
require("todo-comments").setup {}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lewis6991/gitsigns.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim"
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("gitsigns").setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
"editorconfig/editorconfig-vim",
|
|
||||||
-- {
|
|
||||||
-- "hrsh7th/nvim-cmp",
|
|
||||||
-- config = function()
|
|
||||||
-- require("plugins/cmp")
|
|
||||||
-- end,
|
|
||||||
-- dependencies = {
|
|
||||||
-- "hrsh7th/cmp-buffer",
|
|
||||||
-- "hrsh7th/cmp-nvim-lsp",
|
|
||||||
-- "hrsh7th/cmp-path",
|
|
||||||
-- "hrsh7th/cmp-nvim-lua",
|
|
||||||
-- "hrsh7th/cmp-emoji",
|
|
||||||
-- "David-Kunz/cmp-npm",
|
|
||||||
-- "hrsh7th/cmp-nvim-lsp-signature-help",
|
|
||||||
-- "saadparwaiz1/cmp_luasnip"
|
|
||||||
-- }
|
|
||||||
-- },
|
|
||||||
{
|
|
||||||
"saghen/blink.cmp",
|
|
||||||
lazy = false, -- lazy loading handled internally
|
|
||||||
-- optional: provides snippets for the snippet source
|
|
||||||
dependencies = "rafamadriz/friendly-snippets",
|
|
||||||
-- use a release tag to download pre-built binaries
|
|
||||||
version = "v0.*",
|
|
||||||
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
|
||||||
-- build = 'cargo build --release',
|
|
||||||
-- If you use nix, you can build from source using latest nightly rust with:
|
|
||||||
-- build = 'nix run .#build-plugin',
|
|
||||||
|
|
||||||
---@module 'blink.cmp'
|
|
||||||
---@type blink.cmp.Config
|
|
||||||
opts = {
|
|
||||||
-- 'default' for mappings similar to built-in completion
|
|
||||||
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
|
|
||||||
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
|
|
||||||
-- see the "default configuration" section below for full documentation on how to define
|
|
||||||
-- your own keymap.
|
|
||||||
keymap = {
|
|
||||||
preset = "enter",
|
|
||||||
["<C-f>"] = {"show", "show_documentation", "hide_documentation"}
|
|
||||||
},
|
|
||||||
appearance = {
|
|
||||||
-- sets the fallback highlight groups to nvim-cmp's highlight groups
|
|
||||||
-- useful for when your theme doesn't support blink.cmp
|
|
||||||
-- will be removed in a future release, assuming themes add support
|
|
||||||
use_nvim_cmp_as_default = true,
|
|
||||||
nerd_font_variant = "mono"
|
|
||||||
},
|
|
||||||
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
|
||||||
-- adjusts spacing to ensure icons are aligned
|
|
||||||
completion = {
|
|
||||||
menu = {
|
|
||||||
max_height = 20
|
|
||||||
},
|
|
||||||
documentation = {
|
|
||||||
auto_show = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
cmdline = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- experimental auto-brackets support
|
|
||||||
-- accept = { auto_brackets = { enabled = true } }
|
|
||||||
|
|
||||||
-- experimental signature help support
|
|
||||||
-- trigger = { signature_help = { enabled = true } }
|
|
||||||
},
|
|
||||||
-- allows extending the enabled_providers array elsewhere in your config
|
|
||||||
-- without having to redefining it
|
|
||||||
opts_extend = {"sources.completion.enabled_providers"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
version = "v2.*",
|
|
||||||
build = "make install_jsregexp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"saecki/crates.nvim",
|
|
||||||
event = {"BufRead Cargo.toml"},
|
|
||||||
dependencies = {{"nvim-lua/plenary.nvim"}},
|
|
||||||
config = function()
|
|
||||||
require("crates").setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
"aklt/plantuml-syntax",
|
|
||||||
-- {
|
|
||||||
-- "github/copilot.vim",
|
|
||||||
-- config = function()
|
|
||||||
-- require("plugins/copilot")
|
|
||||||
-- end
|
|
||||||
-- },
|
|
||||||
{
|
|
||||||
"supermaven-inc/supermaven-nvim",
|
|
||||||
config = function()
|
|
||||||
if not (vim.fn.has_key(vim.fn.environ(), "LOAD_SUPERMAVEN") == 0) then
|
|
||||||
require("supermaven-nvim").setup({})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ggandor/lightspeed.nvim",
|
|
||||||
dependencies = {"tpope/vim-repeat"}
|
|
||||||
},
|
|
||||||
"jghauser/mkdir.nvim",
|
|
||||||
{
|
|
||||||
"David-Kunz/cmp-npm",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"rebelot/heirline.nvim",
|
|
||||||
config = function()
|
|
||||||
require "plugins/heirline"
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
"kyazdani42/nvim-web-devicons",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
"monokai.nvim",
|
|
||||||
"nvim-lspconfig"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isobit/vim-caddyfile",
|
|
||||||
{
|
|
||||||
"nvim-neotest/neotest",
|
|
||||||
config = function()
|
|
||||||
require("plugins/neotest")
|
|
||||||
end,
|
|
||||||
event = {"BufRead *.test.*,*.spec.*,*Test.*,*.zig"},
|
|
||||||
dependencies = {
|
|
||||||
"lawrence-laz/neotest-zig",
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"antoinemadec/FixCursorHold.nvim",
|
|
||||||
"haydenmeade/neotest-jest",
|
|
||||||
"monokai.nvim"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"andweeb/presence.nvim",
|
|
||||||
config = function()
|
|
||||||
require("presence"):setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
config = function()
|
|
||||||
require("plugins/dap")
|
|
||||||
end,
|
|
||||||
dependencies = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
branch = "main",
|
|
||||||
config = function()
|
|
||||||
require("plugins/neo-tree")
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"kyazdani42/nvim-web-devicons", -- not strictly required, but recommended
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
"s1n7ax/nvim-window-picker",
|
|
||||||
"monokai.nvim"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"luukvbaal/statuscol.nvim",
|
|
||||||
config = function()
|
|
||||||
require("statuscol").setup(
|
|
||||||
{
|
|
||||||
-- setopt = true,
|
|
||||||
ft_ignore = {"neo-tree"}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"axelvc/template-string.nvim",
|
|
||||||
config = function()
|
|
||||||
require("template-string").setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hedyhli/outline.nvim",
|
|
||||||
config = function()
|
|
||||||
-- Example mapping to toggle outline
|
|
||||||
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>", {desc = "Toggle Outline"})
|
|
||||||
|
|
||||||
require("outline").setup {}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
return {
|
||||||
|
'saghen/blink.cmp',
|
||||||
|
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||||
|
version = '1.*',
|
||||||
|
build = 'cargo build --release',
|
||||||
|
|
||||||
|
---@module 'blink.cmp'
|
||||||
|
---@type blink.cmp.Config
|
||||||
|
opts = {
|
||||||
|
keymap = {
|
||||||
|
preset = 'enter',
|
||||||
|
['<C-f>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
||||||
|
},
|
||||||
|
|
||||||
|
appearance = {
|
||||||
|
nerd_font_variant = 'mono',
|
||||||
|
},
|
||||||
|
|
||||||
|
completion = {
|
||||||
|
documentation = { auto_show = true },
|
||||||
|
menu = {
|
||||||
|
max_height = 24,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Default list of enabled providers defined so that you can extend it
|
||||||
|
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||||
|
sources = {
|
||||||
|
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||||
|
},
|
||||||
|
cmdline = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
fuzzy = { implementation = 'prefer_rust_with_warning' },
|
||||||
|
enabled = function()
|
||||||
|
return not vim.tbl_contains({ 'sagarename' }, vim.bo.filetype)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
opts_extend = { 'sources.default' },
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
return {
|
||||||
|
'uga-rosa/ccc.nvim',
|
||||||
|
config = function()
|
||||||
|
require('ccc').setup({
|
||||||
|
highlighter = {
|
||||||
|
auto_enable = true,
|
||||||
|
lsp = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -1,98 +0,0 @@
|
||||||
local cmp = require "cmp"
|
|
||||||
require("cmp-npm").setup({})
|
|
||||||
|
|
||||||
local cmp_kinds = {
|
|
||||||
Text = " ",
|
|
||||||
Method = " ",
|
|
||||||
Function = " ",
|
|
||||||
Constructor = " ",
|
|
||||||
Field = " ",
|
|
||||||
Variable = " ",
|
|
||||||
Class = " ",
|
|
||||||
Interface = " ",
|
|
||||||
Module = " ",
|
|
||||||
Property = " ",
|
|
||||||
Unit = " ",
|
|
||||||
Value = " ",
|
|
||||||
Enum = " ",
|
|
||||||
Keyword = " ",
|
|
||||||
Snippet = " ",
|
|
||||||
Color = " ",
|
|
||||||
File = " ",
|
|
||||||
Reference = " ",
|
|
||||||
Folder = " ",
|
|
||||||
EnumMember = " ",
|
|
||||||
Constant = " ",
|
|
||||||
Struct = " ",
|
|
||||||
Event = " ",
|
|
||||||
Operator = " ",
|
|
||||||
TypeParameter = " ",
|
|
||||||
Copilot = " "
|
|
||||||
}
|
|
||||||
|
|
||||||
options = {
|
|
||||||
confirm_opts = {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = false
|
|
||||||
},
|
|
||||||
experimental = {
|
|
||||||
ghost_text = true,
|
|
||||||
native_menu = false
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require "luasnip".lsp_expand(args.body)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
kind_icons = cmp_kinds,
|
|
||||||
source_names = {
|
|
||||||
nvim_lsp = "",
|
|
||||||
emoji = "",
|
|
||||||
path = "(Path)",
|
|
||||||
calc = "(Calc)",
|
|
||||||
cmp_tabnine = "(Tabnine)",
|
|
||||||
vsnip = "(Snippet)",
|
|
||||||
luasnip = "(Snippet)",
|
|
||||||
buffer = "(Buffer)"
|
|
||||||
},
|
|
||||||
duplicates = {
|
|
||||||
buffer = 1,
|
|
||||||
path = 1,
|
|
||||||
nvim_lsp = 0,
|
|
||||||
luasnip = 1
|
|
||||||
},
|
|
||||||
duplicates_default = 0,
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
vim_item.kind = options.formatting.kind_icons[vim_item.kind] .. " " .. vim_item.kind
|
|
||||||
vim_item.menu = options.formatting.source_names[entry.source.name]
|
|
||||||
vim_item.dup = options.formatting.duplicates[entry.source.name] or options.formatting.duplicates_default
|
|
||||||
return vim_item
|
|
||||||
end,
|
|
||||||
fields = {"abbr", "kind", "menu"}
|
|
||||||
--[[ format = function(_, vim_item)
|
|
||||||
vim_item.kind = cmp_kinds[vim_item.kind] or ""
|
|
||||||
return vim_item
|
|
||||||
end ]]
|
|
||||||
},
|
|
||||||
mapping = {
|
|
||||||
["<C-f>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({select = true}),
|
|
||||||
["<Up>"] = cmp.mapping.select_prev_item(),
|
|
||||||
["<Down>"] = cmp.mapping.select_next_item()
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
{name = "nvim_lsp"},
|
|
||||||
{name = "path"},
|
|
||||||
{name = "luasnip"},
|
|
||||||
{name = "nvim_lua"},
|
|
||||||
-- {name = "buffer"},
|
|
||||||
{name = "emoji"},
|
|
||||||
{name = "copilot", group_index = 2},
|
|
||||||
{name = "npm", keyword_length = 4},
|
|
||||||
{name = "nvim_lsp_signature_help"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmp.setup(options)
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
return {
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
event = { 'BufWritePre' },
|
||||||
|
cmd = { 'ConformInfo' },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
-- Customize or remove this keymap to your liking
|
||||||
|
'<leader>f',
|
||||||
|
function()
|
||||||
|
require('conform').format({ async = true })
|
||||||
|
end,
|
||||||
|
mode = '',
|
||||||
|
desc = 'Format buffer',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- This will provide type hinting with LuaLS
|
||||||
|
---@module "conform"
|
||||||
|
---@type conform.setupOpts
|
||||||
|
opts = {
|
||||||
|
-- Define your formatters
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { 'stylua' },
|
||||||
|
javascript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
javascriptreact = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
typescript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
typescriptreact = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
css = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
scss = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
json = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
jsonc = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
markdown = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
cs = { 'astyle' },
|
||||||
|
php = { 'php_cs_fixer' },
|
||||||
|
go = { 'gofmt' },
|
||||||
|
},
|
||||||
|
-- Set default options
|
||||||
|
default_format_opts = {
|
||||||
|
lsp_format = 'fallback',
|
||||||
|
},
|
||||||
|
-- Set up format-on-save
|
||||||
|
format_on_save = { timeout_ms = 500 },
|
||||||
|
-- Customize formatters
|
||||||
|
formatters = {
|
||||||
|
shfmt = {
|
||||||
|
prepend_args = { '-i', '2' },
|
||||||
|
},
|
||||||
|
astyle = {
|
||||||
|
prepend_args = { '--style=java', '--max-code-length=80', '--squeeze-ws' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- If you want the formatexpr, here is the place to set it
|
||||||
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
vim.g.copilot_enabled = true
|
|
||||||
-- Map Ctrl-Enter to copilot#Accept
|
|
||||||
-- vim.cmd(":Copilot disable>")
|
|
||||||
|
|
@ -1,90 +0,0 @@
|
||||||
-- dapui
|
|
||||||
require("dapui").setup(
|
|
||||||
{
|
|
||||||
controls = {
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
local dap, dapui = require("dap"), require("dapui")
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- C#
|
|
||||||
dap.adapters.coreclr = {
|
|
||||||
type = "executable",
|
|
||||||
command = "netcoredbg",
|
|
||||||
args = {"--interpreter=vscode"}
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.g.dotnet_build_project = function()
|
|
||||||
local default_path = vim.fn.getcwd() .. "/"
|
|
||||||
if vim.g["dotnet_last_proj_path"] ~= nil then
|
|
||||||
default_path = vim.g["dotnet_last_proj_path"]
|
|
||||||
end
|
|
||||||
local cmd = "dotnet build -c Debug > /dev/null"
|
|
||||||
print("")
|
|
||||||
print("Cmd to execute: " .. cmd)
|
|
||||||
local f = os.execute(cmd)
|
|
||||||
if f == 0 then
|
|
||||||
print("\nBuild: ✔️ ")
|
|
||||||
else
|
|
||||||
print("\nBuild: ❌ (code: " .. f .. ")")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.g.dotnet_get_dll_path = function()
|
|
||||||
local cwd = vim.fn.getcwd()
|
|
||||||
local solution = vim.fn.glob(cwd .. "/*.csproj")
|
|
||||||
local projectName = vim.fn.fnamemodify(solution, ":t:r")
|
|
||||||
local dll = cwd .. "/bin/Debug/net7.0/linux-x64/" .. projectName .. ".dll"
|
|
||||||
return dll
|
|
||||||
end
|
|
||||||
|
|
||||||
local config = {
|
|
||||||
{
|
|
||||||
type = "coreclr",
|
|
||||||
name = "launch - netcoredbg",
|
|
||||||
request = "launch",
|
|
||||||
program = function()
|
|
||||||
if vim.fn.confirm("Should I recompile first?", "&yes\n&no", 2) == 1 then
|
|
||||||
vim.g.dotnet_build_project()
|
|
||||||
end
|
|
||||||
return vim.g.dotnet_get_dll_path()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations.cs = config
|
|
||||||
|
|
||||||
-- keybindings
|
|
||||||
local api = vim.api
|
|
||||||
local keymap_restore = {}
|
|
||||||
dap.listeners.after["event_initialized"]["me"] = function()
|
|
||||||
for _, buf in pairs(api.nvim_list_bufs()) do
|
|
||||||
local keymaps = api.nvim_buf_get_keymap(buf, "n")
|
|
||||||
for _, keymap in pairs(keymaps) do
|
|
||||||
if keymap.lhs == "K" then
|
|
||||||
table.insert(keymap_restore, keymap)
|
|
||||||
api.nvim_buf_del_keymap(buf, "n", "K")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
api.nvim_set_keymap("n", "K", '<Cmd>lua require("dap.ui.widgets").hover()<CR>', {silent = true})
|
|
||||||
end
|
|
||||||
|
|
||||||
dap.listeners.after["event_terminated"]["me"] = function()
|
|
||||||
for _, keymap in pairs(keymap_restore) do
|
|
||||||
api.nvim_buf_set_keymap(keymap.buffer, keymap.mode, keymap.lhs, keymap.rhs, {silent = keymap.silent == 1})
|
|
||||||
end
|
|
||||||
keymap_restore = {}
|
|
||||||
end
|
|
||||||
api.nvim_set_keymap("n", "<leader>B", ":lua require'dap'.toggle_breakpoint()<CR>", {noremap = true, silent = true})
|
|
||||||
api.nvim_set_keymap("n", "<f5>", ":lua require'dap'.continue()<CR>", {noremap = true, silent = true})
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
local cb = require "diffview.config".diffview_callback
|
|
||||||
|
|
||||||
require "diffview".setup {
|
|
||||||
diff_binaries = false, -- Show diffs for binaries
|
|
||||||
use_icons = true, -- Requires nvim-web-devicons
|
|
||||||
key_bindings = {
|
|
||||||
disable_defaults = false, -- Disable the default key bindings
|
|
||||||
-- The `view` bindings are active in the diff buffers, only when the current
|
|
||||||
-- tabpage is a Diffview.
|
|
||||||
view = {
|
|
||||||
["<tab>"] = cb("select_next_entry"), -- Open the diff for the next file
|
|
||||||
["<s-tab>"] = cb("select_prev_entry"), -- Open the diff for the previous file
|
|
||||||
["<leader>e"] = cb("focus_files"), -- Bring focus to the files panel
|
|
||||||
["<leader>b"] = cb("toggle_files") -- Toggle the files panel.
|
|
||||||
},
|
|
||||||
file_panel = {
|
|
||||||
["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
|
|
||||||
["<down>"] = cb("next_entry"),
|
|
||||||
["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
|
|
||||||
["<up>"] = cb("prev_entry"),
|
|
||||||
["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
|
|
||||||
["o"] = cb("select_entry"),
|
|
||||||
["<2-LeftMouse>"] = cb("select_entry"),
|
|
||||||
["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
|
|
||||||
["S"] = cb("stage_all"), -- Stage all entries.
|
|
||||||
["U"] = cb("unstage_all"), -- Unstage all entries.
|
|
||||||
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
|
|
||||||
["<tab>"] = cb("select_next_entry"),
|
|
||||||
["<s-tab>"] = cb("select_prev_entry"),
|
|
||||||
["<leader>e"] = cb("focus_files"),
|
|
||||||
["<leader>b"] = cb("toggle_files")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>g", ":DiffviewOpen<CR>", {silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>G", ":DiffviewClose<CR>", {silent = true})
|
|
||||||
|
|
@ -1,137 +0,0 @@
|
||||||
local prettierd = function()
|
|
||||||
return {
|
|
||||||
exe = "prettierd",
|
|
||||||
args = {"'" .. vim.api.nvim_buf_get_name(0) .. "'"},
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
require("formatter").setup(
|
|
||||||
{
|
|
||||||
logging = false,
|
|
||||||
filetype = {
|
|
||||||
typescriptreact = {prettierd},
|
|
||||||
json = {prettierd},
|
|
||||||
jsonc = {prettierd},
|
|
||||||
css = {prettierd},
|
|
||||||
scss = {prettierd},
|
|
||||||
markdown = {prettierd},
|
|
||||||
typescript = {prettierd},
|
|
||||||
javascript = {prettierd},
|
|
||||||
javascriptreact = {prettierd},
|
|
||||||
lua = {
|
|
||||||
-- luafmt
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "luafmt",
|
|
||||||
args = {"--indent-count", 2, "--stdin"},
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
rust = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "rustfmt",
|
|
||||||
args = {"--emit=stdout", "--edition=2021"},
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
cpp = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "clang-format",
|
|
||||||
args = {"'" .. vim.api.nvim_buf_get_name(0) .. "'"},
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
prisma = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "npx",
|
|
||||||
args = {"prisma", "format", "--schema=" .. vim.api.nvim_buf_get_name(0)},
|
|
||||||
stdin = false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
swift = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "swift-format",
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
xml = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "xmllint",
|
|
||||||
args = {"--format", "-"},
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
cs = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "dotnet-csharpier",
|
|
||||||
args = {"--write-stdout"},
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
-- ocaml
|
|
||||||
ocaml = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "ocamlformat",
|
|
||||||
args = {"--name", vim.api.nvim_buf_get_name(0), "-"},
|
|
||||||
stdin = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
php = {
|
|
||||||
function()
|
|
||||||
return {
|
|
||||||
exe = "vendor/bin/php-cs-fixer",
|
|
||||||
args = {
|
|
||||||
"fix"
|
|
||||||
},
|
|
||||||
stdin = false,
|
|
||||||
ignore_exitcode = true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
augroup FormatAutogroup
|
|
||||||
autocmd!
|
|
||||||
autocmd BufWritePost *.cs,*.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json,*.jsonc,*.swift,*.xml,*.sln,*.csproj,*.ml,*.php FormatWrite
|
|
||||||
augroup END
|
|
||||||
]],
|
|
||||||
true
|
|
||||||
)
|
|
||||||
-- local formatGrp = vim.api.nvim_create_augroup("Format", {clear = true})
|
|
||||||
-- vim.api.nvim_create_autocmd(
|
|
||||||
-- "BufWritePre",
|
|
||||||
-- {
|
|
||||||
-- pattern = "*.php",
|
|
||||||
-- command = "lua vim.lsp.buf.format { async = false }",
|
|
||||||
-- group = formatGrp
|
|
||||||
-- }
|
|
||||||
-- )
|
|
||||||
|
|
||||||
-- local function organize_imports()
|
|
||||||
-- local params = {
|
|
||||||
-- command = "typescript.organizeImports",
|
|
||||||
-- arguments = {vim.api.nvim_buf_get_name(0)},
|
|
||||||
-- title = ""
|
|
||||||
-- }
|
|
||||||
-- vim.lsp.buf.execute_command(params)
|
|
||||||
-- end
|
|
||||||
|
|
@ -0,0 +1,193 @@
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
local colors = require('tokyonight.colors').setup({
|
||||||
|
style = 'night',
|
||||||
|
})
|
||||||
|
local utils = require('heirline.utils')
|
||||||
|
|
||||||
|
local TablineFileName = {
|
||||||
|
provider = function(self)
|
||||||
|
-- self.filename will be defined later, just keep looking at the example!
|
||||||
|
local filename = self.filename
|
||||||
|
filename = filename == '' and '[No Name]' or vim.fn.fnamemodify(filename, ':t')
|
||||||
|
return filename
|
||||||
|
end,
|
||||||
|
hl = function(self)
|
||||||
|
return { bold = self.is_active or self.is_visible, italic = true }
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
local TablineFileFlags = {
|
||||||
|
{
|
||||||
|
provider = function(self)
|
||||||
|
if vim.bo[self.bufnr].modified then
|
||||||
|
return ' [+]'
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
hl = { fg = colors.green },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider = function(self)
|
||||||
|
if not vim.bo[self.bufnr].modifiable or vim.bo[self.bufnr].readonly then
|
||||||
|
return ' '
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
hl = { fg = 'orange' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local diag_signs = vim.diagnostic.config().signs.text or {}
|
||||||
|
local TablineDiagnostics = {
|
||||||
|
static = {
|
||||||
|
error_icon = diag_signs[1],
|
||||||
|
warn_icon = diag_signs[2],
|
||||||
|
info_icon = diag_signs[3],
|
||||||
|
hint_icon = diag_signs[4],
|
||||||
|
},
|
||||||
|
init = function(self)
|
||||||
|
self.errors = #vim.diagnostic.get(self.bufnr, { severity = vim.diagnostic.severity.ERROR })
|
||||||
|
self.warnings = #vim.diagnostic.get(self.bufnr, { severity = vim.diagnostic.severity.WARN })
|
||||||
|
self.hints = #vim.diagnostic.get(self.bufnr, { severity = vim.diagnostic.severity.HINT })
|
||||||
|
self.info = #vim.diagnostic.get(self.bufnr, { severity = vim.diagnostic.severity.INFO })
|
||||||
|
self.has_diags = self.errors > 0 or self.warnings > 0 or self.hints > 0 or self.info > 0
|
||||||
|
end,
|
||||||
|
{
|
||||||
|
provider = function(self)
|
||||||
|
return self.has_diags and ' '
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider = function(self)
|
||||||
|
local has_next = self.warnings > 0 or self.info > 0 or self.hints > 0
|
||||||
|
return self.errors > 0 and (self.error_icon .. self.errors .. (has_next and ' ' or ''))
|
||||||
|
end,
|
||||||
|
hl = { fg = colors.error },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider = function(self)
|
||||||
|
local has_next = self.info > 0 or self.hints > 0
|
||||||
|
return self.warnings > 0 and (self.warn_icon .. self.warnings .. (has_next and ' ' or ''))
|
||||||
|
end,
|
||||||
|
hl = { fg = colors.warning },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider = function(self)
|
||||||
|
local has_next = self.hints > 0
|
||||||
|
return self.info > 0 and (self.info_icon .. self.info .. (has_next and ' ' or ''))
|
||||||
|
end,
|
||||||
|
hl = { fg = colors.info },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider = function(self)
|
||||||
|
return self.hints > 0 and (self.hint_icon .. self.hints)
|
||||||
|
end,
|
||||||
|
hl = { fg = colors.hint },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local TablineFileIcon = {
|
||||||
|
init = function(self)
|
||||||
|
local filename = self.filename
|
||||||
|
local extension = vim.fn.fnamemodify(filename, ':e')
|
||||||
|
self.icon, self.icon_color = require('nvim-web-devicons').get_icon_color(filename, extension, { default = true })
|
||||||
|
end,
|
||||||
|
provider = function(self)
|
||||||
|
return self.icon and (' ' .. self.icon .. ' ')
|
||||||
|
end,
|
||||||
|
hl = function(self)
|
||||||
|
return { fg = self.icon_color }
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Here the filename block finally comes together
|
||||||
|
local TablineFileNameBlock = {
|
||||||
|
init = function(self)
|
||||||
|
self.filename = vim.api.nvim_buf_get_name(self.bufnr)
|
||||||
|
end,
|
||||||
|
hl = function(self)
|
||||||
|
if self.is_active then
|
||||||
|
return 'TabLineSel'
|
||||||
|
else
|
||||||
|
return 'TabLine'
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_click = {
|
||||||
|
callback = function(_, minwid, _, button)
|
||||||
|
if button == 'm' then -- close on mouse middle click
|
||||||
|
vim.api.nvim_buf_delete(minwid, { force = true })
|
||||||
|
else
|
||||||
|
vim.api.nvim_win_set_buf(0, minwid)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
minwid = function(self)
|
||||||
|
return self.bufnr
|
||||||
|
end,
|
||||||
|
name = 'heirline_tabline_buffer_callback',
|
||||||
|
},
|
||||||
|
TablineFileIcon,
|
||||||
|
TablineFileName,
|
||||||
|
TablineFileFlags,
|
||||||
|
TablineDiagnostics,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- a nice "x" button to close the buffer
|
||||||
|
local TablineCloseButton = {
|
||||||
|
condition = function(self)
|
||||||
|
return not vim.bo[self.bufnr].modified
|
||||||
|
end,
|
||||||
|
{ provider = ' ' },
|
||||||
|
{
|
||||||
|
provider = '',
|
||||||
|
hl = { fg = 'gray' },
|
||||||
|
on_click = {
|
||||||
|
callback = function(_, minwid)
|
||||||
|
vim.api.nvim_buf_delete(minwid, { force = false })
|
||||||
|
end,
|
||||||
|
minwid = function(self)
|
||||||
|
return self.bufnr
|
||||||
|
end,
|
||||||
|
name = 'heirline_tabline_close_buffer_callback',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- The final touch!
|
||||||
|
local TablineBufferBlock = {
|
||||||
|
{
|
||||||
|
hl = function(self)
|
||||||
|
if self.is_active then
|
||||||
|
return { fg = colors.dark3, bg = utils.get_highlight('TabLineSel').bg }
|
||||||
|
else
|
||||||
|
return { fg = colors.dark3, bg = utils.get_highlight('TabLine').bg }
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
provider = '',
|
||||||
|
},
|
||||||
|
TablineFileNameBlock,
|
||||||
|
utils.surround({ '', '' }, function(self)
|
||||||
|
if self.is_active then
|
||||||
|
return utils.get_highlight('TabLineSel').bg
|
||||||
|
else
|
||||||
|
return utils.get_highlight('TabLine').bg
|
||||||
|
end
|
||||||
|
end, TablineCloseButton),
|
||||||
|
{
|
||||||
|
hl = function(self)
|
||||||
|
if self.is_active then
|
||||||
|
return { fg = colors.dark3, bg = utils.get_highlight('TabLineSel').bg }
|
||||||
|
else
|
||||||
|
return { fg = colors.dark3, bg = utils.get_highlight('TabLine').bg }
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
provider = '▐',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- and here we go
|
||||||
|
local BufferLine = utils.make_buflist(
|
||||||
|
TablineBufferBlock,
|
||||||
|
{ provider = '', hl = { fg = 'gray' } }, -- left truncation, optional (defaults to "<")
|
||||||
|
{ provider = '', hl = { fg = 'gray' } } -- right trunctation, also optional (defaults to ...... yep, ">")
|
||||||
|
-- by the way, open a lot of buffers and try clicking them ;)
|
||||||
|
)
|
||||||
|
|
||||||
|
return BufferLine
|
||||||
|
|
@ -1,33 +1,22 @@
|
||||||
local conditions = require("heirline.conditions")
|
return {
|
||||||
local utils = require("heirline.utils")
|
'rebelot/heirline.nvim',
|
||||||
|
dependencies = {
|
||||||
local colors = {
|
'folke/tokyonight.nvim',
|
||||||
bg = "#333842",
|
'lewis6991/gitsigns.nvim',
|
||||||
brown = "#504945",
|
|
||||||
white = "#f8f8f0",
|
|
||||||
grey = "#8F908A",
|
|
||||||
black = "#000000",
|
|
||||||
pink = "#f92672",
|
|
||||||
green = "#a6e22e",
|
|
||||||
blue = "#66d9ef",
|
|
||||||
yellow = "#e6db74",
|
|
||||||
orange = "#fd971f",
|
|
||||||
purple = "#ae81ff",
|
|
||||||
red = "#e95678",
|
|
||||||
diag = {
|
|
||||||
warn = utils.get_highlight("DiagnosticSignWarn").fg,
|
|
||||||
error = utils.get_highlight("DiagnosticSignError").fg,
|
|
||||||
hint = utils.get_highlight("DiagnosticSignHint").fg,
|
|
||||||
info = utils.get_highlight("DiagnosticSignInfo").fg
|
|
||||||
},
|
},
|
||||||
git = {
|
config = function()
|
||||||
del = "#e95678",
|
---@diagnostic disable-next-line: missing-fields
|
||||||
add = "#a6e22e",
|
local colors = require('tokyonight.colors').setup({
|
||||||
change = "#ae81ff"
|
style = 'night',
|
||||||
}
|
})
|
||||||
}
|
local conditions = require('heirline.conditions')
|
||||||
|
local utils = require('heirline.utils')
|
||||||
vim.o.laststatus = 3
|
vim.o.laststatus = 3
|
||||||
|
vim.o.showtabline = 2
|
||||||
|
|
||||||
|
local Align = { provider = '%=' }
|
||||||
|
local Space = { provider = ' ' }
|
||||||
|
local SmallSpace = { provider = ' ' }
|
||||||
|
|
||||||
local ViMode = {
|
local ViMode = {
|
||||||
-- get vim current mode, this information will be required by the provider
|
-- get vim current mode, this information will be required by the provider
|
||||||
|
|
@ -42,41 +31,47 @@ local ViMode = {
|
||||||
static = {
|
static = {
|
||||||
mode_names = {
|
mode_names = {
|
||||||
-- change the strings if you like it vvvvverbose!
|
-- change the strings if you like it vvvvverbose!
|
||||||
["n"] = "NORMAL ",
|
['n'] = 'NORMAL ',
|
||||||
["no"] = "N·OPERATOR PENDING ",
|
['no'] = 'N·OPERATOR PENDING ',
|
||||||
["v"] = "VISUAL ",
|
['v'] = 'VISUAL ',
|
||||||
["V"] = "V·LINE ",
|
['vs'] = 'VISUAL·S ',
|
||||||
[""] = "V·BLOCK ",
|
['V'] = 'V·LINE ',
|
||||||
["s"] = "SELECT ",
|
['Vs'] = 'V·LINE·S ',
|
||||||
["S"] = "S·LINE ",
|
[''] = 'V·BLOCK ',
|
||||||
[""] = "S·BLOCK ",
|
['s'] = 'SELECT ',
|
||||||
["i"] = "INSERT ",
|
['S'] = 'S·LINE ',
|
||||||
["R"] = "REPLACE ",
|
[''] = 'S·BLOCK ',
|
||||||
["Rv"] = "V·REPLACE ",
|
['i'] = 'INSERT ',
|
||||||
["c"] = "COMMAND ",
|
['ic'] = 'COMPLETION ',
|
||||||
["cv"] = "VIM EX ",
|
['niI'] = 'INSERT ',
|
||||||
["ce"] = "EX ",
|
['niR'] = 'REPLACE ',
|
||||||
["r"] = "PROMPT ",
|
['niV'] = 'V·REPLACE ',
|
||||||
["rm"] = "MORE ",
|
['R'] = 'REPLACE ',
|
||||||
["r?"] = "CONFIRM ",
|
['Rv'] = 'V·REPLACE ',
|
||||||
["!"] = "SHELL ",
|
['c'] = 'COMMAND ',
|
||||||
["t"] = "TERMINAL "
|
['cv'] = 'VIM EX ',
|
||||||
|
['ce'] = 'EX ',
|
||||||
|
['r'] = 'PROMPT ',
|
||||||
|
['rm'] = 'MORE ',
|
||||||
|
['r?'] = 'CONFIRM ',
|
||||||
|
['!'] = 'SHELL ',
|
||||||
|
['t'] = 'TERMINAL ',
|
||||||
},
|
},
|
||||||
mode_colors = {
|
mode_colors = {
|
||||||
n = colors.green,
|
n = colors.green,
|
||||||
i = colors.pink,
|
i = colors.magenta,
|
||||||
v = colors.blue,
|
v = colors.blue,
|
||||||
V = colors.blue,
|
V = colors.blue,
|
||||||
[""] = colors.blue,
|
[''] = colors.blue,
|
||||||
c = colors.red,
|
c = colors.red,
|
||||||
s = colors.purple,
|
s = colors.purple,
|
||||||
S = colors.purple,
|
S = colors.purple,
|
||||||
[""] = colors.purple,
|
[''] = colors.purple,
|
||||||
R = colors.orange,
|
R = colors.orange,
|
||||||
r = colors.orange,
|
r = colors.orange,
|
||||||
["!"] = colors.red,
|
['!'] = colors.red,
|
||||||
t = colors.red
|
t = colors.red,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
-- We can now access the value of mode() that, by now, would have been
|
-- We can now access the value of mode() that, by now, would have been
|
||||||
-- computed by `init()` and use it to index our strings dictionary.
|
-- computed by `init()` and use it to index our strings dictionary.
|
||||||
|
|
@ -86,44 +81,47 @@ local ViMode = {
|
||||||
-- control the padding and make sure our string is always at least 2
|
-- control the padding and make sure our string is always at least 2
|
||||||
-- characters long. Plus a nice Icon.
|
-- characters long. Plus a nice Icon.
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
return " %2(" .. self.mode_names[self.mode] .. "%)"
|
if self.mode == nil then
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
-- return ' %2(' .. self.mode .. '%)'
|
||||||
|
return ' %2(' .. self.mode_names[self.mode] .. '%)'
|
||||||
end,
|
end,
|
||||||
-- Same goes for the highlight. Now the foreground will change according to the current mode.
|
-- Same goes for the highlight. Now the foreground will change according to the current mode.
|
||||||
hl = function(self)
|
hl = function(self)
|
||||||
local mode = self.mode:sub(1, 1) -- get only the first mode character
|
local mode = self.mode:sub(1, 1) -- get only the first mode character
|
||||||
return { bg = self.mode_colors[mode], fg = colors.bg, bold = true }
|
return { bg = self.mode_colors[mode], fg = colors.bg, bold = true }
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local FileNameBlock = {
|
local FileNameBlock = {
|
||||||
-- let's first set up some attributes needed by this component and it's children
|
-- let's first set up some attributes needed by this component and it's children
|
||||||
init = function(self)
|
init = function(self)
|
||||||
self.filename = vim.api.nvim_buf_get_name(0)
|
self.filename = vim.api.nvim_buf_get_name(0)
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
-- We can now define some children separately and add them later
|
|
||||||
|
|
||||||
local FileIcon = {
|
local FileIcon = {
|
||||||
init = function(self)
|
init = function(self)
|
||||||
local filename = self.filename
|
local filename = self.filename
|
||||||
local extension = vim.fn.fnamemodify(filename, ":e")
|
local extension = vim.fn.fnamemodify(filename, ':e')
|
||||||
self.icon, self.icon_color = require("nvim-web-devicons").get_icon_color(filename, extension, {default = true})
|
self.icon, self.icon_color = require('nvim-web-devicons').get_icon_color(filename, extension, { default = true })
|
||||||
end,
|
end,
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
return self.icon and (self.icon .. " ")
|
return self.icon and (self.icon .. ' ')
|
||||||
end,
|
end,
|
||||||
hl = function(self)
|
hl = function(self)
|
||||||
return {fg = self.icon_color, bg = colors.bg}
|
return { fg = self.icon_color }
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local FileName = {
|
local FileName = {
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
-- first, trim the pattern relative to the current directory. For other
|
-- first, trim the pattern relative to the current directory. For other
|
||||||
-- options, see :h filename-modifers
|
-- options, see :h filename-modifers
|
||||||
local filename = vim.fn.fnamemodify(self.filename, ":.")
|
local filename = vim.fn.fnamemodify(self.filename, ':.')
|
||||||
if filename == "" then
|
if filename == '' then
|
||||||
return "[No Name]"
|
return '[No Name]'
|
||||||
end
|
end
|
||||||
-- now, if the filename would occupy more than 1/4th of the available
|
-- now, if the filename would occupy more than 1/4th of the available
|
||||||
-- space, we trim the file path to its initials
|
-- space, we trim the file path to its initials
|
||||||
|
|
@ -133,59 +131,46 @@ local FileName = {
|
||||||
end
|
end
|
||||||
return filename
|
return filename
|
||||||
end,
|
end,
|
||||||
hl = {fg = utils.get_highlight("Directory").fg, bg = colors.bg}
|
hl = { fg = utils.get_highlight('Directory').fg },
|
||||||
}
|
}
|
||||||
|
|
||||||
local FileFlags = {
|
local FileFlags = {
|
||||||
{
|
{
|
||||||
provider = function()
|
provider = function()
|
||||||
if vim.bo.modified then
|
if vim.bo.modified then
|
||||||
return " [+]"
|
return ' [+]'
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.green, bg = colors.bg}
|
hl = { fg = colors.green },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider = function()
|
provider = function()
|
||||||
if (not vim.bo.modifiable) or vim.bo.readonly then
|
if (not vim.bo.modifiable) or vim.bo.readonly then
|
||||||
return ""
|
return ''
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.orange}
|
hl = { fg = colors.orange },
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Now, let's say that we want the filename color to change if the buffer is
|
-- Change highlight when file has changes
|
||||||
-- modified. Of course, we could do that directly using the FileName.hl field,
|
|
||||||
-- but we'll see how easy it is to alter existing components using a "modifier"
|
|
||||||
-- component
|
|
||||||
|
|
||||||
local FileNameModifer = {
|
local FileNameModifer = {
|
||||||
hl = function()
|
hl = function()
|
||||||
if vim.bo.modified then
|
if vim.bo.modified then
|
||||||
-- use `force` because we need to override the child's hl foreground
|
-- use `force` because we need to override the child's hl foreground
|
||||||
return {fg = colors.cyan, bold = true, force = true, bg = colors.bg}
|
return { fg = colors.cyan, bold = true, force = true }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- let's add the children to our FileNameBlock component
|
local diag_signs = vim.diagnostic.config().signs.text or {}
|
||||||
FileNameBlock =
|
|
||||||
utils.insert(
|
|
||||||
FileNameBlock,
|
|
||||||
FileIcon,
|
|
||||||
utils.insert(FileNameModifer, FileName), -- a new table where FileName is a child of FileNameModifier
|
|
||||||
unpack(FileFlags), -- A small optimisation, since their parent does nothing
|
|
||||||
{provider = "%<"} -- this means that the statusline is cut here when there's not enough space
|
|
||||||
)
|
|
||||||
|
|
||||||
local Diagnostics = {
|
local Diagnostics = {
|
||||||
condition = conditions.has_diagnostics,
|
condition = conditions.has_diagnostics,
|
||||||
static = {
|
static = {
|
||||||
error_icon = vim.fn.sign_getdefined("DiagnosticSignError")[1].text,
|
error_icon = diag_signs[1],
|
||||||
warn_icon = vim.fn.sign_getdefined("DiagnosticSignWarn")[1].text,
|
warn_icon = diag_signs[2],
|
||||||
info_icon = vim.fn.sign_getdefined("DiagnosticSignInfo")[1].text,
|
info_icon = diag_signs[3],
|
||||||
hint_icon = vim.fn.sign_getdefined("DiagnosticSignHint")[1].text
|
hint_icon = diag_signs[4],
|
||||||
},
|
},
|
||||||
init = function(self)
|
init = function(self)
|
||||||
self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
|
self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
|
||||||
|
|
@ -196,30 +181,33 @@ local Diagnostics = {
|
||||||
{
|
{
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
-- 0 is just another output, we can decide to print it or not!
|
-- 0 is just another output, we can decide to print it or not!
|
||||||
return self.errors > 0 and (self.error_icon .. self.errors .. " ")
|
return self.errors > 0 and (self.error_icon .. self.errors .. ' ')
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.diag.error, bg = colors.bg}
|
hl = { fg = colors.error },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
return self.warnings > 0 and (self.warn_icon .. self.warnings .. " ")
|
return self.warnings > 0 and (self.warn_icon .. self.warnings .. ' ')
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.diag.warn, bg = colors.bg}
|
hl = { fg = colors.warning },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
return self.info > 0 and (self.info_icon .. self.info .. " ")
|
return self.info > 0 and (self.info_icon .. self.info .. ' ')
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.diag.info, bg = colors.bg}
|
hl = { fg = colors.info },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
return self.hints > 0 and (self.hint_icon .. self.hints)
|
return self.hints > 0 and (self.hint_icon .. self.hints)
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.diag.hint, bg = colors.bg}
|
hl = { fg = colors.hint },
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- let's add the children to our FileNameBlock component
|
||||||
|
FileNameBlock = utils.insert(FileNameBlock, FileIcon, utils.insert(FileNameModifer, FileName), unpack(FileFlags), { provider = '%<' })
|
||||||
|
|
||||||
local Git = {
|
local Git = {
|
||||||
condition = conditions.is_git_repo,
|
condition = conditions.is_git_repo,
|
||||||
init = function(self)
|
init = function(self)
|
||||||
|
|
@ -228,77 +216,103 @@ local Git = {
|
||||||
end,
|
end,
|
||||||
hl = { fg = colors.orange, bg = colors.bg },
|
hl = { fg = colors.orange, bg = colors.bg },
|
||||||
{
|
{
|
||||||
-- git branch name
|
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
return " " .. self.status_dict.head
|
return ' ' .. self.status_dict.head
|
||||||
end,
|
end,
|
||||||
hl = {bold = true, bg = colors.bg}
|
hl = { bold = true },
|
||||||
},
|
},
|
||||||
-- You could handle delimiters, icons and counts similar to Diagnostics
|
|
||||||
{
|
{
|
||||||
condition = function(self)
|
condition = function(self)
|
||||||
return self.has_changes
|
return self.has_changes
|
||||||
end,
|
end,
|
||||||
provider = " "
|
provider = ' ',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
local count = self.status_dict.added or 0
|
local count = self.status_dict.added or 0
|
||||||
return count > 0 and (" " .. count)
|
return count > 0 and (' ' .. count)
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.git.add, bg = colors.bg}
|
hl = { fg = colors.git.add },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
local count = self.status_dict.removed or 0
|
local count = self.status_dict.removed or 0
|
||||||
return count > 0 and (" " .. count)
|
return count > 0 and (' ' .. count)
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.git.del, bg = colors.bg}
|
hl = { fg = colors.git.delete },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
local count = self.status_dict.changed or 0
|
local count = self.status_dict.changed or 0
|
||||||
return count > 0 and (" " .. count)
|
return count > 0 and (' ' .. count)
|
||||||
end,
|
end,
|
||||||
hl = {fg = colors.git.change, bg = colors.bg}
|
hl = { fg = colors.git.change },
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local WorkDir = {
|
|
||||||
provider = function()
|
|
||||||
local icon = " "
|
|
||||||
local cwd = vim.fn.getcwd(0)
|
|
||||||
cwd = vim.fn.fnamemodify(cwd, ":~")
|
|
||||||
if not conditions.width_percent_below(#cwd, 0.25) then
|
|
||||||
cwd = vim.fn.pathshorten(cwd)
|
|
||||||
end
|
|
||||||
local trail = cwd:sub(-1) == "/" and "" or "/"
|
|
||||||
return icon .. cwd .. trail
|
|
||||||
end,
|
|
||||||
hl = {fg = colors.blue, bold = true, bg = colors.bg}
|
|
||||||
}
|
|
||||||
|
|
||||||
require("fidget").setup(
|
|
||||||
{
|
|
||||||
notification = {
|
|
||||||
window = {
|
|
||||||
winblend = 0
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
progress = {
|
|
||||||
ignore = {"null-ls"}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local FileType = {
|
||||||
|
provider = function()
|
||||||
|
return vim.bo.filetype
|
||||||
|
end,
|
||||||
|
hl = { fg = utils.get_highlight('Statusline').fg, bold = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local FileEncoding = {
|
||||||
|
provider = function()
|
||||||
|
local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc'
|
||||||
|
return enc:upper()
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
local FileInfoBlock = {
|
||||||
|
init = function(self)
|
||||||
|
self.filename = vim.api.nvim_buf_get_name(0)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
FileInfoBlock = utils.insert(
|
||||||
|
FileInfoBlock,
|
||||||
|
FileEncoding,
|
||||||
|
Space,
|
||||||
|
FileIcon,
|
||||||
|
FileType,
|
||||||
|
{ provider = '%<' } -- this means that the statusline is cut here when there's not enough space
|
||||||
|
)
|
||||||
|
|
||||||
|
local FileNameShort = {
|
||||||
|
provider = function(self)
|
||||||
|
-- first, trim the pattern relative to the current directory. For other
|
||||||
|
-- options, see :h filename-modifers
|
||||||
|
local filename = vim.fn.fnamemodify(self.filename, ':t')
|
||||||
|
if filename == '' then
|
||||||
|
return '[No Name]'
|
||||||
|
end
|
||||||
|
return filename
|
||||||
|
end,
|
||||||
|
hl = { fg = colors.fg_dark },
|
||||||
|
}
|
||||||
|
|
||||||
|
local FileNameShortBlock = {
|
||||||
|
init = function(self)
|
||||||
|
self.filename = vim.api.nvim_buf_get_name(0)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
FileNameShortBlock = utils.insert(
|
||||||
|
FileNameShortBlock,
|
||||||
|
FileIcon,
|
||||||
|
FileNameShort,
|
||||||
|
{ provider = '%<' } -- this means that the statusline is cut here when there's not enough space
|
||||||
)
|
)
|
||||||
|
|
||||||
local TerminalName = {
|
local TerminalName = {
|
||||||
-- we could add a condition to check that buftype == 'terminal'
|
-- we could add a condition to check that buftype == 'terminal'
|
||||||
-- or we could do that later (see #conditional-statuslines below)
|
-- or we could do that later (see #conditional-statuslines below)
|
||||||
provider = function()
|
provider = function()
|
||||||
local tname, _ = vim.api.nvim_buf_get_name(0):gsub(".*:", "")
|
local tname, _ = vim.api.nvim_buf_get_name(0):gsub('.*:', '')
|
||||||
return " " .. tname
|
return ' ' .. tname
|
||||||
end,
|
end,
|
||||||
hl = {bold = true, bg = colors.bg}
|
hl = { bold = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
local Ruler = {
|
local Ruler = {
|
||||||
|
|
@ -306,70 +320,9 @@ local Ruler = {
|
||||||
-- %L = number of lines in the buffer
|
-- %L = number of lines in the buffer
|
||||||
-- %c = column number
|
-- %c = column number
|
||||||
-- %P = percentage through file of displayed window
|
-- %P = percentage through file of displayed window
|
||||||
provider = "%7 %p%% Ln %l, Col %c"
|
provider = '%7 %p%% %l,%c',
|
||||||
}
|
}
|
||||||
|
|
||||||
local Align = {provider = "%=", hl = {bg = colors.bg}}
|
|
||||||
local Space = {provider = " "}
|
|
||||||
|
|
||||||
local FileInfoBlock = {
|
|
||||||
-- let's first set up some attributes needed by this component and it's children
|
|
||||||
init = function(self)
|
|
||||||
self.filename = vim.api.nvim_buf_get_name(0)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
local FileType = {
|
|
||||||
provider = function()
|
|
||||||
return vim.bo.filetype
|
|
||||||
end,
|
|
||||||
hl = {fg = utils.get_highlight("Statusline").fg, bold = true, bg = colors.bg}
|
|
||||||
}
|
|
||||||
|
|
||||||
local FileEncoding = {
|
|
||||||
provider = function()
|
|
||||||
local enc = (vim.bo.fenc ~= "" and vim.bo.fenc) or vim.o.enc -- :h 'enc'
|
|
||||||
return enc:upper()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
FileInfoBlock =
|
|
||||||
utils.insert(
|
|
||||||
FileInfoBlock,
|
|
||||||
FileEncoding,
|
|
||||||
Space,
|
|
||||||
FileIcon,
|
|
||||||
FileType,
|
|
||||||
{provider = "%<"} -- this means that the statusline is cut here when there's not enough space
|
|
||||||
)
|
|
||||||
|
|
||||||
local FileNameShort = {
|
|
||||||
provider = function(self)
|
|
||||||
-- first, trim the pattern relative to the current directory. For other
|
|
||||||
-- options, see :h filename-modifers
|
|
||||||
local filename = vim.fn.fnamemodify(self.filename, ":t")
|
|
||||||
if filename == "" then
|
|
||||||
return "[No Name]"
|
|
||||||
end
|
|
||||||
return filename
|
|
||||||
end,
|
|
||||||
hl = {fg = colors.gray, bg = colors.bg}
|
|
||||||
}
|
|
||||||
|
|
||||||
local FileNameShortBlock = {
|
|
||||||
init = function(self)
|
|
||||||
self.filename = vim.api.nvim_buf_get_name(0)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
FileNameShortBlock =
|
|
||||||
utils.insert(
|
|
||||||
FileNameShortBlock,
|
|
||||||
FileIcon,
|
|
||||||
FileNameShort,
|
|
||||||
{provider = "%<"} -- this means that the statusline is cut here when there's not enough space
|
|
||||||
)
|
|
||||||
|
|
||||||
local DefaultStatusline = {
|
local DefaultStatusline = {
|
||||||
ViMode,
|
ViMode,
|
||||||
Space,
|
Space,
|
||||||
|
|
@ -381,299 +334,138 @@ local DefaultStatusline = {
|
||||||
Space,
|
Space,
|
||||||
FileInfoBlock,
|
FileInfoBlock,
|
||||||
Space,
|
Space,
|
||||||
Git
|
Git,
|
||||||
}
|
}
|
||||||
|
|
||||||
local SpecialStatusline = {
|
local SpecialStatusline = {
|
||||||
condition = function()
|
condition = function()
|
||||||
return conditions.buffer_matches(
|
return conditions.buffer_matches({
|
||||||
{
|
buftype = { 'nofile', 'prompt', 'help', 'quickfix' },
|
||||||
buftype = {"nofile", "prompt", "help", "quickfix"},
|
filetype = { '^git.*', 'fugitive' },
|
||||||
filetype = {"^git.*", "fugitive"}
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
end,
|
end,
|
||||||
FileType,
|
FileType,
|
||||||
Space,
|
Space,
|
||||||
Align
|
Align,
|
||||||
}
|
}
|
||||||
|
|
||||||
local TerminalStatusline = {
|
local TerminalStatusline = {
|
||||||
condition = function()
|
condition = function()
|
||||||
return conditions.buffer_matches({buftype = {"terminal"}})
|
return conditions.buffer_matches({ buftype = { 'terminal' } })
|
||||||
end,
|
end,
|
||||||
TerminalName,
|
TerminalName,
|
||||||
Align
|
Align,
|
||||||
}
|
}
|
||||||
|
|
||||||
local StatusLines = {
|
local StatusLines = {
|
||||||
fallthrough = false,
|
fallthrough = false,
|
||||||
SpecialStatusline,
|
SpecialStatusline,
|
||||||
TerminalStatusline,
|
TerminalStatusline,
|
||||||
DefaultStatusline
|
DefaultStatusline,
|
||||||
}
|
}
|
||||||
|
|
||||||
local GSpace = {provider = " ", hl = {bg = colors.bg}}
|
|
||||||
|
|
||||||
local WinBars = {
|
local WinBars = {
|
||||||
fallthrough = false,
|
fallthrough = false,
|
||||||
{
|
{
|
||||||
-- An inactive winbar for regular files
|
-- An inactive winbar for regular files
|
||||||
condition = function()
|
condition = function()
|
||||||
return conditions.buffer_matches({buftype = {"terminal"}}) and not conditions.is_active()
|
return conditions.buffer_matches({ buftype = { 'terminal' } }) and not conditions.is_active()
|
||||||
end,
|
end,
|
||||||
utils.surround({"", ""}, colors.bright_bg, {hl = {fg = "gray", force = true}, GSpace, TerminalName, Align})
|
{
|
||||||
|
hl = { bg = colors.bg_dark, fg = 'gray', force = true },
|
||||||
|
SmallSpace,
|
||||||
|
TerminalName,
|
||||||
|
Align,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
-- A special winbar for terminals
|
-- A special winbar for terminals
|
||||||
condition = function()
|
condition = function()
|
||||||
return conditions.buffer_matches({buftype = {"terminal"}})
|
return conditions.buffer_matches({ buftype = { 'terminal' } })
|
||||||
end,
|
end,
|
||||||
utils.surround(
|
|
||||||
{"", ""},
|
|
||||||
colors.dark_red,
|
|
||||||
{
|
{
|
||||||
GSpace,
|
hl = { bg = colors.bg_dark1, force = true },
|
||||||
|
SmallSpace,
|
||||||
TerminalName,
|
TerminalName,
|
||||||
Align
|
Align,
|
||||||
}
|
},
|
||||||
)
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
-- An inactive winbar for regular files
|
-- An inactive winbar for regular files
|
||||||
condition = function()
|
condition = function()
|
||||||
return not conditions.is_active()
|
return not conditions.is_active()
|
||||||
end,
|
end,
|
||||||
utils.surround({"", ""}, colors.bright_bg, {hl = {fg = "gray", force = true}, GSpace, FileNameShortBlock, Align})
|
{
|
||||||
|
hl = { bg = colors.bg_dark, fg = 'gray', force = true },
|
||||||
|
SmallSpace,
|
||||||
|
FileNameShortBlock,
|
||||||
|
Align,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-- A winbar for regular files
|
-- A winbar for regular files
|
||||||
{
|
{
|
||||||
GSpace,
|
hl = { bg = colors.bg_dark1, force = true },
|
||||||
|
SmallSpace,
|
||||||
FileNameShortBlock,
|
FileNameShortBlock,
|
||||||
-- GSpace,
|
Align,
|
||||||
Align
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd(
|
vim.api.nvim_create_autocmd('User', {
|
||||||
"User",
|
pattern = 'HeirlineInitWinbar',
|
||||||
{
|
|
||||||
pattern = "HeirlineInitWinbar",
|
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local buf = args.buf
|
local buf = args.buf
|
||||||
local buftype = vim.tbl_contains({"prompt", "nofile", "help", "quickfix"}, vim.bo[buf].buftype)
|
local buftype = vim.tbl_contains({ 'prompt', 'nofile', 'help', 'quickfix' }, vim.bo[buf].buftype)
|
||||||
local filetype = vim.tbl_contains({"gitcommit", "fugitive"}, vim.bo[buf].filetype)
|
local filetype = vim.tbl_contains({ 'gitcommit', 'fugitive' }, vim.bo[buf].filetype)
|
||||||
if buftype or filetype then
|
if buftype or filetype then
|
||||||
vim.opt_local.winbar = nil
|
vim.opt_local.winbar = nil
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|
||||||
-- we redefine the filename component, as we probably only want the tail and not the relative path
|
local TablineOffset = {
|
||||||
local TablineFileName = {
|
|
||||||
provider = function(self)
|
|
||||||
-- self.filename will be defined later, just keep looking at the example!
|
|
||||||
local filename = self.filename
|
|
||||||
filename = filename == "" and "[No Name]" or vim.fn.fnamemodify(filename, ":t")
|
|
||||||
return filename
|
|
||||||
end,
|
|
||||||
hl = function(self)
|
|
||||||
return {bold = self.is_active or self.is_visible, italic = true}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
local TablineFileFlags = {
|
|
||||||
{
|
|
||||||
provider = function(self)
|
|
||||||
if vim.bo[self.bufnr].modified then
|
|
||||||
return " [+]"
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
hl = {fg = colors.green}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider = function(self)
|
|
||||||
if not vim.bo[self.bufnr].modifiable or vim.bo[self.bufnr].readonly then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
hl = {fg = "orange"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local TablineDiagnostics = {
|
|
||||||
static = {
|
|
||||||
error_icon = " " .. vim.fn.sign_getdefined("DiagnosticSignError")[1].text,
|
|
||||||
warn_icon = " " .. vim.fn.sign_getdefined("DiagnosticSignWarn")[1].text,
|
|
||||||
info_icon = " " .. vim.fn.sign_getdefined("DiagnosticSignInfo")[1].text,
|
|
||||||
hint_icon = " " .. vim.fn.sign_getdefined("DiagnosticSignHint")[1].text
|
|
||||||
},
|
|
||||||
init = function(self)
|
|
||||||
self.errors = #vim.diagnostic.get(self.bufnr, {severity = vim.diagnostic.severity.ERROR})
|
|
||||||
self.warnings = #vim.diagnostic.get(self.bufnr, {severity = vim.diagnostic.severity.WARN})
|
|
||||||
self.hints = #vim.diagnostic.get(self.bufnr, {severity = vim.diagnostic.severity.HINT})
|
|
||||||
self.info = #vim.diagnostic.get(self.bufnr, {severity = vim.diagnostic.severity.INFO})
|
|
||||||
end,
|
|
||||||
{
|
|
||||||
provider = function(self)
|
|
||||||
return self.errors > 0 and (self.error_icon .. self.errors .. " ")
|
|
||||||
end,
|
|
||||||
hl = {fg = colors.diag.error}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider = function(self)
|
|
||||||
return self.warnings > 0 and (self.warn_icon .. self.warnings .. " ")
|
|
||||||
end,
|
|
||||||
hl = {fg = colors.diag.warn}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider = function(self)
|
|
||||||
return self.info > 0 and (self.info_icon .. self.info .. " ")
|
|
||||||
end,
|
|
||||||
hl = {fg = colors.diag.info}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider = function(self)
|
|
||||||
return self.hints > 0 and (self.hint_icon .. self.hints)
|
|
||||||
end,
|
|
||||||
hl = {fg = colors.diag.hint}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local TablineFileIcon = {
|
|
||||||
init = function(self)
|
|
||||||
local filename = self.filename
|
|
||||||
local extension = vim.fn.fnamemodify(filename, ":e")
|
|
||||||
self.icon, self.icon_color = require("nvim-web-devicons").get_icon_color(filename, extension, {default = true})
|
|
||||||
end,
|
|
||||||
provider = function(self)
|
|
||||||
return self.icon and (" " .. self.icon .. " ")
|
|
||||||
end,
|
|
||||||
hl = function(self)
|
|
||||||
return {fg = self.icon_color}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Here the filename block finally comes together
|
|
||||||
local TablineFileNameBlock = {
|
|
||||||
init = function(self)
|
|
||||||
self.filename = vim.api.nvim_buf_get_name(self.bufnr)
|
|
||||||
end,
|
|
||||||
hl = function(self)
|
|
||||||
if self.is_active then
|
|
||||||
return "TabLineSel"
|
|
||||||
else
|
|
||||||
return "TabLine"
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
on_click = {
|
|
||||||
callback = function(_, minwid, _, button)
|
|
||||||
if (button == "m") then -- close on mouse middle click
|
|
||||||
vim.api.nvim_buf_delete(minwid, {force = true})
|
|
||||||
else
|
|
||||||
vim.api.nvim_win_set_buf(0, minwid)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
minwid = function(self)
|
|
||||||
return self.bufnr
|
|
||||||
end,
|
|
||||||
name = "heirline_tabline_buffer_callback"
|
|
||||||
},
|
|
||||||
TablineFileIcon,
|
|
||||||
TablineFileName,
|
|
||||||
TablineFileFlags,
|
|
||||||
TablineDiagnostics
|
|
||||||
}
|
|
||||||
|
|
||||||
-- a nice "x" button to close the buffer
|
|
||||||
local TablineCloseButton = {
|
|
||||||
condition = function(self)
|
|
||||||
return not vim.bo[self.bufnr].modified
|
|
||||||
end,
|
|
||||||
{provider = " "},
|
|
||||||
{
|
|
||||||
provider = "",
|
|
||||||
hl = {fg = "gray"},
|
|
||||||
on_click = {
|
|
||||||
callback = function(_, minwid)
|
|
||||||
vim.api.nvim_buf_delete(minwid, {force = false})
|
|
||||||
end,
|
|
||||||
minwid = function(self)
|
|
||||||
return self.bufnr
|
|
||||||
end,
|
|
||||||
name = "heirline_tabline_close_buffer_callback"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- The final touch!
|
|
||||||
local TablineBufferBlock =
|
|
||||||
utils.surround(
|
|
||||||
{"", ""},
|
|
||||||
function(self)
|
|
||||||
if self.is_active then
|
|
||||||
return utils.get_highlight("TabLineSel").bg
|
|
||||||
else
|
|
||||||
return utils.get_highlight("TabLine").bg
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{TablineFileNameBlock, TablineCloseButton}
|
|
||||||
)
|
|
||||||
|
|
||||||
-- and here we go
|
|
||||||
local BufferLine =
|
|
||||||
utils.make_buflist(
|
|
||||||
TablineBufferBlock,
|
|
||||||
{provider = "", hl = {fg = "gray"}}, -- left truncation, optional (defaults to "<")
|
|
||||||
{provider = "", hl = {fg = "gray"}} -- right trunctation, also optional (defaults to ...... yep, ">")
|
|
||||||
-- by the way, open a lot of buffers and try clicking them ;)
|
|
||||||
)
|
|
||||||
|
|
||||||
local TabLineOffset = {
|
|
||||||
condition = function(self)
|
condition = function(self)
|
||||||
local win = vim.api.nvim_tabpage_list_wins(0)[1]
|
local win = vim.api.nvim_tabpage_list_wins(0)[1]
|
||||||
local bufnr = vim.api.nvim_win_get_buf(win)
|
local bufnr = vim.api.nvim_win_get_buf(win)
|
||||||
self.winid = win
|
self.winid = win
|
||||||
|
|
||||||
if vim.bo[bufnr].filetype == "neo-tree" then
|
if vim.bo[bufnr].filetype == 'neo-tree' then
|
||||||
self.title = " NeoTree"
|
self.title = ' NeoTree'
|
||||||
return true
|
return true
|
||||||
-- elseif vim.bo[bufnr].filetype == "TagBar" then
|
|
||||||
-- ...
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
local title = self.title
|
local title = self.title
|
||||||
local width = vim.api.nvim_win_get_width(self.winid)
|
local width = vim.api.nvim_win_get_width(self.winid) + 2
|
||||||
local pad = math.ceil((width - #title) / 2)
|
local padLeft = math.ceil((width - #title) / 2)
|
||||||
return string.rep(" ", pad) .. title .. string.rep(" ", pad)
|
local padRight = width - #title - padLeft
|
||||||
|
return string.rep(' ', padLeft) .. title .. string.rep(' ', padRight) .. '▐'
|
||||||
end,
|
end,
|
||||||
hl = function(self)
|
hl = function(self)
|
||||||
if vim.api.nvim_get_current_win() == self.winid then
|
if vim.api.nvim_get_current_win() == self.winid then
|
||||||
return "TablineSel"
|
return 'TablineSel'
|
||||||
else
|
else
|
||||||
return "Tabline"
|
return 'Tabline'
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local Tabpage = {
|
local Tabpage = {
|
||||||
provider = function(self)
|
provider = function(self)
|
||||||
return "%" .. self.tabnr .. "T " .. self.tabnr .. " %T"
|
return '%' .. self.tabnr .. 'T ' .. self.tabnr .. ' %T'
|
||||||
end,
|
end,
|
||||||
hl = function(self)
|
hl = function(self)
|
||||||
if not self.is_active then
|
if not self.is_active then
|
||||||
return "TabLine"
|
return 'TabLine'
|
||||||
else
|
else
|
||||||
return "TabLineSel"
|
return 'TabLineSel'
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local TabpageClose = {
|
local TabpageClose = {
|
||||||
provider = "%999X %X",
|
provider = '%999X %X',
|
||||||
hl = "TabLine"
|
hl = 'TabLine',
|
||||||
}
|
}
|
||||||
|
|
||||||
local TabPages = {
|
local TabPages = {
|
||||||
|
|
@ -681,56 +473,33 @@ local TabPages = {
|
||||||
condition = function()
|
condition = function()
|
||||||
return #vim.api.nvim_list_tabpages() >= 2
|
return #vim.api.nvim_list_tabpages() >= 2
|
||||||
end,
|
end,
|
||||||
{provider = "%="},
|
{ provider = '%=' },
|
||||||
utils.make_tablist(Tabpage),
|
utils.make_tablist(Tabpage),
|
||||||
TabpageClose
|
TabpageClose,
|
||||||
}
|
}
|
||||||
|
|
||||||
local TabLine = {TabLineOffset, BufferLine, TabPages}
|
local BufferLine = require('plugins.heirline-tabline')
|
||||||
|
|
||||||
-- require "heirline".setup(StatusLines, WinBars, TabLine)
|
local Tabline = { TablineOffset, BufferLine, TabPages }
|
||||||
require "heirline".setup(
|
|
||||||
{
|
require('heirline').setup({
|
||||||
statusline = StatusLines,
|
statusline = StatusLines,
|
||||||
winbar = WinBars,
|
winbar = WinBars,
|
||||||
tabline = TabLine,
|
tabline = Tabline,
|
||||||
opts = {
|
opts = {
|
||||||
disable_winbar_cb = function(args)
|
disable_winbar_cb = function(args)
|
||||||
local buf = args.buf
|
local buf = args.buf
|
||||||
local buftype = vim.tbl_contains({"prompt", "nofile", "help", "quickfix"}, vim.bo[buf].buftype)
|
local buftype = vim.tbl_contains({ 'prompt', 'nofile', 'help', 'quickfix' }, vim.bo[buf].buftype)
|
||||||
local filetype = vim.tbl_contains({"gitcommit", "fugitive", "Trouble", "packer"}, vim.bo[buf].filetype)
|
local filetype = vim.tbl_contains({ 'gitcommit', 'fugitive', 'Trouble', 'packer', 'markdown' }, vim.bo[buf].filetype)
|
||||||
return buftype or filetype
|
return buftype or filetype
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
vim.o.showtabline = 2
|
|
||||||
|
|
||||||
vim.cmd([[au FileType * if index(['wipe', 'delete', 'unload'], &bufhidden) >= 0 | set nobuflisted | endif]])
|
|
||||||
|
|
||||||
vim.api.nvim_create_augroup("Heirline", {clear = true})
|
|
||||||
vim.api.nvim_create_autocmd(
|
|
||||||
"ColorScheme",
|
|
||||||
{
|
|
||||||
callback = function()
|
|
||||||
local colors = setup_colors()
|
|
||||||
utils.on_colorscheme(colors)
|
|
||||||
end,
|
end,
|
||||||
group = "Heirline"
|
},
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|
||||||
local function get_bufs()
|
|
||||||
return vim.tbl_filter(
|
|
||||||
function(bufnr)
|
|
||||||
return vim.api.nvim_buf_is_loaded(bufnr) and vim.bo[bufnr].buflisted
|
|
||||||
end,
|
|
||||||
vim.api.nvim_list_bufs()
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function goto_buf(index)
|
local function goto_buf(index)
|
||||||
local bufs = get_bufs()
|
local bufs = vim.tbl_filter(function(bufnr)
|
||||||
|
return vim.api.nvim_buf_is_loaded(bufnr) and vim.bo[bufnr].buflisted
|
||||||
|
end, vim.api.nvim_list_bufs())
|
||||||
if index > #bufs then
|
if index > #bufs then
|
||||||
index = #bufs
|
index = #bufs
|
||||||
end
|
end
|
||||||
|
|
@ -738,17 +507,14 @@ local function goto_buf(index)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function addKey(key, index)
|
local function addKey(key, index)
|
||||||
vim.keymap.set(
|
vim.keymap.set('', '<A-' .. key .. '>', function()
|
||||||
"",
|
|
||||||
"<A-" .. key .. ">",
|
|
||||||
function()
|
|
||||||
goto_buf(index)
|
goto_buf(index)
|
||||||
end,
|
end, { noremap = true, silent = true })
|
||||||
{noremap = true, silent = true}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1, 9 do
|
for i = 1, 9 do
|
||||||
addKey(i, i)
|
addKey(i, i)
|
||||||
end
|
end
|
||||||
addKey("0", 10)
|
addKey('0', 10)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
require("nvim-web-devicons").set_icon {
|
|
||||||
["test.ts"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#519aba",
|
|
||||||
name = "TsTest"
|
|
||||||
},
|
|
||||||
["test.tsx"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#519aba",
|
|
||||||
name = "TsTest"
|
|
||||||
},
|
|
||||||
["test.js"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#cbcb41",
|
|
||||||
name = "JsTest"
|
|
||||||
},
|
|
||||||
["test.jsx"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#cbcb41",
|
|
||||||
name = "JsTest"
|
|
||||||
},
|
|
||||||
["readme.md"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#42A5F5",
|
|
||||||
name = "Readme"
|
|
||||||
},
|
|
||||||
["package.json"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#8BC34A",
|
|
||||||
name = "PackageJson"
|
|
||||||
},
|
|
||||||
["package-lock.json"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#8BC34A",
|
|
||||||
name = "PackageJson"
|
|
||||||
},
|
|
||||||
["tsconfig.json"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#0288D1",
|
|
||||||
name = "TsConfig"
|
|
||||||
},
|
|
||||||
["prisma"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#FFFFFF",
|
|
||||||
name = "Prisma"
|
|
||||||
},
|
|
||||||
["jar"] = {
|
|
||||||
icon = "",
|
|
||||||
color = "#FFFFFF",
|
|
||||||
name = "Jar"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,285 +1,155 @@
|
||||||
local util = require "lspconfig.util"
|
return {
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
vim.fn.sign_define("DiagnosticSignError", {text = " ", texthl = "DiagnosticSignError"})
|
dependencies = {
|
||||||
vim.fn.sign_define("DiagnosticSignWarn", {text = " ", texthl = "DiagnosticSignWarn"})
|
{ 'mason-org/mason.nvim', opts = {} },
|
||||||
vim.fn.sign_define("DiagnosticSignInfo", {text = " ", texthl = "DiagnosticSignInfo"})
|
'mason-org/mason-lspconfig.nvim',
|
||||||
vim.fn.sign_define("DiagnosticSignHint", {text = " ", texthl = "DiagnosticSignHint"})
|
{ 'j-hui/fidget.nvim', opts = {
|
||||||
vim.fn.sign_define("DapBreakpoint", {text = " ", texthl = "DiagnosticSignError"})
|
notification = {
|
||||||
vim.fn.sign_define("DapStopped", {text = " ", texthl = "DiagnosticSignInfo"})
|
window = {
|
||||||
|
winblend = 0,
|
||||||
-- vim.ui.select = require "popui.ui-overrider"
|
|
||||||
vim.ui.input = require "popui.input-overrider"
|
|
||||||
|
|
||||||
-- common servers
|
|
||||||
local common_servers = {
|
|
||||||
"pyright",
|
|
||||||
"bashls",
|
|
||||||
"clangd",
|
|
||||||
"cssls",
|
|
||||||
"texlab",
|
|
||||||
"prismals",
|
|
||||||
"solidity",
|
|
||||||
"zls",
|
|
||||||
-- "gleam",
|
|
||||||
"intelephense",
|
|
||||||
"lua_ls",
|
|
||||||
"html",
|
|
||||||
"vimls",
|
|
||||||
"yamlls",
|
|
||||||
"ocamllsp"
|
|
||||||
}
|
|
||||||
local extra_servers = {
|
|
||||||
"vtsls",
|
|
||||||
"eslint",
|
|
||||||
"jsonls",
|
|
||||||
"rust_analyzer",
|
|
||||||
"tailwindcss"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Ensure that required tools are installed
|
|
||||||
require("mason").setup()
|
|
||||||
require("mason-lspconfig").setup(
|
|
||||||
{
|
|
||||||
ensure_installed = vim.tbl_extend("force", common_servers, extra_servers)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
require("mason-null-ls").setup(
|
|
||||||
{
|
|
||||||
ensure_installed = {"cspell"}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
--- Completion Icons
|
|
||||||
require("lspkind").init({})
|
|
||||||
|
|
||||||
--- Null-LS
|
|
||||||
|
|
||||||
local cspell = require("cspell")
|
|
||||||
require("null-ls").setup(
|
|
||||||
{
|
|
||||||
sources = {
|
|
||||||
cspell.code_actions,
|
|
||||||
cspell.diagnostics.with(
|
|
||||||
{
|
|
||||||
diagnostics_postprocess = function(diagnostic)
|
|
||||||
diagnostic.severity = vim.diagnostic.severity["WARN"]
|
|
||||||
end
|
|
||||||
}
|
|
||||||
)
|
|
||||||
-- require("typescript.extensions.null-ls.code-actions")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
-- local lsp = require "lspconfig"
|
|
||||||
-- vim.lsp.start(
|
|
||||||
-- {
|
|
||||||
-- cmd = {"bun", "/home/gordon/git/lsp/index.ts", "--stdio"},
|
|
||||||
-- filetypes = {"typescript"},
|
|
||||||
-- name = "blacklist",
|
|
||||||
-- root_dir = vim.fn.getcwd()
|
|
||||||
-- }
|
|
||||||
-- )
|
|
||||||
|
|
||||||
--- Languages
|
|
||||||
local nvim_lsp = require("lspconfig")
|
|
||||||
|
|
||||||
local function codeAction()
|
|
||||||
-- if vim.bo.filetype == "cs" then
|
|
||||||
vim.lsp.buf.code_action()
|
|
||||||
-- else
|
|
||||||
-- vim.cmd [[CodeActionMenu]]
|
|
||||||
-- end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Mappings.
|
|
||||||
local opts = {noremap = true, silent = true}
|
|
||||||
vim.api.nvim_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "gs", "<Cmd>VtsExec goto_source_definition<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
|
|
||||||
-- buf_set_keymap("n", "<leader>t", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "<F2>", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
|
||||||
-- vim.api.nvim_set_keymap("n", "<leader>a", "<cmd>CodeActionMenu<CR>", opts)
|
|
||||||
vim.keymap.set("n", "<leader>a", codeAction, opts)
|
|
||||||
vim.keymap.set("v", "<leader>a", codeAction, opts)
|
|
||||||
|
|
||||||
-- vim.keymap.set("n", "<leader>a", '<cmd>lua require("fastaction").code_action()<CR>', {buffer = bufnr})
|
|
||||||
-- vim.keymap.set("v", "<leader>a", "<esc><cmd>lua require('fastaction').range_code_action()<CR>", {buffer = bufnr})
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<leader>d", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "[d", "<cmd>lua vim.diagnostic.goto_prev()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "]d", "<cmd>lua vim.diagnostic.goto_next()<CR>", opts)
|
|
||||||
vim.api.nvim_set_keymap("n", "<space>q", "<cmd>lua vim.diagnostic.set_loclist()<CR>", opts)
|
|
||||||
local on_attach = function(client, bufnr)
|
|
||||||
local function buf_set_keymap(...)
|
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
|
||||||
end
|
|
||||||
local function buf_set_option(...)
|
|
||||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
||||||
local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
||||||
|
|
||||||
require "lspconfig".jsonls.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = {
|
|
||||||
debounce_text_changes = 150
|
|
||||||
},
|
},
|
||||||
settings = {
|
|
||||||
json = require "json-schema"
|
|
||||||
},
|
},
|
||||||
capabilities = capabilities
|
} },
|
||||||
}
|
'saghen/blink.cmp',
|
||||||
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
|
'b0o/schemastore.nvim',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||||
|
callback = function(event)
|
||||||
|
local map = function(keys, func, desc, mode)
|
||||||
|
mode = mode or 'n'
|
||||||
|
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||||
|
end
|
||||||
|
|
||||||
require("lspconfig.configs").vtsls = require("vtsls").lspconfig
|
-- map('<leader>a', vim.lsp.buf.code_action, 'Code Action', { 'n', 'x', 'v' })
|
||||||
|
|
||||||
require("lspconfig").vtsls.setup(
|
map('gr', require('telescope.builtin').lsp_references, 'Goto References')
|
||||||
{
|
|
||||||
capabilities = capabilities,
|
map('gi', require('telescope.builtin').lsp_implementations, 'Goto Implementation')
|
||||||
on_attach = on_attach,
|
|
||||||
|
map('gd', require('telescope.builtin').lsp_definitions, 'Goto Definition')
|
||||||
|
|
||||||
|
map('<leader>fs', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')
|
||||||
|
|
||||||
|
map('<leader>d', vim.diagnostic.open_float, 'Show Diagnostics')
|
||||||
|
map('<leader>D', function()
|
||||||
|
vim.diagnostic.jump({ count = 1, float = true })
|
||||||
|
end, 'Next Diagnostics')
|
||||||
|
|
||||||
|
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||||
|
---@param client vim.lsp.Client
|
||||||
|
---@param method vim.lsp.protocol.Method
|
||||||
|
---@param bufnr? integer some lsp support methods only in specific files
|
||||||
|
---@return boolean
|
||||||
|
local function client_supports_method(client, method, bufnr)
|
||||||
|
if vim.fn.has('nvim-0.11') == 1 then
|
||||||
|
return client:supports_method(method, bufnr)
|
||||||
|
else
|
||||||
|
return client.supports_method(method, { bufnr = bufnr })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The following two autocommands are used to highlight references of the
|
||||||
|
-- word under your cursor when your cursor rests there for a little while.
|
||||||
|
-- See `:help CursorHold` for information about when this is executed
|
||||||
|
--
|
||||||
|
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||||
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
|
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
|
||||||
|
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
||||||
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
group = highlight_augroup,
|
||||||
|
callback = vim.lsp.buf.document_highlight,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
group = highlight_augroup,
|
||||||
|
callback = vim.lsp.buf.clear_references,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('LspDetach', {
|
||||||
|
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
|
||||||
|
callback = function(event2)
|
||||||
|
vim.lsp.buf.clear_references()
|
||||||
|
vim.api.nvim_clear_autocmds({ group = 'kickstart-lsp-highlight', buffer = event2.buf })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The following code creates a keymap to toggle inlay hints in your
|
||||||
|
-- code, if the language server you are using supports them
|
||||||
|
--
|
||||||
|
-- This may be unwanted, since they displace some of your code
|
||||||
|
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
||||||
|
map('<leader>th', function()
|
||||||
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||||
|
end, '[T]oggle Inlay [H]ints')
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local servers = {
|
||||||
|
lua_ls = {
|
||||||
settings = {
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
path = {
|
||||||
|
'lua/?.lua',
|
||||||
|
'lua/?/init.lua',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
bashls = {},
|
||||||
|
zls = {},
|
||||||
|
cssls = {},
|
||||||
|
prismals = {},
|
||||||
|
intelephense = {},
|
||||||
|
html = {},
|
||||||
|
yamlls = {},
|
||||||
|
eslint = {},
|
||||||
|
tailwindcss = {},
|
||||||
vtsls = {
|
vtsls = {
|
||||||
autoUseWorkspaceTsdk = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
require "lspconfig".eslint.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
root_dir = util.root_pattern(
|
|
||||||
".eslintrc",
|
|
||||||
".eslintrc.js",
|
|
||||||
".eslintrc.cjs",
|
|
||||||
".eslintrc.yaml",
|
|
||||||
".eslintrc.yml",
|
|
||||||
".eslintrc.json",
|
|
||||||
"eslint.config.js",
|
|
||||||
"eslint.config.mjs",
|
|
||||||
"eslint.config.cjs",
|
|
||||||
"eslint.config.yaml",
|
|
||||||
"eslint.config.yml",
|
|
||||||
"eslint.config.json",
|
|
||||||
"eslint.config.ts"
|
|
||||||
),
|
|
||||||
handlers = {
|
|
||||||
["eslint/openDoc"] = function(_, result)
|
|
||||||
if not result then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
print(result.url)
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
require "lspconfig".gdshader_lsp.setup {}
|
|
||||||
require "lspconfig".gdscript.setup {}
|
|
||||||
|
|
||||||
--[[ require "lspconfig".java_language_server.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
cmd = {"java-language-server"}
|
|
||||||
} ]]
|
|
||||||
for _, lsp in ipairs(common_servers) do
|
|
||||||
nvim_lsp[lsp].setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = {
|
|
||||||
debounce_text_changes = 150
|
|
||||||
},
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local path = vim.uv.cwd()
|
|
||||||
local config_path = path .. "/.vscode/settings.json"
|
|
||||||
local tailwindcss_settings = {
|
|
||||||
tailwindCSS = {
|
|
||||||
experimental = {
|
|
||||||
classRegex = {
|
|
||||||
{"cva\\(([^)]*)\\)", '["\'`]([^"\'`]*).*?["\'`]'},
|
|
||||||
{"cx\\(([^)]*)\\)", '(?:\'|"|`)([^\']*)(?:\'|"|`)'},
|
|
||||||
{"cn\\(([^)]*)\\)", '["\'`]([^"\'`]*).*?["\'`]'},
|
|
||||||
{"([a-zA-Z0-9\\-:]+)"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-- local function patch_tailwindcss_settings()
|
|
||||||
-- if vim.uv.fs_stat(config_path) then
|
|
||||||
-- local file = vim.fn.readfile(config_path)
|
|
||||||
-- local vscode_settings = vim.fn.json_decode(file)
|
|
||||||
-- tailwindcss_settings =
|
|
||||||
-- vim.tbl_deep_extend(
|
|
||||||
-- "force",
|
|
||||||
-- tailwindcss_settings,
|
|
||||||
-- {
|
|
||||||
-- tailwindCSS = {
|
|
||||||
-- rootFontSize = vscode_settings["tailwindCSS.rootFontSize"]
|
|
||||||
-- }
|
|
||||||
-- }
|
|
||||||
-- )
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- pcall(patch_tailwindcss_settings)
|
|
||||||
nvim_lsp.tailwindcss.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = {
|
|
||||||
debounce_text_changes = 150
|
|
||||||
},
|
|
||||||
capabilities = capabilities,
|
|
||||||
-- settings = tailwindcss_settings
|
|
||||||
settings = {
|
settings = {
|
||||||
tailwindCSS = {
|
vtsls = { autoUseWorkspaceTsdk = true },
|
||||||
experimental = {
|
|
||||||
classRegex = {
|
|
||||||
{"cva\\(([^)]*)\\)", '["\'`]([^"\'`]*).*?["\'`]'},
|
|
||||||
{"cx\\(([^)]*)\\)", '(?:\'|"|`)([^\']*)(?:\'|"|`)'},
|
|
||||||
{"cn\\(([^)]*)\\)", '(?:\'|"|`)([^\']*)(?:\'|"|`)'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require("roslyn").setup(
|
|
||||||
{
|
|
||||||
config = {},
|
|
||||||
exe = {
|
|
||||||
"dotnet",
|
|
||||||
vim.fs.joinpath(vim.fn.stdpath("data"), "roslyn", "Microsoft.CodeAnalysis.LanguageServer.dll")
|
|
||||||
},
|
},
|
||||||
filewatching = true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
nvim_lsp.rust_analyzer.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = {
|
|
||||||
debounce_text_changes = 150
|
|
||||||
},
|
},
|
||||||
capabilities = capabilities,
|
jsonls = {
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
json = {
|
||||||
imports = {
|
schemas = require('schemastore').json.schemas(),
|
||||||
granularity = {
|
validate = { enable = true },
|
||||||
group = "module"
|
|
||||||
},
|
},
|
||||||
prefix = "crate"
|
|
||||||
},
|
},
|
||||||
cargo = {
|
|
||||||
buildScripts = {
|
|
||||||
enable = true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
procMacro = {
|
gopls = {},
|
||||||
enable = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
|
vim.list_extend(ensure_installed, {
|
||||||
|
'stylua',
|
||||||
|
'prettierd',
|
||||||
|
'php-cs-fixer',
|
||||||
|
'cspell',
|
||||||
|
})
|
||||||
|
|
||||||
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
|
|
||||||
|
require('mason-tool-installer').setup({ ensure_installed = ensure_installed })
|
||||||
|
for server_name, server in pairs(servers) do
|
||||||
|
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
|
vim.lsp.config(server_name, server)
|
||||||
|
vim.lsp.enable(server_name)
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
return {
|
||||||
|
'nvimdev/lspsaga.nvim',
|
||||||
|
config = function()
|
||||||
|
require('lspsaga').setup({
|
||||||
|
symbol_in_winbar = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
lightbulb = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
beacon = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
rename = {
|
||||||
|
keys = {
|
||||||
|
quit = '<C-c>',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
code_action = {
|
||||||
|
keys = {
|
||||||
|
quit = '<C-c>',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.keymap.set('', '<leader>a', '<cmd>Lspsaga code_action<CR>')
|
||||||
|
vim.keymap.set('n', 'K', '<cmd>Lspsaga hover_doc<CR>')
|
||||||
|
vim.keymap.set('n', '<F2>', '<cmd>Lspsaga rename<CR>')
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter', -- optional
|
||||||
|
'nvim-tree/nvim-web-devicons', -- optional
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,186 +1,178 @@
|
||||||
|
return {
|
||||||
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
's1n7ax/nvim-window-picker',
|
||||||
|
},
|
||||||
|
lazy = false, -- neo-tree will lazily load itself
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||||
vim.api.nvim_set_keymap("", "<TAB>", ":Neotree reveal<CR>", {silent = true})
|
vim.api.nvim_set_keymap('', '<TAB>', ':Neotree reveal<CR>', { silent = true })
|
||||||
-- require "window-picker".setup()
|
require('window-picker').setup({
|
||||||
require "window-picker".setup(
|
|
||||||
{
|
|
||||||
autoselect_one = true,
|
autoselect_one = true,
|
||||||
include_current = false,
|
include_current = false,
|
||||||
filter_rules = {
|
filter_rules = {
|
||||||
-- filter using buffer options
|
|
||||||
bo = {
|
bo = {
|
||||||
-- if the file type is one of following, the window will be ignored
|
filetype = { 'neo-tree', 'neo-tree-popup', 'notify' },
|
||||||
filetype = {"neo-tree", "neo-tree-popup", "notify"},
|
buftype = { 'terminal', 'quickfix' },
|
||||||
-- if the buffer type is one of following, the window will be ignored
|
|
||||||
buftype = {"terminal", "quickfix"}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
selection_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
},
|
||||||
|
selection_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||||
highlights = {
|
highlights = {
|
||||||
statusline = {
|
statusline = {
|
||||||
focused = {
|
focused = {
|
||||||
bg = "#519aba"
|
bg = '#519aba',
|
||||||
},
|
},
|
||||||
unfocused = {
|
unfocused = {
|
||||||
bg = "#519aba"
|
bg = '#519aba',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
winbar = {
|
winbar = {
|
||||||
focused = {
|
focused = {
|
||||||
bg = "#519aba"
|
bg = '#519aba',
|
||||||
},
|
},
|
||||||
unfocused = {
|
unfocused = {
|
||||||
bg = "#519aba"
|
bg = '#519aba',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
-- other_win_hl_color = "#519aba"
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
require("neo-tree").setup(
|
require('neo-tree').setup({
|
||||||
{
|
|
||||||
default_component_configs = {
|
default_component_configs = {
|
||||||
icon = {
|
icon = {
|
||||||
folder_empty = "",
|
folder_empty = '',
|
||||||
folder_empty_open = ""
|
folder_empty_open = '',
|
||||||
},
|
},
|
||||||
git_status = {
|
git_status = {
|
||||||
symbols = {
|
symbols = {
|
||||||
renamed = "",
|
renamed = '',
|
||||||
unstaged = ""
|
unstaged = '',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
document_symbols = {
|
document_symbols = {
|
||||||
kinds = {
|
kinds = {
|
||||||
File = {icon = "", hl = "Tag"},
|
File = { icon = '', hl = 'Tag' },
|
||||||
Namespace = {icon = "", hl = "Include"},
|
Namespace = { icon = '', hl = 'Include' },
|
||||||
Package = {icon = "", hl = "Label"},
|
Package = { icon = '', hl = 'Label' },
|
||||||
Class = {icon = "", hl = "Include"},
|
Class = { icon = '', hl = 'Include' },
|
||||||
Property = {icon = "", hl = "@property"},
|
Property = { icon = '', hl = '@property' },
|
||||||
Enum = {icon = "", hl = "@number"},
|
Enum = { icon = '', hl = '@number' },
|
||||||
Function = {icon = "", hl = "Function"},
|
Function = { icon = '', hl = 'Function' },
|
||||||
String = {icon = "", hl = "String"},
|
String = { icon = '', hl = 'String' },
|
||||||
Number = {icon = "", hl = "Number"},
|
Number = { icon = '', hl = 'Number' },
|
||||||
Array = {icon = "", hl = "Type"},
|
Array = { icon = '', hl = 'Type' },
|
||||||
Object = {icon = "", hl = "Type"},
|
Object = { icon = '', hl = 'Type' },
|
||||||
Key = {icon = "", hl = ""},
|
Key = { icon = '', hl = '' },
|
||||||
Struct = {icon = "", hl = "Type"},
|
Struct = { icon = '', hl = 'Type' },
|
||||||
Operator = {icon = "", hl = "Operator"},
|
Operator = { icon = '', hl = 'Operator' },
|
||||||
TypeParameter = {icon = "", hl = "Type"},
|
TypeParameter = { icon = '', hl = 'Type' },
|
||||||
StaticMethod = {icon = " ", hl = "Function"}
|
StaticMethod = { icon = ' ', hl = 'Function' },
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
|
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
|
||||||
popup_border_style = "rounded",
|
popup_border_style = 'rounded',
|
||||||
enable_git_status = true,
|
enable_git_status = true,
|
||||||
enable_diagnostics = false,
|
enable_diagnostics = false,
|
||||||
sort_case_insensitive = false, -- used when sorting files and directories in the tree
|
sort_case_insensitive = false,
|
||||||
sort_function = nil, -- use a custom function for sorting files and directories in the tree
|
sort_function = nil,
|
||||||
-- sort_function = function (a,b)
|
|
||||||
-- if a.type == b.type then
|
|
||||||
-- return a.path > b.path
|
|
||||||
-- else
|
|
||||||
-- return a.type > b.type
|
|
||||||
-- end
|
|
||||||
-- end , -- this sorts files and directories descendantly
|
|
||||||
default_component_configs = {
|
default_component_configs = {
|
||||||
container = {
|
container = {
|
||||||
enable_character_fade = true
|
enable_character_fade = true,
|
||||||
},
|
},
|
||||||
indent = {
|
indent = {
|
||||||
indent_size = 2,
|
indent_size = 2,
|
||||||
padding = 1, -- extra padding on left hand side
|
padding = 1, -- extra padding on left hand side
|
||||||
-- indent guides
|
-- indent guides
|
||||||
with_markers = true,
|
with_markers = true,
|
||||||
indent_marker = "│",
|
indent_marker = '│',
|
||||||
last_indent_marker = "└",
|
last_indent_marker = '└',
|
||||||
highlight = "NeoTreeIndentMarker",
|
highlight = 'NeoTreeIndentMarker',
|
||||||
-- expander config, needed for nesting files
|
-- expander config, needed for nesting files
|
||||||
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
|
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
|
||||||
expander_collapsed = "",
|
expander_collapsed = '',
|
||||||
expander_expanded = "",
|
expander_expanded = '',
|
||||||
expander_highlight = "NeoTreeExpander"
|
expander_highlight = 'NeoTreeExpander',
|
||||||
},
|
},
|
||||||
icon = {
|
icon = {
|
||||||
folder_closed = "",
|
folder_closed = '',
|
||||||
folder_open = "",
|
folder_open = '',
|
||||||
folder_empty = "",
|
folder_empty = '',
|
||||||
default = "",
|
default = '',
|
||||||
highlight = "NeoTreeFileIcon"
|
highlight = 'NeoTreeFileIcon',
|
||||||
},
|
},
|
||||||
modified = {
|
modified = {
|
||||||
symbol = "[+]",
|
symbol = '[+]',
|
||||||
highlight = "NeoTreeGitAdded"
|
highlight = 'NeoTreeGitAdded',
|
||||||
},
|
},
|
||||||
name = {
|
name = {
|
||||||
trailing_slash = false,
|
trailing_slash = false,
|
||||||
use_git_status_colors = true,
|
use_git_status_colors = true,
|
||||||
highlight = "NeoTreeFileName"
|
highlight = 'NeoTreeFileName',
|
||||||
},
|
},
|
||||||
git_status = {
|
git_status = {
|
||||||
symbols = {
|
symbols = {
|
||||||
-- Change type
|
added = '',
|
||||||
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
modified = '',
|
||||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
deleted = '✖',
|
||||||
deleted = "✖",
|
renamed = '',
|
||||||
-- this can only be used in the git_status source
|
untracked = '',
|
||||||
renamed = "",
|
ignored = '',
|
||||||
-- this can only be used in the git_status source
|
unstaged = '',
|
||||||
-- Status type
|
staged = '',
|
||||||
untracked = "",
|
conflict = '',
|
||||||
ignored = "",
|
},
|
||||||
unstaged = "",
|
},
|
||||||
staged = "",
|
|
||||||
conflict = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
position = "left",
|
position = 'left',
|
||||||
width = 35,
|
width = 35,
|
||||||
mapping_options = {
|
mapping_options = {
|
||||||
noremap = true,
|
noremap = true,
|
||||||
nowait = true
|
nowait = true,
|
||||||
},
|
},
|
||||||
mappings = {
|
mappings = {
|
||||||
["<space>"] = {
|
['<space>'] = {
|
||||||
"toggle_node",
|
'toggle_node',
|
||||||
nowait = false
|
nowait = false,
|
||||||
},
|
},
|
||||||
["<esc>"] = "revert_preview",
|
['<esc>'] = 'revert_preview',
|
||||||
["P"] = {"toggle_preview", config = {use_float = true}},
|
['P'] = { 'toggle_preview', config = { use_float = true } },
|
||||||
["s"] = "split_with_window_picker",
|
['s'] = 'split_with_window_picker',
|
||||||
["v"] = "vsplit_with_window_picker",
|
['v'] = 'vsplit_with_window_picker',
|
||||||
["t"] = "open_tabnew",
|
['t'] = 'open_tabnew',
|
||||||
["<cr>"] = "open_with_window_picker",
|
['<cr>'] = 'open_with_window_picker',
|
||||||
["<2-LeftMouse>"] = "open_with_window_picker",
|
['<2-LeftMouse>'] = 'open_with_window_picker',
|
||||||
["C"] = "close_node",
|
['C'] = 'close_node',
|
||||||
["z"] = "close_all_nodes",
|
['z'] = 'close_all_nodes',
|
||||||
["a"] = {
|
['a'] = {
|
||||||
"add",
|
'add',
|
||||||
config = {
|
config = {
|
||||||
show_path = "absolute"
|
show_path = 'absolute',
|
||||||
}
|
|
||||||
},
|
},
|
||||||
["d"] = "delete",
|
},
|
||||||
["r"] = "rename",
|
['d'] = 'delete',
|
||||||
["y"] = "copy_to_clipboard",
|
['r'] = 'rename',
|
||||||
["x"] = "cut_to_clipboard",
|
['y'] = 'copy_to_clipboard',
|
||||||
["p"] = "paste_from_clipboard",
|
['x'] = 'cut_to_clipboard',
|
||||||
["c"] = "copy",
|
['p'] = 'paste_from_clipboard',
|
||||||
["m"] = {
|
['c'] = 'copy',
|
||||||
"move",
|
['m'] = {
|
||||||
|
'move',
|
||||||
config = {
|
config = {
|
||||||
show_path = "absolute"
|
show_path = 'absolute',
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
['q'] = 'close_window',
|
||||||
|
['R'] = 'refresh',
|
||||||
|
['?'] = 'show_help',
|
||||||
|
['>'] = 'prev_source',
|
||||||
|
['<'] = 'next_source',
|
||||||
},
|
},
|
||||||
["q"] = "close_window",
|
|
||||||
["R"] = "refresh",
|
|
||||||
["?"] = "show_help",
|
|
||||||
[">"] = "prev_source",
|
|
||||||
["<"] = "next_source"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
nesting_rules = {},
|
nesting_rules = {},
|
||||||
filesystem = {
|
filesystem = {
|
||||||
|
|
@ -188,16 +180,16 @@ require("neo-tree").setup(
|
||||||
visible = false, -- when true, they will just be displayed differently than normal items
|
visible = false, -- when true, they will just be displayed differently than normal items
|
||||||
hide_dotfiles = false,
|
hide_dotfiles = false,
|
||||||
hide_gitignored = true,
|
hide_gitignored = true,
|
||||||
hide_by_name = {".git"},
|
hide_by_name = { '.git' },
|
||||||
hide_by_pattern = {},
|
hide_by_pattern = {},
|
||||||
always_show = {"node_modules"},
|
always_show = { 'node_modules' },
|
||||||
never_show = {},
|
never_show = {},
|
||||||
never_show_by_pattern = {}
|
never_show_by_pattern = {},
|
||||||
},
|
},
|
||||||
follow_current_file = { enabled = false }, -- This will find and focus the file in the active buffer every
|
follow_current_file = { enabled = false }, -- This will find and focus the file in the active buffer every
|
||||||
-- time the current file is changed while the tree is open.
|
-- time the current file is changed while the tree is open.
|
||||||
group_empty_dirs = false, -- when true, empty folders will be grouped together
|
group_empty_dirs = false, -- when true, empty folders will be grouped together
|
||||||
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
|
hijack_netrw_behavior = 'open_default', -- netrw disabled, opening a directory opens neo-tree
|
||||||
-- in whatever position is specified in window.position
|
-- in whatever position is specified in window.position
|
||||||
-- "open_current", -- netrw disabled, opening a directory opens within the
|
-- "open_current", -- netrw disabled, opening a directory opens within the
|
||||||
-- window like netrw would, regardless of window.position
|
-- window like netrw would, regardless of window.position
|
||||||
|
|
@ -206,17 +198,17 @@ require("neo-tree").setup(
|
||||||
-- instead of relying on nvim autocmd events.
|
-- instead of relying on nvim autocmd events.
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
["<bs>"] = "navigate_up",
|
['<bs>'] = 'navigate_up',
|
||||||
["."] = "set_root",
|
['.'] = 'set_root',
|
||||||
["H"] = "toggle_hidden",
|
['H'] = 'toggle_hidden',
|
||||||
["/"] = "fuzzy_finder",
|
['/'] = 'fuzzy_finder',
|
||||||
["D"] = "fuzzy_finder_directory",
|
['D'] = 'fuzzy_finder_directory',
|
||||||
["f"] = "filter_on_submit",
|
['f'] = 'filter_on_submit',
|
||||||
["<c-x>"] = "clear_filter",
|
['<c-x>'] = 'clear_filter',
|
||||||
["[g"] = "prev_git_modified",
|
['[g'] = 'prev_git_modified',
|
||||||
["]g"] = "next_git_modified"
|
[']g'] = 'next_git_modified',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
buffers = {
|
buffers = {
|
||||||
follow_current_file = { enabled = true }, -- This will find and focus the file in the active buffer every
|
follow_current_file = { enabled = true }, -- This will find and focus the file in the active buffer every
|
||||||
|
|
@ -225,44 +217,44 @@ require("neo-tree").setup(
|
||||||
show_unloaded = true,
|
show_unloaded = true,
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
["d"] = "buffer_delete",
|
['d'] = 'buffer_delete',
|
||||||
["<bs>"] = "navigate_up",
|
['<bs>'] = 'navigate_up',
|
||||||
["."] = "set_root"
|
['.'] = 'set_root',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
git_status = {
|
git_status = {
|
||||||
window = {
|
window = {
|
||||||
position = "float",
|
position = 'float',
|
||||||
mappings = {
|
mappings = {
|
||||||
["gA"] = "git_add_all",
|
['gA'] = 'git_add_all',
|
||||||
["gu"] = "git_unstage_file",
|
['gu'] = 'git_unstage_file',
|
||||||
["ga"] = "git_add_file",
|
['ga'] = 'git_add_file',
|
||||||
["gr"] = "git_revert_file",
|
['gr'] = 'git_revert_file',
|
||||||
["gc"] = "git_commit",
|
['gc'] = 'git_commit',
|
||||||
["gp"] = "git_push",
|
['gp'] = 'git_push',
|
||||||
["gg"] = "git_commit_and_push"
|
['gg'] = 'git_commit_and_push',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
source_selector = {
|
source_selector = {
|
||||||
winbar = true,
|
winbar = true,
|
||||||
statusline = false,
|
statusline = false,
|
||||||
sources = {
|
sources = {
|
||||||
-- table
|
|
||||||
{
|
{
|
||||||
source = "filesystem", -- string
|
source = 'filesystem',
|
||||||
display_name = " Files" -- string | nil
|
display_name = ' Files',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source = "buffers", -- string
|
source = 'document_symbols',
|
||||||
display_name = " Buffers" -- string | nil
|
display_name = ' Symbols',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source = "git_status", -- string
|
source = 'git_status',
|
||||||
display_name = " Git" -- string | nil
|
display_name = ' Git',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
require("neotest").setup(
|
|
||||||
{
|
|
||||||
adapters = {
|
|
||||||
require("neotest-jest")(
|
|
||||||
{
|
|
||||||
jestCommand = "npx jest --bail --ci",
|
|
||||||
env = {
|
|
||||||
NODE_OPTIONS = "--no-deprecation"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
),
|
|
||||||
require("neotest-zig")
|
|
||||||
},
|
|
||||||
icons = {
|
|
||||||
passed = "🌈",
|
|
||||||
skipped = "🌙",
|
|
||||||
failed = "⛈️",
|
|
||||||
running = "☀️"
|
|
||||||
},
|
|
||||||
highlights = {
|
|
||||||
passed = "DiagnosticSignSuccess",
|
|
||||||
skipped = "DiagnosticSignInfo",
|
|
||||||
failed = "DiagnosticSignError",
|
|
||||||
running = "DiagnosticSignWarn"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
local keymap = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
keymap("n", "<leader>tf", ':lua require("neotest").run.run(vim.fn.expand("%"))<CR>', {silent = true, noremap = true})
|
|
||||||
keymap("n", "<leader>tn", ':lua require("neotest").run.run()<CR>', {silent = true})
|
|
||||||
keymap("n", "<leader>tr", ':lua require("neotest").run.run()<CR>', {silent = true})
|
|
||||||
keymap("n", "<leader>td", ':lua require("neotest").output.open({enter=true,short=true})<CR>', {silent = true})
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvimtools/none-ls.nvim',
|
||||||
|
event = 'VeryLazy',
|
||||||
|
dependencies = { 'davidmh/cspell.nvim' },
|
||||||
|
opts = function(_, opts)
|
||||||
|
local cspell = require('cspell')
|
||||||
|
opts.sources = opts.sources or {}
|
||||||
|
table.insert(
|
||||||
|
opts.sources,
|
||||||
|
cspell.diagnostics.with({
|
||||||
|
diagnostics_postprocess = function(diagnostic)
|
||||||
|
diagnostic.severity = vim.diagnostic.severity.WARN
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
table.insert(opts.sources, cspell.code_actions)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
-- vim.g.nvim_tree_indent_markers = 1
|
|
||||||
-- vim.api.nvim_set_keymap("", "<TAB>", ":NvimTreeFindFile<CR>:NvimTreeFocus<CR>", {silent = true})
|
|
||||||
|
|
||||||
vim.cmd [[
|
|
||||||
autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif
|
|
||||||
autocmd BufRead,BufNewFile NvimTree_1 lua vim.diagnostic.disable()
|
|
||||||
]]
|
|
||||||
|
|
||||||
local tree_cb = require "nvim-tree.config".nvim_tree_callback
|
|
||||||
-- default mappings
|
|
||||||
require "nvim-tree".setup(
|
|
||||||
{
|
|
||||||
auto_reload_on_write = true,
|
|
||||||
reload_on_bufenter = true,
|
|
||||||
git = {
|
|
||||||
enable = true,
|
|
||||||
ignore = false,
|
|
||||||
timeout = 500
|
|
||||||
},
|
|
||||||
filters = {
|
|
||||||
dotfiles = false,
|
|
||||||
custom = {
|
|
||||||
".git",
|
|
||||||
".webpack",
|
|
||||||
"\\.out",
|
|
||||||
".cache"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
view = {
|
|
||||||
mappings = {
|
|
||||||
custom_only = true,
|
|
||||||
list = {
|
|
||||||
{key = {"<CR>", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")},
|
|
||||||
{key = {"<2-RightMouse>", "<C-]>"}, cb = tree_cb("cd")},
|
|
||||||
{key = "<C-v>", cb = tree_cb("vsplit")},
|
|
||||||
{key = "<C-x>", cb = tree_cb("split")},
|
|
||||||
{key = "t", cb = tree_cb("tabnew")},
|
|
||||||
{key = "<", cb = tree_cb("prev_sibling")},
|
|
||||||
{key = ">", cb = tree_cb("next_sibling")},
|
|
||||||
{key = "P", cb = tree_cb("parent_node")},
|
|
||||||
{key = "<BS>", cb = tree_cb("close_node")},
|
|
||||||
{key = "<S-CR>", cb = tree_cb("close_node")},
|
|
||||||
{key = "<Tab>", cb = tree_cb("preview")},
|
|
||||||
{key = "K", cb = tree_cb("first_sibling")},
|
|
||||||
{key = "J", cb = tree_cb("last_sibling")},
|
|
||||||
{key = "I", cb = tree_cb("toggle_ignored")},
|
|
||||||
{key = "I", cb = tree_cb("toggle_dotfiles")},
|
|
||||||
{key = "r", cb = tree_cb("refresh")},
|
|
||||||
{key = "a", cb = tree_cb("create")},
|
|
||||||
{key = "d", cb = tree_cb("remove")},
|
|
||||||
{key = "m", cb = tree_cb("rename")},
|
|
||||||
{key = "<C-r>", cb = tree_cb("full_rename")},
|
|
||||||
{key = "x", cb = tree_cb("cut")},
|
|
||||||
{key = "c", cb = tree_cb("copy")},
|
|
||||||
{key = "p", cb = tree_cb("paste")},
|
|
||||||
{key = "y", cb = tree_cb("copy_name")},
|
|
||||||
{key = "Y", cb = tree_cb("copy_path")},
|
|
||||||
{key = "gy", cb = tree_cb("copy_absolute_path")},
|
|
||||||
{key = "[c", cb = tree_cb("prev_git_item")},
|
|
||||||
{key = "]c", cb = tree_cb("next_git_item")},
|
|
||||||
{key = "-", cb = tree_cb("dir_up")},
|
|
||||||
{key = "q", cb = tree_cb("close")},
|
|
||||||
{key = "?", cb = tree_cb("toggle_help")}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
renderer = {
|
|
||||||
indent_markers = {
|
|
||||||
enable = true,
|
|
||||||
icons = {
|
|
||||||
corner = "└",
|
|
||||||
edge = "│ ",
|
|
||||||
none = " "
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icons = {
|
|
||||||
webdev_colors = true,
|
|
||||||
show = {
|
|
||||||
folder_arrow = false
|
|
||||||
},
|
|
||||||
glyphs = {
|
|
||||||
default = "",
|
|
||||||
symlink = "",
|
|
||||||
git = {
|
|
||||||
unstaged = "✗",
|
|
||||||
staged = "✓",
|
|
||||||
unmerged = "",
|
|
||||||
renamed = "➜",
|
|
||||||
untracked = "★",
|
|
||||||
deleted = "",
|
|
||||||
ignored = "◌"
|
|
||||||
},
|
|
||||||
folder = {
|
|
||||||
arrow_open = "",
|
|
||||||
arrow_closed = "",
|
|
||||||
default = "",
|
|
||||||
open = "",
|
|
||||||
empty = "",
|
|
||||||
empty_open = "",
|
|
||||||
symlink = "",
|
|
||||||
symlink_open = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
'echasnovski/mini.pairs',
|
||||||
|
event = 'VeryLazy',
|
||||||
|
opts = {
|
||||||
|
modes = { insert = true, command = true, terminal = false },
|
||||||
|
-- skip autopair when next character is one of these
|
||||||
|
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||||
|
-- skip autopair when the cursor is inside these treesitter nodes
|
||||||
|
skip_ts = { 'string' },
|
||||||
|
-- skip autopair when next character is closing pair
|
||||||
|
-- and there are more closing pairs than opening pairs
|
||||||
|
skip_unbalanced = true,
|
||||||
|
-- better deal with markdown code blocks
|
||||||
|
markdown = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
vim.g.signify_sign_add = "│"
|
|
||||||
vim.g.signify_sign_change = "│"
|
|
||||||
|
|
@ -1,56 +1,62 @@
|
||||||
local selectX = function(n)
|
return { -- Fuzzy Finder (files, lsp, etc)
|
||||||
return function(bufnr)
|
'nvim-telescope/telescope.nvim',
|
||||||
local a = require("telescope.actions")
|
event = 'VimEnter',
|
||||||
local s = require("telescope.actions.state")
|
dependencies = {
|
||||||
local picker_name = s.get_current_picker(bufnr).prompt_title
|
'nvim-lua/plenary.nvim',
|
||||||
-- if not quick_prompts[picker_name] then
|
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
|
||||||
-- -- Disable quick prompts to not press by accident
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
-- -- TODO: Still type the number
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
a.move_to_top(bufnr)
|
|
||||||
for _ = 1, n - 1 do
|
|
||||||
a.move_selection_next(bufnr)
|
|
||||||
end
|
|
||||||
a.select_default(bufnr)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local dropdown_configs = {
|
-- `build` is used to run some command when the plugin is installed/updated.
|
||||||
layout_config = {
|
-- This is only run then, not every time Neovim starts up.
|
||||||
prompt_position = "top",
|
build = 'make',
|
||||||
vertical = {
|
|
||||||
width = 80,
|
-- `cond` is a condition used to determine whether this plugin should be
|
||||||
height = 12
|
-- installed and loaded.
|
||||||
}
|
cond = function()
|
||||||
|
return vim.fn.executable('make') == 1
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
border = {}
|
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||||
}
|
|
||||||
|
|
||||||
require("telescope").setup {
|
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||||
file_ignore_patterns = {"package-lock.json"},
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local actions = require('telescope.actions')
|
||||||
|
require('telescope').setup({
|
||||||
extensions = {
|
extensions = {
|
||||||
["ui-select"] = {
|
['ui-select'] = {
|
||||||
require("telescope.themes").get_dropdown(dropdown_configs)
|
require('telescope.themes').get_dropdown(),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
["<Esc>"] = "close",
|
['<C-s>'] = actions.select_horizontal,
|
||||||
["1"] = {selectX(1), type = "action"},
|
|
||||||
["2"] = {selectX(2), type = "action"},
|
|
||||||
["3"] = {selectX(3), type = "action"},
|
|
||||||
["4"] = {selectX(4), type = "action"},
|
|
||||||
["5"] = {selectX(5), type = "action"},
|
|
||||||
["6"] = {selectX(6), type = "action"},
|
|
||||||
["7"] = {selectX(7), type = "action"},
|
|
||||||
["8"] = {selectX(8), type = "action"},
|
|
||||||
["9"] = {selectX(9), type = "action"},
|
|
||||||
["0"] = {selectX(10), type = "action"}
|
|
||||||
},
|
},
|
||||||
n = {}
|
n = {
|
||||||
|
['<C-s>'] = actions.select_horizontal,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Enable Telescope extensions if they are installed
|
||||||
|
pcall(require('telescope').load_extension, 'fzf')
|
||||||
|
pcall(require('telescope').load_extension, 'ui-select')
|
||||||
|
|
||||||
|
-- See `:help telescope.builtin`
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags)
|
||||||
|
vim.keymap.set('n', '<leader>fk', builtin.keymaps)
|
||||||
|
vim.keymap.set('n', '<leader>ff', builtin.find_files)
|
||||||
|
vim.keymap.set('n', '<leader>fs', builtin.builtin)
|
||||||
|
vim.keymap.set('n', '<leader>fw', builtin.grep_string)
|
||||||
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep)
|
||||||
|
vim.keymap.set('n', '<leader>fd', builtin.diagnostics)
|
||||||
|
vim.keymap.set('n', '<leader>fr', builtin.resume)
|
||||||
|
vim.keymap.set('n', '<leader>f.', builtin.oldfiles)
|
||||||
|
vim.keymap.set('n', '<leader>fb', builtin.buffers)
|
||||||
|
vim.keymap.set('n', '<leader>ft', '<CMD>TodoTelescope<CR>')
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
require("telescope").load_extension("ui-select")
|
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,56 @@
|
||||||
local parser_configs = require("nvim-treesitter.parsers").get_parser_configs()
|
return {
|
||||||
parser_configs.http = {
|
'nvim-treesitter/nvim-treesitter',
|
||||||
install_info = {
|
build = ':TSUpdate',
|
||||||
url = "https://github.com/NTBBloodbath/tree-sitter-http",
|
config = function()
|
||||||
files = {"src/parser.c"},
|
local configs = require('nvim-treesitter.configs')
|
||||||
branch = "main"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
local npairs = require("nvim-autopairs")
|
|
||||||
npairs.setup(
|
|
||||||
{
|
|
||||||
check_ts = true,
|
|
||||||
enable_check_bracket_line = true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
require("nvim-ts-autotag").setup({})
|
configs.setup({
|
||||||
|
ensure_installed = {
|
||||||
local tscc = require("ts_context_commentstring.config")
|
'bash',
|
||||||
tscc.update(
|
'c_sharp',
|
||||||
{
|
'caddy',
|
||||||
enable_autocmd = false
|
'css',
|
||||||
}
|
'csv',
|
||||||
)
|
'desktop',
|
||||||
|
'diff',
|
||||||
require "nvim-treesitter.configs".setup {
|
'dockerfile',
|
||||||
highlight = {
|
'editorconfig',
|
||||||
enable = true
|
'gdscript',
|
||||||
|
'gdshader',
|
||||||
|
'git_config',
|
||||||
|
'gitattributes',
|
||||||
|
'gitcommit',
|
||||||
|
'gitignore',
|
||||||
|
'html',
|
||||||
|
'ini',
|
||||||
|
'javascript',
|
||||||
|
'jsdoc',
|
||||||
|
'json',
|
||||||
|
'json5',
|
||||||
|
'jsonc',
|
||||||
|
'lua',
|
||||||
|
'luadoc',
|
||||||
|
'luap',
|
||||||
|
'markdown',
|
||||||
|
'php',
|
||||||
|
'printf',
|
||||||
|
'prisma',
|
||||||
|
'properties',
|
||||||
|
'python',
|
||||||
|
'robots',
|
||||||
|
'scss',
|
||||||
|
'sql',
|
||||||
|
'ssh_config',
|
||||||
|
'toml',
|
||||||
|
'tsx',
|
||||||
|
'typescript',
|
||||||
|
'xml',
|
||||||
|
'yaml',
|
||||||
|
'zig',
|
||||||
},
|
},
|
||||||
indent = {
|
sync_install = false,
|
||||||
enable = true
|
highlight = { enable = true },
|
||||||
},
|
indent = { enable = true },
|
||||||
autopairs = {
|
})
|
||||||
enable = true
|
end,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
return {
|
||||||
|
'kyazdani42/nvim-web-devicons',
|
||||||
|
config = function()
|
||||||
|
require('nvim-web-devicons').set_icon({
|
||||||
|
['test.ts'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#519aba',
|
||||||
|
name = 'TsTest',
|
||||||
|
},
|
||||||
|
['test.tsx'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#519aba',
|
||||||
|
name = 'TsTest',
|
||||||
|
},
|
||||||
|
['test.js'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#cbcb41',
|
||||||
|
name = 'JsTest',
|
||||||
|
},
|
||||||
|
['test.jsx'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#cbcb41',
|
||||||
|
name = 'JsTest',
|
||||||
|
},
|
||||||
|
['readme.md'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#42A5F5',
|
||||||
|
name = 'Readme',
|
||||||
|
},
|
||||||
|
['package.json'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#8BC34A',
|
||||||
|
name = 'PackageJson',
|
||||||
|
},
|
||||||
|
['package-lock.json'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#8BC34A',
|
||||||
|
name = 'PackageJson',
|
||||||
|
},
|
||||||
|
['tsconfig.json'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#0288D1',
|
||||||
|
name = 'TsConfig',
|
||||||
|
},
|
||||||
|
['prisma'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#FFFFFF',
|
||||||
|
name = 'Prisma',
|
||||||
|
},
|
||||||
|
['jar'] = {
|
||||||
|
icon = '',
|
||||||
|
color = '#FFFFFF',
|
||||||
|
name = 'Jar',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
22
setup.sh
22
setup.sh
|
|
@ -1,22 +0,0 @@
|
||||||
[ -e ~/.local/share/nvim/site/pack/packer/start/packer.nvim ] || git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|
||||||
npm i -g @fsouza/prettierd@latest \
|
|
||||||
diagnostic-languageserver@latest \
|
|
||||||
eslint_d@latest \
|
|
||||||
lua-fmt@latest \
|
|
||||||
typescript-language-server@latest \
|
|
||||||
typescript@latest \
|
|
||||||
vim-language-server@latest \
|
|
||||||
vscode-css-languageserver-bin@latest \
|
|
||||||
vscode-html-languageserver-bin@latest \
|
|
||||||
vscode-json-languageserver@latest \
|
|
||||||
vscode-langservers-extracted@latest \
|
|
||||||
bash-language-server@latest \
|
|
||||||
@prisma/language-server@latest \
|
|
||||||
cspell@latest \
|
|
||||||
@cspell/dict-de-de@latest \
|
|
||||||
tsx@latest \
|
|
||||||
intelephense \
|
|
||||||
@vtsls/language-server
|
|
||||||
|
|
||||||
cspell link add @cspell/dict-de-de
|
|
||||||
dotnet tool install --global csharp-ls
|
|
||||||
Binary file not shown.
|
|
@ -1,18 +0,0 @@
|
||||||
auth/!
|
|
||||||
auth
|
|
||||||
Todo
|
|
||||||
Minecraft
|
|
||||||
FTB
|
|
||||||
Technic
|
|
||||||
Mojang
|
|
||||||
config
|
|
||||||
#echnic
|
|
||||||
technic/!
|
|
||||||
ConfigManager
|
|
||||||
Grenning
|
|
||||||
BWL
|
|
||||||
Marriot
|
|
||||||
Loadbalancer
|
|
||||||
nodejs
|
|
||||||
Wordpress
|
|
||||||
VSCode
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,52 +0,0 @@
|
||||||
local wezterm = require "wezterm"
|
|
||||||
|
|
||||||
local config = wezterm.config_builder()
|
|
||||||
|
|
||||||
config.font =
|
|
||||||
wezterm.font_with_fallback(
|
|
||||||
{
|
|
||||||
{family = "Input Mono Narrow", stretch = "Normal"},
|
|
||||||
{family = "Hack Nerd Font", stretch = "Normal"}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
config.allow_square_glyphs_to_overflow_width = "Always"
|
|
||||||
config.treat_east_asian_ambiguous_width_as_wide = true
|
|
||||||
|
|
||||||
config.default_prog = {"zsh"}
|
|
||||||
config.use_fancy_tab_bar = false
|
|
||||||
config.font_size = 11
|
|
||||||
config.front_end = "WebGpu"
|
|
||||||
config.max_fps = 60
|
|
||||||
config.animation_fps = 60
|
|
||||||
config.colors = {
|
|
||||||
foreground = "#c5c8c6",
|
|
||||||
background = "#1d1f21",
|
|
||||||
cursor_bg = "#c5c8c6",
|
|
||||||
cursor_border = "#c5c8c6",
|
|
||||||
cursor_fg = "#1d1f21",
|
|
||||||
selection_bg = "#373b41",
|
|
||||||
selection_fg = "#c5c8c6",
|
|
||||||
ansi = {
|
|
||||||
"#282a2e", -- black
|
|
||||||
"#a54242", -- red
|
|
||||||
"#8c9440", -- green
|
|
||||||
"#f79d1e", -- yellow
|
|
||||||
"#5f819d", -- blue
|
|
||||||
"#85678f", -- magenta
|
|
||||||
"#049494", -- cyan
|
|
||||||
"#707880" -- white
|
|
||||||
},
|
|
||||||
brights = {
|
|
||||||
"#373b41", -- bright black
|
|
||||||
"#cc6666", -- bright red
|
|
||||||
"#b5bd68", -- bright green
|
|
||||||
"#f7c530", -- bright yellow
|
|
||||||
"#81a2be", -- bright blue
|
|
||||||
"#b294bb", -- bright magenta
|
|
||||||
"#66fbfb", -- bright cyan
|
|
||||||
"#c5c8c6" -- bright white
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return config
|
|
||||||
Loading…
Reference in New Issue